AI-Powered ECG Analysis & Vectorcardiography Conversion
ElectroVector is an innovative iOS application that leverages machine learning to digitize electrocardiogram (ECG) scans and convert them into vectorcardiogram (VCG) diagrams. The app combines real-time ECG monitoring simulation with advanced image processing capabilities to provide comprehensive cardiac analysis.
- Real-time ECG Monitoring: Simulated ECG waveform display with heart rate monitoring
- Camera Integration: Capture ECG images directly from physical ECG printouts
- Image Upload: Process captured ECG images for digitization
- User-friendly Interface: Intuitive SwiftUI-based design with beautiful animations
- Permission Management: Seamless camera permission handling
- ECG Digitization: Advanced machine learning models in the
MLbackendfolder convert ECG images to digital data - VCG Conversion: Transform digitized ECG signals into vectorcardiogram representations
- Server Processing: Flask-based backend handles image processing and ML inference
- Real-time Results: Fast processing and response delivery
ElectroVector/
├── iOS App (SwiftUI)
│ ├── ECGScannerView.swift # Main interface
│ ├── ECGService.swift # Network communication
│ ├── CameraView.swift # Camera capture
│ ├── ECGWaveformView.swift # Waveform visualization
│ └── Supporting Files
└── MLbackend/ # Server-side ML models
├── Flask Server
├── ECG Digitization Models
└── VCG Conversion Algorithms
- iOS 18.4+
- Xcode 16.3+
- Swift 5.0+
- Camera access permission
- Python 3.8+
- Flask framework
- Machine learning dependencies (see MLbackend folder)
- ngrok for tunneling (development)
- Clone the repository
- Open
ElectroVector.xcodeprojin Xcode - Update the development team in project settings
- Build and run on device or simulator
- Navigate to the
MLbackendfolder - Install required Python dependencies
- Start the Flask server
- Update the server URL in
ECGService.swiftto point to your backend
- For simulator testing: Use
127.0.0.1orlocalhost - For device testing: Use your computer's IP address or ngrok tunnel
- Update
serverURLinECGService.swiftaccordingly
- Launch the App: Open ElectroVector on your iOS device
- Start Monitoring: Tap "Start Monitoring" to begin real-time ECG simulation
- Capture ECG: Use "Capture ECG Image" to photograph a physical ECG printout
- Processing: The app uploads the image to the ML backend for analysis
- Results: Receive digitized ECG data and VCG diagram conversion
- Image Capture: High-quality JPEG capture of ECG printouts
- Preprocessing: Image enhancement and noise reduction
- Signal Extraction: ML models identify and extract ECG waveforms
- Digitization: Convert visual signals to numerical time-series data
- VCG Conversion: Transform ECG leads into 3D vectorcardiogram
- Endpoint:
/digitize(POST) - Format: Multipart form data with image field
- Response: JSON with processing status and results
- Error Handling: Comprehensive error responses with detailed messages
- Local Processing: ECG simulation runs entirely on device
- Secure Upload: Images uploaded via HTTPS for ML processing
- No Data Storage: Images processed and discarded, no permanent storage
- Permission-Based: Camera access only when explicitly granted
We welcome contributions! Please see the MLbackend folder for server-side improvements and submit pull requests for iOS app enhancements.
[Add your license information here]
For technical support or questions about the ECG digitization algorithms, please refer to the documentation in the MLbackend folder or create an issue in this repository.
ElectroVector - Transforming cardiac care through AI-powered ECG analysis