Deep Learning for Security and Privacy Preservation in IoT