djzenma / ECG-Heart-Monitor-STM32-TFLite

ECG Heart Monitor and Disease Detection using TensorFlow Lite on STM32 Microcontroller

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ECG Heart monitor using the STM32 Nucleo Board and TensorFlow Lite

Both the Report and the Presentation explaining the Project in great details are found in the Report_Presentation Folder.

Documentation

Below is the documentation for the most importatnt functions. More documentation is found inside the code itself.
Convention: functionName : parameter1, parameter2, ... : return value1, return value2, ...

Main

  • HAL_TIM_PeriodElapsedCallback : void : void

  • Callback whenever the Timer TIM15 raises an interrupt (when the timer == value AR register) This is where the ADC performs the conversion.
  • main : no arguments : returns void (never returns)

  • Check if ready then performs inference and outputs the result using UART2.

app_x-cube-ai.c

  • aiInit : ai_u8 activations : void

  • Initializes the Neural Network
  • aiRun : const void * in_data (input float buffer with the 187 ECG samples), void * out_data (output int buffer of size 5 (5 classes)) : int (prediction status)

  • Performs the Inference
  • MX_CUBE_AI_Init : void : void

  • Calls aiInit
  • MX_CUBE_AI_Process : void : int (the prediction class)

  • Initializes the input buffer by converting the ECG buffer to bytes then feeding it to aiRun which outputs the prediction then the predicted class is returned

About

ECG Heart Monitor and Disease Detection using TensorFlow Lite on STM32 Microcontroller


Languages

Language:C 95.4%Language:HTML 1.5%Language:Makefile 1.4%Language:C++ 1.4%Language:Assembly 0.3%