Skip to content

shambavi2007/ARDS-Early-Warning-System

Repository files navigation

🏥 ARDS Early Warning and Prediction System

A comprehensive web application for early prediction of Acute Respiratory Distress Syndrome (ARDS) in ICU patients using machine learning and clinical data analysis.

🎯 Project Overview

ARDS Early Warning System is an AI-powered healthcare application that helps medical professionals predict the risk of ARDS development in ICU patients. The system combines machine learning algorithms with clinical expertise to provide early warnings and treatment recommendations.

Key Features

  • 🤖 AI-Powered Predictions: Machine learning models trained on clinical data
  • 🔐 Secure Authentication: Role-based access for healthcare professionals
  • 🌍 Multi-Language Support: English, Hindi, and Tamil
  • 📊 Interactive Visualizations: Real-time risk assessment charts
  • 📱 Responsive Design: Works on desktop, tablet, and mobile devices
  • 🏥 Clinical Decision Support: Evidence-based recommendations
  • 📈 Performance Metrics: Model accuracy and validation statistics

🛠️ Technology Stack

Backend

  • Flask: Web framework
  • SQLAlchemy: Database ORM
  • Flask-Login: User authentication
  • SQLite: Database

Frontend

  • HTML5/CSS3: Structure and styling
  • Bootstrap 5: Responsive UI framework
  • JavaScript: Interactive functionality
  • Gradio: ML model interface

Machine Learning

  • Scikit-learn: ML algorithms
  • Pandas/NumPy: Data processing
  • Matplotlib/Seaborn: Visualizations
  • SHAP: Model interpretability

📋 Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)
  • Web browser (Chrome, Firefox, Safari, Edge)

🚀 Quick Start

1. Clone or Download the Project

# If using git
git clone <repository-url>
cd "ARDS final"

# Or download and extract the ZIP file

2. Run the Setup Script

python setup.py

This will:

  • Install all required packages
  • Create necessary directories
  • Initialize the database
  • Train the machine learning model
  • Set up default user accounts

3. Start the Application

Option A: Flask Web Application

python app.py

Then open: http://localhost:5000

Option B: Gradio Interface

python gradio_interface.py

Then open: http://localhost:7860

👥 Default User Accounts

After setup, you can login with these accounts:

Role Username Password Description
Admin admin admin123 Full system access
Doctor doctor doctor123 Clinical user access

📖 User Guide

1. Landing Page

  • Overview of the ARDS prediction system
  • Key features and statistics
  • Navigation to different sections

2. User Authentication

  • Sign Up: Create new healthcare professional accounts
  • Login: Access the prediction system
  • Role Management: Different access levels for admins and doctors

3. ARDS Prediction

Enter patient clinical parameters:

Patient Demographics

  • Patient Name
  • Age (years)
  • Gender

Vital Signs

  • Heart Rate (30-200 bpm)
  • Blood Pressure Systolic/Diastolic (mmHg)
  • Respiratory Rate (8-50 breaths/min)
  • Oxygen Saturation (70-100%)

Laboratory & Ventilator Parameters

  • PaO₂/FiO₂ Ratio (50-500)
  • PEEP (0-25 cmH₂O)
  • FiO₂ (21-100%)

4. Results Interpretation

Risk Levels

  • High Risk (>50%): Immediate medical attention required
  • Low Risk (≤50%): Continue standard monitoring

Medical Recommendations

  • Specific clinical guidelines based on risk level
  • Evidence-based treatment suggestions
  • Monitoring protocols

🔧 Configuration

Database Configuration

The system uses SQLite by default. To use a different database:

  1. Update app.py:
app.config['SQLALCHEMY_DATABASE_URI'] = 'your-database-url'

Model Configuration

To retrain the model with your own data:

  1. Replace data/ards_data.csv with your dataset
  2. Run: python train_model.py

Customization

  • Styling: Modify app/static/css/style.css
  • Templates: Edit HTML files in app/templates/
  • Medical Tips: Update data/medical_tips.json

📊 Model Performance

The machine learning model is trained on synthetic clinical data with the following performance metrics:

  • Accuracy: ~95%
  • Precision: ~93%
  • Recall: ~94%
  • F1-Score: ~93%
  • AUC-ROC: ~96%

Model Features

  1. Heart Rate (HR)
  2. Blood Pressure (Systolic/Diastolic)
  3. Respiratory Rate (RR)
  4. Oxygen Saturation (O₂ Sat)
  5. PaO₂/FiO₂ Ratio
  6. Patient Age
  7. PEEP Settings
  8. FiO₂ Levels

🌍 Multi-Language Support

The system supports three languages:

  • English: Default language
  • हिंदी (Hindi): Indian regional language
  • தமிழ் (Tamil): South Indian regional language

Language can be selected in the prediction interface.

🔒 Security Features

  • Password Hashing: Secure password storage using Werkzeug
  • Session Management: Flask-Login for secure sessions
  • Role-Based Access: Different permissions for admins and doctors
  • Input Validation: Client and server-side validation
  • SQL Injection Protection: SQLAlchemy ORM prevents SQL injection

📱 Responsive Design

The application is fully responsive and works on:

  • Desktop: Full-featured interface
  • Tablet: Optimized layout
  • Mobile: Touch-friendly interface

🧪 Testing

Manual Testing

  1. Test user registration and login
  2. Enter various patient parameters
  3. Verify prediction results
  4. Check responsive design on different devices

Example Test Cases

  • High Risk Case: PaO₂/FiO₂ < 200, O₂ Sat < 90%
  • Low Risk Case: Normal vital signs
  • Edge Cases: Extreme values within valid ranges

🚨 Important Disclaimers

⚠️ Medical Disclaimer: This system is designed for educational and research purposes. It should NOT be used as the sole basis for medical decisions. Always consult qualified healthcare professionals.

⚠️ Data Privacy: Ensure compliance with healthcare data regulations (HIPAA, GDPR) when using with real patient data.

⚠️ Model Limitations: The model is trained on synthetic data and may not reflect real-world clinical scenarios.

🛠️ Troubleshooting

Common Issues

Installation Problems

# If pip install fails
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

Database Issues

# Reset database
rm instance/ards_system.db
python setup.py

Port Conflicts

# Change port in app.py
app.run(debug=True, port=5001)  # Use different port

Error Messages

  • "Model not found": Run python train_model.py
  • "Database error": Check database permissions
  • "Import error": Verify all packages are installed

📁 Project Structure

ARDS final/
├── app.py                 # Main Flask application
├── setup.py              # Setup and initialization script
├── train_model.py        # ML model training script
├── gradio_interface.py   # Gradio UI interface
├── requirements.txt      # Python dependencies
├── README.md            # This file
├── app/
│   ├── templates/       # HTML templates
│   │   ├── base.html
│   │   ├── index.html
│   │   ├── about.html
│   │   ├── login.html
│   │   ├── signup.html
│   │   ├── predict.html
│   │   └── result.html
│   └── static/
│       ├── css/
│       │   └── style.css
│       ├── js/
│       └── images/
├── data/
│   ├── ards_data.csv    # Training dataset
│   └── medical_tips.json # Clinical recommendations
├── models/
│   ├── ards_model.pkl   # Trained ML model
│   └── model_metrics.txt # Performance metrics
└── instance/
    └── ards_system.db   # SQLite database

🤝 Contributing

To contribute to this project:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Development Guidelines

  • Follow PEP 8 for Python code
  • Use meaningful variable names
  • Add comments for complex logic
  • Test all new features
  • Update documentation

📄 License

This project is for educational purposes. Please ensure compliance with healthcare regulations when using with real patient data.

📞 Support

For technical support or questions:

  • Create an issue in the repository
  • Contact the development team
  • Check the troubleshooting section

🔮 Future Enhancements

  • Real-time Monitoring: Integration with hospital systems
  • Advanced ML Models: Deep learning approaches
  • Mobile App: Native mobile application
  • Cloud Deployment: AWS/Azure deployment
  • API Integration: RESTful API for external systems
  • Advanced Analytics: Population health insights
  • Telemedicine: Remote monitoring capabilities

Remember: This system is a clinical decision support tool. Always prioritize patient safety and consult with healthcare professionals for medical decisions.

🏥 ARDS Early Warning System - Saving lives through early detection and AI-powered insights.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors