Inspiration

Small holder farmers in Imo State experience difficulty managing their crops' health, relying only on their experiences, trial and error due to lack of access to extension services. Many small holder farmers in Nigeria and Africa experience difficulties when it comes to identifying and managing crop diseases at an early stage. This, in turn, has driven us to create an AI-powered tool that can detect plant diseases with speed and precision only with a smartphone but offline. Our aim is to provide farmers with a straightforward and affordable solution that not only diminishes crop loss but also ensures food security in our region.

What it does

SmartCropGuard is an AI-driven system that recognizes major diseases in tomato, maize, and cassava plants through the analysis of leaf images. It has a positive impact on farmers by enabling them to find out the problems at an early stage, offering them management recommendations thereby reducing potential crop losses due to disease. The system utilizes machine learning models that have been trained on real datasets of plant diseases to generate predictions that are precise, enhancing the decision of the farmer to adopt good agricultural practice.

How we built it

We recognized that the problem of early disease detection in crops by small holder farmers was a challenge.

We collected and cleaned image datasets of leaves of tomato, maize, and cassava plants from PlantVillage and Mendeley.

We built a MobileNetV2 model and trained it on Google Colab with an image normalization using 1./255.

We evaluated the model and confirmed that the accuracy is still high across the crop types.

We converted the model into TensorFlow Lite in order to make it compatible with mobiles.

We integrated the model into an offline Mobile app.

We conducted testing and ensured that image preprocessing is aligned for consistent predictions.

We documented the process and got the app ready for use in the field.

Challenges we ran into

Unstable power supply and the current high cost of data stressed us.

Limited compute resources forced us to efficiently train on Google Colab CPU despite longer runtimes.

Mobile optimization needed a tradeoff between accuracy and size, thus we chose MobileNetV2 and TFLite for fast, lightweight offline performance.

Using TensorFlow Lite for deployment was new to us, however, the integration into mobile helped us solidify our deployment skills.

Designing for offline-first use was a bit difficult but it ensured that SmartCropGuard can work without any connection problems in the farming areas which have very low connectivity.

Limited dataset diversity has made us use data augmentation and transfer learning in order to get better generalization.

The short hackathon time frame forced us to concentrate on only the most impactful features and be able to deliver a strong and functional MVP.

Mobile ML deployment on the go was difficult but it has driven us faster to practical skills and confidence.

Accomplishments that we're proud of

We developed a deep learning model that efficiently detects plant diseases in tomato, maize, and cassava from leaf images with the following accuracies: Tomato: 87.6%, Maize: 91.2% and Cassava: 87.4%

The model gave high prediction results which means the technology is ready to be used in the agricultural field.

Furthermore, this system can be used offline on mobile devices by employing TensorFlow Lite, thus allowing it to be run in rural areas that have low network connectivity.

We established one framework that can be used for the detection of various plant diseases on multiple crops thus facilitating the farmers for them to be able to use it.

Our prototype demonstrates that AI can be the driving force for the continuation of sustainable farming that is in line with SDG 2 and SDG 12.

We successfully turn a concept into a practical, user-centered solution by harnessing interdisciplinary collaboration.

With a tight timeline, we demonstrated our speed and adaptability by completing the whole pipeline, right from training to deployment.

Model Evaluation Results

To understand how well our system works, we trained and tested separate models for tomato, maize, and cassava leaf diseases. Each model was evaluated on new, unseen images to see how accurately it could detect and classify different plant conditions. We used metrics like accuracy, precision, recall, and F1-score to measure performance, and the results below highlight how each crop model performed in real-world terms.

Tomato Disease Detection - Summary The tomato model achieved an overall accuracy of 87.6%, but more importantly, it showed strong sensitivity (ability to correctly detect actual disease) across key classes like Tomato Yellow Leaf Curl Virus, with both precision and recall above 96%, and healthy leaves with an F1-score of 0.93. The model also performed well on diseases like Bacterial Spot and Late Blight, each scoring high on F1. However, it struggled slightly with Early Blight, where the recall was lower (0.69), suggesting the model occasionally missed true cases. Overall, macro and weighted averages show balanced performance across classes, though further refinement is needed for underrepresented diseases.

Maize Disease Detection - Summary With an overall accuracy of 91.2%, the maize model demonstrated high specificity and sensitivity, especially for Healthy leaves and Common Rust, which scored near-perfect on both precision and recall. Even for more challenging diseases like Gray Leaf Spot, the model maintained solid F1-scores and low false positive rates. Macro and weighted F1-scores exceeded 88% and 90%, showing balanced predictions even across classes with fewer samples. This makes the model both reliable and fair - key traits for real-world deployment in maize farming.

Cassava Disease Detection - Summary The cassava model achieved 87.4% accuracy, with excellent detection of Healthy leaves and Cassava Mosaic Disease (CM) - both showing high precision and recall, and a CM F1-score of 0.86. However, the model struggled with Cassava Bacterial Blight (CB), where recall dropped to 0.39, indicating a higher rate of missed cases (False Negatives). Despite this, the model's macro and weighted averages reflect reasonable balance, but the low sensitivity for CB suggests a need for further data or model tuning to improve detection of less common or harder-to-distinguish diseases.

What we learned

We got practical experience creating an entire machine learning pipeline from data preprocessing to deployment.

We increased our knowledge of CNNs by adapting MobileNetV2 for multi-class plant disease detection.

We also gained confidence in using TensorFlow and Keras for image classification and deploying it on mobile devices.

We discovered how to deploy AI models on mobile devices while also optimizing the performance and size.

We were able to learn how to adjust the model accuracy with efficiency to be able to meet offline needs in rural areas.

We enhanced our communication and collaboration skills through teamwork in the fast-paced project.

We became better at planning and time management through delivering a complete prototype within the tight deadlines.

We found out how much AI can do for social good and got motivated to create even more solutions that can support the SDGs.

What's next for SmartCropGuard

To build on our progress and respond to valuable feedback, here are the next steps we plan to take in making SmartCropGuard even more effective and accessible:

We plan to expand SmartCropGuard to cover more crops and diseases that are common across different regions.

We'll integrate an automatic crop recognition feature so users don’t have to select the crop manually before getting a diagnosis.

To avoid misclassification, we'll add a “None of the Above” or “Unknown” option for leaf conditions that don’t match known diseases.

We will introduce a recommendation engine that offers locally relevant, practical advice based on traditional practices, organic methods, or IPM strategies.

Our user interface will be redesigned with simple visuals, minimal text, and support for local languages and voice prompts to support farmers with low literacy levels.

We'll include a feature for farmers to track disease progression and treatment results, helping them manage their crops better and contribute to improving the system.

In places with occasional internet, we’ll enable optional connections with agricultural extension officers for expert guidance when needed.

We aim to broaden our detection capabilities to include other crop stresses like pests, nutrient deficiencies, and water stress.

We’ll work with agricultural agencies, NGOs, and community groups to support rollout and ensure the tool fits real farmer needs.

Finally, we’ll gather feedback directly from farmers during field use to keep improving SmartCropGuard based on their lived experiences.

Built With

Share this project:

Updates