Skip to content

PetDerma is an AI-powered web app that uses computer vision and deep learning to accurately diagnose skin diseases in cats and dogs, providing confidence scores and treatment recommendations.

License

Notifications You must be signed in to change notification settings

kohesee/PetDerma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿถ PetDerma - AI-Powered Pet Skin Disease Diagnosis Platform

Python Flask PyTorch License

๐ŸŽฏ Overview

PetDerma is an advanced AI-powered web application designed to diagnose skin diseases in pets using computer vision and deep learning technologies. The platform features specialized diagnostic modules for both cats and dogs, providing accurate disease detection with confidence scores and treatment recommendations.

โœจ Key Features

๐Ÿฑ CatDerma Module

  • Disease Detection: Flea Allergy, Healthy Skin, Ringworm, Scabies
  • AI Model: ResNet-50 based classification
  • Real-time Analysis: Instant diagnostic results with confidence scores
  • Visual Feedback: Probability distribution charts for all conditions

๐Ÿ• DogDerma Module

  • Disease Detection: Dermatitis, Fungal Infections, Healthy Skin, Hypersensitivity, Demodicosis, Ringworm
  • Advanced Diagnostics: Comprehensive skin condition analysis
  • Treatment Guidance: Detailed information about each condition
  • User Feedback System: Integrated feedback collection for model improvement

๐Ÿ› ๏ธ Technology Stack

Datasets

Backend Technologies

  • Python 3.8+: Core programming language
  • Flask 3.0+: Web framework for API and routing
  • PyTorch 2.0+: Deep learning framework for AI models

AI/ML Libraries

  • torchvision: Computer vision transformations and models
  • ResNet-50: Pre-trained convolutional neural network architecture
  • PIL (Pillow): Image processing and manipulation
  • NumPy: Numerical computing and array operations

Data Science & Visualization

  • Matplotlib: Statistical plotting and visualization
  • Pandas: Data manipulation and analysis
  • Scikit-learn: Machine learning utilities

Frontend Technologies

  • HTML5/CSS3: Modern web standards
  • Responsive Design: Mobile-first approach

๐Ÿ“ Project Structure

PetDerma/
โ”œโ”€โ”€ app.py                          # Main application launcher
โ”œโ”€โ”€ requirements.txt                # Python dependencies
โ”œโ”€โ”€ README.md                       # Project documentation
โ”œโ”€โ”€ templates/
โ”‚   โ””โ”€โ”€ index.html                  # Main landing page
โ”œโ”€โ”€ static/                         # Static assets
โ”œโ”€โ”€ CatDerma/                       # Cat skin disease module
โ”‚   โ”œโ”€โ”€ app.py                      # CatDerma Flask application
โ”‚   โ”œโ”€โ”€ cat_skin_disease_model.pth  # Trained PyTorch model
โ”‚   โ”œโ”€โ”€ cat_skin_model.ipynb        # Training Dataset to get model
โ”‚   โ”œโ”€โ”€ feedback_data.csv           # User feedback storage
โ”‚   โ”œโ”€โ”€ requirements.txt            # Module-specific dependencies
โ”‚   โ”œโ”€โ”€ templates/
โ”‚   โ”‚   โ”œโ”€โ”€ index.html              # CatDerma interface
โ”‚   โ”‚   โ”œโ”€โ”€ home.html               # Results display
โ”‚   โ”‚   โ””โ”€โ”€ about.html              # Information page
โ”‚   โ””โ”€โ”€ static/uploads/             # Uploaded images storage
โ””โ”€โ”€ DogDerma/                       # Dog skin disease module
    โ”œโ”€โ”€ app.py                      # DogDerma Flask application
    โ”œโ”€โ”€ best_model.pth              # Trained PyTorch model
    โ”œโ”€โ”€ dog_skin_model.ipynb        # Training Dataset to get model
    โ”œโ”€โ”€ feedback_data.csv           # User feedback storage
    โ”œโ”€โ”€ requirements.txt            # Module-specific dependencies
    โ”œโ”€โ”€ templates/
    โ”‚   โ”œโ”€โ”€ index.html              # DogDerma interface
    โ”‚   โ”œโ”€โ”€ home.html               # Results display
    โ”‚   โ””โ”€โ”€ about.html              # Information page
    โ””โ”€โ”€ static/uploads/             # Uploaded images storage

๐Ÿš€ Installation & Setup

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)
  • Virtual environment (recommended)

Step 1: Clone the Repository

git clone <repository-url>
cd PetDerma

Step 2: Create Virtual Environment

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

Step 3: Install Dependencies

# Upgrade pip and setuptools
python -m pip install --upgrade pip setuptools wheel

# Install required packages
pip install -r requirements.txt

๐ŸŽฎ Running the Application

Launch Application

python app.py

This command will:

  • Start the main PetDerma application on http://localhost:5000
  • Automatically launch CatDerma on http://localhost:5001
  • Automatically launch DogDerma on http://localhost:5002

๐Ÿ“– Usage Guide

Getting Started

  1. Access the Platform: Navigate to http://localhost:5000
  2. Choose Your Pet: Select either "Cat Diagnosis" or "Dog Diagnosis"
  3. Upload Image: Select a clear image of your pet's skin condition
  4. Get Results: View diagnostic results with confidence scores
  5. Review Information: Read detailed condition descriptions and treatment advice

Best Practices for Image Upload

  • Image Quality: Use high-resolution, well-lit images
  • Focus Area: Ensure the affected skin area is clearly visible
  • File Formats: Supports JPG, JPEG, PNG formats
  • Image Size: Optimal size is 224x224 pixels (automatically resized)

Understanding Results

  • Confidence Score: Percentage indicating model certainty
  • Probability Distribution: Visual chart showing likelihood of each condition
  • Condition Information: Detailed descriptions, symptoms, and treatment options
  • Report Maker: Select respective options and Generate Report

๐Ÿงช Model Information

Architecture

  • Base Model: ResNet-50 (pre-trained on ImageNet)
  • Custom Classification Layer: Adapted for pet skin conditions
  • Input Size: 224x224 RGB images
  • Normalization: ImageNet standard normalization

Cat Disease Classes

  1. Flea Allergy: Allergic reaction to flea saliva
  2. Healthy: Normal, healthy skin condition
  3. Ringworm: Fungal infection affecting skin and hair
  4. Scabies: Parasitic mite infestation

Dog Disease Classes

  1. Dermatitis: Inflammatory skin condition
  2. Fungal Infections: Various fungal skin diseases
  3. Healthy: Normal, healthy skin condition
  4. Hypersensitivity: Allergic skin reactions
  5. Demodicosis: Demodex mite infestation
  6. Ringworm: Fungal infection affecting skin and hair

๐Ÿค Contributing

We welcome contributions to improve PetDerma! Please see our contribution guidelines:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

โš ๏ธ Disclaimer

Important: PetDerma is designed to assist in identifying potential skin conditions but should not replace professional veterinary diagnosis and treatment. Always consult with a qualified veterinarian for proper medical advice and treatment of your pet's health conditions.

Made with โค๏ธ for pet health and well-being

About

PetDerma is an AI-powered web app that uses computer vision and deep learning to accurately diagnose skin diseases in cats and dogs, providing confidence scores and treatment recommendations.

Resources

License

Stars

Watchers

Forks