- scikit-learn
- pytorch
- MDK5
We implemented custom feature extraction and used classifier from scikit-learn.
the training script is present in model_training_design\train_model.py
Our implementation is based on the feature extraction function implemented in the train_model.py file.
The best intercept from the classifier are extracted and used for deployment on the board.
To run the training, simply run the python script train_model.py
with following parameters path_data
and path_indices
,
the result will display the Coefficients learned from the classifier.
Note: He have not used X-CUBE-AI for generating our model, rather we implemented our own from scratch.
In the folder deploy_design
, we have the design implemented in the main.c
and used the template provided by TEST_OwnModel.zip
.
In the project, the file main.c
contains all the functions needed for classification result.
Note: no need to implement Model_Init()
method is the function as we do not have any neural network to be loaded, rather all our classifier coefficient are hardcoded in the main.c
, extract_peaks_features_optimized_v3()
function.
We only impelemnted aiRun
function to inference the input IEMG segment. The rest of the code, including data reception, data transmission and serial communication, is retained as a template.
Use the same steps as defined in Load Program to Board
section of README-Cube.md
Also mentioned below:
-
Connet the boadr to computer.
-
Open project in MDK5 and build.
-
Check if the debugger is connected.
First, click Options for Target.
Then switch to Debug and click Settings.
If the debugger is connected, you can see the IDCODE and the Device Name.
Finally, switch to Flash Download and check Reset and Run
-
Now you can load program to the board.
We use usb2micro usb cable to connect the development board and the upper computer to achieve communication.
Afering connect the board to PC, run the validation.py
, when seeing output like below, press the reset button shown in the picture, and the validation will start.