Hi everyone,
I am a graduate student working in a laboratory that is studying gait analysis in rats with spinal cord injuries. We are using a video-based approach to track the paws of the rats as they walk.
We previously used a MATLAB code to manually draw the paws in each frame of the video. This was very time-consuming, so we decided to use deep learning to automate the process. I was responsible for setting up DeepLabCut, training the models, and processing the output.
DeepLabCut outputs a CSV file with the X and Y coordinates of the labels in each frame. The CSV file is very large, so I wrote a set of MATLAB codes to process it. These codes remove records with likelihood values below 0.6, separate the labels by paw, and calculate the area of each paw.
The four paws of the rat are labeled as LF (left front), LH (left hind), RF (right front), and RH (right hind). The front paws should have smaller areas than the hind paws. However, I am seeing that the LF area is often similar to or larger than the LH area.
I have checked my code and the data multiple times, but I cannot find the source of the problem. The RF and RH areas seem to be working correctly.
I am attaching my code, documentation, and an example dataset for your review. I would really appreciate any help you can provide.
I have tried to reduce the outliers in the AreaMasterOutlierFill code using the outlierfill function, but I was unsuccessful. I also tried to stabilize the records using fillmissing in the source files, but that did not work either.
Thanks, Atilla
Additional information:
- The code is written in MATLAB 2023a.
- The dataset is a series of more than 100 videos of rats walking.
- The video resolution is 1920 x 1080.
- The paw labels are generated using DeepLabCut with a ResNet-50 model.
Questions:
- Is there anything wrong with the way I am calculating the area of the paws?
- Are there any other possible causes for the LF area to be larger than the LH area?
I would be grateful for any insights you can provide.