Cardamom (Elettaria cardamomum), a valuable spice crop cultivated extensively in the Western Ghats and parts of Southeast Asia, suffers from various foliar diseases including Blight and Phyllosticta Leaf Spot, which can reduce yields significantly. Traditional disease detection techniques depend on expert manual inspection or laboratory testing, making them infeasible for smallholder farmers in remote regions. This study introduces CardaScan, an embedded, real-time disease classification system leveraging TinyML and a MobileNetV1 deep learning architecture trained on Edge Impulse. The model distinguishes between Blight, Phyllosticta, and Healthy leaves, achieving 98.2% accuracy on validation data and 94.41% on unseen test data. The quantized model, deployed on an Arduino Nano 33 BLE Sense, performs all inference on-device, requiring no cloud or smartphone connection. CardaScan represents a scalable, cost-effective AI tool that bridges precision agriculture and edge computing for low-connectivity farming communities.
Cardamom, often called the "Queen of Spices," is widely grown in humid, shaded plantation ecosystems that are ideal for fungal growth. Leaf Blight and Phyllosticta Leaf Spot are among the most common diseases, often spreading rapidly during the monsoon season and causing substantial loss in productivity and quality.
Current disease identification methods—visual inspections, lab diagnoses—are either slow, inaccessible, or too expensive for marginal farmers. With the rise of TinyML, it's now feasible to run convolutional neural networks (CNNs) on microcontrollers, enabling real-time field diagnostics.
This work presents CardaScan, an AI-powered, offline disease classification system running on the Arduino Nano 33 BLE Sense. It is designed for deployment in resource-constrained rural environments where connectivity is limited and technical expertise is scarce.
The dataset consisted of high-resolution images of cardamom leaves across three classes:
All images were preprocessed using:
Component | Specification |
---|---|
Microcontroller | Arduino Nano 33 BLE Sense (Cortex-M4, 64 MHz) |
Camera | OV7675 via TinyML shield |
Deployment | Edge Impulse → Arduino .ino library |
Power | USB or battery-powered |
Output | Serial monitor / OLED screen display (optional) |
The trained model was compiled and exported via the Edge Impulse Arduino library for real-time inference.
To evaluate the model's capability to distinguish between three distinct leaf health states under real-world conditions and offline deployment.
Metric | Value |
---|---|
Accuracy | 98.2% |
Loss | 0.05 |
Precision | 0.98 |
Recall | 0.98 |
F1 Score | 0.98 |
Inference Time | 792 ms |
Peak RAM Usage | 134.2 KB |
Flash Usage | 296.7 KB |
Confusion Matrix (Validation Set)
Actual \ Predicted | Blight | Healthy | Phyllosticta |
---|---|---|---|
Blight | 100% | 0% | 0% |
Healthy | 0% | 96.9% | 3.1% |
Phyllosticta | 0.9% | 0% | 99.1% |
Metric | Value |
---|---|
Accuracy | 94.41% |
AUC | 0.99 |
Precision | 0.95 |
Recall | 0.95 |
F1 Score | 0.95 |
Confusion Matrix (Test Set)
Actual \ Predicted | Blight | Healthy | Phyllosticta | Uncertain |
---|---|---|---|---|
Blight | 100% | 0% | 0% | 0% |
Healthy | 0.6% | 90.3% | 7.8% | 1.3% |
Phyllosticta | 0% | 3.1% | 96.9% | 0% |
CardaScan demonstrates the feasibility of deploying TinyML-based visual disease classification on microcontrollers for precision agriculture. With an on-device accuracy of 94.41% on unseen images and efficient inference under 1 second, this system is well-suited for real-world use in rural farming conditions.
The ability to run offline, without internet or smartphone dependency, makes it an ideal solution for remote cardamom plantations. The successful deployment of this model opens avenues for scaling the approach to other crops, integrating BLE/LoRa for alerting, and enabling farmers to take immediate action upon disease detection.
By making plant disease diagnostics accessible, CardaScan contributes to the goals of sustainable agriculture, reduced chemical usage, and increased crop yields, aligning with UN SDGs 2 (Zero Hunger) and 12 (Responsible Consumption and Production).