Multi-camera collaborative dynamic crowd density estimation and abnormal behavior early warning method
By combining online calibration with a multi-scale attention network, the problems of calibration accuracy and feature fusion in multi-camera systems are solved, achieving high-precision crowd density estimation and abnormal behavior detection, improving the robustness and real-time performance of the system, while protecting data privacy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-09
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies suffer from low calibration accuracy of multi-camera systems, poor feature fusion performance, and insufficient robustness in abnormal behavior detection, resulting in low accuracy in crowd density estimation and inaccurate detection of abnormal behavior.
An online calibration method without preset calibration targets is adopted. The camera extrinsic matrix is optimized by photometric error. Feature fusion is performed by combining multi-scale attention network and Transformer network to generate a globally consistent BEV feature map. Anomalous behavior is detected by dual-stream spatiotemporal attention network. Real-time performance and privacy are guaranteed by federated learning and edge computing.
It achieves high-precision spatial alignment of multiple cameras, improves the accuracy of crowd density estimation, reduces the impact of noise, and increases the accuracy of abnormal behavior detection, meeting the needs of real-time monitoring and protecting data privacy.
Smart Images

Figure CN121640359A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and intelligent surveillance, and in particular to a method for dynamic crowd density estimation and abnormal behavior early warning using multi-camera collaboration. Background Technology
[0002] With the acceleration of urbanization and the increasing demand for public safety, intelligent monitoring and management of crowds in large public places (such as transportation hubs, squares, and stadiums) has become crucial. Crowd density estimation and abnormal behavior detection are the core functions of intelligent monitoring systems, aiming to grasp the distribution of crowds in real time and promptly identify potential safety risks.
[0003] However, existing technical solutions have many limitations: Limitations of Single-Camera Solutions: Traditional crowd density estimation methods based on single cameras are severely limited by a fixed viewpoint and a limited field of view. In densely populated scenes, occlusion issues are particularly pronounced, leading to low counting accuracy. Furthermore, a single viewpoint struggles to capture global crowd dynamics and cannot effectively detect abnormal behaviors across areas (such as unusual crowd movement).
[0004] Challenges of Multi-Camera Collaboration Solutions: While multi-camera arrays can expand the monitoring range, they also introduce new technical challenges. First, calibration accuracy is low. Traditional camera extrinsic parameter calibration often relies on manually deployed calibration boards or specific targets, a cumbersome process that struggles with real-time online updates, leading to significant spatial alignment errors when stitching or projecting views from different cameras. Second, feature fusion mechanisms are imperfect. Simple image-level stitching or feature overlay cannot effectively handle information redundancy in overlapping areas or information differences in non-overlapping areas, making it difficult to form a globally consistent and high-quality scene representation. Finally, the robustness of abnormal behavior detection is insufficient. Existing methods often rely on manually set rules or single-modal features, making it difficult to capture complex spatiotemporal anomalies caused by multiple factors. Furthermore, fixed warning thresholds cannot adapt to dynamically changing crowd densities at different times and in different areas, easily resulting in high false alarm or false negative rates. Summary of the Invention
[0005] This invention primarily addresses the technical problems of existing technologies, such as low calibration accuracy of multi-camera systems, poor feature fusion performance, and insufficient robustness in abnormal behavior detection. It provides a method for dynamic crowd density estimation and abnormal behavior early warning through multi-camera collaboration that achieves high accuracy, high real-time performance, and robustness.
[0006] The present invention addresses the aforementioned technical problems primarily through the following technical solution: a method for dynamic crowd density estimation and abnormal behavior early warning using multi-camera collaboration, comprising the following steps: S1: Perform spatial calibration on each camera deployed in the target scene; S2: Project the visual features extracted from the video streams of each camera onto a unified bird's-eye view space and perform feature fusion to generate a globally consistent BEV feature map. S3: Based on the globally consistent BEV feature map, generate a dynamic crowd density map that can characterize the real-time spatial distribution of crowds in the target scene; S4: Combines dynamic crowd density maps and spatiotemporal information in the video stream to detect abnormal behavior in the target scene, and outputs a warning signal when abnormal behavior is detected.
[0007] Preferably, the spatial calibration in step S1 is an online calibration method without a preset calibration target, specifically including: S11: Construct an optimization problem, where the camera extrinsic parameter matrix T to be solved is the optimization variable, and the photometric loss L is defined by the following formula. photo The objective function to be minimized is: ; Among them, Ω i,j I represents the common field of view area of cameras i and j. i (p) represents the brightness value of camera i at pixel p, T i→j (p) represents the corresponding pixel after transforming pixel p from the camera i coordinate system to the camera j coordinate system. j (T i→j (p) is the brightness value of camera j at the corresponding pixel after pixel p is transformed by the extrinsic parameter matrix T; S12: The optimization problem is solved using a phased numerical optimization method. In the previous phase, the phased numerical optimization method explores the parameter space of the extrinsic parameter matrix T with a first search range and a first search step size to obtain an initial solution. In the next phase, based on the initial solution, a second search range and a second search step size are used to perform precise optimization to determine the optimal extrinsic parameter matrix T. The width of the first search range is greater than the second search range, and the first search step size is greater than the second search step size.
[0008] This solution employs fully automatic targetless calibration, using a coarse-to-fine random search strategy based on photometric error to optimize the camera extrinsic matrix T and minimize photometric loss in overlapping areas.
[0009] Preferably, in step S2, the visual feature acquisition method is as follows: the video streams from each camera are input into the feature extraction network, and the feature extraction network uses a multi-scale attention mechanism to extract multi-scale visual features containing rich contextual information from each video stream. The feature fusion specifically involves using a Transformer network to aggregate the multi-scale visual features from different cameras that have been projected into the bird's-eye view space, generating a BEV feature map to achieve adaptive weighted fusion of cross-camera features.
[0010] Preferably, step S3 specifically involves: processing the globally consistent BEV feature map using a multi-scale attention network to generate the dynamic crowd density map, wherein the density map generation network includes several branches for extracting features from different receptive fields, and adaptively weighting and fusing the features of each branch through a scaling dot product attention mechanism, the scaling dot product attention mechanism being defined by the following formula: ; Where Q is the query vector, K is the key vector, and V is the value vector. Q, K, and V are generated by linear transformations of features from different branches. k This is the dimension scaling factor.
[0011] Branches with different receptive fields (such as convolutional layers with different kernel sizes) are used to extract multi-scale local features. These features are processed to generate query (Q), key (K), and value (V) vectors in the attention mechanism. Finally, adaptive weighted fusion of features is achieved through the scaling dot product attention formula mentioned above. This formula is the core of introducing scaling dot product attention to calculate weights, and the input for weight calculation comes from the features of each branch.
[0012] Preferably, the multi-scale attention network is trained by iteratively adjusting its internal parameters to minimize an objective function L. density This is achieved by the objective function defined by the following equation: L density =W1(D,D')+λL TV ; Where W1(D,D') is the first-order Wasserstein distance between the dynamic crowd density map D predicted by the multi-scale attention network under the current parameters and the real crowd density map D', λ is the balance coefficient, and L TV The total variation loss is defined by the following formula: ; in, and These are the horizontal and vertical gradients of the dynamic crowd density map D at pixel p, respectively.
[0013] Preferably, step S4 specifically involves: S41: Spatial branch processing: The image sequence in the video stream is input into the spatial branch of the dual-stream spatiotemporal attention network. The spatial branch uses a three-dimensional convolutional neural network (3D CNN) to extract appearance features that characterize the local spatiotemporal behavior of individuals or small groups. S42: Temporal branch processing: A series of continuous dynamic crowd density maps are input into the temporal branch of the dual-stream spatiotemporal attention network. The temporal branch uses a long short-term memory network (LSTM) to capture the temporal features that characterize the macroscopic dynamic changes of the crowd. S43: Feature fusion and probability output: The appearance features extracted by the spatial branch and the temporal features extracted by the temporal branch are fused to generate a comprehensive feature vector, and the comprehensive feature vector is input into the classifier to output an abnormal probability value that quantifies the possibility of abnormal behavior occurring. S44: Dynamic density threshold calculation: Based on the mean μ and standard deviation σ of the density values in the dynamic crowd density map within a preset spatiotemporal sliding window, the dynamic density detection threshold is calculated. This threshold is determined by the following formula: threshold = μ + 2σ; S45: Warning Trigger Determination: A warning signal is triggered when any of the following conditions are met: a) Density anomaly triggering condition: The density value at any location in the dynamic population density map exceeds the dynamic density detection threshold; b) Abnormal behavior triggering condition: The abnormal probability value output by the classifier exceeds the preset probability threshold.
[0014] As a preferred approach, the dynamic crowd density estimation and abnormal behavior early warning method based on multi-camera collaboration is lightweighted by model quantization or knowledge distillation techniques and then deployed on edge computing devices for execution.
[0015] As a preferred approach, the multi-camera collaborative dynamic crowd density estimation and abnormal behavior early warning method adopts a federated learning framework during the model training phase. By aggregating locally trained model parameters or gradients, it achieves collaborative training and updating of the model while protecting the privacy of local data from each camera.
[0016] The overall process of this solution can be summarized as follows: First, a multi-camera array is deployed to collect data. Online calibration is performed using a coarse-to-fine random search strategy based on photometric error to optimize the extrinsic parameter matrix and achieve spatial alignment. Next, the video streams from each camera are input into a multi-scale attention network to extract multi-scale features and project them into the BEV space. These features are then aggregated using a Transformer to generate a global feature map. The density map is then optimized by combining OT loss and TV loss. A dual-stream spatiotemporal attention network is used to detect abnormal behavior, and the threshold is dynamically adjusted based on the local density distribution. Finally, an alert is triggered when the density exceeds the threshold or an anomaly is detected. Simultaneously, edge computing and federated learning ensure real-time performance and data privacy.
[0017] Compared with the prior art, the present invention has the following significant advantages: High precision and automation: By using an online calibration method based on photometric error, high-precision fully automatic spatial alignment of a multi-camera system is achieved, with a spatial alignment error of less than 0.5 pixels and a 40% improvement in calibration accuracy, which is significantly better than traditional manual calibration methods.
[0018] High robustness: By combining a multi-scale attention network and optimal transport loss, the crowd density estimation model (MAE reduced by 27.8%) can more realistically reflect the global crowd distribution while maintaining local smoothness, effectively suppressing the effects of noise and occlusion. Meanwhile, the dual-stream, dual-trigger anomaly detection mechanism can sensitively capture micro-level individual behavioral anomalies and macro-level group dynamic anomalies, achieving an anomaly behavior identification accuracy of 97.6%.
[0019] Real-time performance and privacy protection: By lightweighting the model and deploying it on edge devices, the system inference speed can reach 30 FPS, meeting real-time monitoring requirements. Combined with a federated learning framework for model training, local data does not need to leave the domain, effectively protecting user privacy and reducing the risk of data leakage by 90%. Attached Figure Description
[0020] Figure 1 This is a flowchart of a multi-camera collaborative dynamic crowd density estimation and abnormal behavior early warning method according to the present invention. Detailed Implementation
[0021] The technical solution of the present invention will be further described in detail below through embodiments and in conjunction with the accompanying drawings.
[0022] Example: A method for dynamic crowd density estimation and abnormal behavior early warning using multi-camera collaboration, such as... Figure 1 As shown, it includes the following steps: Step S1: Spatial Calibration This step aims to achieve online, automated calibration of multi-camera extrinsic parameters without manual intervention or preset calibration targets. In this embodiment, this step specifically includes two sub-steps, S11 and S12: S11: Construct an optimization problem. Use the camera extrinsic parameter matrix T to be solved as the optimization variable, and define the photometric loss L as follows: photo The objective function to be minimized is: ; Where i and j are indices of different cameras; Ω i,j I represents the common field of view of cameras i and j. i (p) represents the brightness value of camera i at pixel p; T i→j (p) represents the pixel after transforming pixel p from the camera i coordinate system to the camera j coordinate system; j (T i→j (p) represents the brightness value of the corresponding pixel of camera j after transformation of pixel p by the extrinsic parameter matrix T. The physical meaning of this objective function is that, under correct camera extrinsic parameters, the brightness of the same physical world point captured by different cameras should be as consistent as possible.
[0023] S12: The optimization problem is solved using a phased numerical optimization method. This method follows a "coarse-to-fine" search strategy, specifically as follows: The first stage (coarse search): The parameter space of the extrinsic matrix T is explored with a first search range and a first search step size to obtain an initial solution. This stage has a large range and a long step size, aiming to quickly locate the approximate region of the optimal solution.
[0024] The next stage (refined search): Based on the initial solution, precise optimization is performed using a second search range and a second search step size to determine the optimal extrinsic parameter matrix T. This stage has a narrower search range and a shorter step size, aiming to refine the initial solution. Specifically, the width of the first search range is greater than the second search range, and the first search step size is greater than the second search step size.
[0025] By using multi-camera collaborative calibration, fully automatic high-precision spatial alignment is achieved, solving the problem of traditional calibration relying on manual labor.
[0026] Step S2: Feature Extraction and Fusion This step aims to extract useful visual information from the video streams of each camera and fuse them into a unified global view.
[0027] First, visual features are acquired. The video streams from each camera are input into a feature extraction network. This network preferably employs a multi-scale attention mechanism, which can extract features from different receptive fields in parallel and adaptively focus on key regions in the image (such as regions containing human figures), thereby extracting multi-scale visual features from each video stream.
[0028] Next, feature fusion is performed. The multi-scale visual features extracted above, still within their respective camera perspectives, are projected onto a unified bird's-eye view (BEV) space using the calibration extrinsic parameter matrix T obtained in step S1. Subsequently, a Transformer network is used to aggregate the multi-scale visual features projected onto the BEV space from different cameras. The Transformer's self-attention mechanism can effectively capture long-distance dependencies between features from different cameras and perform adaptive weighted fusion, ultimately generating a high-quality, globally consistent BEV feature map.
[0029] Step S3: Dynamic density estimation This step generates the final dynamic crowd density map based on a globally consistent BEV feature map.
[0030] Specifically, a density map generation network is used to process the globally consistent BEV feature map. This network can also employ a multi-scale attention architecture, including 4,000 branches for extracting features from different receptive fields, and adaptively weighted fusion of the features from each branch is performed through a scaled dot product attention mechanism. The scaled dot product attention mechanism is defined by the following formula: ; Where Q is the query vector, K is the key vector, V is the value vector, and dk is the dimension scaling factor, i.e., the length or dimension of K.
[0031] Q (Query Vector): Generated by a linear transformation of the features of a certain receptive field branch, it represents "which information from other branches the current branch's features need to pay attention to", and is the query signal that triggers attention computation.
[0032] K (Key, key vector): generated by linear transformation of features from other receptive field branches, used to match Q, and the similarity between features is calculated through inner product (i.e., the original score of attention weights).
[0033] V (Value, value vector): generated by linear transformation of features from other receptive field branches, representing "the specific feature content to be aggregated", and finally weighted and summed by attention weights to form the fused features.
[0034] Four branches with different receptive fields (such as convolutional layers with different kernel sizes) are used to extract multi-scale local features. These features are processed to generate query (Q), key (K), and value (V) vectors in the attention mechanism. Finally, adaptive weighted fusion of features is achieved through the above-mentioned scaled dot product attention formula. This formula is the core of introducing scaled dot product attention to calculate weights, and the input for weight calculation comes from the features of the four branches.
[0035] This solution uses multi-scale attention feature fusion to adaptively select key features and improve feature representation capabilities in dynamic scenes.
[0036] To ensure that the generated density map is both globally accurate and locally smooth, the training process of this density map generation network involves iteratively adjusting its internal parameters to minimize an objective function L. density This is achieved through the objective function, which is defined as follows: L density =W1(D,D')+λL TV ; Here, D is the dynamic crowd density map predicted by the model, a two-dimensional matrix (dimension H×W, corresponding to the height and width of the image), where each element D(p) represents the number of people per unit area at pixel p (e.g., "people / square meter"). D is output by a multi-scale attention network (MSIANet), generated through feature fusion and attention weighting calculations from four different receptive field branches, directly reflecting the model's estimation of the crowd distribution in the current scene. D' is the real crowd density map (also known as the "label density map"), serving as a benchmark for measuring prediction accuracy, with the same dimension as D. D' is generated from manually labeled crowd location points; for each labeled point q, a Gaussian kernel function (e.g., N(q,σ)) is applied. 2) (where σ is the bandwidth parameter) diffuses into a continuous density distribution, eventually forming a global true density map.
[0037] W1(D,D') is the first-order Wasserstein distance (also known as "Earth travel distance") between the dynamic crowd density map D predicted by the network under the current parameters and the actual crowd density map D'. It measures the transportation cost between two probability distributions; the smaller the value, the closer the predicted distribution is to the actual distribution. W1(D,D') is calculated based on optimal transport (OT) theory by solving for the "optimal transport plan from D to D'", and it captures the global differences in density distributions better than the traditional mean squared error (MSE).
[0038] λ is the total variation loss (L) TVThe balance coefficient (weighting coefficient) is a non-negative hyperparameter used to balance the "distribution matching accuracy" and the "density map smoothness". λ is determined through experimental tuning and is usually taken as 0.01 to 0.1 in the context of population density estimation, in order to avoid D from experiencing local drastic fluctuations due to overfitting noise.
[0039] L TV The total variation loss is used to constrain the spatial smoothness of the density map D during training, avoiding isolated noise points. A smaller value indicates a smoother gradient change in the density map. TV Based on image regularization theory, it quantifies the "edge sharpness" of the density map by calculating the partial derivatives of each pixel p in the x and y directions, thus suppressing glitch or isolated noise points in the prediction results. It is calculated by the following formula: ; in, and These are the horizontal and vertical gradients of density map D at pixel p, respectively, reflecting the rate of change of density in the horizontal and vertical directions. and Calculated using the finite difference method (e.g.) It is extracted directly from the spatial gradient of the predicted density map D.
[0040] W1(D,D') ensures that the predicted density map is globally consistent with the actual distribution (e.g., matching the location and intensity of population clusters); λL TV By constraining the spatial smoothness of the density map, density estimation distortion caused by local noise is avoided (such as misjudging sparse crowds as dense areas). The combination of the two enables the model to generate dynamic density maps that are both close to the real distribution and have spatial continuity even in complex scenarios (such as occlusion and changes in lighting), providing reliable density feature inputs for subsequent abnormal behavior warnings.
[0041] Step S4: Spatiotemporal Anomaly Detection and Early Warning This step employs a dual-stream network architecture and a dual-trigger mechanism to detect and issue warnings for abnormal behaviors in the scenario.
[0042] S41: Spatial Branch Processing. The image sequence in the original video stream is input into the spatial branch of the dual-stream spatiotemporal attention network. This branch preferably uses a three-dimensional convolutional neural network (3D CNN). The spatial attention module enhances the response of key regions, which can simultaneously process spatial and short-term temporal dimension information. It is used to extract appearance features that represent the local spatiotemporal behavior of individuals or small groups, such as fighting, falling down, etc.
[0043] S42: Time Branch Processing. The series of continuous dynamic crowd density maps generated in step S3 are used as sequence inputs and sent to the time branch of the dual-stream spatiotemporal attention network. This branch preferably uses a long short-term memory network (LSTM), which can effectively capture the long-term dependencies of sequence data and is used to capture temporal features that characterize macroscopic dynamic changes in the crowd, such as abnormal clustering and sudden evacuation.
[0044] S43: Feature Fusion and Probability Output. The appearance features extracted from the spatial branch and the temporal features extracted from the temporal branch are fused (e.g., through concatenation or attention mechanisms) to generate a comprehensive feature vector. This comprehensive feature vector is then input into a classifier (e.g., a fully connected layer + Softmax) to output an anomaly probability value that quantifies the likelihood of abnormal behavior occurring.
[0045] S44: Dynamic density threshold calculation. In parallel, based on the dynamic crowd density map, the mean μ and standard deviation σ of the density values are calculated within a preset spatiotemporal sliding window (e.g., a local area over the past 5 seconds). Then, the dynamic density detection threshold is calculated according to the following formula: threshold = μ + 2σ; This threshold will adaptively adjust according to real-time changes in scene density.
[0046] S45: Warning Trigger Determination. The system will trigger and output a warning signal (such as audible and visual alarm, information push to the monitoring center, etc.) when any of the following conditions are met: a) Density anomaly triggering condition: The density value at any location in the dynamic population density map exceeds the dynamic density detection threshold; b) Abnormal behavior triggering condition: The abnormal probability value output by the classifier in step S43 exceeds a preset probability threshold (e.g., 0.95).
[0047] This solution captures the spatiotemporal correlation of behaviors through a spatiotemporal attention mechanism and dynamic thresholds, thereby improving the accuracy of complex behavior recognition.
[0048] Deployment and Training To meet real-time requirements, the method of this invention can be lightweighted using model quantization or knowledge distillation techniques and then deployed on edge devices (such as Jetson Nano) for execution.
[0049] During the model training phase, a federated learning framework can be employed. Each edge device, where a camera is located, trains the model locally using only the data. The model parameters or gradients (rather than the original data) are then uploaded to a central server for aggregation and updates, and the updated global model is subsequently distributed. This approach achieves collaborative model training and updates while protecting the privacy of local data from each camera.
[0050] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.
[0051] Although this paper uses terms such as spatial calibration and dynamic crowd density map frequently, the possibility of using other terms is not excluded. These terms are used merely for the convenience of describing and explaining the essence of the invention; interpreting them as any additional limitation would contradict the spirit of the invention.
Claims
1. A method of multi-camera coordinated dynamic crowd density estimation and abnormal behavior early warning, characterized in that, The method comprises the following steps: S1: performing spatial calibration on each camera deployed in the target scene; S2: projecting visual features extracted from the video streams of each camera into a unified bird's eye view (BEV) space and performing feature fusion to generate a globally consistent BEV feature map; S3: generating a dynamic crowd density map capable of representing the real-time spatial distribution of the crowd in the target scene based on the globally consistent BEV feature map; S4: detecting abnormal behavior in the target scene in combination with the dynamic crowd density map and the spatiotemporal information in the video stream, and outputting a warning signal when abnormal behavior is detected.
2. The multi-camera coordinated dynamic crowd density estimation and abnormal behavior early warning method according to claim 1, characterized in that, The spatial calibration in step S1 is an online calibration method without preset calibration targets, and specifically comprises: S11: Construct an optimization problem, where the camera extrinsic parameter matrix T to be solved is the optimization variable, and the photometric loss L defined by the following formula photo is the objective function to be minimized: ; wherein Ω i,j is the common view area of camera i and camera j, I i (p) is the intensity value of camera i at pixel p, T i→j (p) is the corresponding pixel of pixel p after transforming from camera i coordinate system to camera j coordinate system, I j (T i→j (p)) is the intensity value of camera j at the corresponding pixel of pixel p after transforming by the extrinsic matrix T. S12: solving the optimization problem by using a staged numerical optimization method, wherein the staged numerical optimization method explores the parameter space of the extrinsic parameter matrix T with a first search range and a first search step in a previous stage to obtain an initial solution, and performs accurate optimization based on the initial solution with a second search range and a second search step in a subsequent stage to determine the optimal extrinsic parameter matrix T, the width of the first search range is greater than that of the second search range, and the first search step is greater than the second search step.
3. The multi-camera coordinated dynamic crowd density estimation and abnormal behavior early warning method of claim 1, wherein, In step S2, the visual feature acquisition method is to input the video streams of each camera into a feature extraction network respectively, and the feature extraction network extracts visual features from each video stream by using a multi-scale attention mechanism; The feature fusion specifically comprises: using a Transformer network to aggregate the visual features projected into the bird's eye view space to generate a BEV feature map.
4. The multi-camera coordinated dynamic crowd density estimation and abnormal behavior early warning method according to claim 1 or 3, characterized in that, Step S3 specifically comprises: processing the globally consistent BEV feature map by using a multi-scale attention network to generate the dynamic crowd density map, wherein the density map generation network comprises a plurality of branches for extracting different receptive field features, and each branch's features are adaptively weighted and fused by a scaled dot-product attention mechanism, which is defined by the following formula: ; where Q is a query vector, K is a key vector, and V is a value vector, Q, K, and V are generated by linear transformation of features from different branches, d k is a dimension scaling factor.
5. The multi-camera coordinated dynamic crowd density estimation and abnormal behavior early warning method of claim 4, wherein, The training of the multi-scale attention network is achieved by iteratively adjusting internal parameters of the multi-scale attention network to minimize an objective function L density , which is defined by the following equation: L density = W1(D, D') + λL TV ; wherein W1(D, D') is the first-order Wasserstein distance between the dynamic crowd density map D predicted by the multi-scale attention network at the current parameter and the real crowd density map D', λ is a balance coefficient, L TV is the total variation loss and is defined by the following equation: ; wherein, and respectively the horizontal and vertical directional gradients of the dynamic crowd density map D at pixel p.
6. The multi-camera coordinated dynamic crowd density estimation and abnormal behavior early warning method of claim 4, wherein, Step S4 specifically comprises: S41: spatial branch processing: inputting the image sequence in the video stream into the spatial branch of the dual-stream spatiotemporal attention network, and the spatial branch uses a three-dimensional convolutional neural network to extract appearance features representing the local spatiotemporal behavior of individuals or small groups; S42: time branch processing: inputting a series of continuous dynamic crowd density maps into the time branch of the dual-stream spatiotemporal attention network, and the time branch uses a long short-term memory network to capture time sequence features representing the macro dynamic changes of the crowd; S43: feature fusion and probability output: fusing the appearance features extracted by the spatial branch and the time sequence features extracted by the time branch to generate a comprehensive feature vector, and inputting the comprehensive feature vector into a classifier to output an abnormal probability value quantifying the possibility of abnormal behavior; S44: dynamic density threshold calculation: based on the mean μ and standard deviation σ of the density values of the dynamic crowd density map within a preset spatiotemporal sliding window, a dynamic density detection threshold threshold is calculated, which is determined by the following formula: threshold = μ + 2σ; S45: Early warning trigger determination: trigger an early warning signal when any of the following conditions is met: a) Abnormal density trigger condition: the density value of any position in the dynamic crowd density map exceeds the dynamic density detection threshold threshold; b) Abnormal behavior trigger condition: the abnormal probability value output by the classifier exceeds the preset probability threshold.
7. The multi-camera coordinated dynamic crowd density estimation and abnormal behavior early warning method of claim 1, wherein, The method is lightweighted by model quantization or knowledge distillation technology, and is deployed on an edge computing device for execution.
8. The multi-camera coordinated dynamic crowd density estimation and abnormal behavior early warning method of claim 1, wherein, In the model training stage, the method adopts a federated learning framework, aggregates locally trained model parameters or gradients, and realizes collaborative training and updating of the model under the premise of protecting the local data privacy of each camera.
Citation Information
Patent Citations
Multi-scene crowd density estimation method based on convolution network and multi-task learning
CN109389044A
Crowd counting, positioning and early warning method based on multi-scale attention mechanism
CN119181057A
Network edge monitoring and early warning method based on video image AI analysis
CN120220062A
Deep-learning-based apparatus and method for monitoring behavioral norms in jail
WO2022022368A1