## 3 Proposed Methods
### Overview of Model Structure
#### 3.1.1 End-to-End Detection with an Improved DETR  
Most detection methods perform detection based on detectors such as an anchor or Dense Box. However, since these methods perform repeated detection of the same target body, i.e., redundant detection frames are predicted, this problem must be addressed by means such as NMS. In contrast, the DETR structure proposed by [PERSON] et al. does not require prediction of a candidate anchor and directly uses the model for violent regression.  
Therefore, this method combines DETR and improves it. The whole DETR architecture consists of extracting skeletal points frame by frame by the OpenPose algorithm and encoder-decoder architecture, which does not require any custom network structure and simplifies the training process. It only requires a fixed set of object queries (query object); the DETR will predict the results in parallel based on the relationship between the target object and the global image context. The structure of the improved DETR is shown in Figure 7.  
The input data will first be extracted by the OpenPose algorithm frame by frame and then combined with positional encoding as the input data of the encoder. The decoder will use a small number of fixed query objects and the encoder output as the input of the decoder at the same time. The decoder-processed data will flow into the improved ST-GCN-1 unit and be used as the input of the improved ST-GCN network. In the original ST-GCN network, which contains nine layers, the GCN and TCN modules are used alternately to transform the temporal and spatial dimensions. In the GCN module, a random division is used to combine the graph convolution operations of three subgraphs into one, which effectively improves the computational performance of the algorithm.  
The DETR uses a decoder to predict a fixed number of detection frames; it does not need to use post-processing means such as NMS. It uses the set loss function as a  
Figure 6: Network structure of the improved ST-GCN.  
Figure 7: Structure of the improved DETR.  
supervised signal for end-to-end training, where the set loss function uses the bipartite matching algorithm to match the prediction object with the ground truth object, as shown in Equation (2):  
\[\hat{v}=arg\min\sum_{i}^{N}L_{match}(y_{i},\hat{y}_{\sigma_{i}}) \tag{2}\]  
where \(y\) denotes the ground truth target set, \(\hat{y}_{\sigma_{i}}\) denotes the \(N\) elements in the prediction set, and \(L_{match}(y_{i},\hat{y}_{\sigma_{i}})\) denotes the loss value of the prediction and ground truth matching about element i of \(\sigma_{i}\). The matching effect is shown in Figure 8.  
Figure 8 contains the correspondence between two sets of prediction and ground truth, each set contains \(N\) target bodies, and each target body contains two elements, which are the confidence level of the class to which the target body belongs (\(probs_{i}\), where \(i\in[1,N]\)) and the location and size of the target body (\(bbox_{i}\), where \(i\in[1,N]\), containing the center point of location coordinates and the width and height of the detection box). After matching the elements in the two sets, for example, (\(probs_{1},bbox_{1}\)) in the prediction sets corresponds to (\(probs_{3},bbox_{3}\)) in the ground truth, etc. (where \(\varnothing\) indicates that the class is empty), the Hungarian algorithm can be used to calculate its loss value, which abstracts the target detection task as a set prediction problem and then predicts all targets simultaneously and trains them end-to-end by set loss, thus simplifying the model training process and effectively avoiding problems such as anchor and NMS.