Automated tomato leaf disease detection and alert system using Internet of Things and TinyML
摘要
Early and accurate identification of foliar diseases is critical for sustaining tomato crop yields. The conventional diagnosis methods are labour-intensive and slow. This paper presents a fully embedded TinyML IoT pipeline that performs real time tomato leaf disease detection directly on a microcontroller class device and reports results to a remote Internet of Things (IoT) server for continuous agricultural field monitoring. A lightweight, convolutional neural network was trained on the PlantVillage dataset to classify five tomato leaf diseases. The model occupies 1.1 MB RAM with an average inference time of 500 ms on the test set, with < 15 ms per image inference on the microcontroller, enabling deployment on the ESP32S3 microcontroller operating at 240 MHz. Detected class labels and confidence scores are streamed via Message Queuing Telemetry Transport (MQTT) over Wi Fi to a cloud IoT server, where time-stamped diagnoses are logged for agronomic analytics and threshold-based alerting. The model achieved an accuracy of 94.6% and a macro F1-score of 0.94 across five tomato leaf diseases. Inference time on the ESP32-S3 microcontroller was 500 ms, with total memory usage of 1.1 MB. A seven-day field deployment verified over 95% data integrity and timely disease alerts via MQTT. The TinyML model demonstrates parity with heavier edge GPU baselines while consuming < 140 mW during inference. The proposed architecture offers a scalable, low-cost solution for precision agriculture. The proposed system enables farmers to receive instantaneous disease insights and enact timely interventions without relying on cloud-based computation.