https://github.com/tariktoplu/medicalvision-ai
Advanced Medical Imaging Analysis - Desktop app for brain CT/MR analysis using deep learning
https://github.com/tariktoplu/medicalvision-ai
deep-learning desktop-app dicom healthcare-ai medical-imaging pytorch
Last synced: about 1 month ago
JSON representation
Advanced Medical Imaging Analysis - Desktop app for brain CT/MR analysis using deep learning
- Host: GitHub
- URL: https://github.com/tariktoplu/medicalvision-ai
- Owner: tariktoplu
- Created: 2025-08-05T21:53:40.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-08-21T01:07:31.000Z (about 2 months ago)
- Last Synced: 2025-08-21T03:33:38.909Z (about 2 months ago)
- Topics: deep-learning, desktop-app, dicom, healthcare-ai, medical-imaging, pytorch
- Language: Python
- Homepage:
- Size: 773 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ฅ MedicalVision-AI
> **Advanced Medical Imaging Analysis System** - Professional desktop application for automated brain CT/MR image analysis using deep learning ensemble models.


## ๐ฏ Overview
MedicalVision-AI is a state-of-the-art desktop application designed for medical professionals to analyze brain imaging data. The system uses a 5-fold ensemble CNN-LSTM model with SE (Squeeze-and-Excitation) attention mechanism to classify stroke lesion phases.
### ๐ฌ Medical Classifications
- **HiperakutAkut** (Hyperacute/Acute)
- **Subakut** (Subacute)
- **NormalKronik** (Normal/Chronic)## โจ Features
### ๐ฅ๏ธ **Modern Desktop Interface**
- Professional PyQt5 GUI with responsive design
- Intuitive workflow: Modality โ Analysis Mode โ Results
- Real-time image preview and processing status### ๐ง **Advanced AI Model**
- **5-Fold Ensemble Learning** for higher accuracy
- **CNN-LSTM Architecture** with SE Attention blocks
- **GPU/CPU Auto-detection** for optimal performance
- **Focal Loss** optimization for imbalanced medical data### ๐ **Multi-Format Support**
- **DICOM** (.dcm) - Native medical imaging format
- **Standard Images** (.png, .jpg, .jpeg, .bmp)
- **Batch Processing** - Analyze multiple files simultaneously
- **Automatic Preprocessing** - Normalization and resizing### ๐๏ธ **Analysis Modes**
- **Single Analysis**: Individual file processing with detailed results
- **Multi Analysis**: Batch processing with tabular results
- **Progress Tracking**: Real-time processing status
- **Error Handling**: Robust error management per file## ๐ Installation
### Prerequisites
- Python 3.8 or higher
- CUDA-compatible GPU (optional, but recommended)### Step 1: Clone Repository
```bash
git clone https://github.com/yourusername/MedicalVision-AI.git
cd MedicalVision-AI
```### Step 2: Create Virtual Environment (Recommended)
```bash
# Windows
python -m venv medical_ai_env
medical_ai_env\Scripts\activate# macOS/Linux
python3 -m venv medical_ai_env
source medical_ai_env/bin/activate
```### Step 3: Install Dependencies
```bash
pip install -r requirements.txt
```### Step 4: Setup Model Files
Create the model directory and place your trained models:
```bash
mkdir Models
```Place your 5-fold model files in the `Models/` directory:
```
Models/
โโโ best_model_fold_0.pt
โโโ best_model_fold_1.pt
โโโ best_model_fold_2.pt
โโโ best_model_fold_3.pt
โโโ best_model_fold_4.pt
```## ๐ฎ Usage
### Launch Application
```bash
python medical_analyzer.py
```### Step-by-Step Workflow
1. **Select Modality**
- Choose between BT (CT) or MR imaging2. **Choose Analysis Mode**
- **Single Analysis**: For individual file processing
- **Multi Analysis**: For batch processing multiple files3. **Upload Files**
- Support for DICOM (.dcm) and standard image formats
- Drag & drop functionality (in single mode)4. **View Results**
- **Prediction**: Primary classification result
- **Confidence**: Prediction confidence percentage
- **All Probabilities**: Complete class probability breakdown### Single Analysis Features
- ๐ผ๏ธ **Image Preview**: Real-time visualization
- ๐ **Detailed Results**: Comprehensive analysis output
- โก **Instant Processing**: Fast single-file analysis### Multi Analysis Features
- ๐ **Batch Upload**: Process multiple files at once
- ๐ **Table View**: Organized results in tabular format
- ๐ **Progress Tracking**: Real-time processing status
- ๐ **Parallel Processing**: Efficient multi-file handling## ๐ง Technical Architecture
### Model Architecture
```
Input (256x256x16) โ 3D CNN โ SE Attention โ MaxPool โ
3D CNN โ SE Attention โ MaxPool โ LSTM โ Dense โ Output (3 classes)
```### Key Components
- **SE Blocks**: Squeeze-and-Excitation attention mechanism
- **3D Convolutions**: Spatial-temporal feature extraction
- **LSTM**: Sequential pattern recognition
- **Focal Loss**: Handles class imbalance in medical data### System Requirements
- **RAM**: Minimum 8GB (16GB recommended)
- **Storage**: 2GB+ for models and dependencies
- **GPU**: CUDA-compatible (optional, improves speed 10x+)## ๐ Performance Metrics
The ensemble model achieves high accuracy through:
- โ **5-Fold Cross-Validation** training
- โ **Ensemble Averaging** for robust predictions
- โ **Class-Weighted Sampling** for balanced learning
- โ **Early Stopping** to prevent overfitting## ๐ ๏ธ Development
### Project Structure
```
MedicalVision-AI/
โโโ medical_analyzer.py # Main application
โโโ train.py # Model training script
โโโ requirements.txt # Dependencies
โโโ README.md # Documentation
โโโ Models/ # Model files directory
โ โโโ best_model_fold_0.pt
โ โโโ ...
โโโ assets/ # Application assets (optional)
```### Contributing
1. Fork the repository
2. Create feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit changes (`git commit -m 'Add AmazingFeature'`)
4. Push to branch (`git push origin feature/AmazingFeature`)
5. Open Pull Request## ๐ Troubleshooting
### Common Issues
**Model Loading Error**
```bash
Error: Hiรงbir model dosyasฤฑ bulunamadฤฑ!
```
**Solution**: Ensure model files are in `Models/` directory with correct naming.**CUDA Out of Memory**
```bash
RuntimeError: CUDA out of memory
```
**Solution**: Reduce batch size or use CPU mode (automatic fallback).**PyQt5 Import Error**
```bash
ModuleNotFoundError: No module named 'PyQt5'
```
**Solution**: Install PyQt5 with `pip install PyQt5` or use conda environment.### System Requirements Check
```python
import torch
print(f"PyTorch: {torch.__version__}")
print(f"CUDA Available: {torch.cuda.is_available()}")
print(f"CUDA Device: {torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'CPU'}")
```## ๐ Acknowledgments
- PyTorch team for the deep learning framework
- DICOM community for medical imaging standards
- PyQt5 developers for the GUI framework
- Medical imaging research community## ๐ง Contact
- **Author**: Tarฤฑk Toplu
- **Email**: tarikttoplu@gmail.com
- **Project Link**: [https://github.com/yourusername/MedicalVision-AI](https://github.com/tariktoplu/MedicalVision-AI)---
โญ **Star this repository if it helped you!**
๐ฌ **Built for medical professionals, by AI researchers**