Skip to content

mnxtr/CloudbasedBioMetric-Sensors

Repository files navigation

CSE498R Directed Research | Cloud-based Biometric Sensor

Tasks

Task list

To verify that the heart rate monitor is working as expected, open the serial monitor  at 9600 baud

interfacing with arduino and AD8232

/src/sketch.ino

#include <Wire.h>
#include <AD8232.h>

// Define the AD8232 module
AD8232 heartRate;

void setup()
{
  Serial.begin(9600);   // Initialize serial communication
  heartRate.begin();    // Initialize the AD8232 module
}

void loop()
{
  float heart_rate = heartRate.getHeartRate();  // Read the heart rate value
  Serial.println("Heart rate: " + String(heart_rate) + " bpm");  // Print the heart rate value
  delay(1000);  // Wait for 1 second
}

. You should see values printed on the screen. Below is an example output with the sensors connected to the forearms and right leg. Your serial work should spike between +300/-200 around the center value of about ~500.

List of hardware required

  • Arduino Rev3 atmega328 + Wi-Fi → as MCU
  • AD8232 Heart Sensing Monitor
  • Breadboard
  • Breadboard connector
  • Electrode Sensor Surface pad → Disposable
  • Pulse Sensor Module.
  • EEG Muscle Sensor.

Software


Serial Plotter

Initial Prototype

Initial Prototype

First Test Case Requires Finetuning

First Test Case Requires Finetuning

Arduino Rev3 atmega328 + AD8232 Connection.

Wiring

Wiring

Untitled

HeartRate_Normal.png

Untitled

  • Cable Color Signal Black RA (Right Arm ) | Blue LA (Left Arm) | Red RL (Right Leg)

Untitled

Enhancement+

Enhancement+

Arduino layout with 7 Segment Led

Untitled

Research design and problem addressing


  • A research problem is a specific issue, contradiction, or gap in existing knowledge that needs to be addressed.

  • Identifying a research problem involves recognizing something problematic that requires attention, explanation, or a solution.

  • It is essential to have a well-defined research problem to guide the research process and to contribute to the field of study.

  • The process of defining a research problem includes:

    • Identifying a broad topic of interest.

    • Conducting a literature review to understand the current state of knowledge.

    • Narrowing down to a specific issue that is under-explored or controversial.

    • Formulating the problem into a clear, concise statement or question.

  • Types of research problems include:

    • Descriptive: Documenting certain phenomena or situations.
    • Exploratory: Investigating a topic to generate new insights or hypotheses.
    • Explanatory: Understanding the causes or effects of certain phenomena.
    • Predictive: Anticipating future occurrences based on current trends or data.
    • Evaluative: Assessing the effectiveness of interventions, programs, or policies.
  • Defining a research problem is crucial for:

    • Setting the direction and scope of the study.
    • Ensuring the research is focused and manageable.
    • Avoiding duplication of existing knowledge.
    • Making a meaningful contribution to the academic field or practical application.
  • For more detailed guidance on defining a research problem, resources such as Scribbr's articles can provide step-by-step instructions and examples.

Scopes


BPNN Model Integration

The repository now includes comprehensive mathematical formulations for integrating a Backpropagation Neural Network (BPNN) with the EKG system.

Mathematical Formulations Documentation

See BPNN_MATHEMATICAL_FORMULATIONS.md for complete mathematical documentation including:

Core BPNN Mathematics

  • Forward Propagation: $z^{[l]} = W^{[l]} a^{[l-1]} + b^{[l]}$
  • Activation Functions: Sigmoid, Tanh, ReLU, Softmax (with derivatives)
  • Loss Functions: Binary/Categorical Cross-Entropy, MSE
  • Backpropagation: Complete gradient computation formulas
  • Parameter Updates: Gradient Descent, Momentum, Adam optimizer

Signal Processing

  • Normalization: Min-Max and Z-Score formulas
  • Filtering: Moving Average and Butterworth Bandpass filters
  • Feature Extraction: HRV metrics (SDNN, RMSSD, pNN50)

EKG Synthesis Model

Mathematical model for generating synthetic EKG signals:

$$\text{ECG}(t) = \sum_{i \in {P, Q, R, S, T}} A_i \exp\left(-\frac{(t - t_i)^2}{2\sigma_i^2}\right)$$

Jupyter Notebooks

1. Data Loading and Preprocessing (dataloading.ipynb)

  • Signal normalization implementations
  • EKG filtering techniques
  • HRV feature extraction
  • Window-based segmentation for neural network input
  • Complete preprocessing pipeline with visualizations

2. BPNN Implementation (randomdatasetgenerator.ipynb)

  • Complete BPNN implementation from scratch
  • Synthetic EKG dataset generation (normal and abnormal patterns)
  • Training and evaluation pipeline
  • Multi-class classification (Normal, Tachycardia, Bradycardia, Arrhythmia)
  • Performance visualization and analysis

Quick Start

To use the BPNN model:

# Install required dependencies
pip install numpy pandas matplotlib scipy scikit-learn

# Run the validation script
python3 validate_formulations.py

# Open Jupyter notebooks
jupyter notebook dataloading.ipynb
jupyter notebook randomdatasetgenerator.ipynb

Model Architecture

The implemented BPNN uses the following architecture:

  • Input Layer: 250 neurons (EKG window samples)
  • Hidden Layer 1: 128 neurons (ReLU activation)
  • Hidden Layer 2: 64 neurons (ReLU activation)
  • Hidden Layer 3: 32 neurons (ReLU activation)
  • Output Layer: 4 neurons (Softmax activation for 4 classes)

Total Parameters: ~54,000 trainable parameters

Classification Classes

The model classifies EKG signals into four categories:

  1. Normal: Regular heart rhythm (60-100 bpm)
  2. Tachycardia: Fast heart rate (>100 bpm)
  3. Bradycardia: Slow heart rate (<60 bpm)
  4. Arrhythmia: Irregular heart rhythm

About

Research on AI based ekg interpretation of myocardial infarction using multiple neural networks.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •