# AI-Enabled Animal Behavior Analysis with High Usability: A Case Study on Open-Field Experiments
## 6 Application Case
### Behavioral Recognition  
DeepLabCut is fully pre-trained on the ImageNet dataset. In addition, DeepLabCut has been tested and calibrated on behavioral data generated by different species of organisms, such as mice and fruit flies. These diverse data make the model robust. In this case, we trained DeepLabCut specifically using the mouse mentioned above behavioral dataset mentioned above, due to the differences in key point locations. We evaluated the model's accuracy by comparing the deviation between the pixel coordinates of the key points predicted by the model and the coordinates labeled by the expert. We used the change in the mean value of the deviation for each key point to objectively assess the stability of the model. The root mean square error (\(RMSE\)) measures the root mean square difference between the predicted and true values, thus indicating the average degree of deviation between the predicted and true values. The formula for the RMSE is shown below:  
\[RMSE=\sqrt{\frac{\sum_{i=1}^{n}\left[x_{t,i}-x_{p,i}\right]^{2}}{n}} \tag{1}\]  
where \(n\) is the number of observations, \(x_{t}\) is the true value, and \(x_{p}\) is the predicted value. Since DeepLabCut supports a variety of feature extraction networks, we selected six different feature extraction network models to obtain the best performance, including ResNet-50 and ResNet-101 for training [32; 33]. We evaluated the detection performance of these networks on mouse skeletal key points and selected the most suitable feature extraction network for this case. As shown in Figure 7, the RMSEs of different feature extraction networks for the three key points of the mice varied. The EfficientNet-b6 network has the smallest error on the test set [34], and the difference between its predicted coordinates and the true pixel coordinates was close to 5.9 pixels at the tail. Considering the higher pixels occupied by the nose part of the mouse in the high-resolution image in this experiment, such a coordinate deviation is acceptable. In addition to this, we also evaluated the processing speed of different feature extraction networks. For example, when using MobileNet-V2-0.35 [35], the model can reach a processing speed of 16.5 frames/sed but with a relatively high error rate. The slowest detection speed is EfficientNet-b6, about 3.8 frames/sec. In medical animal experiments, the need for accuracy is usually higher than the processing speed. Therefore, we finally chose EfficientNet-b6 as the feature extraction network for DeepLabCut. In the study of the pathological mechanism of motor deficits caused by UBE3A gene deletion, in addition to capturing the relationship between motor function and calcium signals in mice through changes in skeleton key point coordinates, the main focus was on whether the frequency of occurrence of the five movements of stationary, stand, rectilinear movement, steering movement and curl up in diseased mice and normal mice has changed. To analyze the changes in the frequency of these actions, the experimentalists, in constructing the behavioral dataset of the mice, selected only the videos that contained these actions. Figure 8 demonstrates the different behavioral actions in a single pose frame. Then, we input this dataset into DeepLabCut, which led to the corresponding skeleton key point data. After data preprocessing, we obtained valid inputs applicable to the ST-GCN network, and using these valid inputs, we retrained the ST-GCN network. Table 3 shows the detection accuracy of the ST-GCN network for different classes of actions. For actions with significant pose changes, ST-GCN has high detection accuracy. However, for steering movement, which is similar to rectilinear movement, the model may not be able to learn enough detailed information due to the small number of key points, resulting in average detection accuracy. Therefore, we suggest the experimenter mark more key points in the video to track the detailed changes in the pose more accurately.