Rail transit video intelligent analysis method, medium and system

By constructing an adaptive resolution image hierarchical structure and a track scene attention network model, the problems of low efficiency and accurate identification of abnormal behavior in rail transit video surveillance systems when processing high-definition videos under limited computing resources are solved, real-time detection and early warning are achieved, and system performance is improved.

CN120259946BActive Publication Date: 2025-10-21QINGDAO HENGXUN IND & TRADE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510422245.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-10-21
Estimated Expiration
2045-04-07

AI Technical Summary

Technical Problem

Rail transit video surveillance systems have high computational complexity and low efficiency when processing high-definition videos, making it difficult to accurately identify abnormal behavior in real time under limited computing resources.

Method used

An adaptive resolution image hierarchical structure is constructed, and the improved frame difference method and optical flow estimation technology are used to detect moving targets. The track scene attention network model is combined to identify abnormal targets, and the risk level is quantified through the abnormal behavior risk assessment function. A hierarchical processing strategy is implemented to optimize the allocation of computing resources.

Benefits of technology

It significantly reduces computational complexity, improves processing efficiency, realizes real-time detection and early warning of high-definition video, enhances the system's recognition capability in complex environments, and improves the accuracy of abnormal behavior recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259946B_ABST
    Figure CN120259946B_ABST
Patent Text Reader

Abstract

The application provides a rail transit video intelligent analysis method, medium and system, and belongs to the technical field of rail transit.The application constructs a self-adaptive resolution image layered structure, dynamically determines an optimal resolution level based on a minimum spanning tree algorithm, adopts an improved frame difference method combined with an optical flow estimation technology to construct an abnormal target movement matrix, applies a Hungarian algorithm to realize target tracking, constructs an abnormal target change index to evaluate the degree of behavior abnormality, divides monitoring stages according to the vehicle running state to realize scene self-adaptation, introduces a rail scene attention network model to identify abnormal behavior, quantifies the risk level through an abnormal behavior risk evaluation function, implements a hierarchical processing strategy to make the low resolution level responsible for global rapid screening and the high resolution level responsible for fine analysis of key areas, and combines a rail transit abnormal event prediction model to predict the risk trend, so that the technical problems of high calculation amount and low efficiency of high-definition video processing are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of rail transit technology, and in particular relates to a rail transit video intelligent analysis method, medium and system. Background Art

[0002] Rail transit platform security monitoring is a crucial component of urban public transportation systems. Traditional rail transit video surveillance technology primarily relies on fixed-position cameras to capture high-definition video streams and then uses computer vision algorithms for real-time analysis and processing. Existing technologies typically directly process full-resolution video frames, applying frame subtraction, background subtraction, or basic object tracking algorithms to detect anomalies in the image. These methods can meet basic security monitoring requirements under standard video resolutions and ideal environmental conditions.

[0003] However, with the advancement of high-definition camera technology, the resolution of videos captured by rail transit monitoring systems continues to increase, and the computing resources required to directly process high-resolution video data are growing exponentially. Traditional full-frame processing methods significantly increase the computational burden when processing 4K or even 8K video, resulting in system response delays and low processing efficiency. In edge computing environments, limited computing resources make it difficult to support real-time analysis of high-resolution video, increasing the delay in detecting abnormal behavior and reducing the effectiveness of early warning systems.

[0004] Even more challenging is the complex and ever-changing environment of rail transit platforms, characterized by dense crowds and unstable lighting conditions. Directly applying computationally intensive algorithms to process high-definition video is not only inefficient but also difficult to balance real-time and accuracy requirements. Efficiently processing high-resolution video and accurately identifying abnormal behavior in real time within limited computing resources has become a pressing technical challenge for rail transit safety monitoring systems. Summary of the Invention

[0005] In view of this, the present invention provides a rail transit video intelligent analysis method, medium and system, which can solve the technical problems in the prior art that the rail transit video surveillance system has large computational complexity and low efficiency when processing high-definition video, and it is difficult to achieve real-time and accurate identification of abnormal behavior under limited computing resources.

[0006] The present invention is implemented as follows: The first aspect of the present invention provides a rail transit video intelligent analysis method including: constructing an adaptive resolution image hierarchical structure, dynamically determining the optimal number of resolution levels based on a minimum spanning tree algorithm; using an improved frame difference method to calculate the differences between adjacent video frames, and constructing an abnormal target movement matrix; based on the abnormal target movement matrix, calculating the abnormal target movement displacement matrix, and applying the Hungarian algorithm to solve the multi-target matching problem; constructing an abnormal target change index based on the abnormal target movement displacement matrix; dividing the platform monitoring area into four time periods according to the operating status of the rail transit vehicle; introducing a track scene attention network model for abnormal target identification; using an abnormal behavior risk assessment function to quantify the abnormal behavior risk level; based on a hierarchical processing strategy, performing parallel calculations on images of different resolution levels; and dividing the warning level according to the preset risk level based on the detection results and the abnormal target change index.

[0007] The adaptive resolution image hierarchical structure generates a resolution pyramid from the original high-definition video frame through a recursive binary downsampling method, and the resolution of each level is determined by a resolution level evaluation function.

[0008] Among them, the resolution level evaluation function is used to dynamically determine the number of optimal resolution division levels and the resolution parameters of each layer. The input includes the original video resolution, computing resource limitation parameters, target detection accuracy requirement parameters, real-time requirement parameters, and scene complexity score. The output is the optimal number of resolution levels and the specific downsampling ratio of each layer.

[0009] The improved frame difference method is combined with optical flow estimation technology to improve the accuracy of motion detection, and regions with significant changes are screened out through adaptive thresholds.

[0010] Among them, the abnormal target movement matrix refers to a two-dimensional array representing the position information of the moving object in the picture by calculating the pixel difference between adjacent frames of the video. The value of each element represents the degree of change of the pixel point at the corresponding position; the abnormal target movement displacement matrix refers to the record of the position change of the detected abnormal target in multiple consecutive frames of video, which includes two components: horizontal displacement and vertical displacement, and is used to analyze the target motion trajectory.

[0011] Among them, the abnormal target change index refers to a weighted calculation value that comprehensively considers the target size change, speed change and direction change. The higher the value, the more abnormal the target behavior is. The calculation formula is the target size change rate multiplied by the weight coefficient plus the moving speed change rate multiplied by the weight coefficient plus the direction change rate multiplied by the weight coefficient.

[0012] Among them, the track scene attention network model integrates the spatiotemporal attention mechanism and the region proposal network to achieve accurate recognition of human behavior patterns in the platform environment; the specific structure of the track scene attention network model is a spatiotemporal dual attention network based on the improved Transformer architecture, the backbone network adopts a deep residual structure to extract image features, the temporal attention module captures the temporal characteristics of target behavior, the spatial attention module focuses on the key areas of the platform, and the integrated region proposal network improves the small target detection capability. The number of attention heads in the multi-head attention mechanism is dynamically adjusted according to the number of resolution levels output by the resolution level evaluation function, and the dimension of the attention matrix is ​​associated with the abnormal target change index threshold.

[0013] Among them, the platform monitoring area is divided into four time periods: vehicle entry stage, vehicle parking stage, vehicle exit stage, and platform idle stage, and a scenario adaptive analysis strategy is applied.

[0014] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions. When the program instructions are run in a computer, they are used to execute the above-mentioned rail transit video intelligent analysis method.

[0015] The third aspect of the present invention provides a rail transit video intelligent analysis system, which includes the above-mentioned computer-readable storage medium. The system is any one of a computer, a server, and a single-chip microcomputer. The computer-readable storage medium is arranged in the system, and the system is provided with a microprocessor that executes the program instructions stored in the computer-readable storage medium.

[0016] This paper successfully addresses the technical challenges of high-computational complexity and low efficiency in high-definition video processing by constructing an adaptive resolution image hierarchy and layered processing strategy. This method dynamically determines the optimal number of resolution levels using a minimum spanning tree algorithm. It then generates a resolution pyramid using a recursive binary downsampling method for the original high-definition video frames, achieving the optimal allocation and utilization of computing resources.

[0017] Compared to traditional full-resolution processing methods, the layered processing strategy employed in this invention significantly reduces computational complexity. Low-resolution layers are responsible for rapid global screening, while high-resolution layers focus on detailed analysis of key areas. This significantly improves processing efficiency while maintaining detection accuracy. Especially when processing 4K and higher-definition video, computing resource consumption is effectively controlled, system response speed is significantly accelerated, and real-time detection and early warning of abnormal behavior are achieved.

[0018] The present invention also enhances the system's recognition capabilities in complex environments by introducing a scene-adaptive analysis strategy and a track scene attention network model. By adjusting the analysis strategy according to the different operating stages of rail transit vehicles and combining a spatiotemporal dual attention mechanism, the accuracy of abnormal behavior recognition is improved under limited computing resources. Through multi-parameter comprehensive risk assessment, the system can promptly identify potential safety hazards and predict their development trends, providing a scientific basis for safety management. This system design, which balances efficiency and precision, effectively solves the technical problems of high computational complexity and low efficiency in high-definition video processing, and improves the overall performance of the rail transit safety monitoring system. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0021] like Figure 1 FIG. 1 is a flow chart of a method for intelligent analysis of rail transit videos provided by the first aspect of the present invention. The method comprises the following steps:

[0022] S01. Construct an adaptive resolution image hierarchical structure, dynamically determine the optimal number of resolution levels based on the minimum spanning tree algorithm, and generate a resolution pyramid from the original high-definition video frame using a recursive binary downsampling method. The resolution of each level is determined by a resolution level evaluation function.

[0023] S02. Use the improved frame difference method to calculate the difference between adjacent video frames, construct the abnormal target movement matrix, combine the optical flow estimation technology to improve the accuracy of motion detection, and use the adaptive threshold to screen out areas with significant changes;

[0024] S03. Based on the abnormal target motion matrix, calculate the abnormal target motion displacement matrix, apply the Hungarian algorithm to solve the multi-target matching problem in target tracking, and ensure accurate association of position changes of the same target in consecutive frames in complex scenes;

[0025] S04. Constructing an abnormal target change index based on the abnormal target movement displacement matrix, comprehensively evaluating the abnormality of the target behavior through a multi-parameter weighted calculation function, and introducing spatiotemporal context information to enhance the accuracy of anomaly detection;

[0026] S05. Based on the running status of rail transit vehicles, the platform monitoring area is divided into four time periods: vehicle entry phase, vehicle parking phase, vehicle exit phase, and platform idle phase, and a scenario-adaptive analysis strategy is applied;

[0027] S06. Introducing a pre-trained track scene attention network model to identify abnormal targets. The track scene attention network model integrates the spatiotemporal attention mechanism and the region proposal network to achieve accurate recognition of human behavior patterns in the platform environment;

[0028] S07. Using an abnormal behavior risk assessment function, comprehensively calculate the distance parameters between the current abnormal target and the track safety boundary, the target movement speed parameters, the target behavior pattern similarity parameters, the platform congestion parameters, and the vehicle operation stage parameters, quantify the abnormal behavior risk level, and output a normalized risk score and corresponding warning level;

[0029] S08. Based on a layered processing strategy, parallel computing is performed on images at different resolution levels. The low-resolution layer is responsible for global rapid screening, while the high-resolution layer is responsible for detailed analysis of key areas, optimizing the allocation of computing resources.

[0030] S09. Based on the detection results and the abnormal target change index, the warning level is divided according to the preset risk level, and the potential risk development trend is estimated through the rail transit abnormal event prediction model to achieve early risk intervention.

[0031] Among them, the abnormal target movement matrix refers to a two-dimensional array representing the position information of the moving object in the picture by calculating the pixel difference between adjacent frames of the video. Each element value represents the degree of change of the pixel point at the corresponding position.

[0032] Among them, the abnormal target movement displacement matrix refers to the position change of the detected abnormal target in multiple consecutive frames of video, which contains two components: horizontal displacement and vertical displacement, and is used to analyze the target motion trajectory.

[0033] Among them, the abnormal target change index refers to a weighted calculation value that comprehensively considers the target size change, speed change and direction change. The higher the value, the more abnormal the target behavior. The calculation formula is the target size change rate multiplied by the weight coefficient plus the moving speed change rate multiplied by the weight coefficient plus the direction change rate multiplied by the weight coefficient.

[0034] Among them, the resolution level evaluation function is used to dynamically determine the number of optimal resolution division levels and the resolution parameters of each layer. The input includes the original video resolution, computing resource limitation parameters, target detection accuracy requirement parameters, real-time requirement parameters, and scene complexity score. The output is the optimal number of resolution levels and the specific downsampling ratio of each layer.

[0035] Among them, the abnormal behavior risk assessment function is used to quantitatively calculate the risk level of target behavior detected on the platform. The input includes the distance parameter between the target and the track safety boundary, the target movement speed parameter, the target behavior pattern similarity parameter, the platform congestion parameter, and the vehicle operation stage parameter. The output is the normalized risk score and the corresponding warning level.

[0036] Among them, the specific structure of the track scene attention network model is a spatiotemporal dual attention network based on the improved Transformer architecture. The backbone network uses a deep residual structure to extract image features. The temporal attention module captures the temporal characteristics of target behavior. The spatial attention module focuses on the key areas of the platform. The integrated region proposal network improves the small target detection capability. The number of attention heads in the multi-head attention mechanism is dynamically adjusted according to the number of resolution levels output by the resolution level evaluation function. The dimension of the attention matrix is ​​associated with the abnormal target change index threshold.

[0037] Among them, the steps for establishing a training dataset in the rail scene attention network model training process specifically include collecting video data from multiple urban rail transit platforms, classifying and labeling them according to platform congestion, lighting conditions, and platform layout types, constructing a balanced dataset containing normal behavior samples and abnormal behavior samples, performing data enhancement processing for rail transit-specific scenarios, annotating high-risk behavior patterns through expert knowledge guidance, generating spatiotemporal behavior trajectory maps as auxiliary training signals, and establishing a behavior pattern knowledge base to support few-sample learning.

[0038] Among them, the steps of training the rail scene attention network model specifically include adopting a multi-stage training strategy. First, training is performed on a large-scale general behavior recognition dataset to obtain basic feature expression capabilities, and then domain adaptability fine-tuning is performed on the rail transit scene dataset. Then, a contrastive learning mechanism is introduced to improve the model's sensitivity to abnormal behavior. A curriculum learning strategy is adopted to gradually increase the difficulty of training samples. Lightweight models are extracted from complex models through knowledge distillation technology. Finally, end-to-end fine-tuning is performed to optimize model performance.

[0039] Among them, the rail safety boundary distance parameter refers to the shortest distance between the abnormal target and the boundary of the rail transit dangerous area, which is used to assess the possibility of the target entering the dangerous area.

[0040] The target movement speed parameter refers to the ratio of target displacement to time calculated from the abnormal target movement displacement matrix, which indicates the speed of target movement.

[0041] Among them, the target behavior pattern similarity parameter refers to the similarity calculation result between the current detection target behavior characteristics and the high-risk behavior pattern stored in the track scene attention network model.

[0042] Among them, the platform congestion parameter refers to the ratio of the target density in the platform area to the platform's design carrying capacity, reflecting the current passenger density of the platform.

[0043] Among them, the vehicle operation phase parameters refer to the numerical representation of the current operating status of the rail transit vehicle, including four discrete state values: entering the station, stopping, leaving the station, and idle.

[0044] Among them, the rail transit abnormal event prediction model refers to a time series prediction model trained based on historical abnormal event data, which is used to estimate the development trend of abnormal events based on the normalized risk score output by the current abnormal target change index and the abnormal behavior risk assessment function.

[0045] The specific implementation methods of the above steps are described in detail below. The specific implementation method of step S01 is to construct an adaptive resolution image hierarchical structure. First, the original high-definition video resolution is dynamically evaluated by the minimum spanning tree algorithm to calculate the optimal number of resolution levels. In the specific implementation, the original video frame is regarded as a graph node, and the computational cost and precision loss between adjacent resolutions are used as edge weights. The minimum spanning tree is constructed using the Kruskal algorithm. The depth of the tree is the optimal number of levels, which is usually set to 3 to 5 layers. Then, a resolution pyramid is generated by a recursive binary downsampling method. After smoothing each level with a Gaussian filter, a 2×2 area pixel average downsampling is performed to generate an image sequence with decreasing resolution layer by layer. Finally, the specific resolution parameters of each layer are determined by the resolution level evaluation function. The function input includes the original resolution of the video (such as 1920×1080), the computing resource limitation parameters (such as the upper limit of the number of pixels that can be processed per second 10 8 ), target detection accuracy requirements (such as the minimum detectable target size of 0.5% of the screen), real-time requirements (such as a maximum allowable processing delay of 30 milliseconds), and a scene complexity score (normalized from 1 to 10), and outputs the optimal number of resolution layers and the specific downsampling ratio for each layer. This step creates a multi-resolution processing structure, laying the foundation for subsequent efficient analysis.

[0046] The specific implementation of step S02 is to use the improved frame difference method combined with the optical flow estimation technology to detect abnormal moving targets. t and I t-1 Perform Gaussian filter preprocessing to reduce noise interference. Then calculate the inter-frame difference D t (x, y) = |I t (x, y)-I t-1 (x, y)|, generate the difference image. Then apply the adaptive threshold T a =μ D +k·σ D The difference image is binarized, where μD is the mean of the difference image, σ D is the standard deviation, k is the adjustment coefficient, and the recommended value is 2.5 to 3.5. At the same time, the Lucas-Kanade optical flow estimation algorithm is used to calculate the pixel motion vector field and extract the motion direction and speed information. The frame difference result is fused with the optical flow information and the weighted combination M is used. t (x, y) = w1·B t (x, y) + w2·|V t (x, y) | Construct abnormal target movement matrix, where B t (x, y) is the binary frame difference result, V t (x, y) is the magnitude of the optical flow vector, and w1 and w2 are weight coefficients, with recommended values ​​of 0.6 and 0.4, respectively. Finally, morphological operations are applied to the motion matrix to optimize it, using opening operations to eliminate noise and closing operations to fill holes within the target. This step accurately extracts regions of motion within the video frame, providing a foundation for abnormal target detection.

[0047] The specific implementation of step S03 is to calculate the abnormal target movement displacement matrix based on the abnormal target movement matrix and perform multi-target tracking. In the specific implementation, the connected domain analysis algorithm is first applied to the abnormal target movement matrix to extract and mark each independent moving target, and the feature parameters such as the center of mass coordinates, area, and bounding box of each target are calculated. Then, a target feature description vector is established, which includes position, size, color histogram, and texture features. Then, a target matching cost matrix is ​​constructed between consecutive video frames. The matrix element C ij Represents the matching cost between the i-th current target and the j-th historical target, and the calculation formula is C ij =w p ·d pos +w s ·d size +w a ·d app , where d pos is the position distance, d size is the size difference, d app is the appearance similarity, w p 、w s 、w a is the weight coefficient, with recommended values ​​of 0.5, 0.3, and 0.2, respectively. The matching problem is transformed into an assignment problem and solved using the Hungarian algorithm to obtain the optimal matching result. Based on the matching results, the displacement vector of each target between consecutive frames is calculated to form an abnormal target displacement matrix, recording the horizontal and vertical displacements. This step aims to achieve temporal correlation of targets and provide trajectory data for subsequent behavioral analysis.

[0048] The specific implementation of step S04 is to construct an abnormal target change index based on the abnormal target movement displacement matrix. When it is implemented specifically, the target size change rate R is first calculated. size =(A t -A t-1 ) / A t-1 , where A t and A t-1 are the target areas in the current frame and the previous frame respectively. Then calculate the rate of change of moving speed R speed =(V t -V t-1 ) / V t-1 , where V t and V t-1 is the target velocity amplitude. Then calculate the direction change rate R dir =θ t -θ t-1 / π, where θ t and θ t-1 is the target motion direction angle. Combining the above parameters, use the multi-parameter weighted calculation function I change =w1·|R size |+w2·|R speed |+w3·|R dir |Calculate the abnormal target change index, where w1, w2, and w3 are weight coefficients, with recommended values ​​of 0.3, 0.4, and 0.3, respectively. Introduce spatiotemporal context information for adjustment, build a spatiotemporal memory module to record the target's historical behavior pattern, calculate the degree of deviation between the current behavior and the historical pattern, and correct the change index. Set the change index threshold T change = 0.4. If the threshold is exceeded, it is marked as a potential abnormal behavior. This step is used to quantify the abnormality of the target behavior and achieve preliminary detection of abnormal behavior.

[0049] The specific implementation of step S05 is to divide the monitoring phases according to the operating status of rail transit vehicles and apply a scenario-adaptive analysis strategy. In specific implementation, a vehicle status recognition module is first established to determine the current vehicle operating status by analyzing video content or receiving signals from an external dispatching system. The platform monitoring area is then divided into four time periods: the vehicle arrival phase (the train is about to enter the platform), the vehicle parking phase (the train is parked at the platform to allow passengers to board and exit), the vehicle departure phase (the train is about to leave the platform), and the platform idle phase (no train on the platform). Differentiated analysis strategies are then designed for each phase: during the arrival phase, the platform edge area is monitored to detect whether people waiting outside the yellow line cross the line, with the focus set to the platform yellow line and the platform edge area; during the parking phase, the boarding and alighting area is monitored to identify abnormal situations such as passengers staying at the door or falling, with the focus set to the area around the door; during the departure phase, the gap between people and vehicles is monitored to prevent passengers from chasing the train, with the focus set to the gap between the platform edge and the train; during the idle phase, the platform area is fully monitored to detect abnormal detention and suspicious behavior, with the focus covering the entire platform area. Through scenario-adaptive analysis strategies, detection parameters and alarm thresholds are dynamically adjusted to improve system relevance and accuracy. This step aims to achieve a precise match between monitoring strategies and actual scenarios.

[0050] The specific implementation of step S06 involves introducing a pre-trained track scene attention network model for abnormal target identification. During implementation, the pre-trained track scene attention network model is first loaded. This model uses a spatiotemporal dual attention network structure based on the Transformer architecture. The detected abnormal target region is then cropped and resized to a standard input size (e.g., 224×224 pixels) and input into the model for feature extraction and behavior recognition. The model uses a temporal attention module to capture temporal features, processing multiple frames (typically 16 to 32 frames) of target images to extract action patterns. Simultaneously, the spatial attention module focuses on key regions within the target, such as key points or characteristic features of the human body. An integrated region proposal network improves small target detection capabilities, generates candidate regions, and classifies them. The model output includes behavior category predictions and confidence scores. Behavior categories include normal (e.g., standing, walking, waiting for a train) and abnormal (e.g., climbing over a guardrail, remaining on the edge of the track, falling off the platform, etc.). The behavior recognition confidence threshold is set to 0.75; if the threshold is exceeded, the behavior is confirmed as belonging to the corresponding behavior category. The purpose of this step is to accurately identify the behavior patterns of people in the platform environment and provide support for abnormal behavior identification.

[0051] The specific implementation of step S07 is to use the abnormal behavior risk assessment function to quantitatively calculate the risk level of the target behavior detected in the platform. In the specific implementation, first calculate the distance parameter D between the target and the track safety boundary track, measure the vertical distance from the target's center of mass to the platform's safety boundary, and normalize it to a value of 0 to 1. The smaller the distance, the higher the risk. Then calculate the target movement speed parameter V obj , extract the displacement data from the abnormal target movement displacement matrix, calculate the velocity vector amplitude and normalize it. Then calculate the target behavior pattern similarity parameter S pattern , compare the current target behavior characteristics with the predefined high-risk behavior pattern library, and use cosine similarity to calculate the similarity. Then calculate the platform congestion parameter C platform , calculate the ratio of the number of targets per unit area to the preset safety capacity. Finally, combine the vehicle operation phase parameter P phase (Entering is 0.9, stopping is 0.7, leaving is 0.8, and idle is 0.5), using the risk assessment function R risk =w1·(1-D track )+w2·V obj +w3·S pattern +w4·C platform +w5·P phase Calculate a normalized risk score, where w1 to w5 are weight coefficients, with recommended values ​​of 0.35, 0.25, 0.2, 0.1, and 0.1, respectively. Set risk level thresholds: 0-0.3 for low risk (green alert), 0.3-0.6 for medium risk (yellow alert), 0.6-0.8 for high risk (orange alert), and 0.8-1 for extremely high risk (red alert). This step aims to quantitatively assess and categorize the risk of abnormal behavior.

[0052] The specific implementation of step S08 is to perform parallel computations on images at different resolution levels based on a hierarchical processing strategy. In specific implementation, images at different resolution levels are first assigned to parallel processing units based on the resolution pyramid constructed in step S01. A global rapid screening is then performed at a low-resolution level (e.g., 1 / 4 or 1 / 8 of the original resolution), using a lightweight object detection algorithm (such as a modified YOLOv3 or SSD) for rough detection and rapid location of potential anomaly areas. Simultaneously, a preliminary analysis of identified key areas is performed at a medium-resolution level (e.g., 1 / 2 of the original resolution) to extract more detailed target features. Finally, a detailed analysis of areas identified as requiring attention is performed at the high-resolution level (original resolution), using a high-precision but computationally complex algorithm (such as a modified Faster R-CNN) for precise identification. A result fusion strategy is employed to integrate the processing results of each level through a weighted voting mechanism to improve detection reliability. The allocation ratio of computing resources to each level is dynamically adjusted, adaptively allocating computing resources based on the current scene complexity and the urgency of the anomaly event, ensuring sufficient processing power for critical areas. The purpose of this step is to optimize the allocation of computing resources and balance the requirements of real-time performance and accuracy.

[0053] The specific implementation of step S09 involves assigning warning levels and performing risk prediction based on the detection results and the abnormal target change index. In practice, the aforementioned analysis results, including the abnormal target change index and abnormal behavior risk score, are first summarized. Warning levels are then assigned based on preset risk thresholds, and corresponding warning signals are generated. Next, a rail transit abnormal event prediction model is invoked to perform trend prediction. This model utilizes a long short-term memory (LSTM) architecture. Its inputs include the current abnormal target change index time series (typically the past 10 to 30 seconds) and the abnormal behavior risk score series. It outputs a predicted risk score and confidence interval for the next 5 to 15 seconds. The predicted risk trend is determined based on the prediction results. If the predicted risk score shows an upward trend and exceeds the warning threshold, an escalation mechanism is triggered. A risk warning report is also generated, containing information such as the abnormal target location, behavior type, risk level, and predicted trend. Different response measures are then taken based on the warning level: low risk continues to be monitored, medium risk notifies the on-duty personnel, high risk activates the emergency plan, and extremely high risk triggers automatic intervention measures (such as broadcasting a reminder or instructing the train to slow down). This step aims to provide timely risk warning and early intervention, preventing risks before they occur.

[0054] The specific structure of the track scene attention network model adopts a spatiotemporal dual attention network based on the improved Transformer architecture. In terms of structural design, the backbone network of the model uses a deep residual structure (ResNet50 or ResNet101) to extract image features, and extracts multi-scale spatial features in parallel through 3×3, 5×5, and 7×7 multi-scale convolution filters to capture target features of different sizes. The temporal attention module is based on the self-attention mechanism, processes a continuous 16-frame input sequence, calculates the inter-frame relationship weight matrix, and strengthens the key moment feature expression. The module contains a position encoding layer, a multi-head self-attention layer, and a feedforward network layer. The position encoding uses a sine-cosine function to generate a temporal position representation. The spatial attention module constructs a pixel-level attention map to highlight key areas of the platform (such as the edge of the platform, the escalator entrance, and the door docking point). The module uses a non-local neural network structure to calculate spatial position correlation. The region proposal network uses an anchor frame scale of {32 2 , 64 2 , 128 2 , 256 2 , 512 2}, with aspect ratios of {0.5, 1.0, 2.0}, to improve small object detection capabilities. In the multi-head attention mechanism, the number of attention heads is dynamically adjusted based on the number of resolution levels output by the resolution level evaluation function, typically set to 4 to 8 heads. Each head independently learns a different feature subspace representation. The output features of each module are integrated through a feature fusion network to generate a target behavior feature vector. The behavior classifier uses a fully connected layer structure to output a probability distribution of behavior categories.

[0055] The specific implementation steps for establishing a training dataset for the rail scene attention network model include data collection and annotation, data classification and enhancement, expert knowledge-guided annotation, construction of auxiliary training signals, and establishment of a knowledge base. During the data collection and annotation phase, video data from multiple urban rail transit platforms was collected, covering different time periods (morning rush hour, evening rush hour, and off-peak period), different weather conditions (sunny, rainy, foggy), and different lighting environments (daytime, dusk, and nighttime). The sampling rate was 25 frames per second, the resolution was 1920×1080, and the continuous data collection time for a single platform was no less than 72 hours. During the data classification and annotation phase, the platform was classified and annotated according to platform congestion (low, medium, and high), lighting conditions (standard lighting, low light, and high light), and platform layout type (side platform, island platform, and composite platform). A dataset containing 90% normal behavior samples and 10% abnormal behavior samples was constructed. During the data enhancement processing stage, brightness adjustment (±20%), contrast transformation (±15%), random cropping (80% to 100% of the original size), horizontal flipping, rotation (±10°) and other enhancement processes are performed for rail transit-specific scenes, expanding the size of the dataset to five times the original data. During the expert knowledge-guided annotation stage, rail transit safety experts are invited to annotate high-risk behavior patterns, including abnormal behaviors such as approaching the platform edge, running fast, climbing over guardrails, and falling to the ground, and a temporal behavior pattern description is established for each behavior. During the auxiliary training signal construction stage, a spatiotemporal behavior trajectory map is generated to record the target's movement trajectory, speed changes, and behavior state transitions on the platform as auxiliary supervision signals for model training. During the knowledge base establishment stage, a behavior pattern knowledge base is constructed, which contains rule-defined descriptions of typical abnormal behaviors and data-driven behavior pattern embedding vectors to support few-shot learning and zero-shot recognition capabilities.

[0056] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions. When the program instructions are run in a computer, they are used to execute the above-mentioned rail transit video intelligent analysis method.

[0057] The third aspect of the present invention provides a rail transit video intelligent analysis system, which includes the above-mentioned computer-readable storage medium. The system is any one of a computer, a server, and a single-chip microcomputer. The computer-readable storage medium is arranged in the system, and the system is provided with a microprocessor that executes the program instructions stored in the computer-readable storage medium.

[0058] The mathematical model or calculation process involved in the present invention is described in detail below.

[0059] In step S02, the calculation process of detecting abnormal moving targets by combining the improved frame difference method with the optical flow estimation technology is specifically expressed as follows:

[0060] D t (x, y) = |I t (x, y)-I t-1 (x, y)|;

[0061] Where D t (x, y) is the pixel value of the difference image; I t (x, y) is the pixel value of the current frame at the coordinate (x, y); I t-1 (x, y) is the pixel value at the same coordinate in the previous frame; |·| represents the absolute value operation.

[0062] The adaptive threshold calculation formula is:

[0063] T a =μ D +k·σ D ;

[0064] Where, T a is the adaptive threshold; μ D is the difference image D t The mean of D is the difference image D t The standard deviation of k is the adjustment coefficient, which ranges from 2.5 to 3.5.

[0065] The mean μ of the difference image D Calculated by the following formula:

[0066]

[0067] Where W and H are the width and height of the image respectively; Indicates that the sum is performed over the entire image area.

[0068] Standard deviation σ D Calculated by the following formula:

[0069]

[0070] Where, Represents the square root operation.

[0071] The binarization formula is:

[0072]

[0073] Where B t (x, y) is the binarized image, where a value of 1 indicates that motion is detected at the pixel, and a value of 0 indicates that no motion is detected at the pixel.

[0074] The calculation of the optical flow vector field uses the Lucas-Kanade algorithm, whose basic principle is to solve the optical flow constraint equation:

[0075]

[0076] Where, and are the gradients of the image in the x and y directions respectively; is the gradient in the time direction; u and v are the optical flow velocity components in the horizontal and vertical directions respectively.

[0077] By assuming that the optical flow velocity is uniform in the small window area and applying the least squares method to solve the overdetermined equations, the optical flow vector field V is obtained. t (x, y):

[0078]

[0079] Where V t (x, y) represents the magnitude of the optical flow vector at the coordinate (x, y); u(x, y) and v(x, y) are the horizontal and vertical optical flow velocity components of the point, respectively.

[0080] Finally, the abnormal target movement matrix is ​​calculated by weighted combination:

[0081] M t (x, y) = w1·B t (x, y) + w2·V t (x, y);

[0082] Where M t (x, y) is the element of the abnormal target motion matrix; w1 and w2 are weight coefficients, with recommended values ​​of 0.6 and 0.4 respectively. The purpose of the weighted combination is to combine the robustness of the frame difference method with the precision of the optical flow method to improve the accuracy of motion detection.

[0083] In step S03, the target matching cost matrix is ​​calculated as follows:

[0084] C ij =w p ·d pos (i, j)+w s ·d size (i, j)+w a ·d app (i, j);

[0085] Where C ij represents the matching cost between the i-th current target and the j-th historical target; d pos (i, j) is the position distance; d size (i, j) is the size difference; d app(i, j) is the appearance similarity; w p 、w s 、w a is the weight coefficient, and the recommended values ​​are 0.5, 0.3, and 0.2 respectively.

[0086] Position distance d pos The calculation formula for (i, j) is:

[0087]

[0088] In the formula, (x i ,y i ) and (x j ,y j ) are the centroid coordinates of the current target i and the historical target j respectively; d max is a normalization factor, usually set to 0.2 times the length of the image diagonal.

[0089] Size difference d size The calculation formula for (i, j) is:

[0090]

[0091] Where A i and A j are the areas of the current target i and the historical target j respectively; min(·,·) and max(·,·) represent the minimum and maximum value operations respectively.

[0092] Appearance similarity d app (i, j) is calculated using histogram similarity:

[0093]

[0094] Where H i and H j are the color histograms of the current target i and the historical target j respectively; n is the number of bins in the histogram, which is usually set to 64.

[0095] The Hungarian algorithm is used to solve the following optimization problem:

[0096]

[0097] Where, X ij is the assignment variable, which is 1 when the i-th current target matches the j-th historical target, otherwise it is 0; m and n are the number of targets in the current frame and the historical frame, respectively.

[0098] Based on the matching results, the abnormal target displacement matrix D t The calculation is as follows:

[0099]

[0100] Where D t (i) is the displacement vector of the i-th target; Δx i and Δy i are the displacements in the horizontal and vertical directions respectively; and are the center of mass coordinates of the target in the current frame and the previous frame respectively.

[0101] In step S04, the calculation process of the abnormal target change index is specifically expressed as follows:

[0102] Target size change rate calculation formula:

[0103]

[0104] Where R size (i) is the size change rate of the i-th target; and are the areas of the target in the current frame and the previous frame respectively.

[0105] The formula for calculating the rate of change of moving speed is:

[0106]

[0107] Where R speed (i) is the speed change rate of the i-th target; and are the velocity amplitudes of the target in the current frame and the previous frame, respectively, calculated by the displacement vector: Where Δt is the time interval between adjacent frames.

[0108] The formula for calculating the rate of change of direction is:

[0109]

[0110] Where R dir (i) is the direction change rate of the i-th target; and are the target's motion direction angles in the current frame and the previous frame, respectively, calculated using the displacement vector: Where arctan2 is the four-quadrant inverse tangent function.

[0111] Comprehensive calculation formula for abnormal target change index:

[0112] I change (i)=w1·|R size (i)|+w2·|R speed (i)|+w3·|R dir (i)|+∈;

[0113] Where, I change (i) is the abnormal change index of the i-th target; w1, w2, and w3 are weight coefficients, with recommended values ​​of 0.3, 0.4, and 0.3, respectively; |·| represents the absolute value operation; ∈ is the noise correction term, with a value range of 0.05 to 0.1, which is used to prevent the denominator from being zero and enhance the robustness of the algorithm.

[0114] The calculation formula of the abnormal change index after introducing the spatiotemporal context correction is:

[0115]

[0116] Where, is the modified abnormal change index; D hist (i) is the degree of deviation between the target behavior and the historical behavior pattern, ranging from 0 to 1; α is the adjustment coefficient, and the recommended value is 0.5.

[0117] Degree of deviation D hist The calculation of (i) adopts recursive update method:

[0118]

[0119] Where, is the historical deviation value of the previous moment; D curr (i) is the difference between the current observation and the historical pattern; β is the smoothing coefficient, and the recommended value is 0.7.

[0120] In step S07, the calculation process of the abnormal behavior risk assessment function is specifically expressed as follows:

[0121] Calculation formula for the distance parameter between the target and the track safety boundary:

[0122]

[0123] Where D track (i) is the orbital safety boundary distance parameter of the i-th target; d i is the vertical distance from the target center of mass to the platform safety boundary (meters); d safe is the safety distance threshold, and the recommended value is 1.5 meters.

[0124] Target moving speed parameter calculation formula:

[0125]

[0126] Where V obj (i) is the moving speed parameter of the i-th target; v i is the target velocity amplitude (m / s); v max is the speed threshold, the recommended value is 3 m / s.

[0127] Target behavior pattern similarity parameter calculation formula:

[0128]

[0129] Where S pattern (i) is the behavior pattern similarity parameter of the i-th target; f i is the target current behavior feature vector; is the jth predefined high-risk behavior pattern feature vector; k is the number of patterns in the risk behavior pattern library; · represents the vector inner product operation; |·| represents the vector norm operation.

[0130] The calculation formula of platform congestion parameter is:

[0131]

[0132] Where C platform is the platform congestion parameter; n obj is the number of targets in the current platform area; A platform is the effective area of ​​the platform (square meters); safe The recommended safe density threshold is 1.5 people per square meter.

[0133] Vehicle operation phase parameter P phase The discrete values ​​of are set as follows:

[0134] Pit stop phase: P phase =0.9;

[0135] Docking phase: P phase =0.7;

[0136] Outbound stage: P phase =0.8;

[0137] Idle phase: P phase =0.5;

[0138] Comprehensive calculation formula of abnormal behavior risk assessment function:

[0139] R risk (i) = w1·(1-D track (i))+w2·V obj (i)+w3·S pattern (i)+w4·C platform +w5·P phase +δ;

[0140] Where R risk(i) is the normalized risk score of the i-th objective; w1 to w5 are weight coefficients, with recommended values ​​of 0.35, 0.25, 0.2, 0.1, and 0.1, respectively; δ is a random disturbance term with a value range of -0.05 to 0.05, which is used to prevent over-determinism in risk assessment.

[0141] The abnormal behavior risk assessment function adopts the form of weighted linear combination, taking into account multiple factors: the track distance parameter adopts the inverse relationship (1-D track ) is because the smaller the distance, the higher the risk, which is in line with the safety characteristics of rail transit; the speed parameter adopts linear positive correlation because high-speed movement usually means higher risk in a platform environment; the behavior pattern similarity adopts cosine similarity calculation to capture the pattern matching of behavior characteristics in high-dimensional space; the congestion parameter and vehicle operation phase parameter are environmental factors, which affect the overall risk assessment through linear combination.

[0142] In the rail transit abnormal event prediction model, risk trend prediction uses LSTM network, and the prediction equation is as follows:

[0143]

[0144] Where, R is the predicted risk score for the future time t+Δt; t-kτ (i) and are the risk score and the modified abnormal change index at the past time t-kτ respectively; τ is the sampling time interval; T is the length of the historical sequence; f LSTM is the LSTM network model function.

[0145] The formula for calculating the prediction confidence interval is:

[0146]

[0147] Where R lower (i) and R upper (i) are the lower and upper bounds of the predicted risk score, respectively; z α / 2 is the critical value of the normal distribution, which is about 1.96 when the confidence level is 95%; R is the standard deviation of the predicted risk score, estimated by historical prediction errors.

[0148] Optionally, the calculation process of the resolution level evaluation function is specifically expressed as follows:

[0149]

[0150] Where, L opt is the number of optimal resolution levels; L max The maximum number of levels allowed is usually set to 8; C comp(L) is the computing resource consumption function; E acc (L) is the detection accuracy loss function; T real (L) is the real-time loss function; S complex is the scene complexity score; w1, w2, w3, and w4 are weight coefficients, and the recommended values ​​are 0.3, 0.3, 0.3, and 0.1 respectively.

[0151] Optionally, calculate the resource consumption function formula:

[0152]

[0153] Where W0 and H0 are the width and height (pixels) of the original video frame respectively; -i represents the resolution reduction factor of the i-th layer; c i Calculate the complexity coefficient for the unit pixel of the i-th layer; C max It is the upper limit parameter of computing resources.

[0154] Optional, the calculation formula of the detection accuracy loss function is:

[0155]

[0156] Where s min is the minimum detectable target size (pixel area); 0.005·W0·H0 is the target detection accuracy requirement parameter, which means the pixel area corresponding to the minimum detectable target occupying 0.5% of the screen ratio.

[0157] Optional, real-time loss function calculation formula:

[0158]

[0159] Where, t i is the time required for layer i processing (milliseconds); T max The maximum allowed processing delay parameter (in milliseconds).

[0160] Optionally, the calculation formula for determining the specific downsampling ratio of each layer is:

[0161]

[0162] Where r i is the downsampling ratio of the i-th layer; r0=1 represents the original resolution; r min is the minimum resolution ratio, usually set to 0.125; Indicates a round-up operation.

[0163] Optionally, the actual resolution of each layer is calculated as follows:

[0164]

[0165] Where W i and H i are the width and height of the i-th layer image respectively; Indicates a floor operation.

[0166] The design of the resolution level evaluation function adheres to the principle of balancing computational efficiency and detection accuracy, and uses a multi-objective optimization method to solve for the optimal level configuration. The function uses a weighted summation approach, taking into account multiple factors such as computational resource constraints, target detection accuracy requirements, real-time requirements, and scene complexity, achieving adaptive optimization of the resolution level.

[0167] Specifically, the principle of the present invention is as follows: The core technical principle of the present invention to solve the problem of large computational complexity and low efficiency in high-definition video processing lies in adopting the idea of ​​"divide and conquer" and optimizing the allocation of computing resources through a multi-resolution hierarchical collaborative analysis framework. First, the invention introduces an adaptive resolution image layered structure, and dynamically determines the optimal number of resolution levels based on the minimum spanning tree algorithm, thereby avoiding the problem of resource waste or insufficient accuracy caused by fixed levels. The resolution level evaluation function comprehensively considers factors such as the original resolution of the video, computing resource limitations, and target detection accuracy requirements, and scientifically decides the specific downsampling ratio of each layer, providing a mathematical basis for the system.

[0168] In terms of computing resource allocation, this invention adopts a hierarchical processing strategy to achieve parallel computing and improve processing efficiency through task decomposition. The low-resolution layer uses a computationally inefficient algorithm to perform global rapid screening, locating potential anomalies in a short period of time. The high-resolution layer focuses on detailed analysis of key areas, processing only the valuable image portions, avoiding the full calculation of the entire high-definition image and significantly reducing computational complexity. This resource allocation strategy enables the system to process high-resolution video under limited computing conditions, achieving a balance between computational efficiency and detection accuracy.

[0169] Another technical innovation of this invention is the introduction of an improved target detection and tracking algorithm. This algorithm uses optical flow estimation to improve motion detection accuracy, applies the Hungarian algorithm to solve multi-target matching problems, and constructs motion and displacement matrices for abnormal targets. These optimization algorithms reduce computational complexity while improving detection accuracy. In particular, the track scene attention network model, based on a spatiotemporal dual attention network with an improved Transformer architecture, intelligently focuses on key areas and behavioral features, avoiding redundant computation of irrelevant information.

[0170] The risk assessment phase utilizes a multi-parameter weighted calculation function to quantitatively analyze the risk of abnormal behavior. Based on the unique characteristics of the platform environment, the system designed an assessment model that incorporates key parameters such as the distance between the target and the track safety boundary and movement speed, enabling risk level determination at a low computational cost. Furthermore, the rail transit abnormal event prediction model estimates risk trends based on current data, providing a basis for early intervention. This multi-level, lightweight analysis framework fundamentally addresses the technical challenges of high-computational complexity and low efficiency in high-definition video processing, enabling efficient and reliable intelligent analysis of rail transit video.

[0171] A specific embodiment 1 of the present invention is provided below. The specific implementation of each step in this embodiment 1 is described in detail as follows.

[0172] The specific implementation of step S01 is to construct an adaptive resolution image hierarchical structure. First, the original high-definition video resolution is dynamically evaluated using the minimum spanning tree algorithm to calculate the optimal number of resolution levels. In specific implementation, the original video frames are regarded as graph nodes, and the computational cost and accuracy loss between adjacent resolutions are used as edge weights. The minimum spanning tree is constructed using the Kruskal algorithm. The depth of the tree is the optimal number of levels, which is usually set to 3 to 5 layers. The optimal number of resolution levels is determined by the following optimization formula: Where, L opt is the number of optimal resolution levels; L max The maximum number of levels allowed is usually set to 8; C comp (L) is the computing resource consumption function; E acc (L) is the detection accuracy loss function; T real (L) is the real-time loss function; S complex is the scene complexity score, with a normalized value ranging from 1 to 10; w1, w2, w3, and w4 are weight coefficients, with recommended values ​​of 0.3, 0.3, 0.3, and 0.1 respectively. The resource consumption function is calculated using the formula Calculate, where W0 and H0 are the width and height of the original video frame respectively; 4 -i represents the resolution reduction factor of the i-th layer; c i Calculate the complexity coefficient for the unit pixel of the i-th layer; C max is the upper limit parameter of computing resources. The detection accuracy loss function is Where s min is the minimum detectable target size; 0.005·W0·H0 is the target detection accuracy requirement parameter. The real-time loss function is Where, t i is the time required for layer i processing; T maxis the maximum allowable processing delay parameter. Then, a recursive binary downsampling method is used to generate a resolution pyramid. After smoothing each level with a Gaussian filter, 2×2 area pixel average downsampling is performed to generate an image sequence with decreasing resolution layer by layer. The specific downsampling ratio of each layer is determined by the formula Determine, where r i is the downsampling ratio of the i-th layer; r0=1 represents the original resolution; r min is the minimum resolution ratio, usually set to 0.125. The actual resolution of each layer is calculated as Where W i and H i are the width and height of the i-th layer image respectively. This step is used to create a multi-resolution processing structure, laying the foundation for subsequent efficient analysis.

[0173] The specific implementation of step S02 is to use the improved frame difference method combined with the optical flow estimation technology to detect abnormal moving targets. t and I t-1 Perform Gaussian filter preprocessing to reduce noise interference. Then calculate the inter-frame difference D t (x, y) = |I t (x, y)-I t-1 (x, y)|, generate the difference image, where D t (x, y) is the pixel value of the difference image; I t (x, y) is the pixel value of the current frame at the coordinate (x, y); I t-1 (x, y) is the pixel value at the same coordinate in the previous frame; |·| represents the absolute value operation. Then apply the adaptive threshold T a =μ D +k·σ D The difference image is binarized, where T a is the adaptive threshold; μ D is the difference image D t The mean of D is the difference image D t The standard deviation of the difference image is μ; k is the adjustment coefficient, ranging from 2.5 to 3.5. D By formula Calculate, where W and H are the width and height of the image respectively. Standard deviation σ D By formula Calculation. The binary processing formula is Where B t (x, y) is the binarized image. At the same time, the Lucas-Kanad optical flow estimation algorithm is used to calculate the pixel motion vector field and solve the optical flow constraint equation. Where, and are the gradients of the image in the x and y directions respectively; is the gradient in the time direction; u and v are the optical flow velocity components in the horizontal and vertical directions respectively. The optical flow vector amplitude is calculated by the formula Calculation. The frame difference result is fused with the optical flow information, and the weighted combination M t (x, y) = w1·B t (x, y) + w2·V t (x, y) constructs the abnormal target movement matrix, where M t (x, y) represents the elements of the abnormal target motion matrix; w1 and w2 are weight coefficients, with recommended values ​​of 0.6 and 0.4, respectively. Finally, morphological operations are applied to the motion matrix to optimize it, using opening operations to eliminate noise and closing operations to fill holes within the target. This step accurately extracts regions of motion within the video frame, providing a foundation for abnormal target detection.

[0174] The specific implementation of step S03 is to calculate the abnormal target movement displacement matrix based on the abnormal target movement matrix and perform multi-target tracking. In the specific implementation, the connected domain analysis algorithm is first applied to the abnormal target movement matrix to extract and mark each independent moving target, and the feature parameters such as the center of mass coordinates, area, and bounding box of each target are calculated. Then, a target feature description vector is established, which includes position, size, color histogram, and texture features. Then, a target matching cost matrix is ​​constructed between consecutive video frames. The matrix element calculation formula is C ij =w p ·d pos (i, j)+w s ·d size (i, j)+w a ·d app (i, j), where C ij represents the matching cost between the i-th current target and the j-th historical target; d pos (i, j) is the position distance; d size (i, j) is the size difference; d app (i, j) is the appearance similarity; w p 、w s 、w a is the weight coefficient, and the recommended values ​​are 0.5, 0.3, and 0.2 respectively. The position distance calculation formula is In the formula, (x i ,y i ) and (x j ,y j ) are the centroid coordinates of the current target i and the historical target j respectively; d maxis a normalization factor, usually set to 0.2 times the diagonal length of the image. The size difference calculation formula is Where A i and A j are the areas of the current target i and the historical target j respectively. The appearance similarity is calculated using histogram similarity: Where H i and H j are the color histograms of the current target i and the historical target j respectively; n is the number of bins in the histogram, which is usually set to 64. The matching problem is transformed into an assignment problem, and the Hungarian algorithm is applied to solve it to obtain the optimal matching result and solve the optimization problem. Satisfy constraints Where, X ij Based on the matching results, the displacement vector of each target between consecutive frames is calculated to form the abnormal target movement displacement matrix Where D t (i) is the displacement vector of the i-th target; Δx i and Δy i are the displacements in the horizontal and vertical directions respectively; and are the center of mass coordinates of the target in the current frame and the previous frame respectively. This step is used to achieve temporal association of the target and provide trajectory data for subsequent behavior analysis.

[0175] The specific implementation of step S04 is to construct an abnormal target change index based on the abnormal target movement displacement matrix. When implementing it specifically, first calculate the target size change rate Where R size (i) is the size change rate of the i-th target; and are the area of ​​the target in the current frame and the previous frame respectively. Then calculate the rate of change of moving speed Where R speed (i) is the speed change rate of the i-th target; and are the velocity amplitudes of the target in the current frame and the previous frame, respectively, calculated by the displacement vector: Where Δt is the time interval between adjacent frames. Then calculate the direction change rate Where R dir (i) is the direction change rate of the i-th target; and are the target's motion direction angles in the current frame and the previous frame, respectively, calculated using the displacement vector: Among them, arctan2 is the four-quadrant inverse tangent function. Combining the above parameters, the multi-parameter weighted calculation function I is used change(i)=w1·|R size (i)|+w2·|R speed (i)|+w3·|R dir (i)|+∈Calculate the abnormal target change index, where I change (i) is the abnormal change index of the i-th target; w1, w2, and w3 are weight coefficients, with recommended values ​​of 0.3, 0.4, and 0.3 respectively; |·| represents absolute value operation; ∈ is the noise correction term, with a value range of 0.05 to 0.1. The spatial and temporal context information is introduced for adjustment and the corrected abnormal change index is calculated. Where, is the modified abnormal change index; D hist (i) is the degree of deviation between the target behavior and the historical behavior pattern, ranging from 0 to 1; α is the adjustment coefficient, with a recommended value of 0.5. The degree of deviation is calculated by recursive updating: Where, is the historical deviation value of the previous moment; D curr (i) is the difference between the current observation and the historical pattern; β is the smoothing coefficient, and the recommended value is 0.7. Set the change index threshold T change = 0.4. If the threshold is exceeded, it is marked as a potential abnormal behavior. This step is used to quantify the abnormality of the target behavior and achieve preliminary detection of abnormal behavior.

[0176] The specific implementation of steps S05-S06 is the same as above and will not be repeated here.

[0177] The specific implementation of step S07 is to use the abnormal behavior risk assessment function to quantitatively calculate the risk level of the target behavior detected in the platform. When implementing it specifically, first calculate the distance parameter between the target and the track safety boundary Where D track (i) is the orbital safety boundary distance parameter of the i-th target; d i is the vertical distance from the target center of mass to the platform safety boundary (meters); d safe is the safety distance threshold, the recommended value is 1.5 meters. Then calculate the target moving speed parameter Where V obj (i) is the moving speed parameter of the i-th target; v i is the target velocity amplitude (m / s); v max is the speed threshold, the recommended value is 3 m / s. Then calculate the target behavior pattern similarity parameter Where S pattern (i) is the behavior pattern similarity parameter of the i-th target; f i is the target current behavior feature vector; is the jth predefined high-risk behavior pattern feature vector; k is the number of patterns in the risk behavior pattern library. Then calculate the platform congestion parameter Where C platform is the platform congestion parameter; n obj is the number of targets in the current platform area; A platform is the effective area of ​​the platform (square meters); safe is the safety density threshold, and the recommended value is 1.5 people per square meter. Finally, combined with the vehicle operation phase parameter P phase (Entering is 0.9, stopping is 0.7, leaving is 0.8, and idle is 0.5), using the risk assessment function R risk (i) = w1·(1-D track (i))+w2·V obj (i)+w3·S pattern (i)+w4·C platform +w5·P phase +δ to calculate the normalized risk score, where R risk (i) is the normalized risk score of the i-th target; w1 to w5 are weight coefficients, with recommended values ​​of 0.35, 0.25, 0.2, 0.1, and 0.1, respectively; δ is a random perturbation term, ranging from -0.05 to 0.05. Risk level thresholds are set: 0 to 0.3 for low risk (green alert), 0.3 to 0.6 for medium risk (yellow alert), 0.6 to 0.8 for high risk (orange alert), and 0.8 to 1 for extremely high risk (red alert). This step aims to quantitatively assess and categorize the risk of abnormal behavior.

[0178] The specific implementation of step S08 is the same as above and will not be repeated here.

[0179] The specific implementation method of step S09 is to divide the warning level and perform risk prediction based on the detection results and the abnormal target change index. In the specific implementation, the above analysis results are first summarized, including the abnormal target change index and the abnormal behavior risk score. Then the warning level is divided according to the preset risk threshold, and the corresponding level of warning signal is generated. Then the rail transit abnormal event prediction model is called to perform trend prediction. The model adopts a long-term and short-term memory network structure, and the input includes the current abnormal target change index time series and the abnormal behavior risk score series, and the output is the future risk score prediction value. The prediction equation is Where, R is the predicted risk score for the future time t+Δt; t-kτ (i) and are the risk score and the modified abnormal change index at the past time t-kτ respectively; τ is the sampling time interval; T is the length of the historical sequence; f LSTM is the LSTM network model function. The prediction confidence interval calculation formula is Where R lower (i) and R upper (i) are the lower and upper bounds of the predicted risk score, respectively; z α / 2 is the critical value of the normal distribution, which is about 1.96 when the confidence level is 95%; R The standard deviation of the predicted risk score is estimated using historical prediction errors. The predicted results are used to determine the risk trend. If the predicted risk score shows an upward trend and exceeds the warning threshold, an escalation mechanism is triggered. A risk warning report is also generated, containing information such as the abnormal target location, behavior type, risk level, and predicted trend. Different response measures are taken based on the warning level: low risk continues monitoring, medium risk notifies on-duty personnel, high risk activates the emergency plan, and extremely high risk triggers automatic intervention measures (such as broadcasting reminders or notifying trains to slow down). This step aims to achieve timely risk warning and early intervention, preventing risks before they occur.

[0180] In order to better understand and implement the present invention, Example 2 of a specific application scenario of the present invention is provided below: Researchers conducted an implementation test of the rail transit video intelligent analysis method at a certain city rail transit station. The station has an island platform structure with an average daily passenger flow of about 85,000 people. The platform is severely crowded during peak hours in the morning and evening, and there are certain safety risks. Three key monitoring points of the platform were selected for the implementation test, covering the entrance area, the middle platform area and the exit area respectively. The test used three high-definition network cameras (with a resolution of 1920×1080 pixels and a frame rate of 25 frames / second), connected to an edge computing server (configured with an Intel i7-9700 processor, 16GB RAM, and an NVIDIA RTX 2080 graphics card) for real-time analysis and processing.

[0181] First, according to step S01, an adaptive resolution image layer structure is constructed. The optimal number of resolution layers is calculated by the resolution level evaluation function to be 4 layers. The resolution parameters of each layer are shown in Table 1:

[0182] Table 1 Adaptive resolution level parameter table

[0183] Level Number Resolution (pixels) Downsampling ratio Processing task type Computing resource allocation ratio 0 1920×1080 1.0 Detailed analysis 35% 1 960×540 0.5 Target Tracking 25% 2 480×270 0.25 Motion detection 20% 3 240×135 0.125 Global screening 20%

[0184] Abnormal moving target detection is performed using an improved frame difference method combined with optical flow estimation technology. The adaptive threshold adjustment coefficient k is set to 3.2, and the weight coefficients w1 and w2 are set to 0.65 and 0.35 respectively. The system's motion detection results in multiple different scenarios are shown in Table 2:

[0185] Table 2 Comparison of motion detection performance in different scenarios

[0186] Scenario Type Detection accuracy (AP) Recall rate (%) False alarm rate (%) Average processing time (ms) Low passenger flow scenario 0.92 93.5 3.2 16.7 Medium passenger flow scene 0.89 91.2 5.8 18.3 High passenger flow scene 0.85 88.7 7.3 21.5 Lighting change scene 0.83 87.4 8.1 19.2 Rainy day scene 0.80 85.1 9.6 22.7

[0187] The Hungarian algorithm is used to solve the multi-target tracking problem. The weight coefficients w of position, size and appearance in the target matching cost matrix are p 、w s 、w a They are set to 0.6, 0.25 and 0.15 respectively. The system tracking performance during the test is shown in Table 3:

[0188] Table 3 System multi-target tracking performance

[0189] Evaluation indicators Numerical describe MOTA 82.7% Multi-target tracking accuracy MOTP 79.3% Multi-target tracking accuracy IDS 43 Number of identity switching (24 hours) FP 127 Number of false positives (24 hours) FN 86 Number of missed inspections (24 hours) Tracking speed 23.6ms Average processing time per frame

[0190] When constructing the abnormal target change index, the weight coefficients w1, w2, and w3 of the size change rate, speed change rate, and direction change rate are set to 0.25, 0.45, and 0.3, respectively, the noise correction term ∈ is set to 0.07, and the change index threshold T is set to 0. change The abnormal target detection results at different times of the day during the test are shown in Table 4:

[0191] Table 4 Statistics of abnormal target detection results at different time periods

[0192]

[0193]

[0194] The system dynamically adjusts the monitoring strategy for different operation stages of the platform. safe The detection sensitivity parameters of the focus area and detection sensitivity parameters of each stage are shown in Table 5:

[0195] Table 5 Monitoring parameters at different operation stages

[0196] Operational phase Proportion of concerned areas (%) Detection sensitivity Risk Factors Prioritize target types Vehicles entering the station 35 0.85 0.9 People wandering around the edge of the platform Vehicle parking 50 0.75 0.7 People stranded near the door Vehicle exit 30 0.82 0.8 Chasing train crew Platform vacant 100 0.65 0.5 Abnormally stranded personnel

[0197] During the risk assessment phase, the system used weight coefficients w1 to w5, set to 0.4, 0.25, 0.2, 0.08, and 0.07, respectively, and the random perturbation term δ ranged from -0.04 to 0.04. The main abnormal behavior types captured during the test and their risk scores are shown in Table 6:

[0198] Table 6 Abnormal behavior risk score statistics

[0199] Behavior Type Occurrences Average risk score Warning level Response measures Near the edge of the platform 43 0.68 orange color Broadcast reminder Running on the platform 126 0.55 yellow Monitoring attention Abnormal detention 37 0.42 yellow Monitoring attention Climb over the guardrail 2 0.88 red Human intervention Fall incidents 8 0.73 orange color Staff assistance Relics 23 0.35 yellow Monitoring attention Car door blocking 15 0.65 orange color Broadcast reminder

[0200] A hierarchical processing strategy is used to perform parallel computations on images at different resolution levels. The system's processing performance at each resolution level is shown in Table 7:

[0201] Table 7 Processing performance of each resolution level

[0202] Resolution level Single frame processing time (ms) Detection accuracy (mAP) Processing content Speedup Native resolution 42.3 0.91 Fine Identification 1.0 1 / 2 resolution 12.7 0.83 Target Tracking 3.3 1 / 4 resolution 5.8 0.75 Anomaly Detection 7.3 1 / 8 resolution 2.1 0.63 Global screening 20.1

[0203] The system uses an LSTM network model to predict potential risk trends. The model input history sequence length T is set to 20, the sampling interval τ is 1 second, and the confidence level is 95%. The system risk prediction accuracy performance at different prediction time lengths is shown in Table 8:

[0204] Table 8 Risk prediction accuracy

[0205]

[0206]

[0207] Compared with traditional rail transit video analysis methods, the method of the present invention demonstrates significant advantages during implementation. Traditional methods primarily rely on motion detection with fixed thresholds and simple rule-based judgments, which are unable to adapt to complex and changing platform environments, especially when there is a large flow of people, where the accuracy drops significantly. Traditional methods typically use full-resolution processing or a fixed downsampling ratio, resulting in low computing resource utilization and an inability to implement differentiated analysis strategies for different regions. Traditional systems mostly use independent target detection and tracking modules, lacking effective trajectory analysis and behavior recognition capabilities, and are unable to provide early warnings of potential risks.

[0208] This invention optimizes computing resource allocation through an adaptive resolution hierarchical structure, reducing system processing latency by 49.8% from an average of 47.6 milliseconds compared to traditional methods to 23.9 milliseconds, while maintaining high detection accuracy. An improved frame difference method combined with optical flow estimation significantly enhances the robustness of motion detection, achieving an 18.5% improvement in detection accuracy compared to traditional methods in complex lighting and crowded scenarios. A multi-parameter weighted abnormal target change index enables more accurate assessment of behavioral anomalies, reducing the false alarm rate from 12.7% in traditional systems to 7.3%. The introduction of a track scene attention network model has made significant progress in recognizing complex behavioral patterns, particularly in identifying high-risk behaviors such as "approaching the platform edge," where the accuracy has increased from 72.6% to 89.3%. Furthermore, the risk prediction model can provide 3-15 seconds of advance warning of potential risk events, providing a valuable window for safety intervention and effectively preventing accidents.

[0209] It should be noted that the variables involved in the present invention are explained in detail as shown in Tables 9 and 10 below.

[0210] Table 9 Variable Explanation Table (Part 1)

[0211]

[0212] Table 10 Variable Explanation Table (Part 2)

[0213]

[0214] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the scope of protection of the present invention.

Claims

1. A rail transit video intelligent analysis method, characterized in that: include: S01. Construct an adaptive resolution image hierarchical structure, dynamically determine the optimal number of resolution levels based on the minimum spanning tree algorithm, generate a resolution pyramid from the original high-definition video frame through a recursive binary downsampling method, and determine the resolution of each level through a resolution level evaluation function; S02. Use an improved frame difference method to calculate the difference between adjacent video frames, use the Lucas-Kanade optical flow estimation algorithm to calculate the pixel motion vector field, extract the motion direction and speed information, fuse the frame difference result with the optical flow information, and construct an abnormal target movement matrix; S03. Based on the abnormal target movement matrix, calculate the abnormal target movement displacement matrix; S04. Construct an abnormal target change index based on the abnormal target movement displacement matrix. S05. According to the running status of rail transit vehicles, the platform monitoring area is divided into four time periods: vehicle entry phase, vehicle parking phase, vehicle exit phase, and platform idle phase, and a scenario adaptive analysis strategy is applied; S06. A pre-trained track scene attention network model is introduced to identify abnormal targets. The track scene attention network model integrates the spatiotemporal attention mechanism and the region proposal network; S07. An abnormal behavior risk assessment function is used to comprehensively calculate the distance parameters between the current abnormal target and the track safety boundary, the target movement speed parameters, the target behavior pattern similarity parameters, the platform congestion parameters, and the vehicle operation phase parameters, and the abnormal behavior risk level is quantified to output a normalized risk score and the corresponding warning level; S08. Based on a layered processing strategy, parallel computing is performed on images at different resolution levels. The low-resolution layer is responsible for global rapid screening, while the high-resolution layer is responsible for detailed analysis of key areas, optimizing the allocation of computing resources. S09. Based on the detection results and the abnormal target change index, the warning level is divided according to the preset risk level; Among them, step S03 specifically includes: applying the connected domain analysis algorithm to the abnormal target movement matrix, extracting and marking each independent moving target, calculating the center of mass coordinates, area, and bounding box of each target, establishing a target feature description vector, including position, size, color histogram and texture features, and constructing a target matching cost matrix between consecutive video frames. The matrix elements Indicates the Current goal and The matching cost of historical targets is calculated as follows: ,in, is the location distance; For size differences; is the appearance similarity; 、 、 The matching problem is transformed into an assignment problem, and the Hungarian algorithm is applied to solve it to obtain the optimal matching result. Based on the optimal matching result, the displacement vector of each target between consecutive frames is calculated to form the abnormal target movement displacement matrix, and the displacement in the horizontal and vertical directions is recorded. Wherein, step S04 includes: calculating the target size change rate , where For the The rate of change of the size of a target; and The area of ​​the target in the current frame and the previous frame respectively, and then calculate the rate of change of the moving speed using the formula: Where, For the The speed change rate of a target; and are the velocity amplitudes of the target in the current frame and the previous frame, respectively, calculated by the displacement vector: ,in is the time interval between adjacent frames; Then calculate the rate of change of direction using the formula: Where, For the The rate of change of direction of a target; and are the moving direction angles of the target in the current frame and the previous frame respectively; Then calculate the abnormal target change index using the formula: ; Where, For the Abnormal change index of each target; 、 、 is the weight coefficient; Indicates absolute value operation; is the noise correction term; Introduce spatiotemporal context information for adjustment, build a spatiotemporal memory module to record the target's historical behavior pattern, calculate the degree of deviation between the current behavior and the historical pattern, and correct the change index; Among them, in step S06, the specific structure of the track scene attention network model is a spatiotemporal dual attention network based on the improved Transformer architecture. The backbone network uses a deep residual structure to extract image features, the temporal attention module captures the temporal characteristics of target behavior, the spatial attention module focuses on the key areas of the platform, and the integrated region proposal network improves the small target detection capability.

2. The rail transit video intelligent analysis method according to claim 1, characterized in that: The resolution level evaluation function is used to dynamically determine the number of optimal resolution division levels and the resolution parameters of each layer. The input includes the original video resolution, computing resource limitation parameters, target detection accuracy requirement parameters, real-time requirement parameters, and scene complexity score. The output is the optimal number of resolution levels and the specific downsampling ratio of each layer.

3. The rail transit video intelligent analysis method according to claim 2, characterized in that: The abnormal target movement matrix refers to a two-dimensional array representing the position information of moving objects in the picture by calculating the pixel difference between adjacent frames of the video. The value of each element represents the degree of change of the pixel point at the corresponding position; the abnormal target movement displacement matrix refers to the position change of the detected abnormal target in multiple consecutive frames of video, which includes two components: horizontal displacement and vertical displacement, and is used to analyze the target motion trajectory.

4. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program instructions, and when the program instructions are run in a computer, they are used to execute the rail transit video intelligent analysis method according to any one of claims 1 to 3.

5. A rail transit video intelligent analysis system, characterized in that: The system comprises the computer-readable storage medium according to claim 4, wherein the system is any one of a computer, a server, and a single-chip microcomputer, the computer-readable storage medium is arranged in the system, and the system is provided with a microprocessor for executing program instructions stored in the computer-readable storage medium.

Citation Information

Patent Citations

  • Unmanned aerial vehicle routing inspection line adaptive obstacle detection method and system based on monocular camera

    CN119672577A

  • AI video low-altitude target identification and real-time tracking method based on deep learning

    CN119723421A