rezaul-h/CottonVerse: CottonVerse
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