CN-121999448-A - Track intrusion detection method and system based on computer vision
Abstract
The invention discloses a track intrusion detection method and system based on computer vision, and relates to the technical field of image detection. The method comprises the steps of carrying out feature extraction and target detection on an intrusion-free track monitoring image to obtain an image feature map and a target category score, calculating the importance of each feature channel based on the target category score, screening to form a self-whitelist channel set, setting a channel inhibition coefficient, carrying out channel inhibition on the image feature map to obtain an image residual feature map, establishing a normal residual distribution model, extracting a current frame feature map from a current frame to be detected, applying the same channel inhibition, inputting a result into the normal residual distribution model to obtain an abnormal measurement value, mapping the abnormal measurement value into a space residual abnormal heat map, constructing a potential field map according to a track mask, carrying out random diffusion iteration on an initial activation map obtained from the space residual abnormal heat map under potential field constraint, constructing an activation energy map according to the change of the activation value in the iteration process, and processing the activation energy map to obtain a track intrusion detection result.
Inventors
- Yin Zuobin
- LIU HAO
- Ren Kaitong
- HOU XUFEI
- WANG JUNHENG
Assignees
- 重庆五盾科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260408
Claims (10)
- 1. The track intrusion detection method based on computer vision is characterized by comprising the following steps of: step S1, carrying out feature extraction and target detection on an intrusion-free track monitoring image, generating an image feature image and a target category score, calculating channel importance values of all feature channels according to the target category score, and screening according to the channel importance values to obtain a self-whitelist channel set; step S2, setting channel inhibition coefficients according to the self-whitelist channel set, carrying out inhibition operation on the image feature images through the channel inhibition coefficients to obtain image residual feature images, and constructing a normal residual distribution model according to the image residual feature images; Step S3, a current frame track monitoring image to be detected is obtained, a current frame feature image is extracted, a current residual feature vector is calculated by combining a channel suppression coefficient, the current residual feature vector is input into a normal residual distribution model to obtain an abnormal measurement value, and the abnormal spatial residual heat image is obtained by mapping; And S4, constructing a potential field diagram through the track mask, performing random diffusion iterative operation on an initial activation diagram generated based on the space residual error abnormal heat diagram under the constraint of the potential field diagram, acquiring an activation energy diagram according to the change of an activation value in the iterative process, and outputting a track intrusion detection result based on the activation energy diagram.
- 2. The method for detecting track intrusion based on computer vision as set forth in claim 1, wherein the step S1 specifically includes: Step S11, acquiring an intrusion-free track monitoring image, geometric structure information of a track scene and scene configuration, and performing target detection on each frame of the intrusion-free track monitoring image to obtain a detection frame set of each frame of the intrusion-free track monitoring image; the geometric structure information of the track scene comprises a track center line, a track surface height and a track gauge; the scene configuration comprises a fixed installation position of the track equipment and a boundary of an allowed occupied area of the track vehicle; The detection frame set comprises a rail vehicle and rail equipment; step S12, extracting a feature map corresponding to each frame of non-invasive track monitoring image to obtain an image feature map, and taking a region corresponding to a detection frame of each frame of non-invasive track monitoring image in the image feature map as a detection frame feature map; The image feature map comprises feature channels and space positions; step S13, selecting a target class score of the rail vehicle or the rail device in the detection frame set, and calculating the channel contribution degree according to the target class score, wherein the calculation expression is as follows: ; Wherein, the The channel contribution degree of the kth detection frame in the c-th characteristic channel, k is the detection frame index, c is the characteristic channel index, In order to detect the spatial position covered by the frame, For the characteristic value of the c-th characteristic channel at the spatial position (u, v), For the target class score to be a score, Partial derivatives of the target class score relative to the feature value; step S14, calculating the average value of the channel contribution degree on all detection frames in the characteristic channels to obtain channel importance values, and forming the channel importance values of all the characteristic channels into an importance value sequence; Step S15, sorting all the characteristic channels according to the importance value sequence from large to small, selecting the characteristic channels with the channel importance value larger than a preset importance threshold from the sorting result, and forming a self-white list channel set.
- 3. The method for detecting track intrusion based on computer vision as set forth in claim 2, wherein the step S2 specifically includes: Step S21, setting a channel suppression coefficient for each characteristic channel; Wherein a channel suppression coefficient of a characteristic channel not belonging to the self-whitelist channel set is set to 1; setting a channel suppression coefficient of a characteristic channel belonging to the self-whitelist channel set to a constant greater than 0 and less than 1; step S22, calculating the product of the characteristic value of each characteristic channel in each frame of image characteristic map and the channel inhibition coefficient of the characteristic channel to obtain a residual characteristic value, and obtaining an image residual characteristic map through the combination of the residual characteristic values; Step S23, combining all residual characteristic values in all the image residual characteristic diagrams to obtain residual characteristic vectors, and obtaining a normal residual sample set; And S24, calculating a mean vector and a covariance matrix of all residual feature vectors in the normal residual sample set, and constructing a normal residual distribution model by using the mean vector and the covariance matrix.
- 4. The computer vision-based track intrusion detection method of claim 3, wherein the process of constructing the normal residual distribution model specifically comprises: taking the mean value vector as the central position of the normal residual error distribution model, taking the covariance matrix as the covariance structure of the normal residual error distribution model, calculating an abnormal measurement value of the residual error feature vector under the normal residual error distribution model, and calculating the expression as follows: ; Wherein, the As a measure of the anomaly it is, As a residual feature vector of the image processing device, As a mean value vector of the data set, Is the inverse of the covariance matrix, Is the square of the mahalanobis distance, Is a normalized coefficient; the calculation expression of the normalization coefficient is: ; Wherein, the In the form of a covariance matrix, Is a feature dimension.
- 5. The method for detecting track intrusion based on computer vision as set forth in claim 4, wherein the step S3 specifically includes: Step S31, a current frame track monitoring image to be detected is obtained, a current frame feature image corresponding to the current frame track monitoring image is extracted, the product of the feature value of each feature channel in the current frame feature image and the channel suppression coefficient of the feature channel is calculated, a current frame residual feature value is obtained, a current residual feature vector is obtained through combination of the current frame residual feature values, the current residual feature vector is input into a normal residual distribution model, an abnormal measurement value of the current residual feature vector is calculated, and a feature domain residual abnormal heat image is obtained; And step S32, mapping the characteristic domain residual error abnormal heat map to a track monitoring image pixel space according to the spatial correspondence between the current frame characteristic map and the track monitoring image of the current frame to be detected, and obtaining the spatial residual error abnormal heat map on the track monitoring image pixel space.
- 6. The method for detecting track intrusion based on computer vision as set forth in claim 5, wherein the step S4 specifically includes: step S41, acquiring a track mask in a track monitoring image pixel space according to the geometric structure information of a track scene and scene configuration, wherein the track mask comprises a track dangerous area mask, a track equipment occupation permission area mask and a track vehicle occupation permission area mask; Setting the pixel positions corresponding to the track equipment occupation permission area mask and the track vehicle occupation permission area mask as a first potential value, setting the pixel position corresponding to the track dangerous area mask as a second potential value, and setting the pixel position not belonging to the track mask as a third potential value to construct a potential field diagram; wherein the third potential value is greater than the first potential value and the first potential value is greater than the second potential value; Step S42, setting the abnormal measurement value which does not belong to the corresponding pixel position of the track dangerous area mask in the space residual error abnormal heat map to zero, and reserving the abnormal measurement value which corresponds to the pixel position in the track dangerous area mask to form an initial activation map; Step S43, taking the initial activation diagram as an initial state, executing random diffusion iteration operation on the initial activation diagram under the constraint of a potential field diagram, taking the iteration activation diagram of the previous iteration as input in each round of random diffusion iteration operation, generating a corresponding iteration activation diagram of the next iteration, and recording the activation value changes of the iteration activation diagram at the beginning of the round and the iteration activation diagram at the end of the round in each round of iteration, thereby obtaining an activation energy diagram.
- 7. The computer vision-based track intrusion detection method of claim 6, wherein the random diffusion iterative operation specifically comprises: Adding a preset random disturbance value to each pixel position of the iteration activation map of the previous iteration to obtain a disturbance activation map, wherein the potential value of the first pixel position is larger than that of the second pixel position through the amplitude of the preset random disturbance value, and the amplitude of the preset random disturbance value corresponding to the first pixel position is smaller than that of the preset random disturbance value corresponding to the second pixel position; Determining a suppression value of each pixel position according to the potential value of the potential field diagram in each pixel position, performing suppression processing on the activation value of each pixel position in the disturbance activation diagram through the suppression value, so that the potential value of the first pixel position is larger than the potential value of the second pixel position, and the reduction amplitude of the activation value of the first pixel position is not smaller than the reduction amplitude of the activation value of the second pixel position, thereby obtaining a suppressed activation diagram; Determining an enhancement value of each pixel position according to the initial activation value of the initial activation map at each pixel position, and enhancing the activation value of each pixel position in the inhibited activation map by the enhancement value, so that the initial activation value of the first pixel position is larger than the initial activation value of the second pixel position, and the increase amplitude of the activation value of the first pixel position is not smaller than the increase amplitude of the activation value of the second pixel position, thereby obtaining the enhanced activation map; Attenuating the activation value of each pixel position in the enhanced activation map according to a preset attenuation proportion to obtain a current iteration activation map of the current iteration, and taking the current iteration activation map as an iteration activation map of the previous iteration in the next random diffusion iteration operation; the first pixel position and the second pixel position are any pixel position in the pixel space of the track monitoring image.
- 8. The computer vision based track intrusion detection method of claim 7, wherein the process of acquiring an activation energy map specifically comprises: Calculating the activation value difference between the pixel position in the iteration activation diagram of the previous iteration at the beginning of each round of iteration and the activation value of the corresponding pixel position in the current iteration activation diagram at the end of each round of iteration when each round of random diffusion iteration operation is performed, taking the activation value absolute value of the activation value difference, and taking the activation value absolute value as the activation change value of the pixel position in each round of iteration; And accumulating the activation change values corresponding to each pixel position on the round of all random diffusion iterative operations to obtain accumulated activation change amounts, and forming an activation energy diagram by the accumulated activation change amounts of all pixel positions.
- 9. The computer vision-based track intrusion detection method of claim 8, wherein step S4 further comprises: Step S44, marking the pixel position with the activation variation larger than the activation energy threshold value as an intrusion candidate pixel in the activation energy diagram to obtain an intrusion target mask; step S45, carrying out connected domain analysis operation on the intrusion target mask to obtain adjacent intrusion candidate pixels, and taking the adjacent intrusion candidate pixels as intrusion target areas to obtain an intrusion target area set; step S46, the intersection part of the pixel set corresponding to the track dangerous area mask is screened out from the intrusion target area set to be used as an overlapped intrusion target area, and the overlapped intrusion target area is used as a track intrusion detection output result of the track monitoring image of the current frame.
- 10. A computer vision-based track intrusion detection system applied to the computer vision-based track intrusion detection method according to any one of claims 1 to 9, and comprising a feature recognition module, a construction module, an anomaly measurement module and an analysis module; The feature recognition module is used for carrying out feature extraction and target detection on the non-invasive track monitoring image, generating an image feature map and a target category score, calculating channel importance values of each feature channel according to the target category score, and screening according to the channel importance values to obtain a self-whitelist channel set; The construction module is used for setting channel inhibition coefficients according to the self-whitelist channel set, carrying out inhibition operation on the image feature images through the channel inhibition coefficients to obtain image residual feature images, and constructing a normal residual distribution model according to the image residual feature images; The anomaly measurement module is used for acquiring a current frame track monitoring image to be detected, extracting a current frame feature image, calculating a current residual error feature vector by combining a channel suppression coefficient, inputting the current residual error feature vector into the normal residual error distribution model to acquire an anomaly measurement value, and mapping to acquire a space residual error anomaly heat image; The analysis module is used for constructing a potential field diagram through the track mask, carrying out random diffusion iterative operation on an initial activation diagram generated based on the space residual error abnormal heat diagram under the constraint of the potential field diagram, acquiring an activation energy diagram according to the change of an activation value in the iterative process, and outputting a track intrusion detection result based on the activation energy diagram.
Description
Track intrusion detection method and system based on computer vision Technical Field The invention relates to the technical field of image detection, in particular to a track intrusion detection method and system based on computer vision. Background In recent years, with the increasing application of fixed cameras and intelligent video analysis in railway scenes, the use of computer vision to realize track intrusion detection has become an important means for improving driving safety. In the existing method, a target detection model is mostly adopted, pedestrians, vehicles or foreign matters are detected on a monitoring picture directly, an alarm is triggered in a predefined track ROI, or background modeling or image difference is adopted, and the change of a track area is regarded as invasion. However, the track scene has the remarkable characteristics that the train body is a legal target occupied by a large area in a picture, the track equipment is complex in shape and color and is fixedly distributed, the appearance of the track equipment can be frequently changed by different vehicle types, different coating and equipment transformation, and real foreign matters such as small stones, tools, falling parts and the like are often small in volume and low in contrast. The conventional method is easy to generate a strongly dependent class label or static white list, the false alarm rate suddenly increases when the appearance of a train or equipment changes, a pixel level or an original feature level threshold is difficult to establish stable distinction between legal and foreign matters, the train or equipment is difficult to avoid being treated as invasion, small foreign matters in a track dangerous area are difficult to reliably find, and a detection scheme optimized from the double angles of feature space and track physical constraint is needed. The invention of China with the application number of CN202011496298.1 at present discloses a method and a device for detecting track foreign matter invasion based on computer vision, which comprises the steps of reading an input image, carrying out gray level processing, extracting gradient characteristics, carrying out binary processing, carrying out mask coverage on the binary image to leave effective information in an interested area, extracting contour line characteristics in the binary interested image, filtering closed contour lines in the contour lines to obtain all contours with the highest track correlation, obtaining central axes of all contours, distinguishing left and right track areas according to the central axes, clustering and screening the contour lines in the left and right track areas respectively to obtain track line contours, feeding back the track contour lines to the binary interested area, judging to be blocked if endpoints of the track contour lines cannot intersect with boundaries of the binary interested area, and finishing a result format and outputting. The invention has low running cost and high efficiency, is not limited to linear tracks, and has wide application range. However, the related technology is difficult to simultaneously combine low false alarm and high detection, and when track intrusion detection is performed, legal targets such as trains, track equipment and the like are frequently misjudged to be foreign matter intrusion, and small-volume or low-contrast track foreign matter is difficult to detect in time. Disclosure of Invention The invention solves the technical problems that the related technology is difficult to simultaneously realize low false alarm and high detection, and the problems that legal targets such as trains, track equipment and the like are frequently misjudged to be foreign matter invasion, small-volume or low-contrast track foreign matters are difficult to detect in time when track invasion detection is carried out are solved. In order to solve the technical problems, the invention provides the following technical scheme: the track intrusion detection method based on computer vision comprises the following steps: step S1, carrying out feature extraction and target detection on an intrusion-free track monitoring image, generating an image feature image and a target category score, calculating channel importance values of all feature channels according to the target category score, and screening according to the channel importance values to obtain a self-whitelist channel set; step S2, setting channel inhibition coefficients according to the self-whitelist channel set, carrying out inhibition operation on the image feature images through the channel inhibition coefficients to obtain image residual feature images, and constructing a normal residual distribution model according to the image residual feature images; Step S3, a current frame track monitoring image to be detected is obtained, a current frame feature image is extracted, a current residual feature vector is calculated by combining a channel