Skip to content

raiigauravv/heathcare-ai-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ Healthcare AI Assistant

A sophisticated multimodal AI-powered healthcare assistant that provides preliminary health analysis based on text descriptions, medical images, and audio recordings. Built with OpenAI's latest models and deployed on Hugging Face Spaces.

Healthcare AI Assistant Python Gradio OpenAI

πŸš€ Live Demo

Try the Healthcare AI Assistant

⚠️ Important Disclaimer

This is a demonstration tool for educational purposes only. It does not provide medical advice and should not be used as a substitute for professional medical consultation, diagnosis, or treatment. Always seek advice from qualified healthcare professionals.

🎯 Features

πŸ” Multimodal Analysis

  • Text Input: Describe symptoms in natural language
  • Image Analysis: Upload medical photos (rashes, wounds, swelling, etc.)
  • Audio Input: Voice descriptions of symptoms using speech-to-text
  • Audio-Only Mode: Complete analysis from voice input alone

πŸ‘€ Personalized Experience

  • Patient Information: Name, age, and gender integration
  • Personalized Responses: AI addresses patients by name
  • Demographics-Aware: Age and gender-relevant medical insights
  • Contextual Analysis: Tailored recommendations based on patient profile

πŸ€– Advanced AI Integration

  • GPT-4: Comprehensive health analysis and recommendations
  • GPT-4 Vision: Medical image interpretation
  • Whisper AI: High-accuracy speech transcription
  • Real-time Processing: Instant analysis and feedback

πŸ› οΈ Technology Stack

Frontend & UI

  • Gradio 4.0+: Modern web interface with healthcare theme
  • HTML/CSS: Custom styling for medical application aesthetics
  • JavaScript: Interactive elements and real-time updates

Backend & AI

  • Python 3.11+: Core application language
  • OpenAI API v1.0+: Advanced AI models integration
    • GPT-4: Text analysis and medical reasoning
    • GPT-4 Vision: Medical image analysis
    • Whisper: Speech-to-text transcription

Data Processing

  • PIL (Pillow): Image processing and format conversion
  • Librosa: Audio processing and analysis
  • NumPy: Numerical computing and array operations

Deployment & Infrastructure

  • Hugging Face Spaces: Cloud deployment platform
  • Git: Version control and collaboration
  • Virtual Environments: Isolated Python environments

πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User Input    β”‚    β”‚   Gradio UI      β”‚    β”‚  OpenAI APIs    β”‚
β”‚                 β”‚    β”‚                  β”‚    β”‚                 β”‚
β”‚ β€’ Text          │───▢│ β€’ Interface      │───▢│ β€’ GPT-4         β”‚
β”‚ β€’ Image         β”‚    β”‚ β€’ Validation     β”‚    β”‚ β€’ GPT-4 Vision  β”‚
β”‚ β€’ Audio         β”‚    β”‚ β€’ Processing     β”‚    β”‚ β€’ Whisper       β”‚
β”‚ β€’ Demographics  β”‚    β”‚                  β”‚    β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β”‚                       β–Ό                       β”‚
         β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚
         β”‚              β”‚ Data Ingestion   β”‚            β”‚
         β”‚              β”‚                  β”‚            β”‚
         β”‚              β”‚ β€’ Text Parser    β”‚            β”‚
         └──────────────│ β€’ Image Handler  β”‚β—€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚ β€’ Audio Processorβ”‚
                        β”‚                  β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚ AI Analysis &    β”‚
                        β”‚ Response Gen.    β”‚
                        β”‚                  β”‚
                        β”‚ β€’ Medical Insightsβ”‚
                        β”‚ β€’ Personalizationβ”‚
                        β”‚ β€’ Recommendationsβ”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

healthcare-ai-assistant/
β”œβ”€β”€ app.py                 # Main Gradio application
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ .env.example          # Environment variables template
β”œβ”€β”€ .gitignore            # Git ignore rules
β”œβ”€β”€ LICENSE               # MIT License
β”œβ”€β”€ README.md             # This file
└── src/
    β”œβ”€β”€ openai_integration.py    # OpenAI API client
    β”œβ”€β”€ ingestion.py            # Multimodal data processing
    └── preprocess.py           # Data preprocessing utilities

πŸš€ Quick Start

Prerequisites

  • Python 3.11 or higher
  • OpenAI API key
  • Git

Installation

  1. Clone the repository
git clone https://github.com/raiigauravv/heathcare-ai-assistant.git
cd heathcare-ai-assistant
  1. Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Set up environment variables
cp .env.example .env
# Edit .env and add your OpenAI API key
  1. Run the application
python app.py

The application will be available at http://localhost:7860

πŸ”§ Configuration

Environment Variables

Create a .env file in the root directory:

OPENAI_API_KEY=your_openai_api_key_here

Supported File Formats

  • Images: JPG, JPEG, PNG, BMP, TIFF, WEBP
  • Audio: MP3, WAV, M4A, FLAC, OGG

πŸ“ Usage Examples

1. Text-Only Analysis

Patient: "John Doe"
Age: "25"
Gender: "Male"
Symptoms: "I have been experiencing severe headaches for the past 3 days, along with sensitivity to light and nausea."

2. Image + Text Analysis

Patient: "Jane Smith"
Age: "35"
Gender: "Female"
Symptoms: "Strange rash appeared on my arm yesterday"
Image: [Upload photo of rash]

3. Audio-Only Analysis

Patient: "Mike Johnson"
Age: "45"
Gender: "Male"
Audio: [Record voice describing symptoms]

πŸ”’ Privacy & Security

  • No Data Storage: Patient information is not stored permanently
  • Secure API Calls: All communications encrypted via HTTPS
  • Environment Variables: Sensitive keys stored securely
  • Open Source: Full transparency of code and processes

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

🩺 Medical Disclaimer

IMPORTANT: This application is for educational and demonstration purposes only. It:

  • ❌ Does NOT provide medical diagnosis
  • ❌ Does NOT replace professional medical advice
  • ❌ Should NOT be used for emergency medical situations
  • βœ… Provides general health information only
  • βœ… Encourages consultation with healthcare professionals

In case of medical emergency, contact emergency services immediately.

πŸ™ Acknowledgments

  • OpenAI for providing advanced AI models
  • Hugging Face for the deployment platform
  • Gradio for the excellent UI framework
  • Python Community for the amazing libraries

πŸ“ž Support

For questions, issues, or suggestions:


⭐ If you find this project helpful, please consider giving it a star on GitHub!

About

πŸ₯ Multimodal Healthcare AI Assistant powered by GPT-4, GPT-4 Vision, and Whisper AI. Provides preliminary health analysis through text, images, and audio input with personalized patient experiences. Built with Python, Gradio, and OpenAI APIs. Live demo available on Hugging Face Spaces. ⚠️ Educational purposes only - not for medical diagnosis.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages