Unsupervised abnormal behavior detection method for traffic monitoring video

By performing refined processing and self-supervised learning on traffic surveillance video streams and combining them with density peak clustering, the problems of insufficient abnormal behavior recognition and insufficient generalization in existing technologies are solved, and efficient and accurate abnormal behavior detection is achieved.

CN120808286APending Publication Date: 2025-10-17JIANGSU ZHENGFANG TRANSPORTATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510860308.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing abnormal behavior detection technology in traffic surveillance videos has the problems of insufficient recognition of abnormal behavior temporal characteristics and motion patterns, reliance on additional auxiliary data and poor generalization.

Method used

By fragmenting the surveillance video stream, cross-scale feature fusion and graph attention self-supervised learning are adopted to extract the spatiotemporal features of abnormal behavior, and combined with online density peak clustering for real-time detection.

Benefits of technology

It significantly improves the real-time detection performance and recognition accuracy of abnormal behaviors in traffic surveillance videos, reduces missed detection and false detection rates, and enhances the generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808286A_ABST
    Figure CN120808286A_ABST
Patent Text Reader

Abstract

The invention discloses an unsupervised abnormal behavior detection method for a traffic monitoring video, and the method comprises the steps: continuously obtaining a monitoring video stream at a preset frame rate at a target road monitoring camera side, and dividing the video stream into a fragment sequence; performing double-resolution space-time segmentation on each fragment sequence, and fusing to generate a cross-scale space-time representation tensor; inputting a graph attention coding network to obtain an embedded vector representing traffic behaviors; constructing a normal behavior model by adopting online density peak clustering, and calculating the density peak distance of the current embedded vector relative to the normal behavior model; and when the fragment sequence exceeds a set threshold value and violates a corresponding scene rule in the traffic behavior rule base, determining that the fragment sequence has an abnormal behavior. According to the method, the real-time detection performance, the generalization ability and the recognition accuracy of the traffic monitoring video abnormal behaviors are improved, and the problems of missing detection, false detection and insufficient real-time performance of the abnormal behaviors in the traditional technology are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence and video abnormal behavior detection, and particularly relates to an unsupervised abnormal behavior detection method for traffic monitoring video. BACKGROUND

[0002] With the continuous advancement of urbanization, problems such as road traffic congestion and frequent traffic accidents are becoming increasingly serious, and the traditional manual monitoring method has been unable to effectively cope with the processing demand of massive video data, so the automatic detection technology of abnormal behavior of traffic monitoring video has attracted widespread attention. Early abnormal behavior detection methods usually rely on supervised learning strategies with manual annotation, and are trained through a large number of annotated abnormal behavior samples, which can achieve certain results, but the annotation cost is high and the scene adaptability is poor.

[0003] In recent years, the research focus has gradually shifted to unsupervised abnormal behavior detection methods, which mine the internal laws or characteristics of normal behavior to identify abnormal events deviating from the normal mode, and show good generality and scene adaptability. Specifically, the unsupervised abnormal detection field mainly uses optical flow analysis, deep neural networks, autoencoders and other technologies to identify abnormal behavior through spatiotemporal feature learning and reconstruction error analysis of video frame sequences.

[0004] CN117809366A discloses a rail transit video data abnormal behavior detection method, mainly focusing on the spatial appearance features of RGB images in video clips, and performing feature reconstruction through a diffusion model and calculating an abnormal score. However, this method ignores the importance of motion information in video data, resulting in poor performance in identifying the temporal characteristics and motion characteristics of abnormal behavior, and may have high false detection rate and insufficient real-time performance.

[0005] CN118470664A discloses an abnormal behavior detection method for traffic scenes, which obtains attention features through an encoding network of video data and text data, and calculates the cosine similarity to determine abnormal behavior. Although this method improves the accuracy of abnormal detection, it requires additional text data assistance, and the data source is limited, which has limitations in generality, and is less applicable to data scenes without text labels.

[0006] In summary, the existing abnormal behavior detection technology for traffic monitoring video generally has the problems of insufficient identification of temporal characteristics and motion patterns of abnormal behavior, and dependence on additional auxiliary data and weak generality. The present application proposes an unsupervised abnormal behavior detection method for traffic monitoring video, which performs fragmentation processing on the monitoring video stream, uses cross-scale feature fusion and graph attention self-supervised learning to effectively extract the spatiotemporal features of abnormal behavior and realize real-time and accurate detection. SUMMARY

[0007] This section is intended to summarize some aspects of the embodiments of the present application and briefly introduce some preferred embodiments, and some simplifications or omissions may be made in this section and the abstract and title of the specification to avoid obscuring the purpose of this section, the abstract and the title, and such simplifications or omissions cannot be used to limit the scope of the present application.

[0008] In view of the above existing problems, the present application is proposed.

[0009] To solve the above technical problems, the present application provides the following technical solutions: continuously acquiring a monitoring video stream at a preset frame rate on the target road monitoring camera side, and dividing the video stream into a sequence of segments with a time length T seconds according to a unified space-time identifier;

[0010] Performing double-resolution space-time segmentation on each segment sequence, extracting a sparse key frame set and a dense optical flow feature, and fusing to generate a cross-scale space-time representation tensor;

[0011] Inputting the space-time representation tensor into a graph attention encoding network trained by mask reconstruction and time series comparison joint self-supervised training to obtain an embedding vector F t representing traffic behavior;

[0012] Based on the embedding vector set of the last M time points, an online density peak clustering is used to construct a normal behavior model, and a density peak distance D of the current embedding vector F t relative to the normal behavior model is calculated.

[0013] When the density peak distance D exceeds the threshold value adaptively set according to the P quantile of the historical normal score sequence and violates the corresponding scene rule in the traffic behavior rule library, the segment sequence has abnormal behavior.

[0014] As a preferred scheme of the unsupervised abnormal behavior detection method for traffic monitoring video according to the present application, the video stream is divided into a sequence of segments, comprising:

[0015] Using network time synchronization, the original video frames arriving at the buffer are corrected in time sequence;

[0016] Taking the time interval Δt between adjacent frames as the reference, after the whole point synchronization, the video segment with a length of T-0.5Δt to T+0.5Δt is rolled and cut off;

[0017] A unique segment identifier is generated for each segment, which contains three pieces of information: camera number, segment start time and segment sequence number.

[0018] As a preferred scheme of the unsupervised abnormal behavior detection method for traffic monitoring video, the preset frame rate is set to 25-30 frames per second, when the number of continuous frame loss is detected to be no more than two frames, the missing frame is interpolated by linear interpolation, and the interpolation flag is recorded in the frame header metadata.

[0019] As a preferred scheme of the unsupervised abnormal behavior detection method for traffic monitoring video, the double-resolution space-time segmentation is performed on each segment sequence, including:

[0020] The key frame is extracted at a step of no more than one-tenth of the total number of frames, and the key frame is kept at a resolution of one-half to retain detail information;

[0021] The non-key frame is reduced to one-fourth of the original resolution, and the dense motion vector based on the total variation Lagrangian optical flow is calculated;

[0022] At the same time, the illumination intensity and scene brightness change value are recorded for each frame for weight adjustment in the fusion stage.

[0023] As a preferred scheme of the unsupervised abnormal behavior detection method for traffic monitoring video, the cross-scale space-time representation tensor is generated by fusion, including:

[0024] The key frame after color equalization is stacked in time sequence to form a three-dimensional space-time data block;

[0025] The amplitude and direction of the optical flow are split into two channels and normalized;

[0026] The three-dimensional space-time data block and the optical flow channel are cascaded, and the feature scale is unified by three-dimensional convolution operation to obtain the cross-scale space-time representation tensor.

[0027] As a preferred scheme of the unsupervised abnormal behavior detection method for traffic monitoring video, the embedding vector F t characterizing traffic behavior is obtained, including:

[0028] More than 60% of the voxels of the cross-scale space-time representation tensor are randomly occluded, and the occluded part is reconstructed by convolution-deconvolution structure;

[0029] The original tensor and its version after time disturbance constitute a positive and negative sample pair, and the difference between the two is minimized by contrast learning;

[0030] After training convergence, the embedding vector F

[0031] As a preferred scheme of the unsupervised abnormal behavior detection method for traffic monitoring video, the masked reconstruction and time series comparison joint self-supervised training graph attention encoding network comprises:

[0032] A node construction module is configured to generate a traffic participant node according to a detection frame center position, a motion speed and a category label, and generate a node-to-node edge based on a spatial distance and a relative motion direction.

[0033] A multi-head graph attention layer is configured to perform weighted aggregation on node features through multiple attention heads to analyze interaction relationships between participants.

[0034] Residual feedforward layers and normalization layers are alternately stacked to improve network stability and expression capability.

[0035] A mask auto-encoding substructure is configured to maintain encoding integrity in the case that most inputs are occluded.

[0036] As a preferred scheme of the unsupervised abnormal behavior detection method for traffic monitoring video, the online density peak clustering is adopted to construct a normal behavior model, which comprises:

[0037] A cache pool of embedding vectors of recent time points is maintained, and a cosine similarity between vectors is used as a distance metric.

[0038] A local density peak value is determined through a neighbor search, and a peak point represents a normal behavior cluster center.

[0039] When a similarity between a new embedding vector and a nearest center is lower than a set lower limit, a new cluster center is automatically generated.

[0040] When a number of cluster centers exceeds a set upper limit, clusters with lower density are merged into adjacent clusters according to similarities between the centers.

[0041] As a preferred scheme of the unsupervised abnormal behavior detection method for traffic monitoring video, a current embedding vector F t A density peak distance D relative to the normal behavior model comprises:

[0042] A cosine distance between the current embedding vector and a nearest cluster center is first determined.

[0043] Then, a local density difference between the two is compared.

[0044] The cosine distance and the density difference are weighted according to a preset weight to obtain a comprehensive density peak distance, so as to measure a deviation degree of a current behavior from a normal behavior.

[0045] As a preferred scheme of the unsupervised abnormal behavior detection method for traffic monitoring video, the existence of abnormal behaviors in a segment sequence is determined, which comprises:

[0046] comparing the density peak distance with a threshold dynamically updated based on a historical normal score sequence percentile;

[0047] If the density peak distance exceeds the threshold, then the statistics of the speed, driving direction, stay duration and traffic signal light state of the corresponding trajectory are matched with a traffic behavior rule library;

[0048] The traffic behavior rule library includes five types of scenes: reverse driving, red light running, long-time lane occupation, sudden and severe acceleration, and reverse lane changing, each type of scene being composed of a combination of multiple constraint conditions;

[0049] If any scene constraint is met, then the segment has abnormal behavior.

[0050] The present application has the following beneficial effects: the present application significantly improves the real-time detection performance, generalization ability and recognition accuracy of traffic monitoring video abnormal behavior by using a fine video data segmentation and spatio-temporal feature fusion method, an unsupervised joint self-supervised graph attention feature learning and online density peak clustering technology, and combining a dual determination standard of data-driven and rule-driven, effectively solving the problems of missed detection, false detection and insufficient real-time performance of abnormal behavior in traditional technologies. BRIEF DESCRIPTION OF DRAWINGS

[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. Among them:

[0052] Figure 1 The flowchart of the unsupervised abnormal behavior detection method for traffic monitoring video shown in the present application. DETAILED DESCRIPTION

[0053] In order to make the above-mentioned purposes, features and advantages of the present application more apparent and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present application, not all embodiments.

[0054] Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0055] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, it will be apparent to one skilled in the art that the present application can be practiced without the specific details set forth in this description. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the present application.

[0056] According to an embodiment of the present application, in combination with Figure 1 The flowchart shown in the figure, a method for unsupervised abnormal behavior detection of traffic monitoring video, specifically includes the following steps:

[0057] S1, continuously acquire monitoring video stream at a preset frame rate on the target road monitoring camera side, and divide the video stream into a sequence of segments with a time length T seconds according to a unified space-time identifier. It should be noted that this step is:

[0058] Using the Network Time Protocol, the camera local clock is synchronized to the millisecond level;

[0059] The original frame arriving at the edge buffer is reordered according to the synchronization clock timestamp, eliminating the timing drift caused by network jitter and ensuring the monotonic increase of time sequence;

[0060] The camera acquisition frame rate is fixed between twenty-five and thirty frames per second;

[0061] When the number of consecutive lost frames is detected to be no more than two frames, a linear interpolation algorithm is called to generate a compensation frame between the adjacent frames, and an interpolation flag bit is written in the metadata of the compensation frame for subsequent module identification;

[0062] Taking the synchronous whole point as the starting reference, a sliding time window with a length of T seconds is constructed according to the time interval Δt of adjacent frames;

[0063] Every time the window moves forward by Δt, a new video segment is cut off, ensuring seamless connection between segments and complete coverage;

[0064] A unique identifier ID is automatically generated for each newly generated video segment seg , which is spliced by the camera number + segment start timestamp + segment sequence number three fields, and the format example is CAM12-20250624T140000-0001;

[0065] For example, the video segment sequence obtained after the above processing is mathematically represented as:

[0066] {V k |V k ={f i |kT≤t i <(k+1)T},k=0,1,…,N-1}

[0067] wherein f i represents the i-th frame, t i is the absolute timestamp of the i-th frame after time synchronization, T is the fixed segment length, V k is the k-th segment collection, and N is the total number of segments available in the current cache period.

[0068] After the segment is generated, it is written into the edge storage queue with the ID seg as the file (or message) name, and carries the following metadata: start and end time, frame number, number of interpolated frames, frame rate, and camera pose information, for subsequent feature extraction stage to quickly schedule.

[0069] It should be noted that through the fine organization and storage of video data, the temporal consistency and spatial integrity of the video segment data are effectively ensured, providing a clear, continuous and easy-to-analyze data basis for subsequent abnormal behavior detection, improving the data quality and processing efficiency of the subsequent analysis steps, and avoiding the problem of missed detection or misjudgment of abnormal behavior caused by time and space confusion.

[0070] S2, perform dual-resolution spatio-temporal segmentation on each segment sequence, extract a sparse key frame set and dense optical flow features, and fuse to generate a cross-scale spatio-temporal representation tensor. It should be noted that in this step:

[0071] The total number of frames N all is counted, and a sparse key frame set all is selected according to a fixed step size not greater than N

[0072] Downsample the key frames to half the original resolution to preserve the details and textures;

[0073] Uniformly downsample the remaining non-key frames to one quarter of the original resolution to save computing resources for optical flow estimation;

[0074] For each pair of adjacent non-key frames, a dense optical flow algorithm based on the total variation Lagrangian energy model is used to output a displacement vector field U t ;

[0075] The amplitude ||U t || and direction ∠U t of the optical flow are calculated respectively to prepare for subsequent channel splitting;

[0076] The global brightness average L t and the light intensity I t of the corresponding frames are recorded synchronously as subsequent weight adjustment factors;

[0077] Perform color histogram equalization on the key frames to alleviate the difference in light;

[0078] Stack the processed keyframes in chronological order to form a three-dimensional space-time data block wherein C s is the number of color channels, T s is the number of keyframes, H s and W s are the height and width after downsampling;

[0079] The amplitude and direction of the optical flow are normalized to [0, 1] respectively;

[0080] Form a two-channel optical flow tensor wherein T f is the number of non-keyframes, H f and W f are the spatial resolution of the optical flow tensor;

[0081] Cascade S k and F k in the channel dimension to obtain an initial fusion tensor Z k = Concat(S k , F k );

[0082] Input Z k into a three-dimensional convolutional layer group to perform convolutional downsampling and feature alignment for different spatial resolutions and time steps, and output a unified scale tensor

[0083] wherein C is the number of unified channels, T' is the number of standardized time dimension frames, H' and W' are the unified spatial scale.

[0084] Preferably, by simultaneously capturing local detail features and overall motion pattern features of the video content, dynamic and static information in the monitoring video is fully mined to solve the problem that important motion events are easily ignored in single-scale analysis, and ultimately more accurate and comprehensive traffic behavior feature extraction is realized, improving the sensitivity and accuracy of abnormal behavior feature capture.

[0085] S3, input the space-time representation tensor into a graph attention encoding network trained by mask reconstruction and temporal comparison joint self-supervised training to obtain an embedding vector F t representing traffic behavior. It should be noted that this step is:

[0086] Randomly occlude more than 60% of the voxels of the cross-scale space-time representation tensor, and use a convolution-deconvolution structure to reconstruct the occluded part;

[0087] Form a positive and negative sample pair of the original tensor and its version after time disturbance, and minimize the difference between the two through contrastive learning;

[0088] After the training converges, the embedding vector F of the length not exceeding 256 dimensions representing the traffic behavior is output from the encoding end t .

[0089] In an optional embodiment, the masked reconstruction and timing comparison joint self-supervised training graph attention encoding network comprises:

[0090] A node construction module is configured to generate a traffic participant node according to the detection frame center position, motion speed and category label, and generate a node-to-node edge based on the spatial distance and relative motion direction;

[0091] A multi-head graph attention layer is configured to perform weighted aggregation on node features through multiple attention heads to analyze the interaction relationship between participants;

[0092] Residual feedforward layers and normalization layers are alternately stacked to improve network stability and expression ability;

[0093] A mask auto-encoding substructure is configured to maintain the integrity of the encoding in the case that most of the inputs are occluded.

[0094] It should be noted that by automatically learning the typical patterns of normal behavior in the video data under unsupervised conditions, the manual labeling and data training process of a large number of abnormal samples is avoided, the complex interaction relationship between different targets in the traffic scene is adaptively captured, the labeling cost is significantly reduced, and the generalization ability of the model to complex traffic scenes is improved.

[0095] S4, based on the embedding vector set of the last M time points, a normal behavior model is constructed using online density peak clustering, and the density peak distance D of the current embedding vector F t with respect to the normal behavior model. It should be noted that this step is:

[0096] A ring buffer with a length of M is established at the edge node, and the latest embedding vector is written in real time and the earliest record is eliminated;

[0097] The cosine similarity between vectors is used as the distance measure, and fast neighbor search is performed with all current cluster centers when a new vector is written;

[0098] The local density of all vectors in the buffer is estimated according to the number of neighbors;

[0099] The point with the highest local density in its ε neighborhood and the highest similarity is marked as a peak, which is used as the normal behavior cluster center;

[0100] If the similarity between the new vector and the nearest center is lower than the set lower limit, it is recorded as a new cluster center;

[0101] When the number of centers exceeds the upper limit, according to the similarity threshold between centers, the local density of the lower center is merged to the higher density and the most similar adjacent center from bottom to top;

[0102] The cosine distance between the current embedding vector and the nearest center is calculated first;

[0103] Secondly, the difference between the two local densities is compared;

[0104] The cosine distance and the density difference value are input into the following formula to generate the comprehensive density peak distance D to measure the overall deviation of the current behavior from the normal behavior model;

[0105] D is pushed to the threshold judgment module for subsequent steps of abnormality determination;

[0106] At the same time, the local density of the center is re-estimated as needed to maintain the real-time adaptation of the model to the scene changes.

[0107] As an example, the calculation formula of the comprehensive density peak distance is:

[0108]

[0109] Where A(τ) is the kernel diffusion mapping result of the current embedding vector at the normalized time parameter τ, B

[0110] (τ ′ ) is the corresponding mapping of the nearest cluster center at the normalized time parameter τ ′ , E is the adjustment matrix generated based on the local information entropy, C is the value of the gamma function at half, D q is the q-th dimension component of the current vector after normalization, E q is the corresponding component of the nearest center of the same dimension, β is an index dynamically adjusted according to the observation variance, Ξ is a bias constant based on the evaluation of historical mean shift, Θ is the local density mean value in the sliding window, F s is the confidence weight of the s-th historical density peak, G s is the exponential decay factor of the corresponding peak to the current time, Q and S are the embedding vector dimension and the historical peak count respectively.

[0111] Further, the comprehensive density peak distance D has a value range of [0, +∞), and a value close to 0 indicates that the current behavior highly matches the normal behavior model.

[0112] Preferably, by updating the feature space of normal behavior in real time, the dynamic changes of normal behavior in the traffic monitoring scene are effectively adapted, the real-time changes of the traffic environment are quickly responded, the dynamic tracking of the normal behavior features is realized, the real-time and accuracy of the abnormal behavior detection are improved, and the false positive rate caused by the environmental changes is reduced.

[0113] S5, when the density peak distance D exceeds the threshold value adaptively set according to the P-th quantile of the historical normal score sequence and violates the corresponding scene rule in the traffic behavior rule library, then the segment sequence has abnormal behavior. Wherein, the present step needs to be explained:

[0114] In the edge node, a historical normal score sliding window {D t-i i = 1, …, W} of length W is maintained.

[0115] The P-th percentile is calculated by using the quantile function Q P (·), and the latest threshold value

[0116] Smooth Θ t using the first-order exponential moving average to suppress sudden jitter.

[0117] If D t ≤ Θ t , it is immediately judged as normal and the current round of process is ended.

[0118] If D t > Θ t , the rule library matching stage is entered.

[0119] The target average speed v, the driving direction φ, the cumulative stay time τ, and the signal light state sequence {s j} of all frames in the segment are calculated within the current segment.

[0120] The behavior vector ψ t = [v, φ, τ, Mode({s j})] is generated.

[0121] The traffic behavior rule library R = {R (1) , …, R (5)} is preset, wherein each rule is defined as follows:

[0122] R (1) : reverse driving - the direction deviation |φ-φ road |> δ1.

[0123] R (2) : red light running - the signal light state is red and the speed v > v min .

[0124] R (3) : long time occupying the road - the stay time τ > τ max .

[0125] R (4) : sudden and severe acceleration - the adjacent segment speed increment Δv > a max .

[0126] R (5) : reverse lane change - direction change rate greater than ω max and opposite to the lane direction

[0127] ψ t retrieve R sequentially, record the scene set S that meets the conditions t ;

[0128] if and D t > Θ t , it is determined that the segment V k has abnormal behavior, and a tuple <abnormal type = S t , score = D t , time = t> is generated and pushed to the upper platform

[0129] Otherwise, the segment is marked as normal and continues to write to the downstream archive

[0130] where D t is the integrated density peak distance of the current segment, t is the end time of the segment, W is the length of the history window, Θ t is the smoothed adaptive threshold, ψ t is the current behavior vector feature, is the road reference direction, δ1 is the reverse angle threshold, v min is the red light running speed lower limit, τ max is the road occupation stay upper limit, Δv is the adjacent segment speed increment, a max is the sharp acceleration threshold, ω max is the reverse lane change direction change threshold, R (i) is the i-th scene rule in the rule base, S t is the current matching successful rule set, and V k is the video segment to which it belongs.

[0131] Preferably, the data-driven density distance determination and the rule-driven scene constraint are comprehensively considered in this step, effectively realizing double verification of data analysis and rule constraint, improving the reliability and credibility of abnormal behavior determination, avoiding one-sidedness caused by simply relying on model distance error or simply relying on rule matching, significantly reducing the false positive rate of abnormal behavior recognition, and improving the credibility and applicability of the detection result.

[0132] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the present application, and they should be covered in the scope of the claims of the present application.

Claims

1. An unsupervised abnormal behavior detection method for traffic surveillance video, characterized in that: include: Continuously acquire a surveillance video stream at a preset frame rate from a target road surveillance camera, and divide the video stream into a sequence of segments of length T seconds based on a unified spatiotemporal identifier; Perform dual-resolution spatiotemporal segmentation on each sequence, extract sparse keyframe sets and dense optical flow features, and fuse them to generate a cross-scale spatiotemporal representation tensor; The spatiotemporal tensor is input into the graph attention encoding network through mask reconstruction and temporal comparison combined with self-supervised training to obtain the embedding vector F representing the traffic behavior t ; Based on the embedding vector set of the last M moments, the normal behavior model is constructed using online density peak clustering, and the current embedding vector F is calculated. t Density peak distance D relative to the normal behavior model; When the density peak distance D exceeds a threshold adaptively set according to the Pth quantile of the historical normal score sequence and violates the corresponding scenario rule in the traffic behavior rule library, the segment sequence has abnormal behavior.

2. The unsupervised abnormal behavior detection method for traffic monitoring video according to claim 1 is characterized in that Dividing the video stream into a sequence of segments, including: Using network time synchronization, the original video frames arriving at the buffer are time-sequence corrected; Based on the time interval Δt between adjacent frames, a video segment with a length of T-0.5Δt to T+0.5Δt is captured after synchronization at the hour. A unique segment identifier is generated for each segment, and the segment identifier includes three pieces of information: camera number, segment start time, and segment sequence number.

3. The unsupervised abnormal behavior detection method for traffic monitoring video according to claim 1 or 2, characterized in that: The preset frame rate is set to 25 to 30 frames per second. When it is detected that the number of consecutive frame losses does not exceed two frames, the missing frames are interpolated by linear interpolation, and the interpolation flag is recorded in the frame header metadata.

4. The unsupervised abnormal behavior detection method for traffic monitoring video according to claim 1 or 2, characterized in that: Perform dual-resolution spatiotemporal segmentation on each clip sequence, including: Extracting key frames with a step size no greater than one tenth of the total number of frames in the segment, wherein the key frames maintain half the resolution to preserve detail information; For non-key frames, the resolution is reduced to one-quarter of the original resolution and dense motion vectors are calculated based on the total variational Lagrangian optical flow. At the same time, the light intensity and scene brightness change values ​​are recorded for each frame for weight adjustment in the fusion stage.

5. The unsupervised abnormal behavior detection method for traffic monitoring video according to claim 4 is characterized in that: Fusion generates a cross-scale spatiotemporal representation tensor, including: The color-equalized key frames are stacked in chronological order to form a three-dimensional space-time data block; Split the optical flow amplitude and direction into two channels and normalize them; The three-dimensional space-time data block is cascaded with the optical flow channel, and the feature scale is unified through a three-dimensional convolution operation to obtain a cross-scale space-time representation tensor.

6. The unsupervised abnormal behavior detection method for traffic monitoring video according to claim 5 is characterized in that: The embedding vector F that represents the traffic behavior is obtained t ,include: Randomly occlude more than 60% of the voxels in the cross-scale spatiotemporal representation tensor and use a convolution-deconvolution structure to self-reconstruct the occluded parts; The original tensor and its time-perturbed version form positive and negative sample pairs, and the difference between the two is minimized through contrastive learning; After the training converges, the encoder outputs an embedding vector with a length of no more than 256 dimensions that represents the traffic behavior.

7. The unsupervised abnormal behavior detection method for traffic monitoring video according to claim 6 is characterized in that: The graph attention encoding network trained through mask reconstruction and temporal comparison with self-supervision includes: The node construction module is used to generate traffic participant nodes based on the center position of the detection box, movement speed and category label, and to generate edges between nodes based on spatial distance and relative movement direction; Multi-head graph attention layer, which performs weighted aggregation on node features through multiple attention heads to analyze the interaction relationship between participants; The residual feedforward layer and the normalization layer are stacked alternately to improve the network stability and expression ability; A masked autoencoder substructure is used to maintain encoding integrity when most of the input is occluded.

8. The unsupervised abnormal behavior detection method for traffic monitoring video according to claim 6 is characterized in that: Online density peak clustering is used to build a normal behavior model, including: Maintain a cache pool of embedding vectors at the most recent times, and use the cosine similarity between vectors as the distance metric; Determine the local density peak through nearest neighbor search, and use the peak point to represent the center of the normal behavior cluster; When the similarity between the new embedding vector and the nearest center is lower than the set lower limit, a new cluster center is automatically generated; When the number of cluster centers exceeds the set upper limit, clusters with lower density are merged into adjacent clusters based on the similarity between centers.

9. The unsupervised abnormal behavior detection method for traffic monitoring video according to claim 8, characterized in that: Calculate the current embedding vector F t The density peak distance D relative to the normal behavior model includes: First determine the cosine distance between the current embedding vector and the nearest cluster center; Then compare the local density difference between the two; The cosine distance and density difference are weighted according to the preset weight to obtain the comprehensive density peak distance to measure the degree of deviation between the current behavior and the normal behavior.

10. The unsupervised abnormal behavior detection method for traffic monitoring video according to claim 9 is characterized in that: Determine if there is abnormal behavior in the fragment sequence, including: comparing the density peak distance to a threshold value dynamically updated based on historical normal score series percentiles; If the density peak distance exceeds the threshold, the corresponding trajectory's speed, driving direction, dwell time, and traffic light status statistics are matched with the traffic behavior rule library; The traffic behavior rule library includes five scenarios: driving against traffic, running a red light, staying on the road for a long time, sudden and violent acceleration, and changing lanes against traffic. Each scenario is composed of multiple constraints. If any of the scene constraints are satisfied, the clip has abnormal behavior.

Citation Information

Patent Citations

  • Rail transit video data abnormal behavior detection method and system and medium

    CN117809366A

  • Video abnormal behavior detection method

    CN106228149A

  • Abnormal video detection method and system based on graph neural network

    CN117557962A

  • Traffic video anomaly detection method and system based on dual-condition diffusion model

    CN117789087A

  • Road abnormal event detection and early warning method and system based on unsupervised lifelong learning

    CN119889015A