Skip to content

This project is a Deep Learning-based Medical Imaging Platform designed to assist clinicians and researchers in analyzing wound images. It combines state-of-the-art Convolutional Neural Networks (CNNs) for multi-class classification with Vector Similarity Search to retrieve visually similar historical cases.

License

Notifications You must be signed in to change notification settings

hyper07/Deep-Learning-LLM-Wounded-Treatment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🩺 Wound Analysis & Classification Platform

Python 3.12+ TensorFlow Streamlit PostgreSQL Docker License: MIT

A comprehensive AI-powered toolkit for clinical wound image analysis, classification, and similarity-based retrieval.


πŸ“– Overview

This project is a Deep Learning-based Medical Imaging Platform designed to assist clinicians and researchers in analyzing wound images. It combines state-of-the-art Convolutional Neural Networks (CNNs) for multi-class classification with Vector Similarity Search to retrieve visually similar historical cases.

Beyond simple classification, the system integrates Generative AI (LLMs via Ollama) to provide automated medical opinions and treatment recommendations based on visual analysis, acting as an intelligent second opinion for medical professionals.

🎯 Key Capabilities

  • πŸ€– Multi-Class Classification: Accurately identifies 10+ wound types (e.g., Diabetic Wounds, Venous Ulcers, Burns) using robust backbones like ResNet50, EfficientNet, and VGG16.
  • πŸ” Visual Similarity Search: Retrieves similar historical cases from a vector database using 1536-dimensional embeddings and Cosine Similarity (powered by PostgreSQL + pgvector).
  • πŸ’¬ AI Medical Assistant: Integrates with Ollama to generate treatment recommendations and medical insights based on classification results.
  • πŸ“Š Interactive Dashboard: A user-friendly Streamlit interface for model training, dataset exploration, and real-time inference.
  • ⚑ Optimized Pipeline: Supports Apple Metal (MPS) acceleration for Mac users and Docker-based deployment for reproducibility.

πŸ“Έ Interface Gallery

1. Main Dashboard

Home Page Central hub for navigation and project overview.

2. Dataset Analytics

Dataset Summary Comprehensive breakdown of class distributions and dataset statistics.

3. Model Training Hub

Training Interface Real-time training configuration and monitoring.

4. AI-Powered Analysis & Similarity Search

Search Results Visual similarity search finding comparable historical cases.

5. LLM Treatment Recommendations

Treatment Recommendation Generative AI providing treatment suggestions based on diagnosis.


πŸ› οΈ Tech Stack & Architecture

The solution is built on a modern, modular architecture:

Component Technology Description
Frontend Streamlit Interactive web dashboard for all user workflows.
Deep Learning TensorFlow / Keras Model training (ResNet50, EfficientNet, VGG16).
Vector DB PostgreSQL + pgvector Storage and retrieval of high-dimensional image embeddings.
GenAI / LLM Ollama Local LLM inference for medical text generation.
Data Processing Pandas / NumPy Data manipulation and augmentation pipelines.
Deployment Docker & Docker Compose Containerized environment for consistent execution.

πŸ“‚ Project Structure

dl-fall-2025/
β”œβ”€β”€ πŸ“± app-streamlit/       # Frontend Application
β”‚   β”œβ”€β”€ components/         # Reusable UI widgets (Cards, Headers)
β”‚   β”œβ”€β”€ functions/          # App logic (Visualization, DB helpers)
β”‚   β”œβ”€β”€ pages/              # Streamlit pages (Training, Search, Summary)
β”‚   └── Dockerfile          # Frontend container definition
β”œβ”€β”€ 🧠 core/                # Backend Core Library
β”‚   β”œβ”€β”€ model_utils.py      # CNN definitions & training logic
β”‚   β”œβ”€β”€ image_similarity.py # Vector search implementation
β”‚   β”œβ”€β”€ ollama_client.py    # LLM API integration
β”‚   β”œβ”€β”€ database.py         # PostgreSQL connection handler
β”‚   └── data_processing.py  # Dataset loading & transformation
β”œβ”€β”€ πŸ’Ύ files/               # Data Storage
β”‚   β”œβ”€β”€ train_dataset/      # Raw training images (categorized)
β”‚   └── train_dataset_aug/  # Augmented dataset
β”œβ”€β”€ πŸ“¦ models/              # Model Artifacts
β”‚   β”œβ”€β”€ efficientnet/       # EfficientNet weights & metrics
β”‚   β”œβ”€β”€ resnet50/           # ResNet50 weights & metrics
β”‚   └── vgg16/              # VGG16 weights & metrics
β”œβ”€β”€ train_model.py          # CLI entry point for training
β”œβ”€β”€ generate_vectors.py     # CLI for embedding generation
β”œβ”€β”€ database_backup.py      # Backup/Restore utilities
└── 🐳 docker-compose.yml   # Service orchestration

πŸš€ Getting Started

Prerequisites

  • Docker Desktop (Recommended)
  • Python 3.12+ (For local development)
  • Git

⚑ Quick Launch (Docker)

The easiest way to run the full platform (App + Database) is via Docker.

  1. Clone the Repository

    git clone https://github.com/hyper07/dl-fall-2025.git
    cd dl-fall-2025
  2. Start Services

    docker-compose up --build
  3. Access the App

πŸ’» Local Development Setup

If you prefer running the Python code directly:

  1. Install Dependencies

    pip install -r requirements.txt
  2. Setup Environment Copy the example environment file and configure your database credentials if needed.

    cp .env.example .env
  3. Run Streamlit App

    streamlit run Home.py

πŸ§ͺ Usage Workflow

1. Model Training

Train a new wound classification model using the CLI or UI.

# Example: Train EfficientNet with MPS acceleration (Mac)
python train_model.py --architecture efficientnet --device mps --epochs 20

2. Vector Generation

Extract features from your trained model to populate the vector database.

# Generate embeddings for all images in the dataset
python generate_vectors.py

3. Similarity Search & Analysis

Open the Streamlit app and navigate to Similarity Search.

  • Upload a wound image.
  • The system will predict the wound class.
  • It will search for the top 10 most similar past cases.
  • The LLM will generate a preliminary assessment.

πŸ“Š Models & Performance

The platform supports three primary architectures, each serving different needs:

  • ResNet50: Balanced performance and speed. Excellent feature extractor for embeddings.
  • EfficientNet (Default): High accuracy with lower parameter count. Best for resource-constrained environments.
  • VGG16: Simple, deep architecture. Good for educational purposes and feature visualization.

Current benchmarks show 77%+ accuracy on the standard wound dataset for EfficientNet.


πŸ‘₯ Team & Contributors

πŸ“„ License

This project is licensed under the MIT License. See LICENSE for details.


Built with ❀️ by the Deep Learning Fall 2025 Team

About

This project is a Deep Learning-based Medical Imaging Platform designed to assist clinicians and researchers in analyzing wound images. It combines state-of-the-art Convolutional Neural Networks (CNNs) for multi-class classification with Vector Similarity Search to retrieve visually similar historical cases.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages