{'fraction_non_alphanumeric': 0.021539955099811905, 'fraction_numerical': 0.009950852496814514, 'mean_word_length': 4.869658119658119, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Construction Crane Detection under Transmission Line Based on Improved Vibe Algorithm

In this paper, the moving object detection part of crane’s illegal construction detection under transmission line is studied, and two scenes are simulated. The Visual background extraction (Vibe) algorithm is selected as the moving object detection algorithm used in this paper. For the problems of the algorithm, including ghost phenomenon in detection results and the the presence of falsely detected foreground points under dynamic background, the Vibe algorithm is improved by the reconstructed background model, dynamic radius threshold and connected domain analysis. Results of the experiment show that ghost area in the detection results of the improved Vibe algorithm can quickly disappear, and the number of falsely detected foreground points is significantly reduced. Compared with the original Vibe algorithm, the average value of the comprehensive evaluation index F1 is increased by 5.8%, and the detection effect of moving object is significantly improved.


Introduction
With the continuous improvement of China's economic level, the scale of transmission lines is also expanding. In its 13th five year plan, the State Grid Corporation of China proposed to add 401000 km of 110kV and above voltage level lines, and the total mileage of transmission lines has increased by 45% compared with the 12th five year plan [1]. At the same time, transmission line accidents often occur, and illegal construction of crane is one of the main reasons for transmission line accidents. According to statistics, more than 80% of transmission line accidents in a province in one year are caused by illegal construction of large cranes and floating objects attached to the lines [2]. With the continuous construction of infrastructure, the number of transmission line accidents caused by illegal construction of crane is increasing significantly, which brings great economic losses to power supply enterprises and affects people's production and life.
The traditional methods to prevent illegal construction of crane include assigning special person to patrol the line, building a transmission line video monitoring system for centralized monitoring, etc. These methods mainly rely on manual judgment of crane's illegal construction behavior, sometimes can't timely alarm, and the consumption of human and material resources is huge. Under the background of intelligent power grid, it has become a new research direction to integrate computer vision algorithm into the crane's illegal construction detection under transmission line [3].

Research scenarios of this paper
This paper mainly studies the moving object detection part of the crane's illegal construction detection under transmission lines. Two scenes are simulated and two video sequences are obtained, which are referred to as crane stay and crane arm too high, the two video sequences contain the following scenes.
(1) After the crane enters the monitoring screen, the moving object detection algorithm is used to detect the crane foreground. If the crane appears in the monitoring screen for a short time, the monitoring system outputs low-risk alarm information to remind the operator to pay attention to the crane entering the monitoring screen; if the crane appears in the monitoring screen for a long time, it indicates that the crane has a tendency to stay for a long time, the monitoring system outputs high-risk alarm information to remind the operator to pay attention to the follow-up action of the crane and take corresponding measures according to specific situation, as shown in Figure 1, in this video sequence, the phenomenon of the target crane appears in the first frame and the slight shaking of transmission tower, wires and leaves in the background are simulated.  (2) During the lifting operation, due to the negligence of the driver, the crane arm is raised too high when the crane enters the monitoring screen. At this time, the safe distance between the top of the crane arm and the high-voltage line is not satisfied, which is easy to cause high-voltage line discharge, resulting in wire damage and electric shock accidents. Therefore, it is necessary to use the moving object detection algorithm to detect the foreground of the crane. According to whether the safe distance between the top of the crane arm and the transmission line is satisfied and the duration of the crane arm too high state, the alarm is classified, as shown in Figure 2. In this video sequence, the phenomenon of slight shaking of transmission towers, wires and leaves in the background is simulated.

Principle of Vibe algorithm
Visual background extraction algorithm, Vibe algorithm for short, is a pixel level moving object detection method combining temporal and spatial information. The algorithm initializes background 3 model through the first frame, and detects the foreground from the second frame. The calculation process of the Vibe algorithm is simple and the real-time performance is good. The specific implementation process of Vibe algorithm is as follows.

Initialization of background model
Vibe algorithm initializes the background model of each pixel through the first frame of video sequence. For the pixel x in the first frame, the algorithm selects the pixels in the 8 neighborhood of pixel x as the sample set, then the algorithm randomly selects the pixel values of 20 pixels in the sample set as the background sample set of pixel x to complete the initialization of the background model.
The background sample set of pixel x is shown in formula (1).
n --Number of sample points, its value is 20.

Foreground detection
Vibe algorithm starts foreground detection from the second frame. For pixel x , set its pixel value as ) (x V t , and t means that the current frame number is t . Construct a circle )) as the center and 20 = R as the radius, as shown in Figure 3.
--Difference of pixel values between x and background sample point. If the difference of pixel values is less than the radius threshold R , the variable H is added with 1. Traverse the background sample set of pixel x , calculate the difference of pixel values respectively, count the value of variable H , and judge whether the pixel x is the foreground point, as shown in formula (3).
The formula (3) shows that if the number of background sample points falling in the circular range )) ( ( x V S t R is less than the background matching threshold min H , then the pixel x is the foreground point, its pixel value is set to 255; otherwise, the pixel x is the background point, its pixel value is set to 0, and the value of background matching threshold min H is 2.

Background model update
The Vibe algorithm uses random sampling strategy to update its background model. When the pixel is judged as a background point, there is a 16 / 1 probability to update its own background sample set,the update method is to replace the randomly selected sample value in its background sample set with the value of the pixel. At the same time, there is a 16 / 1 probability to update the background sample set of pixels in the 8 neighborhood of the pixel, the update method is to select a pixel in the neighborhood with 16 / 1 probability, and replace the randomly selected sample value in the sample set of selected neighborhood pixel with the value of the pixel [4,5].

Problems of Vibe algorithm
Vibe algorithm uses the first frame of video sequence to initialize the background model. If there is a moving object in the first frame, when initializing the background model, the algorithm will include the pixels of the moving object area into the background model. In the subsequent detection process, the algorithm will mistakenly detect the moving target area in the first frame as the foreground points, resulting in ghost phenomenon, which affects the accuracy of moving target detection and increases the processing time of the subsequent algorithm, as shown in Figure 4   In the process of detecting the moving crane, due to the influence of the site environment, there is a slight shaking of the transmission tower, wires and leaves, forming the dynamic background [7]. Vibe algorithm mistakenly detects the dynamic background as foreground points, which not only affects the accuracy of moving target detection, but also affects the subsequent processing process, and increases the processing time of the subsequent algorithm, as shown in Figure 5.

Dynamic radius threshold
In order to weaken the influence of dynamic background, this paper uses dynamic radius threshold for foreground detection. The variance of the reconstructed background model is calculated as follows.
In formula (7): Define the background complexity of the current frame, as shown in formula (8). (8), α is the weighting coefficient, this paper takes 0.2, and the adjusted radius threshold is shown in formula (9).
The upper and lower limits of radius threshold R are given, as shown in formula (10).

Connected domain analysis
In order to further suppress the influence of dynamic background, this paper uses the two pass scanning method in connected domain analysis to mark the foreground of the detection result of the above improved methods, delete small foreground areas and retain the target construction crane. The two pass scanning method scans the image twice. In the first pass, each foreground pixel position is given a label value. In the scanning process, foreground pixels belonging to the same connected area may be given different label values, therefore, it is necessary to record the equal relationship between different label values to merge them. In the second pass, the foreground pixels marked by the label values with equal relation are classified into a connected domain and given the same label value. Usually, the label value is the minimum of the label values with equal relation. Finally, all connected domains are found [8].

Flow chart of improved Vibe algorithm
The whole flow of the improved Vibe algorithm is shown in Figure 7:

Experiment and analysis
Select the crane stay video and crane arm too high video, for the two video sequences, Vibe algorithm and the improved Vibe algorithm in this paper are used for moving object detection, and the detection results are shown in Figure 8. As shown in Fig. 8 (a), Fig. 8 (c) and Fig. 8 (e), in the crane stay video, due to the existence of the target crane in the first frame, the Vibe algorithm initializes the pixel value of the target crane into the background model, resulting in the ghost phenomenon in the detection result of the algorithm. With the update of the Vibe algorithm's background model, the ghost area does not completely disappear in the 68th detection result of Vibe. Due to the influence of dynamic background, the number of other falsely detected foreground points in the detection result of Vibe algorithm is more than that of the improved Vibe algorithm. In this paper, the improved Vibe algorithm reduces the influence of the target crane in the first frame by reconstructing the background model. From the detection result of the improved Vibe algorithm, it can be seen that the ghost area basically disappears in the 68th frame, and the number of other falsely detected foreground points under the dynamic background is also significantly reduced.
As shown in Fig. 8 (b), Fig. 8 (d) and Fig. 8 (f), in the crane arm too high video, due to the influence of dynamic background such as the slight shaking of transmission tower, wires and leaves, there are EMCEME 2020 IOP Conf. Series: Earth and Environmental Science 692 (2021) 022007 IOP Publishing doi:10.1088/1755-1315/692/2/022007 8 many falsely detected foreground points in the 78th detection result of Vibe algorithm. The improved Vibe algorithm suppresses the influence of dynamic background by setting the dynamic radius threshold and analyzing connected domains, the upper and lower limits of radius threshold are also given. The number of falsely detected foreground points in the 78th detection result of improved Vibe algorithm is significantly reduced. Since there is no target crane in the first frame of the video sequence, there is no ghost phenomenon in the detection results of the two Vibe algorithms.
The comprehensive evaluation index F1 value is introduced to compare the detection effect of Vibe algorithm and the improved Vibe algorithm in this paper. The index reflects the overall situation of moving object detection. The larger the F1 value is, the better the detection effect of the algorithm is. The definition of F1 value is shown in formula (11).
In formula (11), the variable P is called Precision, it reflects the proportion of correctly detected foreground points in all detected foreground points. The larger the value of P is, the less the number of falsely detected foreground points is.
In formula (11), the variable R is called Recall ratio, it reflects the proportion of correctly detected foreground points in all real foreground points. The larger the value of R is, the more complete the detected target is [9].
Read the detection results of crane stay video and crane arm too high video under Vibe algorithm and the improved Vibe algorithm in this paper, take 10 frames each to calculate the comprehensive evaluation index F1 value, and draw the F1 value change curve of detection results, as shown in Figure  9 and Figure 10.    Fig. 9 and Fig. 10 show that the improved Vibe algorithm in this paper speeds up the ghost elimination in the detection results of the algorithm and effectively suppresses the influence of the dynamic background by reconstructing the background model, setting the dynamic radius threshold and analyzing the connected domains. However, compared with the original Vibe algorithm, the detection results of the improved Vibe algorithm in two video sequences show a slight decrease in the integrity of the target crane. In the detection results of two video sequences, the number of falsely detected foreground points of the improved Vibe algorithm is less than that of the original Vibe algorithm, and the comprehensive evaluation index F1 values of the detection results of the improved Vibe algorithm in two video sequences are higher than that of the original Vibe algorithm, which shows that the detection effect of the improved Vibe algorithm is better than that of the original Vibe algorithm.
Calculate the average F1 values of the detection results of Vibe algorithm and the improved Vibe algorithm in two video sequences, as shown in Table 1. The data in Table 1 show that after the improved Vibe algorithm introduces the reconstructed background model, dynamic radius threshold and connected domain analysis, the speed of ghost elimination is accelerated, and the number of falsely detected foreground points caused by dynamic background is effectively reduced, but the integrity of the target crane in the detection results of improved Vibe algorithm in two video sequences is decreased. Compared with the original Vibe algorithm, the average F1 values of the improved Vibe algorithm in two video sequences are improved. The average F1 value of the improved Vibe algorithm is 0.91, which is 5.8% higher than the original Vibe algorithm. This shows the effectiveness of the improved Vibe algorithm.

Conclusion
This paper mainly studies the moving object detection part of the crane illegal construction detection under the transmission line, simulates two scenes, and obtains two video sequences. Vibe algorithm is selected as the algorithm used in this paper. This paper analyzes the problems of Vibe algorithm, including ghost phenomenon in detection results and the presence of falsely detected foreground points under dynamic background. The Vibe algorithm is improved by the reconstructed background model, dynamic radius threshold and connected domain analysis. In the two video sequences, the Vibe algorithm and the improved Vibe algorithm are used to detect moving objects. Results of the experiment show that compared with the Vibe algorithm, the ghost regions in the detection results of the improved Vibe algorithm can disappear quickly, and the number of falsely detected foreground points is also significantly reduced. The average F1 value of detection results of the improved Vibe algorithm is 0.91, which is 5.8% higher than that of Vibe algorithm, which verifies the effectiveness of the improved Vibe algorithm.