Process Flowcharts
Device Connection Flow
This flowchart illustrates the complete process from device discovery to active data streaming, including error handling and recovery mechanisms.
Process Steps
Key Process Steps:
-
Discovery Phase
- USB devices detected via serial port enumeration
- BLE devices found through active scanning
- WiFi/LSL devices discovered via mDNS broadcast
-
Connection Setup
- Driver verification and installation if needed
- Protocol-specific handshake (varies by device type)
- Connection parameters negotiation
-
Configuration
- Sample rate selection (250Hz, 500Hz, 1000Hz)
- Channel mapping and activation
- Digital filter configuration (notch, bandpass)
-
Quality Assurance
- Optional impedance checking per channel
- Signal quality validation
- Automatic bad channel detection
-
Data Streaming
- Zero-copy ring buffer initialization
- Real-time data validation
- Asynchronous Pub/Sub publishing
Session Management Flow
This flowchart shows the complete lifecycle of a neural recording session from creation to completion.
Session Lifecycle
Session Management Steps:
-
Session Creation
- Generate unique session identifier (UUID v4)
- Associate with patient/participant record
- Set recording permissions and access controls
-
Device Selection
- Verify device availability and compatibility
- Check for device conflicts or exclusive access
- Reserve devices for session duration
-
Configuration
- Recording duration (continuous or fixed)
- Event triggers (manual, scheduled, or signal-based)
- Storage options (hot, warm, cold tiers)
-
Recording Process
- Synchronized multi-device recording
- Real-time health monitoring
- Pause/resume functionality
-
Session Completion
- Data file finalization and integrity checks
- Metadata generation with session summary
- Archival to appropriate storage tier
Real-Time Data Streaming Flow
This flowchart details the real-time data processing pipeline from acquisition to client delivery.
Pipeline Stages
Data Processing Pipeline:
-
Acquisition Stage
- Receive raw data from device drivers
- Apply hardware timestamps with microsecond precision
- Validate packet integrity and sequence
-
Pre-Processing Stage
- Remove DC offset using high-pass filter (0.1 Hz)
- Apply notch filter for powerline noise (50/60 Hz)
- Optional: Apply bandpass filter based on use case
-
Quality Assessment
- Check for saturated channels
- Detect disconnected electrodes
- Calculate signal-to-noise ratio
- Mark poor quality segments
-
Buffering Strategy
- Ring buffer: 10,000 samples per channel
- Batch threshold: 1,000 samples (4 seconds @ 250Hz)
- Emergency flush: Every 100ms
-
Distribution
- Parallel fan-out to multiple consumers
- Priority-based message delivery
- Guaranteed delivery to storage
ML Model Lifecycle Flow
This flowchart shows the complete machine learning model lifecycle from data collection through deployment and monitoring, including retraining feedback loops.
Training Pipeline
Model Training Pipeline:
Stage | Duration | Resources | Output |
---|---|---|---|
Data Collection | Continuous | Storage: 10TB/month | Labeled datasets |
Data Cleaning | 2-4 hours | CPU: 32 cores | Clean dataset |
Feature Engineering | 1-2 hours | CPU: 16 cores | Feature matrices |
Model Training | 4-12 hours | GPU: 4x V100 | Trained model |
Hyperparameter Opt | 8-24 hours | GPU: 8x V100 | Best parameters |
Validation | 1-2 hours | CPU: 8 cores | Metrics report |
Clinical Review | 1-3 days | Human experts | Approval/feedback |
Supported Model Types:
MODEL_ARCHITECTURES = {
"classification": {
"EEGNet": "Compact CNN for EEG",
"DeepConvNet": "Deep CNN architecture",
"ShallowConvNet": "Shallow CNN for online",
"LSTM-FCN": "LSTM + Fully Convolutional",
"Transformer": "Attention-based model"
},
"regression": {
"CNN-LSTM": "Feature prediction",
"TCN": "Temporal Convolutional Network",
"WaveNet": "Dilated convolutions"
},
"anomaly_detection": {
"Autoencoder": "Reconstruction-based",
"VAE": "Variational Autoencoder",
"GAN": "Generative Adversarial Network"
}
}