--- license: agpl-3.0 datasets: - KaraAgroAI/CADI-AI language: - en library_name: yolo tags: - object detection - vision - yolo pipeline_tag: object-detection metrics: - mape --- ## Cashew Disease Identification with AI (CADI-AI) Model ### Model Description Object detection model trained using [YOLO v5x](https://github.com/ultralytics/yolov5/releases), a SOTA object detection algorithm. The model was pre-trained on the Cashew Disease Identification with AI (CADI-AI) train set (3788 images) at a resolution of 640x640 pixels. The CADI-AI dataset is available via [Kaggle](https://www.kaggle.com/datasets/karaagroaiprojects/cadi-ai) and [HuggingFace](https://huggingface.co/datasets/KaraAgroAI/CADI-AI). ## Intended uses You can use the raw model for object detection on cashew images. The model was initially developed to inform users whether cashew trees suffer from: - pest infection, i.e. damage to crops by insects or pests - disease, i.e. attacks on crops by microorganisms - abiotic stress caused by non-living factors (e.g. environmental factors like weather or soil conditions or the lack of mineral nutrients to the crop). KaraAgro AI developed the model for the initiatives [Market-Oriented Value Chains for Jobs & Growth in the ECOWAS Region (MOVE)](https://www.giz.de/en/worldwide/108524.html) and [FAIR Forward - Artificial Intelligence for All](https://www.bmz-digital.global/en/overview-of-initiatives/fair-forward/). Both initiatives are implemented by the Deutsche Gesellschaft für Internationale Zusammenarbeit (GIZ) on behalf of the German Federal Ministry for Economic Cooperation and Development (BMZ). ### How to use - Load model and perform prediction: ```bash pip install -U ultralytics ``` ```python from ultralytics import YOLO # load model model = YOLO("CADI-AI/yolov12x.pt") # set confidence threshold model.conf = 0.25 # perform inference results = model("/path/to/your/image.jpg", size=640) # parse results for result in results: boxes = result.boxes.xyxy # x1, y1, x2, y2 scores = result.boxes.conf # confidence scores categories = result.boxes.cls # class indices print(result.names) # {0: 'abiotic', 1: 'disease', 2: 'insect'} # save results into "results/" folder results[0].save(save_dir="results/") ``` - Finetune the model on your custom dataset: ```bash yolo train data=data.yaml imgsz=640 batch=16 model=KaraAgroAI/CADI-AI epochs=10 ``` ### Model performance | Class | Precision | Recall | mAP@50 | mAP@50-95 | | --- | --- | --- | --- | --- | | all | 0.663 | 0.632 | 0.648 | 0.291 | | insect | 0.794 | 0.811 | 0.815 | 0.39 | | abiotic | 0.682 | 0.514 | 0.542 | 0.237 | | disease | 0.594 | 0.571 | 0.588 | 0.248 | ### Demo [CADI-AI Spaces demonstration](https://huggingface.co/spaces/KaraAgroAI/CADI-AI) ### Project Repo If you want to know how the model and dataset has been used further for the GIZ-funded activity, please have a look at: - The [GitHub repository](https://github.com/karaagro/cadi-ai) for the CADI AI desktop application ### Example prediction