rezaul-h/CottonVerse: CottonVerse

Read full text
Authors: RezaulHaque, S M Masfequier Rahman Swapno
Cited by: 0

Abstract

Version 1.0.0 β€” Initial release CottonVerse 🌿 CottonVerse is a multi-model Flask-based web application for image classification tasks in the agricultural and textile domains. It enables interpretable prediction using Grad-CAM and supports four independent models: πŸƒ Cotton Leaf Disease (CottonLeafNet) 🌿 Cotton Leaf Disease (SAR-CLD-2024) 🧡 Fabric Texture Percentage (CottonFabricImageBD) 🩸 Fabric Stain Type (FabricSpotDefect) πŸš€ Features πŸ“ Drag-and-drop file upload βœ… Prediction probabilities with visual bar chart πŸ”₯ Grad-CAM visualization for interpretability πŸ“Έ Upload preview and CAM download πŸ–ΌοΈ Multiple datasets and models supported 🧠 Powered by LEViT model (via PyTorch + timm) 🎨 Responsive, modern, and interactive UI πŸ“‚ Project Structure cottonverse/ β”œβ”€β”€ app.py # Flask app β”œβ”€β”€ utils.py # Preprocessing & Grad-CAM logic β”œβ”€β”€ models/ # Trained .pth models β”œβ”€β”€ static/ β”‚ β”œβ”€β”€ uploads/ # Uploaded images β”‚ └── cams/ # Grad-CAM outputs β”œβ”€β”€ templates/ # HTML templates └── requirements.txt # Dependencies └── README.md βš™οΈ Installation Clone the repository: git clone https://github.com/rezaul-h/CottonVerse.git cd cottonverse Create and activate a virtual environment: python -m venv venv source venv/bin/activate # or venv\Scripts\activate Install dependencies: pip install -r requirements.txt Run the application: python app.py Open http://127.0.0.1:5000 in your browser 🌐 πŸ“Š Models & Datasets | Model Name | Dataset | Classes | |------------|------------------------|---------| | LEViT | CottonLeafNet | 8 | | LEViT | SAR-CLD-2024 | 9 | | LEViT | CottonFabricImageB | 13 | | LEViT | FabricSpotDefect | 12 | All models are trained using the LEViT architecture with PyTorch, saved in .pth format. πŸ§ͺ How to Use Click on a model on the landing page. Upload an image for classification. View prediction probabilities and Grad-CAM. Download the CAM if desired. πŸ“¦ Dependencies Flask PyTorch timm torchvision OpenCV matplotlib pytorch-grad-cam πŸ™ Acknowledgements LEViT model: Facebook AI GradCAM: Jacob Gildenblat (pytorch-grad-cam)

Fields of Study & Subjects

Smart Agriculture and AI Industrial Vision Systems and Defect Detection Advanced Neural Network Applications

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
4 February 2026