AI-powered disease detection for Plants, Humans, and Animals | Desktop GUI Application | Offline-First | Privacy-Focused
An advanced desktop application that uses deep learning to detect and diagnose diseases across multiple species. Built with PyTorch and PySide6, featuring a modern GUI, real-time image analysis, and comprehensive disease information with treatment recommendations.
π Quick Start β’ β¨ Features β’ πΈ Screenshots β’ π οΈ Installation β’ π Usage β’ π€ Contributing
- β Multi-Species Support - Detect diseases in plants, humans, and animals from one application
- β Offline-First - Works completely offline, no internet required after setup
- β Privacy-Focused - All data stays on your device, no external APIs or cloud services
- β Custom Training - Train your own models with custom datasets
- β Modern GUI - Beautiful, intuitive desktop interface built with PySide6
- β Comprehensive Database - 27+ diseases with detailed information and treatments
- β Smart Validation - Rejects invalid images (diagrams, screenshots, text) automatically
- β Research Integration - Fetches Wikipedia and PubMed research data
- β Report Generation - Create PDF and HTML reports of diagnoses
- β Interactive Maps - Visualize disease distribution geographically
- π― AI-Powered Detection: Deep learning model (MobileNetV2) trained on 26 disease classes
- πΌοΈ Image Analysis: Upload and analyze disease images with confidence scoring
- π¬ AI Chatbot: Interactive chatbot for disease information and guidance
- π Disease Database: Comprehensive information on 27+ diseases across all species
- πΊοΈ Geographic Mapping: Visualize disease locations with interactive Folium maps
- π Report Generation: Generate detailed PDF and HTML reports
- π Smart Search: BM25-based search engine for finding disease information
- π Research Integration: Automatic Wikipedia and PubMed research fetching
- π Confidence Scoring: Shows prediction confidence with intelligent thresholding
- β‘ Real-time Processing: Fast inference with caching for improved performance
- Image Validation: Automatically detects and rejects non-disease images (diagrams, text, screenshots)
- Thread-Safe UI: Proper Qt threading to prevent crashes and ensure smooth operation
- Caching System: In-memory and persistent caching for Wikipedia and PubMed data
- Fuzzy Matching: Intelligent disease name matching using Levenshtein distance
- Data Augmentation: Built-in augmentation for model training
- Model Versioning: Track and manage different model versions
- Error Handling: Robust error handling with user-friendly messages
- Modern Design: Clean, professional interface with dark mode support
- Tabbed Interface: Separate tabs for Plants, Humans, and Animals
- Image Preview: Visual feedback for uploaded images
- Progress Indicators: Real-time progress updates during analysis
- Interactive Results: Expandable disease information with stages, causes, and treatments
- Map Visualization: Interactive maps showing disease locations
- Report Preview: Preview generated reports before saving
The application features a modern, tabbed interface for easy navigation between species:
- Plant Diseases Tab: Detect crop and plant diseases
- Human Diseases Tab: Analyze skin conditions and health issues
- Animal Diseases Tab: Identify livestock and pet health problems
- Image Upload: Drag-and-drop or browse for images
- AI Analysis: Real-time disease detection with confidence scores
- Disease Information: Detailed descriptions, symptoms, causes, and treatments
- Research Data: Automatic Wikipedia and PubMed integration
- Report Generation: Professional PDF and HTML reports
- Interactive Maps: Geographic visualization of disease locations
- Python 3.14+ (or Python 3.13+)
- macOS, Linux, or Windows
- 4GB RAM minimum (8GB recommended)
- 500MB free disk space
# 1. Clone the repository
git clone https://github.com/abhi-abhi86/disease-predictor.git
cd disease-predictor
# 2. Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r comprehensive_requirements.txt
# 4. Run the application
./run_app.sh # On Windows: python main.pyClick to expand detailed installation steps
macOS:
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python 3.14
brew install python@3.14Linux (Ubuntu/Debian):
sudo apt update
sudo apt install python3.14 python3.14-venv python3-pipWindows:
- Download Python 3.14 from python.org
- Make sure to check "Add Python to PATH" during installation
# Clone repository
git clone https://github.com/abhi-abhi86/disease-predictor.git
cd disease-predictor
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# macOS/Linux:
source venv/bin/activate
# Windows:
venv\Scripts\activate
# Upgrade pip
pip install --upgrade pip# Install all required packages
pip install -r comprehensive_requirements.txt
# Verify installation
python verify_imports.pyIf you want to train your own model:
cd DiseaseDetectionApp
python train_disease_classifier.py
# Or if you encounter SSL errors:
./run_train.shThe pre-trained model is included, so this step is optional.
# Activate virtual environment
source venv/bin/activate # On Windows: venv\Scripts\activate
# Run the application
./run_app.sh # On Windows: python main.py-
Select Species Tab
- Choose between Plants, Humans, or Animals
-
Upload Image
- Click "Upload Image" button
- Select a clear photo showing disease symptoms
- Supported formats: JPG, PNG, JPEG
-
Analyze
- Click "Diagnose" button
- Wait for AI analysis (usually 2-5 seconds)
- View results with confidence score
-
Review Results
- Read disease name and description
- Check symptoms, causes, and risk factors
- Review treatment recommendations
- View Wikipedia and PubMed research
-
Generate Reports
- Click "Reports" menu
- Choose PDF or HTML format
- Save report to your computer
-
Use Additional Features
- Chatbot: Ask questions about diseases
- Map View: See disease locations on interactive map
- Search: Find diseases by name or symptoms
# Predict disease from image
cd DiseaseDetectionApp
python predict_disease.py path/to/image.jpg
# Train custom model
./run_train.sh
# Run tests
python test_disease_detection.pydisease-predictor/
βββ DiseaseDetectionApp/ # Main application directory
β βββ core/ # Core functionality modules
β β βββ ml_processor.py # AI model and prediction logic
β β βββ worker.py # Background worker for threading
β β βββ data_handler.py # Disease database management
β β βββ llm_integrator.py # AI chatbot integration
β β βββ search_engine.py # BM25 search functionality
β β βββ report_generator.py # PDF report generation
β β βββ html_report_generator.py # HTML report generation
β β βββ wikipedia_integration.py # Wikipedia API
β β βββ ncbi_integration.py # PubMed research fetching
β β βββ google_search.py # Web search integration
β βββ ui/ # User interface components
β β βββ main_window.py # Main application window
β β βββ chatbot_dialog.py # Chatbot interface
β β βββ map_dialog.py # Map visualization
β β βββ image_search_dialog.py # Image search
β β βββ spinner.py # Loading animations
β βββ diseases/ # Disease database (JSON files)
β β βββ plant/ # Plant disease data
β β βββ human/ # Human disease data
β β βββ animal/ # Animal disease data
β βββ disease_model.pt # Trained PyTorch model
β βββ class_to_name.json # Class label mappings
β βββ main.py # Application entry point
β βββ train_disease_classifier.py # Model training script
β βββ predict_disease.py # CLI prediction tool
βββ comprehensive_requirements.txt # Python dependencies
βββ run_app.sh # Quick start script
βββ main.py # Root entry point
βββ verify_imports.py # Dependency verification
βββ README.md # This file
βββββββββββββββββββ
β Image Input β
ββββββββββ¬βββββββββ
β
ββββββΌββββββ
β Preproc β (Resize, Normalize, Augment)
ββββββ¬ββββββ
β
ββββββΌβββββββ
β CNN Model β (Feature Extraction)
ββββββ¬βββββββ
β
ββββββΌβββββββββ
β Classifier β (Disease Categories)
ββββββ¬βββββββββ
β
ββββββΌβββββββββββ
β Post-process β (Confidence, Treatment)
ββββββ¬βββββββββββ
β
ββββββΌβββββββββ
β Output β
βββββββββββββββ
Image Upload β Validation β Preprocessing β AI Inference β Post-processing β Results
β β β β β β
User Input Reject Invalid Resize/Norm MobileNetV2 Confidence Display
(diagrams/text) Transform Prediction Threshold + Research
- High Confidence (β₯55%): Disease identified with treatment recommendations
- Low Confidence (<55%): Returns "No Confident Match Found" with 0% confidence
- Invalid Images: Automatically rejected (diagrams, screenshots, text) with 0% confidence
The system validates images before processing:
- Brightness Check: Rejects too dark/bright images
- Color Variance: Detects diagrams and text (low variance)
- Pixel Distribution: Identifies screenshots and documents
- Thread-Safe: Uses PIL methods to avoid threading issues
- Pepper Bell Bacterial Spot
- Pepper Bell Healthy
- Potato Early Blight
- Potato Healthy
- Potato Late Blight
- Tomato Target Spot
- Tomato Mosaic Virus
- Tomato Yellow Leaf Curl Virus
- Tomato Bacterial Spot
- Tomato Early Blight
- Tomato Healthy
- Tomato Late Blight
- Tomato Leaf Mold
- Tomato Septoria Leaf Spot
- Tomato Spider Mites
- Acne Vulgaris
- AIDS
- Eczema
- Smoker's Lung
- And more...
- Lumpy Skin Disease
- Sarcoptic Mange
- Swine Erysipelas
- And more...
Total: 26 disease classes + healthy/normal states
Edit DiseaseDetectionApp/core/ml_processor.py:
# Confidence threshold (0.0 to 1.0)
IMAGE_CONFIDENCE_THRESHOLD = 0.55 # Default: 55%
# Image size for model input
IMG_SIZE = 224 # Default: 224x224
# Healthy class names
HEALTHY_CLASS_NAMES = ('healthy', 'normal', 'clear_skin')Edit DiseaseDetectionApp/train_disease_classifier.py:
# Training parameters
EPOCHS = 10
BATCH_SIZE = 32
LEARNING_RATE = 0.001
VALIDATION_SPLIT = 0.2# Activate virtual environment
source venv/bin/activate
# Run comprehensive tests
cd DiseaseDetectionApp
python comprehensive_test.py
# Run specific tests
python test_disease_detection.py
python test_train_model.py
python test_image_search.py# Check all dependencies
python verify_imports.py
# Should output:
# β All dependencies are correctly installed!# 1. Prepare your dataset
# Organize images in folders by disease class:
# data/
# βββ disease_class_1/
# β βββ image1.jpg
# β βββ image2.jpg
# βββ disease_class_2/
# βββ image3.jpg
# 2. Update training script with your data path
# Edit train_disease_classifier.py
# 3. Train model
cd DiseaseDetectionApp
python train_disease_classifier.py
# 4. Model will be saved as disease_model.ptfrom DiseaseDetectionApp.core.ml_processor import MLProcessor
from DiseaseDetectionApp.core.data_handler import load_disease_database
# Initialize
ml_processor = MLProcessor()
database = load_disease_database()
# Predict
result, confidence, wiki, stage = ml_processor.predict_from_image(
image_path="path/to/image.jpg",
domain="Plant", # or "Human" or "Animal"
database=database
)
print(f"Disease: {result['name']}")
print(f"Confidence: {confidence}%")
print(f"Treatment: {result['solution']}")import os
from DiseaseDetectionApp.core.ml_processor import MLProcessor
ml_processor = MLProcessor()
database = load_disease_database()
# Process all images in a directory
image_dir = "path/to/images/"
for filename in os.listdir(image_dir):
if filename.endswith(('.jpg', '.png', '.jpeg')):
image_path = os.path.join(image_dir, filename)
result, confidence, _, _ = ml_processor.predict_from_image(
image_path, "Plant", database
)
print(f"{filename}: {result['name']} ({confidence:.1f}%)")Application crashes when uploading second image
Solution: This was a Qt threading issue that has been fixed in the latest version. Make sure you're using the latest code:
git pull origin main
pip install -r comprehensive_requirements.txt --upgradeModuleNotFoundError: No module named 'googleapiclient'
Solution: Install the missing dependency:
pip install google-api-python-clientModel file not found error
Solution: Train the model or download the pre-trained model:
cd DiseaseDetectionApp
./run_train.shPySide6 version incompatibility
Solution: Upgrade to Python 3.14 compatible version:
pip install "PySide6>=6.10.0"- π Check the Issues page
- π¬ Start a Discussion
- π§ Contact: @abhi-abhi86
We welcome contributions! Here's how you can help:
- π Report Bugs: Found a bug? Open an issue
- π‘ Suggest Features: Have an idea? Start a discussion
- π Improve Documentation: Help make the docs better
- π§ͺ Add Tests: Increase test coverage
- π¨ Enhance UI: Improve the user interface
- π¬ Add Diseases: Contribute new disease data
- π Share Datasets: Contribute training data (with proper licensing)
- Fork the repository
- Create a feature branch
git checkout -b feature/AmazingFeature
- Commit your changes
git commit -m "Add some AmazingFeature" - Push to the branch
git push origin feature/AmazingFeature
- Open a Pull Request
- Follow PEP 8 style guide
- Add tests for new features
- Update documentation
- Use descriptive commit messages
- Keep PRs focused and small
This project is licensed under the MIT License - see the LICENSE file for details.
- PyTorch: BSD License
- PySide6: LGPL License
- OpenCV: Apache 2.0 License
- Pillow: HPND License
- PlantVillage: Plant disease dataset
- Kaggle: Various disease datasets
- Public Domain: Community-contributed images
- PyTorch - Deep learning framework
- PySide6 - Qt for Python GUI framework
- Pillow - Image processing library
- scikit-learn - Machine learning utilities
- Wikipedia API - Knowledge integration
- Folium - Interactive maps
- Medical imaging research from Stanford ML Group
- Agricultural AI from PlantDoc project
- Open-source computer vision community
This tool is designed for educational and research purposes only. It is NOT a substitute for professional medical, veterinary, or agricultural advice, diagnosis, or treatment.
Always consult qualified professionals:
- π¨ββοΈ Medical doctors for human health concerns
- π Licensed veterinarians for animal health issues
- πΎ Agricultural extension services for crop diseases
The developers and contributors assume no liability for any consequences resulting from the use of this software. Users are responsible for:
- Validating all results
- Seeking professional consultation
- Using the tool responsibly
- Understanding its limitations
- All data processing happens locally on your device
- No data is sent to external servers (except optional Wikipedia/PubMed lookups)
- No user data is collected or stored by the developers
- You maintain full control of your data
- Multi-species disease detection
- Desktop GUI application
- Offline operation
- Custom model training
- Report generation (PDF/HTML)
- Wikipedia and PubMed integration
- Interactive maps
- AI chatbot
- Image validation
- Thread-safe operation
- Mobile applications (iOS/Android)
- Web-based interface
- Real-time video stream analysis
- Multi-language support
- Cloud-optional deployment
- Integration with medical imaging standards (DICOM)
- Advanced model architectures (Vision Transformers)
- Federated learning support
- API server mode
- Docker containerization
- Developer: Abhi
- GitHub: @abhi-abhi86
- Repository: disease-predictor
- Issues: Report a bug
- Discussions: Ask questions
If you find this project helpful:
- β Star the repository
- π Report bugs and issues
- π‘ Suggest new features
- π€ Contribute code or documentation
- π’ Share with others who might benefit
If you use this project in your research, please cite:
@software{disease_predictor_2025,
author = {Abhi},
title = {Multi-Species Disease Detection and Management System},
year = {2025},
publisher = {GitHub},
url = {https://github.com/abhi-abhi86/disease-predictor},
version = {1.0.0}
}Made with β€οΈ for better healthcare, agriculture, and animal welfare