How AI Helps Smart Factories Increase Efficiency