A Cloud-Edge Artificial Intelligence Framework for Sensor Networks