AI-Driven IoT Systems for Industry 4.0