The impact of climate change, pests, and inadequate agricultural practices on crop health is becoming a growing concern. It is estimated that 20-40% of global crop yield is adversely affected by pests and diseases. This has a direct negative impact on food security and nutritional well-being, as staple cereal crops (such as rice, maize, and wheat) and tuber crops (like potato, onion, and tomato) are affected. Advancements in Artificial Intelligence (AI), Computer Vision (CV), and IoT have a significant influence on reducing crop losses by detecting crop diseases at early stages. The primary focus of this research is to develop a real-time system that can detect tomato crop diseases at an early stage by integrating Machine Learning (ML) algorithms and IoT. The most common tomato leaf diseases, such as Tomato Mosaic Virus (TMV), Tomato Bacterial Leaf Spot (TBLS), Tomato Early Blight (TEB), and Tomato Late Blight (TLB), are considered in this work. The hybrid discriminative feature space is derived from the integration of low- and high-level features via Convolution Neural Network (CNN) Layers. The 3-stage Stacked Deep Convolutional Autoencoder is used to optimize the CNN performance by reducing computation complexity. The proposed model is implemented on the Plantvillage benchmark dataset and achieves the highest recognition accuracy of 95.6% for the 5-class problem using 5-fold cross-validation.