Image Classification
Keras
English
agriscan
agriculture
plant-disease
crop-classification
efficientnet
efficientnetb0
tensorflow
plantvillage
Instructions to use Vernard/AgriScan_EfficientNetB0_Two_Classifier_Training with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Vernard/AgriScan_EfficientNetB0_Two_Classifier_Training with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://Vernard/AgriScan_EfficientNetB0_Two_Classifier_Training") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from Vernard/AgriScan_EfficientNetB0_Two_Classifier_Training: direct link, hf CLI and curl.
- Browser
- Download file 5.47 kB
-
https://huggingface.co/Vernard/AgriScan_EfficientNetB0_Two_Classifier_Training/resolve/main/README.md
- Command line
-
hf download hf://Vernard/AgriScan_EfficientNetB0_Two_Classifier_Training/README.md
-
curl -L -o README.md https://huggingface.co/Vernard/AgriScan_EfficientNetB0_Two_Classifier_Training/resolve/main/README.md
5.47 kB
| language: | |
| - en | |
| license: other | |
| library_name: keras | |
| pipeline_tag: image-classification | |
| tags: | |
| - agriscan | |
| - agriculture | |
| - plant-disease | |
| - crop-classification | |
| - image-classification | |
| - efficientnet | |
| - efficientnetb0 | |
| - tensorflow | |
| - keras | |
| - plantvillage | |
| datasets: | |
| - mohanty/PlantVillage | |
| # AgriScan EfficientNetB0 β Crop and Plant Disease Classifiers | |
| AgriScan is an agricultural intelligence project developing computer-vision tools to support crop identification and plant-health screening. | |
| This repository is intended to contain two separately trained EfficientNetB0 models: | |
| 1. **Crop classifier** β predicts whether an image belongs to maize, potato, or tomato. | |
| 2. **Disease classifier** β predicts one of 17 crop-condition classes across those crops. | |
| > **Status:** Research and pilot prototype. Add measured evaluation results after the training notebook has completed successfully. | |
| ## Repository contents | |
| Expected files: | |
| ```text | |
| . | |
| βββ README.md | |
| βββ agriscan_efficientnet_crop.keras | |
| βββ agriscan_efficientnet_disease.keras | |
| βββ crop_names.json | |
| βββ class_names.json | |
| βββ evaluation_metrics.json | |
| βββ crop_classification_report.csv | |
| βββ disease_classification_report.csv | |
| βββ crop_confusion_matrix.csv | |
| βββ disease_confusion_matrix.csv | |
| ``` | |
| Upload only the files that have actually been generated. Evaluation reports and metrics should be added after the training and evaluation cells finish. | |
| ## Model details | |
| | Property | Crop classifier | Disease classifier | | |
| |---|---|---| | |
| | Architecture | EfficientNetB0 | EfficientNetB0 | | |
| | Task | Crop classification | Crop-condition classification | | |
| | Number of output classes | 3 | 17 | | |
| | Input | RGB image | RGB image | | |
| | Input size | 224 Γ 224 pixels | 224 Γ 224 pixels | | |
| | Model format | Keras `.keras` | Keras `.keras` | | |
| The training workflow uses transfer learning with an ImageNet-pretrained EfficientNetB0 backbone, first training the classification head and then fine-tuning upper backbone layers. | |
| ### Crop classes | |
| - Maize | |
| - Potato | |
| - Tomato | |
| ### Disease classes | |
| The 17 output labels are defined in `class_names.json`. **The JSON order is significant** because it maps each output index to its label. Use the exact file produced by the training notebook; do not manually reorder the labels. | |
| ## Dataset and evaluation | |
| The training workflow uses the `mohanty/PlantVillage` dataset and its `splits/color_train.txt` and `splits/color_test.txt` manifests, filtered to maize, potato, and tomato classes. | |
| The training partition is divided into training and validation subsets. The source test partition is reserved for final evaluation. | |
| No performance metrics are stated here because the EfficientNetB0 training run must complete before results can be reported. After evaluation, update this section using the generated `evaluation_metrics.json` and classification reports. Report the test-set size and metrics exactly as measured; do not use training or validation scores as test scores. | |
| ## Input preprocessing | |
| - Convert the image to RGB. | |
| - Resize to 224 Γ 224 pixels. | |
| - Supply pixel values in the range expected by the saved model. | |
| - The Keras EfficientNetB0 backbone includes input rescaling. Do not apply MobileNetV2-specific `Rescaling(1/127.5, offset=-1)` preprocessing unless the model architecture is deliberately changed and retrained. | |
| Use the model's actual training/inference pipeline when deploying it. | |
| ## Recommended inference flow | |
| 1. Run the crop classifier. | |
| 2. Run the disease classifier. | |
| 3. Read the predicted labels using `crop_names.json` and `class_names.json`. | |
| 4. Compare the crop predicted by the crop classifier with the crop implied by the disease-class label. | |
| 5. If the two classifiers disagree, or confidence is low, return an uncertain/review result instead of presenting a definitive diagnosis. | |
| The two classifiers are independent models. A downstream application must implement the routing, confidence policy, and disagreement handling. | |
| ## Intended use | |
| This model is intended for research, prototyping, and controlled pilot evaluation of crop classification and plant-disease image classification for maize, potato, and tomato. | |
| ## Limitations and responsible use | |
| - This is a closed-set classifier. It is not a general plant detector and may assign an unsupported label to non-plant images. | |
| - It predicts only among the classes represented in the training labels; unknown diseases and other crops are not supported. | |
| - PlantVillage images may differ from farmer field photographs in lighting, backgrounds, camera quality, geography, crop varieties, and disease severity. | |
| - A high softmax score is not a guarantee of correctness and should not be treated as calibrated probability without further calibration work. | |
| - Predictions are not a substitute for expert agricultural advice or laboratory diagnosis. | |
| - Validate on representative real-world field images before operational deployment. | |
| ## Citation and attribution | |
| The dataset used by the training workflow is available as [`mohanty/PlantVillage`](https://huggingface.co/datasets/mohanty/PlantVillage). Review the dataset card and its terms before redistributing derived assets. | |
| ## Contact and project | |
| Project: **AgriScan**, an agricultural intelligence initiative associated with CDSA. | |
| For deployment, document the model version, training date, dataset version, evaluation results, and any changes to preprocessing or class mappings. | |