Probable Bug in My Code

17 visualizaciones (últimos 30 días)
Perver Atilla Ince
Perver Atilla Ince el 23 de Oct. de 2023
Respondida: Perver Atilla Ince el 8 de Nov. de 2023
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.

Respuesta aceptada

Perver Atilla Ince
Perver Atilla Ince el 8 de Nov. de 2023
Hello,
I solved it. Apparently, I forgot to delete "%" when clearing some variables on DataWizard causing LF to increase both in count and value.

Más respuestas (1)

Angelo Yeo
Angelo Yeo el 25 de Oct. de 2023
If you think you found a bug in the 3rd party toolbox, DeepLabCut, you should reach out to the authors of DeepLabCut. Maybe you can contact them through "Issues" tab in their Github Repo.
If you think the issue belongs to MathWorks' products, please contact technical support with reproduction steps.

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by