Skip to content

Darkwebnew/Miniproject

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

32 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Typing SVG


Python TensorFlow Flask OpenCV NumPy


Accuracy Model License Status


๐Ÿซ€ Automated cardiac MRI segmentation โ€” U-Net precisely delineates Left Ventricle, Right Ventricle & Myocardium with 94.8% accuracy, empowering faster and more reliable clinical diagnostics.


โš•๏ธ Medical Disclaimer: This system is an AI-assisted screening tool designed to support qualified medical professionals. All predictions require review by a licensed cardiologist before any clinical decision is made.


๐Ÿš€ Quick Start ย โ€ขย  ๐Ÿ—๏ธ Architecture ย โ€ขย  ๐Ÿ“ธ Screenshots ย โ€ขย  ๐Ÿ“Š Results ย โ€ขย  ๐Ÿ‘ฅ Team ย โ€ขย  โ˜• Support


๐Ÿ† Why HeartSeg AI?

Traditional Segmentation   โ†’   Manual, hours per scan, error-prone, inconsistent across radiologists
HeartSeg AI                โ†’   Automated, sub-minute inference, 94.8% accuracy, reproducible results

94.8% Accuracy
Precise pixel-wise segmentation of all 3 cardiac structures

U-Net Architecture
State-of-the-art encoder-decoder with skip connections

Real-Time Results
Instant segmentation feedback via web interface

6 Disease Classes
Normal + 5 cardiac pathology classifications

๐ŸŒŸ Project Overview

HeartSeg AI is a deep learning-powered cardiac MRI segmentation system built as a Mini Project at Saveetha Engineering College. It implements the U-Net architecture to automatically segment critical heart structures โ€” Left Ventricle, Right Ventricle, and Myocardium โ€” from MRI scans, while also classifying the scan into one of 6 cardiac disease categories through a clean web interface.

๐ŸŽ“ Institution: Saveetha Engineering College, Chennai ๐Ÿ“… Academic Year: 2024โ€“2025 ๐Ÿง  Model: U-Net with 94.8% segmentation accuracy ๐Ÿฅ Clinical Use: Cardiac MRI diagnostic support

๐ŸŽฏ Problem Statement

Manual cardiac MRI segmentation is a bottleneck in clinical cardiology โ€” it takes hours per scan, requires expert radiologists, and produces inconsistent results across practitioners. HeartSeg AI automates this entirely, delivering reproducible, high-accuracy segmentation in under a minute through a browser-based interface that integrates seamlessly into clinical workflows.


โœจ Feature Highlights

๐Ÿง  U-Net Segmentation Engine
  • Encoder Path โ€” Captures multi-scale contextual features through progressive downsampling
  • Bottleneck โ€” Processes the most compressed, abstract feature representation
  • Decoder Path โ€” Precise localization through upsampling with skip connections
  • Pixel-wise Output โ€” Generates full-resolution segmentation masks
  • 3 Structure Segmentation โ€” Left Ventricle, Right Ventricle, Myocardium simultaneously
  • 94.8% accuracy on validation MRI datasets
๐Ÿฅ 6-Class Disease Classification
  • Normal โ€” Healthy cardiac MRI
  • Coronary Artery Disease โ€” Arterial blockage patterns
  • Chronic Ischemic Disease โ€” Chronic blood flow restriction
  • Heart Failure โ€” Reduced ejection fraction indicators
  • Heart Valve Disease โ€” Structural valve abnormalities
  • Irregular Heartbeat โ€” Arrhythmia-related structural changes
๐ŸŒ Web-Based Clinical Interface
  • Secure login system with session management
  • Drag-and-drop MRI image upload
  • Real-time segmentation visualization
  • Overlay of predicted mask on original MRI
  • Clean, responsive dark-themed UI
  • Built with Flask + HTML5/CSS3
โšก Automated Processing Pipeline
  • Image normalization and preprocessing on upload
  • Automatic model inference via mri_segmentation.py
  • Post-processing and mask overlay generation
  • Instant result rendering in browser
  • No manual steps between upload and result

๐Ÿ—๏ธ System Architecture

HeartSeg Architecture

U-Net encoder-decoder architecture: MRI input โ†’ feature extraction โ†’ pixel-wise segmentation mask

Note: See the architecture-diagram.html file for an interactive version of this diagram.

๐Ÿงฉ Component Summary

Component File Technology Purpose
Web Server app.py Flask Routes, session auth, file handling
Segmentation Engine mri_segmentation.py TensorFlow / Keras U-Net inference pipeline
Trained Model h5/heart_mri_model.h5 Keras SavedModel Pre-trained U-Net weights
Training Pipeline train.py TensorFlow 2.4.1 Model training and evaluation
Login UI templates/login.html HTML5 + CSS3 Authentication interface
Upload UI templates/upload.html HTML5 + CSS3 MRI image submission
Result UI templates/result.html HTML5 + CSS3 Segmentation visualization
Styling static/*.css CSS3 Page-specific stylesheets

๐Ÿ”„ Inference Flow

User Login (Flask Session)
         โ”‚
         โ–ผ
MRI Image Upload (JPG/PNG)
         โ”‚
         โ–ผ
Preprocessing โ€” Normalize ยท Resize to (256ร—256) ยท Expand dims
         โ”‚
         โ–ผ
U-Net Model Inference (heart_mri_model.h5)
    Encoder โ†’ Bottleneck โ†’ Decoder
         โ”‚
         โ–ผ
Segmentation Mask (pixel-wise prediction)
         โ”‚
         โ–ผ
Disease Classification (6 classes)
         โ”‚
         โ–ผ
Overlay Visualization + Result Display

๐Ÿ“ธ Screenshots

๐Ÿ”‘ Authentication

Login Page
Login

๐Ÿ“ค Upload Interface

Upload Page Image Selection
Upload Selection

๐Ÿ”ฌ Segmentation Results

Normal Coronary Artery Disease
Normal CAD
Chronic Ischemic Disease Heart Failure
CID HF
Heart Valve Disease Irregular Heartbeat
HVD IHB

๐Ÿ–ฅ๏ธ Development Environment

VS Code โ€” Running Server
VSCode

๐Ÿ“‚ Project Structure

Miniproject/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ h5/
โ”‚   โ””โ”€โ”€ heart_mri_model.h5             # Pre-trained U-Net weights
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ img/                             # Screenshots & diagrams (10 images)
โ”‚   โ”œโ”€โ”€ Login_Page.png
โ”‚   โ”œโ”€โ”€ Upload_Page.png
โ”‚   โ”œโ”€โ”€ Upload_Image_Selection_Page.png
โ”‚   โ”œโ”€โ”€ Prediction_Result_Normal.png
โ”‚   โ”œโ”€โ”€ Prediction_Result_Choronary_Artery_Disease.png
โ”‚   โ”œโ”€โ”€ Prediction_Result_Chronic_Ischemic_Disease.png
โ”‚   โ”œโ”€โ”€ Prediction_Result_Heart_Failure_Disease.png
โ”‚   โ”œโ”€โ”€ Prediction_Result_Heart_Valve_Disease.png
โ”‚   โ”œโ”€โ”€ Prediction_Result_Irregular_Heartbeat_Disease.png
โ”‚   โ””โ”€โ”€ VS_Code_Running_Status.png
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ static/                          # CSS stylesheets
โ”‚   โ”œโ”€โ”€ login.css
โ”‚   โ”œโ”€โ”€ upload.css
โ”‚   โ””โ”€โ”€ result.css
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ templates/                       # Jinja2 HTML templates
โ”‚   โ”œโ”€โ”€ login.html
โ”‚   โ”œโ”€โ”€ upload.html
โ”‚   โ””โ”€โ”€ result.html
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ app.py                           # Flask web server + routes
โ”œโ”€โ”€ ๐Ÿ“„ mri_segmentation.py             # U-Net inference pipeline
โ”œโ”€โ”€ ๐Ÿ“„ train.py                         # Model training script
โ”œโ”€โ”€ ๐Ÿ“„ requirements.txt                 # Python dependencies
โ”œโ”€โ”€ ๐Ÿ“„ LICENSE.txt                      # Proprietary license
โ””โ”€โ”€ ๐Ÿ“„ README.md                        # This file

๐Ÿ› ๏ธ Installation & Quick Start

๐Ÿ“‹ Prerequisites

โœ“ Python 3.6+
โœ“ pip
โœ“ 64-bit OS (Windows 10 or Ubuntu)
โœ“ 4GB+ RAM (GPU recommended for training)

1๏ธโƒฃ Clone

git clone https://github.com/Darkwebnew/Miniproject.git
cd Miniproject

2๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

Or manually:

pip install tensorflow==2.4.1
pip install opencv-python
pip install numpy
pip install scikit-learn
pip install flask

3๏ธโƒฃ Run the Web App

python app.py

Open your browser at http://localhost:5000

4๏ธโƒฃ (Optional) Retrain the Model

python train.py
# Trained model will be saved to h5/heart_mri_model.h5

๐Ÿ“Š Results & Performance

๐ŸŽฏ Segmentation Accuracy: 94.8%

Metric Value
Segmentation Accuracy 94.8% โœ…
Architecture U-Net (Encoder-Decoder)
Input Size 256 ร— 256 px
Segments Left Ventricle ยท Right Ventricle ยท Myocardium
Disease Classes 6 (Normal + 5 pathologies)
Framework TensorFlow 2.4.1 / Keras
Model Size heart_mri_model.h5

๐ŸŒŸ Clinical Impact

Benefit Detail
โฑ๏ธ Speed Hours of manual segmentation โ†’ sub-minute automated results
๐ŸŽฏ Precision 94.8% accuracy โ€” comparable to expert radiologist consistency
๐Ÿ‘จโ€โš•๏ธ Clinical Value Empowers cardiologists with reliable AI pre-screening
๐Ÿฅ Workflow Browser-based โ€” integrates into any clinical environment
๐Ÿ”ฌ Research Demonstrates deep learning's transformative role in cardiac imaging

๐Ÿ“‹ Requirements

Category Specification
OS 64-bit Windows 10 or Ubuntu
Python 3.6 or later
Deep Learning TensorFlow 2.4.1
Image Processing OpenCV
Numerics NumPy, scikit-learn
Web Framework Flask
IDE VSCode or PyCharm (recommended)

๐Ÿ‘ฅ Team

๐Ÿ† Core Development Team



Sriram V
๐Ÿš€ Project Lead & Developer
U-Net Architecture ยท Flask App ยท Model Training



Surothaaman R
โš™๏ธ Backend Developer
Flask Routes ยท Preprocessing ยท Integration



Andrew Varghese V S
๐ŸŽจ Frontend & Research
UI Templates ยท CSS Styling ยท Documentation


๐ŸŽ“ Academic Guidance

Role Institution
Mini Project Supervisors Saveetha Engineering College, Chennai

๐Ÿค Contributing

โš ๏ธ Important: This project is under a restrictive proprietary license. Contributions are welcome strictly for educational improvement purposes only. By submitting a pull request, you agree your contribution becomes part of this project under the same license terms. No contributor may independently use, redistribute, or commercialize any part of this code.

How to Contribute

  1. Open an Issue first โ€” discuss your idea before coding
  2. Fork the repository
  3. Create a branch โ€” git checkout -b feature/YourFeature
  4. Commit โ€” git commit -m 'feat: Add YourFeature'
  5. Push & open a Pull Request with a detailed description

Contribution Areas

Area Difficulty Skills Needed
๐Ÿง  Model Improvements (new architectures) Advanced Python, TensorFlow, Keras
๐ŸŒ Web Interface Enhancement Medium Flask, HTML, CSS
๐Ÿ“Š Additional Disease Classes Advanced Medical imaging, Deep learning
๐Ÿ“š Documentation Beginner Markdown
๐Ÿงช Evaluation Metrics (Dice, IoU) Medium Python, scikit-learn

โ˜• Support the Project

If HeartSeg AI helped your research or clinical project โ€” consider supporting continued development!




Your support helps build better AI healthcare tools for the community.


GitHub Sponsors PayPal


๐Ÿ“„ License

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘              PROPRIETARY SOFTWARE LICENSE                        โ•‘
โ•‘       Copyright (c) 2024โ€“2025  Sriram V & HeartSeg AI Team      โ•‘
โ•‘                   All Rights Reserved                            โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

This software and all associated source code, trained model weights, documentation, UI templates, screenshots, and assets are the exclusive intellectual property of the authors and are fully protected under applicable copyright law and the Indian Copyright Act, 1957.

โŒ You MAY NOT:

  • Copy, reproduce, or redistribute this code in whole or in part
  • Use this project or any portion of it in commercial medical products or services
  • Modify, adapt, or create derivative works based on this project
  • Sublicense, sell, rent, or transfer rights to any third party
  • Use this project's name, model weights, or research in your own publications without explicit written permission
  • Deploy this system in any clinical, production, or commercial environment without written authorization
  • Present this work as your own in academic or professional contexts

โœ… You MAY:

  • View and study the source code for personal educational purposes only
  • Fork on GitHub solely to submit pull requests
  • Reference this project in academic citations with proper attribution

โš–๏ธ Legal Notice

Any unauthorized use, reproduction, distribution, or clinical deployment of this software is strictly prohibited and may result in civil and criminal penalties. The authors reserve all rights and will pursue all available legal remedies for any violations.

For licensing inquiries: @darkwebnew via GitHub Issues

See the full LICENSE.txt for complete terms.


๐Ÿ™ Acknowledgments

Technology Purpose
TensorFlow / Keras U-Net deep learning framework
OpenCV Medical image preprocessing
Flask Web server and routing
NumPy Numerical computation
scikit-learn Evaluation metrics
Saveetha Engineering College Academic support and guidance
ACDC Dataset Cardiac MRI benchmark reference

Academic References: Ronneberger et al. (U-Net, MICCAI 2015) ยท Bernard et al. (ACDC Challenge 2018)


โญ Star this repository if HeartSeg AI helped your project!

GitHub stars GitHub forks GitHub watchers


Made with โค๏ธ for advancing cardiac healthcare ยท Saveetha Engineering College ยท Tamil Nadu, India ๐Ÿ‡ฎ๐Ÿ‡ณ

๐Ÿ› Report Bug ยท ๐Ÿ’ก Request Feature

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 43.6%
  • HTML 32.7%
  • CSS 23.7%