#️⃣ This project explores the potential of Hexabitz EXG Module in ECG acquisition and processing, which is unique to each individual, as a reliable and secure means of identification #️⃣
📝 Introduction:In the modern era of biometric security, traditional methods such as fingerprints and facial recognition are being complemented by innovative approaches. One such promising method is the use of Electrocardiogram (ECG) signals for personal recognition. This project delves into the potential of ECG signals, which are inherently unique to each individual, as a reliable and secure means of identification. By harnessing the distinct patterns of ECG signals, we aim to explore a novel and robust approach to biometric security.
Research in biometrics has contributed with many approaches to implement ECG as biometrics. All these approaches can be classified into three groups: fiducial, non-fiducial, and hybrid (Odinaka et al., 2012). A fiducial approach extracts specific biometric features such as valley to peaks distances, amplitudes, and angles. In general, it detects a specific feature of the signal and performs a biometric match based on the correlation of these features. Non-fiducial approaches extract features based on the whole signal and not a specific characteristic. Wavelets or autocorrelation coefficients are common approaches in this group. Hybrid approaches use a combination of the previous two.
🔍 Project Des cription:1. Objective: To develop a system that utilizes ECG signals for accurate and secure people recognition.
2. Methodology: The project involves collecting ECG data from participants, preprocessing the signals, and applying AI algorithms to identify unique patterns.
3. Expected Outcomes: The system aims to achieve high accuracy in recognizing individuals based on their ECG signals, demonstrating the feasibility of this biometric method in real-world applications. Additionally, due to the inherent uniqueness and complexity of ECG signals, this method offers a high level of security and is resistant to forgery.
🌟 Single-Lead, EXG Monitor (H2BR0x):
Hexabitz Single-Lead, EXG Monitor Module (H2BR0) is one of a kind module that can record publication-grade biopotential signals from your body be it from the heart (ECG), brain (EEG), eyes (EOG), and muscles (EMG).
What makes it different?
- Record publication-quality biopotential signals like ECG, EMG, EOG, or EEG.
- Small size allows easy integration into mobile and space-constrained projects.
- Notch filter (second order) to remove 50 Hz AC mains.
- H2BR0 is based on STM32G0 MCU.
- Program advanced C code with our easy-to-use APIs.
- You can connect to external hardware or combine with other Hexabitz modules!
- The module is equipped with an open source MATLAB interface.
🩺 Sensor Cable – Electrode Pads (3 Connector):
This is a simple three conductor sensor cable with electrode pad leads. The cable is 24˝ long and feature a 3.5mm audio jack connector on one end with snap style receptacles for biomedical sensor pads.
🌟 STLINK-V3MODS Programmer (H40Rx):
H40Rx is a programmer module which contains STLINK-V3MODS stand-alone debugging and programming mini probe for STM32 micro-controllers (Hexabitz modules and other MCUs).
It supports the SWD (Serial Wire Debugging) interface for the communication with any STM32 micro-controller located on an application board.
It also provides bridge interfaces to several communication protocols, allowing for instance the programming of the target through boot-loader.
Step 1 🖤 Writing codes with STM32CubeIDE software:
- Check out this article for writing code with STM32CubeIDE.
- We Initialize the signal type to be measured.
- Then, we used "PlotToTerminal" API, which sends ECG samples through port 3 and display both unfiltered and filtered samples on the Terminal or plot signal ECG,
Step 2 🖤 Experiment of Building a Model for Classifying Individuals Based on ECG Signals Using a Feedforward Neural Network and MATLAB:
#️⃣ A Feedforward Neural Network is a basic type of artificial neural network characterized by transmitting information in only one direction through successive layers.
#️⃣ Advantages of Feedforward Network:
1. Ease of Learning: The Feedforward network is simple in structure and easy to train. It can be trained using an ECG dataset and analyze it to learn the distinctive features of each individual's ECG signals.
2. High Generalization Ability: A trained network can generalize to new data from the same individuals or similar others, meaning it can accurately predict the identity of a new person.
3. Ability to Handle Non-linear Data: The network uses non-linear activation functions, allowing it to learn complex and non-linear relationships between ECG features and identify the person.
4. Noise Resistance: The Feedforward network can reduce the impact of noise or distortions in ECG signals, improving the accuracy of person recognition in non-ideal environments.
5. Scalability: Additional hidden layers and nodes can be added to the network to improve its performance as data complexity increases.
6. Suitability for Temporal Data: The Feedforward network is suitable for handling ECG data, which is temporal data, enabling the network to learn changes over time and relationships between time points in the signal.
- Different Activation Functions have various properties and effects on the learning process. The choice of activation function depends on the type of problem, its complexity, data distribution, and required performance.
- The default activation function in MATLAB for this network and used in our current training is `tanh`. This function maps values between -1 and 1 and is centered around 0, which can make learning easier for the next layer.
#️⃣ Building the Database for the Person Classification and Recognition Project Using ECG Signals Requires Several Basic Steps:
1. Data Collection: Collect ECG data for several individuals.
2. Preprocessing the Data: Process the data to remove noise and improve signal quality (this step is included in the module itself).
3. Labeling: Each ECG signal needs to be labeled with the appropriate person's identifier. This step is crucial for the subsequent training of the model.
#️⃣ Mechanism of the Electrode Status Check Button:
When the button is pressed in the MATLAB interface, a message is sent to the module to check the status of the electrodes, and the module responds by sending one of these values, from which we know the status of the electrodes:
- Lead P_CONNECTED_Lead N_CONNECTED = 0
- Lead P_CONNECTED_Lead N_NOTCONNECTED = 1
- Lead P_NOTCONNECTED_Lead N_CONNECTED = 2
- Lead P_NOTCONNECTED_Lead N_NOTCONNECTED = 3
#️⃣ Code Analysis:
1. The code relies on serial communication with the EXG unit.
2. The code reads raw and filtered data from the EXG unit.
3. The data is plotted on a graph for display and analysis.
Step 3 🖤 Tests Conducted in MATLAB Environment:
1. Data Loading: We started by loading ECG data from three different Excel files, each representing a different individual. We used the `xlsread()` function to read the data from each file and store it in matrices.
2. Feature Extraction: These features help in identifying the unique characteristics of each person's ECG signals. The features include:
- Peaks: Using the `findpeaks()` function to identify the major peaks in the ECG signal.
- Mean
- Standard Deviation
- Gradient: Calculating the absolute difference between successive R-wave peak values.
- Frequency Analysis: Converting R-wave peak data to the frequency domain using Fast Fourier Transform (FFT) and identifying the highest frequency (`freq1`) in the frequency domain with fs=120Hz.
- Heart Rate (HR): Calculating the heart rate by measuring the time interval between successive R-wave peaks.
3. Storing Feature Values: Storing the peak, mean, and standard deviation values for all individuals in a matrix called `Inputs`.
4. Creating Target Matrix: The target for the recognition process is represented in a matrix called `targets`, where each column represents a different individual.
5. Neural Network Setup:
- Network Type: A feedforward neural network was used.
- Network Structure: Consisting of three hidden layers with 40, 30, and 20 neurons respectively.
- Training Algorithm: The Levenberg-Marquardt algorithm was used to supervise the network training.
- Importance of Algorithm: This algorithm helps in determining the best set of weights that minimize prediction error.
- Network Importance:The neural network is used to recognize individuals based on the extracted features.
6. Data Splitting: The ECG data was split into training, validation, and testing sets with proportions of 70%, 20%, and 20% respectively.
7. Learning Rate Adjustment: The learning rate was set to 0.05.
8. Network Training: The neural network was trained using the `train` function with input and target data.
9. Error Calculation: Using the `gsubtract` function to subtract the values of the target and output matrices.
10. Performance Evaluation: The network's performance was evaluated using the validation and testing data sets.
11. Matrix Conversion: Converting the target and output matrices from matrix format to a comparable indexed image format, facilitating the evaluation of the neural network's performance and comparison with target values.
12. Evaluation Results:
- Confusion Matrix: Used to display the prediction accuracy of the neural network in recognizing individuals.
- Training Performance: Displaying the network's performance improvement with each training epoch.
- Overall Evaluation: Helps in understanding the efficiency of the person recognition system.
- Target and Output Relationship: Displaying the network structure using `view(net)`.
13. Testing and Recognition: This phase involves testing and recognition, where a new signal is obtained, the same features applied during training are used, and it is determined whether the new input signal matches the training, leading to recognition. The result is displayed by comparing the resulting signal with the remaining signals to show the match and then displaying the name of the person associated with the signal.
Examples of graph 📈🫀🔍
1. Building the Database: One of the main challenges was constructing the database, particularly in selecting features. The ECG signals of healthy individuals tend to be similar in terms of features and timing, making it difficult to distinguish between them. In contrast, the signals from patients are more distinct, allowing for easier feature extraction.
2. Noise Issues: Various types of noise posed significant challenges, including cable length, surrounding environment, and electrical fields.
📈 Future Prospects:🔴 Image Conversion and Classification: ECG signals can be converted into images, allowing the application of image processing algorithms for classification.
🔴 Audio Signal Transformation: The signals can be transformed into audio files through frequency domains, enabling unique audio-based identification.
🔴 Real-Time Recognition Model: A model can be designed using Python on Colab, which can be embedded within an STM32 microcontroller. This allows for real-time, immediate person recognition without the need for extensive training and testing.
Please feel free to leave a comment here if you have any questions or concerns regarding this project 😃💡
💫 References:
[1] https://link.springer.com/chapter/10.1007/978-3-030-81982-8_4
[3] https://onlinelibrary.wiley.com/doi/10.1155/2022/1238864
Comments
Please log in or sign up to comment.