Skip to content

Graceliying82/DeepPulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ«€ DeepPulse: AI-Powered Physiological Signal Analysis Platform

DeepPulse is an advanced educational and research platform for visualizing and analyzing physiological signals. Combining medical-grade signal processing with AI-powered interpretation using Google Gemini, DeepPulse provides interactive learning and analysis tools for medical students, researchers, and healthcare professionals.

🌟 Overview

DeepPulse provides professional-grade visualization and AI-assisted analysis of physiological signals including:

  • Cardiac signals: ECG (electrocardiogram), heart rate variability
  • Respiratory signals: Respiration waveforms, breathing patterns
  • Neural signals: EEG (electroencephalogram) and other biosignals
  • Other physiological data: Blood pressure, pulse oximetry, and more

Key Capabilities

  1. Medical-grade visualization with TRUE calibration (25mm/s, 10mm/mV for ECG)
  2. AI-driven analysis powered by Google Gemini 3.0 Flash
  3. Interactive learning modes including hints and diagnostic quizzes
  4. Multi-signal support for comprehensive physiological analysis

πŸ“š Data Sources

DeepPulse integrates with PhysioNet, the world's largest repository of open-source physiological data.

Supported Databases:

  • PTB Diagnostic ECG Database (ptbdb): 12-lead ECG recordings with clinical diagnoses
  • MIT-BIH Arrhythmia Database (mitdb): Benchmark arrhythmia database
  • European ST-T Database (edb): ST and T-wave changes
  • MIMIC-III Waveform Database: ICU patient monitoring data
  • And many more via PhysioNet search

Data Access:

  • Uses wfdb (Waveform Database) Python library
  • Local caching for fast repeated access
  • Automatic signal categorization and metadata extraction

πŸ—οΈ Architecture

Modern web application built with:

Frontend

  • React 19 with Vite for fast development
  • SVG-based rendering for medical-grade signal visualization
  • Medical calibration standards: Pixel-perfect 1mm/5mm grids
  • Responsive design with horizontal scrolling for long recordings
  • Real-time updates and interactive controls

Backend

  • FastAPI: Modern Python web framework
  • RESTful API: Clean separation of concerns
  • Google Gemini 3.0 Flash: Multimodal AI for signal interpretation
  • wfdb Integration: Direct PhysioNet database access
  • Smart caching: Persistent local storage

Key Components

  • backend/app/main.py: FastAPI application and API endpoints
  • backend/app/services/ai_service.py: Gemini AI integration and prompt engineering
  • backend/app/services/data_service.py: PhysioNet data loading and management
  • frontend/src/components/SignalViewer.jsx: Medical-grade SVG signal renderer
  • frontend/src/components/Dashboard.jsx: Main application interface

πŸš€ Installation & Usage

Prerequisites

  • Python 3.10+
  • Node.js 18+ and npm
  • Google Gemini API Key (get from Google AI Studio)

Setup

  1. Clone the repository:

    git clone https://github.com/Graceliying82/DeepPulse.git
    cd DeepPulse
  2. Backend Setup:

    cd backend
    pip install -r requirements.txt
  3. Configure API Key: Create backend/.env file:

    GOOGLE_API_KEY=your_gemini_api_key_here
  4. Frontend Setup:

    cd frontend
    npm install

Running the Application

Start Backend (Terminal 1):

cd backend
uvicorn app.main:app --reload --port 8000

Start Frontend (Terminal 2):

cd frontend
npm run dev

Access the application:

✨ Features

Medical-Grade Visualization

  • TRUE calibration: 25mm/s time scale, 10mm/mV amplitude (ECG standard)
  • Professional grid: 1mm minor lines, 5mm major lines matching medical paper
  • DPI-normalized: Accurate pixel-to-millimeter conversion (96 DPI standard)
  • Calibration pulse: Standard 1mV reference marker
  • Multi-lead display: Synchronized scrolling across all channels
  • Print-ready: SVG vector format for documentation

AI-Powered Analysis

  • Full Analysis Mode: Comprehensive clinical interpretation
  • Hints Mode: Educational guidance using Socratic method
  • Quiz Mode: Interactive diagnostic challenges with explanations
  • Multi-signal support: Cardiac, respiratory, neural, and other physiological signals
  • Context-aware: Considers patient metadata and signal characteristics

Data Management

  • Database discovery: AI-powered PhysioNet database recommendations
  • Smart downloads: Automatic categorization and validation
  • Local storage: Persistent caching with data/ directory
  • Record browser: Easy navigation through downloaded signals
  • Batch processing: Download multiple records efficiently

Interactive Learning

  • Switch analysis modes on the fly (Full/Hints/Quiz)
  • Progressive hints that don't reveal the diagnosis
  • Multiple-choice quizzes with detailed explanations
  • Real patient data for authentic learning experiences
  • Instant feedback from AI tutor

πŸ”¬ Technical Highlights

Signal Visualization

  • SVG patterns for consistent 1mm/5mm medical grid
  • Independent minor/major grid layers for precise styling
  • Automatic baseline centering and amplitude scaling
  • Downsampling for performance (500 points/second target)
  • Horizontal scrolling for recordings of any length
  • Time markers every 1 second with clear labels

Medical Standards Compliance

  • Time axis: 25 mm/s (1 small square = 0.04s = 40ms)
  • Amplitude axis: 10 mm/mV (1 small square = 0.1 mV)
  • Grid: Major lines every 5mm (bold), minor lines every 1mm (thin)
  • Calibration: 1mV pulse, 0.2s duration (standard reference)

Performance Optimizations

  • Client-side SVG rendering (no server round-trips)
  • Efficient downsampling prevents DOM bloat
  • React memos and optimized re-renders
  • Smart caching reduces repeated downloads
  • Lazy loading for large datasets

πŸ“– Project Structure

DeepPulse/
β”œβ”€β”€ backend/                 # FastAPI backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py         # API endpoints
β”‚   β”‚   └── services/       # Business logic
β”‚   β”‚       β”œβ”€β”€ ai_service.py    # Gemini AI integration
β”‚   β”‚       └── data_service.py  # PhysioNet data access
β”‚   β”œβ”€β”€ tests/              # Backend tests
β”‚   └── requirements.txt    # Python dependencies
β”‚
β”œβ”€β”€ frontend/               # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx      # Main UI
β”‚   β”‚   β”‚   └── SignalViewer.jsx   # Medical signal renderer
β”‚   β”‚   β”œβ”€β”€ App.jsx        # Root component
β”‚   β”‚   └── main.jsx       # Entry point
β”‚   └── package.json       # Node dependencies
β”‚
β”œβ”€β”€ data/                   # Local signal storage
β”‚   β”œβ”€β”€ cardiac/           # ECG and heart data
β”‚   β”œβ”€β”€ respiratory/       # Breathing signals
β”‚   └── neural/            # EEG and brain data
β”‚
└── README.md              # This file

πŸ§ͺ Development

Running Tests

Backend:

cd backend
pytest

Frontend:

cd frontend
npm run lint

API Documentation

FastAPI provides automatic interactive API docs at:

🀝 Contributing

Contributions welcome! Areas of interest:

  • Additional signal types and visualizations
  • Enhanced AI analysis prompts
  • Interactive measurement tools
  • Export formats (PDF, DICOM, etc.)
  • Real-time monitoring capabilities

πŸ“„ License

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

Disclaimer

DeepPulse is an educational and research tool. AI-generated analyses are based on anonymized PhysioNet data and should be independently verified before any clinical application.

πŸ™ Acknowledgments

  • PhysioNet for providing open-access physiological data
  • Google Gemini for multimodal AI capabilities
  • wfdb library maintainers for PhysioNet integration
  • Medical signal processing community for standards and best practices

Built with ❀️ for medical education and research

About

DeepPulse utilizes deep learning algorithms to analyze ECG time-series data, detecting subtle arrhythmias and predicting cardiovascular anomalies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors