Run this model with HF Jobs
Run VCDSA/agriscan-efficientnet on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/VCDSA/agriscan-efficientnet. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/VCDSA/agriscan-efficientnet on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use VCDSA/agriscan-efficientnet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VCDSA/agriscan-efficientnet with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="VCDSA/agriscan-efficientnet") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("VCDSA/agriscan-efficientnet") model = AutoModelForImageClassification.from_pretrained("VCDSA/agriscan-efficientnet", device_map="auto") - Notebooks
- Google Colab
- Kaggle
agriscan-efficientnet model
#1
by Vernard - opened
12345678910111 unmodified line131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199---library_name: transformerstags: []---# Model Card for Model ID<!-- Provide a quick summary of what the model is/does. -->1 unmodified line### Model Description<!-- Provide a longer summary of what this model is. -->This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.- **Developed by:** [More Information Needed]- **Funded by [optional]:** [More Information Needed]- **Shared by [optional]:** [More Information Needed]- **Model type:** [More Information Needed]- **Language(s) (NLP):** [More Information Needed]- **License:** [More Information Needed]- **Finetuned from model [optional]:** [More Information Needed]### Model Sources [optional]<!-- Provide the basic links for the model. -->- **Repository:** [More Information Needed]- **Paper [optional]:** [More Information Needed]- **Demo [optional]:** [More Information Needed]## Uses<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->### Direct Use<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->[More Information Needed]### Downstream Use [optional]<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->[More Information Needed]### Out-of-Scope Use<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->[More Information Needed]## Bias, Risks, and Limitations<!-- This section is meant to convey both technical and sociotechnical limitations. -->[More Information Needed]### Recommendations<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.## How to Get Started with the ModelUse the code below to get started with the model.[More Information Needed]## Training Details### Training Data<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->[More Information Needed]### Training Procedure<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->#### Preprocessing [optional][More Information Needed]#### Training Hyperparameters- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->#### Speeds, Sizes, Times [optional]<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->[More Information Needed]## Evaluation<!-- This section describes the evaluation protocols and provides the results. -->### Testing Data, Factors & Metrics#### Testing Data<!-- This should link to a Dataset Card if possible. -->[More Information Needed]#### Factors<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->[More Information Needed]#### Metrics<!-- These are the evaluation metrics being used, ideally with a description of why. -->[More Information Needed]### Results[More Information Needed]#### Summary## Model Examination [optional]<!-- Relevant interpretability work for the model goes here -->[More Information Needed]## Environmental Impact<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).- **Hardware Type:** [More Information Needed]- **Hours used:** [More Information Needed]- **Cloud Provider:** [More Information Needed]- **Compute Region:** [More Information Needed]- **Carbon Emitted:** [More Information Needed]## Technical Specifications [optional]### Model Architecture and Objective[More Information Needed]### Compute Infrastructure[More Information Needed]#### Hardware[More Information Needed]#### Software[More Information Needed]## Citation [optional]<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->**BibTeX:**[More Information Needed]**APA:**[More Information Needed]## Glossary [optional]<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->[More Information Needed]## More Information [optional][More Information Needed]## Model Card Authors [optional][More Information Needed]## Model Card Contact[More Information Needed]123456789101112131415161718192021221 unmodified line24252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196---library_name: transformerstags:- agriculture- plant-disease-classification- computer-vision- efficientnet- Africalicense: apache-2.0datasets:- BrandonFors/Plant-Diseases-PlantVillage-Datasetlanguage:- enpipeline_tag: image-classification---# AgriScan-EfficientNetCrop Disease Classification Model1 unmodified line### Model Description**AgriScan-EfficientNet** is a vision model fine-tuned to identify diseases in key crops critical to smallholder farmers in Africa. It is the core AI engine of the **AgriScan** platform—an initiative by **CDSA (Cross Domain Solution Architect)** to provide accessible, AI-powered agricultural intelligence.This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.- **Developed by:** [Vernard Sharbney Ngomane](https://huggingface.co/VCDSA) of CDSA- **Funded by [optional]:** This model was developed as part of a pro-bono innovation project.- **Shared by [optional]:** [More Information Needed]- **Model type:** Image Classification (Fine-tuned EfficientNet)- **Language(s) (NLP):** [More Information Needed]- **License:** Apache 2.0- **Finetuned from model [optional]:** [google/efficientnet-b3](https://huggingface.co/google/efficientnet-b3) (via PyTorch Image Models)- **Demo:** [AgriScan Live Demo Space](https://huggingface.co/spaces/VCDSA/agriscan-demo)### Model Sources [optional]- **Repository:** [CDSA AgriScan Project](https://github.com/[Your-Github-Org]/AgriScan) *(Replace with actual link)*- **Paper (For EfficientNet):** [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks](https://arxiv.org/abs/1905.11946)- **Repository:** [More Information Needed]- **Paper [optional]:** [More Information Needed]- **Demo [optional]:** [More Information Needed]### Direct UseThis model is intended for **direct use in agricultural decision-support systems**. Its primary function is to analyze images of plant leaves and predict the presence and type of disease.- **Primary Use Case:** Integration into mobile applications (via TFLite), web APIs, or messaging bots (WhatsApp) to provide instant disease diagnosis for farmers and agricultural extension officers.- **Educational Use:** Can be used in training materials or apps to help students and farmers learn to identify common crop diseases.### Out-of-Scope Use- **Medical or Human Diagnosis:** This model is strictly for plant disease classification.- **Absolute Decision-Making:** Predictions are advisory. Final agricultural decisions should involve human expertise and local context.- **Non-Visual Data:** Cannot analyze soil samples, weather patterns, or textual descriptions alone.## Bias, Risks, and Limitations- **Geographic & Crop Bias:** Trained primarily on the PlantVillage dataset, which may not fully represent the diversity of disease manifestations, camera qualities, and environmental conditions (e.g., specific lighting, soil backgrounds) found across all African farms.- **Limited Scope:** Classifies diseases present in the training set. It is not an "unknown disease detector" and may misclassify novel or regional-specific pathogens.- **Field Condition Performance:** Lab/studio images from PlantVillage may lead to lower accuracy on blurry, angled, or occluded field photos.- **Mitigation Strategy:** The AgriScan project employs **IBM AI Fairness 360 (AIF360)** for bias auditing and uses a confidence threshold. Low-confidence predictions are flagged for human review.### RecommendationsUsers should:1. Treat outputs as a **first alert system**, not a definitive diagnosis.2. Be aware of the model's training background and correlate predictions with local agricultural expert knowledge.3. Report misclassifications to help improve future model versions.## How to Get Started with the ModelUse the code below to get started with the model.[```pythonfrom transformers import AutoImageProcessor, AutoModelForImageClassificationfrom PIL import Imageimport torch]# Load model and processor from the Hubprocessor = AutoImageProcessor.from_pretrained("VCDSA/agriscan-efficientnet")model = AutoModelForImageClassification.from_pretrained("VCDSA/agriscan-efficientnet")# Load and preprocess an imageimage = Image.open("path_to_your_leaf_image.jpg").convert("RGB")inputs = processor(images=image, return_tensors="pt")# Run inferencewith torch.no_grad():logits = model(**inputs).logits# Get predictionpredicted_class_idx = logits.argmax(-1).item()label = model.config.id2label[predicted_class_idx]print(f"Predicted disease: {label}")## Training Details### Training DataPrimary Dataset: Plant-Diseases-PlantVillage-DatasetDescription: Contains over 54,000 images of healthy and diseased leaves across 14 crop species and 38 disease classes.Preprocessing: Images were resized to 300x300 pixels, normalized using ImageNet statistics, and augmented with random horizontal flips and slight rotations to improve generalization.### Training ProcedureFine-tuning Regime: Standard supervised fine-tuning on the PlantVillage classification task.Optimizer: AdamWLearning Rate: 5e-5 with linear decayEpochs: 10Framework: PyTorch, using Hugging Face transformers and timm libraries.## Evaluation### Testing Data, Factors & MetricsTesting Data: 20% hold-out split from the PlantVillage dataset.Primary Metric: Top-1 AccuracySecondary Metrics: Precision, Recall, F1-Score (computed per class).### ResultsOverall Accuracy: 98.7% on the PlantVillage test set.Note on Real-World Performance: This high accuracy reflects performance on curated lab images. Field performance is actively being evaluated through pilot studies and is expected to be lower. Continuous evaluation with real farmer data is a core part of the AgriScan development cycle.## Model Examination [optional]ExplainabilityTo build trust and transparency, the AgriScan project uses IBM AI Explainability 360 (AIX360) to generate saliency maps (e.g., Grad-CAM). These maps visually highlight the regions of the leaf most influential to the model's prediction, helping users and developers understand the model's "reasoning."## Environmental Impact- **Hardware Type:** 1 x NVIDIA Tesla T4 GPU- **Hours used:** ~4 hours- **Cloud Provider:** Google Colab- **Carbon Emitted:** Estimated < 0.5 kgCO2eq (based on ML CO2 impact calculator)- **Mitigation:** The model's efficiency (EfficientNet architecture) and intended use case—potentially reducing pesticide overuse and crop loss—aim to offset its training footprint with positive environmental impact.## Technical Specifications [optional]### Model Architecture and ObjectiveEfficientNet-B3### Input3-channel RGB image (300x300 pixels)#### OutputLogits over 38 disease classes (compatible with PlantVillage labels).#### Export FormatsAvailable in PyTorch (.bin), ONNX (.onnx), and TensorFlow Lite (.tflite) formats for cross-platform deployment.## Citation [optional]@misc{agriscan2025,author = {Ngomane, Vernard Sharbney and CDSA},title = {AgriScan: An AI-Powered Agricultural Intelligence Platform},year = {2025},publisher = {Hugging Face},url = {https://huggingface.co/VCDSA/agriscan-efficientnet}}@article{tan2020efficientnet,title={EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks},author={Tan, Mingxing and Le, Quoc V.},journal={International Conference on Machine Learning},pages={6105--6114},year={2020},publisher={PMLR}}## Model Card ContactFor questions, comments, or partnership inquiries regarding the AgriScan model, please open a discussion on the AgriScan Hub community.
README.md+102-105