A comprehensive web application for early prediction of Acute Respiratory Distress Syndrome (ARDS) in ICU patients using machine learning and clinical data analysis.
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.
- 🤖 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
- Flask: Web framework
- SQLAlchemy: Database ORM
- Flask-Login: User authentication
- SQLite: Database
- HTML5/CSS3: Structure and styling
- Bootstrap 5: Responsive UI framework
- JavaScript: Interactive functionality
- Gradio: ML model interface
- Scikit-learn: ML algorithms
- Pandas/NumPy: Data processing
- Matplotlib/Seaborn: Visualizations
- SHAP: Model interpretability
- Python 3.8 or higher
- pip (Python package installer)
- Web browser (Chrome, Firefox, Safari, Edge)
# If using git
git clone <repository-url>
cd "ARDS final"
# Or download and extract the ZIP filepython setup.pyThis will:
- Install all required packages
- Create necessary directories
- Initialize the database
- Train the machine learning model
- Set up default user accounts
python app.pyThen open: http://localhost:5000
python gradio_interface.pyThen open: http://localhost:7860
After setup, you can login with these accounts:
| Role | Username | Password | Description |
|---|---|---|---|
| Admin | admin |
admin123 |
Full system access |
| Doctor | doctor |
doctor123 |
Clinical user access |
- Overview of the ARDS prediction system
- Key features and statistics
- Navigation to different sections
- Sign Up: Create new healthcare professional accounts
- Login: Access the prediction system
- Role Management: Different access levels for admins and doctors
Enter patient clinical parameters:
- Patient Name
- Age (years)
- Gender
- Heart Rate (30-200 bpm)
- Blood Pressure Systolic/Diastolic (mmHg)
- Respiratory Rate (8-50 breaths/min)
- Oxygen Saturation (70-100%)
- PaO₂/FiO₂ Ratio (50-500)
- PEEP (0-25 cmH₂O)
- FiO₂ (21-100%)
- High Risk (>50%): Immediate medical attention required
- Low Risk (≤50%): Continue standard monitoring
- Specific clinical guidelines based on risk level
- Evidence-based treatment suggestions
- Monitoring protocols
The system uses SQLite by default. To use a different database:
- Update
app.py:
app.config['SQLALCHEMY_DATABASE_URI'] = 'your-database-url'To retrain the model with your own data:
- Replace
data/ards_data.csvwith your dataset - Run:
python train_model.py
- Styling: Modify
app/static/css/style.css - Templates: Edit HTML files in
app/templates/ - Medical Tips: Update
data/medical_tips.json
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%
- Heart Rate (HR)
- Blood Pressure (Systolic/Diastolic)
- Respiratory Rate (RR)
- Oxygen Saturation (O₂ Sat)
- PaO₂/FiO₂ Ratio
- Patient Age
- PEEP Settings
- FiO₂ Levels
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.
- 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
The application is fully responsive and works on:
- Desktop: Full-featured interface
- Tablet: Optimized layout
- Mobile: Touch-friendly interface
- Test user registration and login
- Enter various patient parameters
- Verify prediction results
- Check responsive design on different devices
- High Risk Case: PaO₂/FiO₂ < 200, O₂ Sat < 90%
- Low Risk Case: Normal vital signs
- Edge Cases: Extreme values within valid ranges
# If pip install fails
python -m pip install --upgrade pip
python -m pip install -r requirements.txt# Reset database
rm instance/ards_system.db
python setup.py# Change port in app.py
app.run(debug=True, port=5001) # Use different port- "Model not found": Run
python train_model.py - "Database error": Check database permissions
- "Import error": Verify all packages are installed
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
To contribute to this project:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Follow PEP 8 for Python code
- Use meaningful variable names
- Add comments for complex logic
- Test all new features
- Update documentation
This project is for educational purposes. Please ensure compliance with healthcare regulations when using with real patient data.
For technical support or questions:
- Create an issue in the repository
- Contact the development team
- Check the troubleshooting section
- 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.