## 2 Methodology  
### Relationship between the Prediction Box and the Belt Edge Line  
It is well known that the prediction result of a generic target detection network, including the RCNN [21], SSD [22; 23], and Yolo [24; 25] series, is a rectangular box that is used to frame and position the potential targets in the image and predict the category to which the target belongs. The complete prediction process is shown in Figure 1. The generic target detection network usually uses a backbone feature extraction network to extract features from the input image, uses upsampling and feature splicing techniques to enrich and enhance the extracted features (Neck), and, finally, uses a prediction network to predict the target class and regress the target position [25]. The prediction box is usually determined by four values: the relative center point coordinates of the prediction box (both horizontal and vertical) and the relative width and height of the prediction box. However, it is clear that it is difficult to characterize the straight line of a conveyor belt edge in the form of a prediction box. Therefore, in light of the actual camera arrangement and how the conveyor belt is presented in the camera's field of view, this paper proposes methods for the detection of straight belt edges suitable for vertical and inclined shots, respectively. In particular, for vertical camera shots, we propose the use of the longitudinal edges of the prediction box (rectangular box) to characterize the belt edges, with two representative edges, such as the left or the right sides of the prediction box, as shown in Figure 2a. In contrast, for oblique camera shots, we propose a straight-line detection method for belt edges based on the diagonal features of the prediction box, aiming to use the upper right and lower left diagonal lines of the prediction box to characterize the left edge and aiming to use the upper left and lower right diagonal lines to characterize the right edge, as shown in Figure 2b. In general, the essence of the deviation state monitoring task is to effectively identify and locate the two straight edge lines of the conveyor belt under a complex environment and, on this basis, to obtain its spatial state equation for the further judgment of the deviation state. For a vertical camera shot, the belt edge presented will be parallel to the camera's field of view, as shown in Figure 2a. If we use the detection of the left edge as an example and assume that the relative center point coordinates of the prediction box are \((x_{L},y_{L})\), and the relative width and height are \(w_{L}\) and \(h_{L}\), respectively, then, for Figure 2a, the coordinates of point \(a\), \((x_{a},y_{a})\), can be calculated using Equation (1), and the coordinates of point \(b\), \((x_{b},y_{b})\), can be calculated using Equation (2). It should be noted that the horizontal coordinates of point \(a\) and point \(b\) are equal. At this time, the straight-line equation of the belt left edge can be expressed as Equation (3):  
\[x_{a}=x_{L}-\frac{w_{L}}{2}\ y_{a}=y_{L}-\frac{h_{L}}{2} \tag{1}\]  
Figure 1: Prediction process for a general target detection network. Figure 2: Principle of conveyor belt edge detection for different shooting situations: (**a**) vertical shooting, (**b**) oblique shooting. \[x_{b}=x_{L}-\frac{w_{L}}{2}\ y_{b}=y_{L}+\frac{h_{L}}{2} \tag{2}\]  
\[x=x_{L}-\frac{w_{L}}{2} \tag{3}\]  
Then, whether the belt deviates can be judged by comparing the lateral offset of the center point of the prediction box. However, since the oblique shooting method can achieve a larger monitoring range, it has wider application in practice, as shown in Figure 2b. Similar to vertical shooting, one should use the detection of the right belt edge as an example, assuming that the relative center point coordinates of the prediction box are \((x_{R},y_{R})\) and the predicted width and height are \(w_{R}\) and \(h_{R}\), respectively.