Station dense passenger flow detection method based on shielding hierarchical adaptive decomposition

By employing adaptive quadtree decomposition, boundary attention mechanism, and occlusion relation matrix decomposition, the problems of insufficient sensitivity in occlusion boundary areas and lack of feature correlation between levels in dense passenger flow detection at stations are solved, achieving low false negative rate and near real-time monitoring under high-density occlusion.

CN121963076APending Publication Date: 2026-05-01NANJING MODERN MULTIMODAL TRANSPORTATION LABORATORY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING MODERN MULTIMODAL TRANSPORTATION LABORATORY
Filing Date
2025-12-18
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing methods for detecting dense passenger flow at stations suffer from insufficient sensitivity in areas where there is obstruction, lack of feature correlation between different levels, and high false negative rates in high-density obstruction scenarios. In particular, when the obstruction rate exceeds 70%, the false negative rate of the detection system far exceeds the requirements for safety monitoring.

Method used

An adaptive decomposition method based on occlusion hierarchy is adopted. Through adaptive quadtree decomposition, boundary attention mechanism, hierarchical consistency evaluation and occlusion relation matrix decomposition, the occlusion boundary is accurately located, the features of each level are decoupled, the sensitivity of occlusion boundary area is improved, the occlusion relation matrix is ​​constructed and the complete pedestrian information is reconstructed.

Benefits of technology

It significantly reduced the false negative rate in obscured scenarios, meeting the requirements of station safety monitoring. The detection accuracy was improved, with the false negative rate dropping from 45% to 8%. The processing speed reached 12 frames per second, meeting the requirements of near real-time monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121963076A_ABST
    Figure CN121963076A_ABST
Patent Text Reader

Abstract

The invention provides a station dense passenger flow detection method based on occlusion hierarchical adaptive decomposition, and the method comprises the steps: carrying out the adaptive hierarchical decomposition of similarity gradient drive, a cross-hierarchical feature transmission and constraint mechanism, boundary attention enhancement and occlusion boundary precise positioning, and a hierarchical self-verification and restoration mechanism. And accurate detection of multi-layer shielding pedestrians in a high-density people stream environment is realized. According to the method, the boundary attention mechanism of the adaptive parameter beta and the hierarchical consistency evaluation function of spatial position weighting are introduced, so that the sensitivity of the occlusion boundary area is remarkably improved, the omission ratio in the occlusion scene is reduced, and the basic requirements of station safety monitoring are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to passenger flow detection, and in particular to a method for detecting dense passenger flow in stations based on adaptive decomposition of occlusion levels. Background Technology

[0002] Station passenger flow detection technology plays a crucial role in urban traffic management, public safety, and intelligent transportation systems. With accelerated urbanization and the increasing sophistication of public transportation systems, stations, as vital transportation hubs, experience a significant increase in passenger density and mobility, particularly during peak hours when high-density crowds often gather on platforms and in passageways. Accurate detection and analysis of these dense passenger flows not only helps optimize station operations and improve traffic efficiency but also forms the key technological foundation for preventing stampedes and achieving intelligent security monitoring. The main challenge in station passenger flow detection is the problem of human occlusion, especially in high-density scenarios where severe occlusion between pedestrians drastically reduces the performance of traditional detection algorithms.

[0003] Current research on passenger flow detection at train stations mainly focuses on several directions: image feature-based regression methods estimate the number of people by extracting overall density features, but struggle to accurately locate individual pedestrians; object detection-based methods perform well in low-density scenes, but their accuracy drops significantly when there is severe occlusion; methods based on partially visible features infer the overall position by detecting local human features (such as the head), and are somewhat effective in lightly occluded scenes. Furthermore, multi-scale feature fusion methods attempt to enhance detection capabilities by combining features of different scales, but they remain insufficient for handling complex occlusion. Occlusion detection methods based on quadtree decomposition decompose the image into blocks of different scales and identify occluded regions through similarity analysis, but the decomposition level is usually fixed at 1-2 layers, making it difficult to handle complex multi-layered occlusion scenarios.

[0004] In densely populated passenger environments like train stations, insufficient accuracy in identifying occlusion layers leads to serious pedestrian misses. Specifically, existing methods face two key technical obstacles when dealing with multi-layered "people overlapping people" occlusion: First, insufficient sensitivity at occlusion boundaries. When multiple people partially overlap, existing methods struggle to accurately locate occlusion boundaries, especially for groups with similar appearance features (such as similar clothing), resulting in a misclassification rate as high as 18%. Second, a lack of feature correlation between layers. The absence of an effective information transmission mechanism between different decomposition layers prevents the full utilization of contextual features and the establishment of an accurate hierarchical relationship model. These technical obstacles result in a miss rate exceeding 40% when the occlusion rate exceeds 70%, far exceeding the 10% threshold required for safety monitoring, severely impacting the reliability of station safety management and passenger flow monitoring. Summary of the Invention

[0005] The purpose of this invention is to provide a method for detecting dense passenger flow in stations based on adaptive decomposition of occlusion levels, in order to solve at least one technical problem existing in the prior art.

[0006] Technical solution: A method for detecting dense passenger flow in stations based on adaptive decomposition of occlusion levels, comprising:

[0007] Acquire station surveillance video data, preprocess it to obtain standardized images, perform quadtree decomposition to obtain multi-level region decomposition results, perform feature extraction on them, and obtain a hierarchical association graph.

[0008] For the occlusion boundary region in the hierarchical relationship graph, a boundary attention mechanism is applied to enhance the boundary features, locate the occlusion boundary, obtain the occlusion boundary map and occlusion topology map, and perform hierarchical consistency evaluation based on them to identify and correct hierarchical errors, and obtain an optimized hierarchical graph.

[0009] Based on the optimized hierarchical graph, an occlusion relationship matrix is ​​constructed and decomposed, features of each level are decoupled, pedestrian detection results of each level are obtained and integrated, redundancy is eliminated, and dense passenger flow detection results are formed.

[0010] The beneficial effects include improved sensitivity in the boundary area of ​​obstruction, reduced the missed detection rate in obstructed scenarios, and met the basic requirements of station security monitoring. Attached Figure Description

[0011] Figure 1 This is a flowchart of the present invention.

[0012] Figure 2 This is a flowchart of the quadtree decomposition of standardized images according to the present invention.

[0013] Figure 3 This is a flowchart of the similarity gradient calculation method of the present invention.

[0014] Figure 4 This is a flowchart illustrating how the optimal decomposition depth matrix is ​​obtained in this invention. Detailed Implementation

[0015] like Figures 1 to 4 As shown, a method for detecting dense passenger flow in stations based on adaptive decomposition of occlusion levels includes the following steps:

[0016] Acquire station surveillance video data, preprocess the video data to obtain standardized images;

[0017] Adaptive quadtree decomposition is performed on the standardized image, and the optimal decomposition level is determined based on the similarity gradient to obtain multi-level region decomposition results;

[0018] Feature extraction is performed on the multi-level region decomposition results to establish feature transfer and constraint relationships between levels, resulting in a hierarchical association graph.

[0019] For the occlusion boundary region in the hierarchical relationship graph, a boundary attention mechanism is applied to enhance the boundary features, accurately locate the occlusion boundary, and obtain the occlusion boundary map and the occlusion topology map.

[0020] Based on the occlusion boundary graph and occlusion topology graph, a hierarchical consistency assessment is performed to identify and correct hierarchical errors, resulting in an optimized hierarchical graph.

[0021] Based on the optimized hierarchical graph, an occlusion relationship matrix is ​​constructed. The features of each level are decoupled through matrix decomposition, and complete pedestrian information is reconstructed to obtain hierarchical pedestrian detection results.

[0022] The system parameters are dynamically adjusted based on the complexity of the scene and the detection results to obtain an optimized parameter set, and the optimized parameter set is applied to optimize the processing results; in addition, the pedestrian detection results at different levels are integrated to eliminate redundancy and form the final dense passenger flow detection results.

[0023] According to one aspect of this application, the steps of performing adaptive quadtree decomposition on a standardized image include:

[0024] The standardized image is initially decomposed into four regions using a quadtree decomposition, resulting in a first-level decomposition.

[0025] For each region in the first-level decomposition result, the feature similarity is calculated, and the similarity gradient is calculated by solving the rate of change of similarity with respect to the decomposition depth to obtain the similarity gradient map;

[0026] Based on the similarity gradient map, decomposition continues when the similarity gradient value of a region is greater than the dynamic threshold, and decomposition stops when the similarity gradient tends to stabilize, thus obtaining the optimal decomposition depth matrix.

[0027] Based on the optimal decomposition depth matrix, the standardized image is recursively decomposed, and quadtree decomposition is performed on the regions that need to be further decomposed to obtain multi-level region decomposition results. The multi-level region decomposition results are then organized into a tree structure, and parent-child node relationships are established to obtain a region decomposition tree, which is output as the multi-level region decomposition result.

[0028] According to one aspect of this application, the steps for calculating the similarity gradient include:

[0029] Read each region from the first-level decomposition result, and use the directional gradient histogram and local binary mode feature extractor to extract features from each region to obtain the region feature vector;

[0030] Read the feature vectors of the regions, calculate the feature similarity between adjacent regions using the cosine similarity formula, and perform the calculation on multiple feature scales to obtain a multi-scale similarity matrix;

[0031] The multi-scale similarity matrix is ​​read, and the similarity change rate is calculated for each decomposition level while retaining the gradient direction information to form a vectorized similarity gradient. Based on the vectorized similarity gradient, the gradient value of each region is mapped back to the image space to construct a two-dimensional gradient map. Noise is eliminated by Gaussian smoothing to obtain the similarity gradient map.

[0032] According to one aspect of this application, the adaptive depth determination step includes:

[0033] A dynamic threshold function is constructed that adaptively adjusts with the decomposition depth, where the threshold decreases as the decomposition depth increases, thus obtaining the dynamic threshold function;

[0034] Read the similarity gradient map and dynamic threshold function, compare the gradient value of each region with the threshold corresponding to the current depth, mark the regions that need to be further decomposed, and obtain the region decomposition label map;

[0035] The decomposition map is read, and the necessity of decomposition for each region is comprehensively evaluated by combining local entropy and gradient direction consistency. The decision score is calculated to obtain the optimized decomposition decision. Based on the optimized decomposition decision, the optimal decomposition depth is assigned to each region in the image, a depth matrix is ​​constructed, and the depth difference between adjacent regions is smoothed by median filtering to ensure decomposition continuity, thus obtaining the optimal decomposition depth matrix.

[0036] According to one aspect of this application, the steps for establishing feature transfer and constraint relationships between hierarchical levels include:

[0037] Features are extracted from each node region in the multi-level region decomposition results, and gradient histograms and texture feature descriptors are used to obtain a multi-level feature set;

[0038] Based on multi-level feature sets and similarity gradient maps, a feature transfer function between levels is constructed to realize information flow between levels and obtain the feature transfer mapping.

[0039] By using feature transfer mapping, feature constraints are passed from the upper layer to the lower layer. The features of the upper layer provide spatial location priors for the lower layer, resulting in top-down constrained features.

[0040] By utilizing top-down constraint features and multi-level feature sets, bottom-up verification is performed, with lower-level features providing feedback to verify the upper-level segmentation results and correcting boundary errors, resulting in bottom-up verification features. Furthermore, by integrating top-down constraint features and bottom-up verification features, a hierarchical association graph is constructed to record the feature correspondences and spatial dependencies between different levels, thus obtaining the hierarchical association graph.

[0041] According to one aspect of this application, the steps of constructing an inter-layer feature transfer function include:

[0042] Read the multi-level feature set, perform principal component analysis decomposition on the feature vector, extract the main feature components, decompose the features into basic features and detailed features, and obtain the decomposed feature set;

[0043] Read the similarity gradient map, calculate the similarity weight matrix between adjacent levels, and obtain the similarity weight matrix;

[0044] Based on the similarity weight matrix, a feature transfer kernel function is designed. This kernel function adaptively adjusts the transfer weights according to the magnitude and direction of the similarity gradient, thus obtaining the feature transfer kernel.

[0045] By combining the feature transfer kernel and the decomposed feature set, a nonlinear mapping function is constructed to realize adaptive feature transfer between levels, resulting in the nonlinear mapping function. Furthermore, by applying the nonlinear mapping function, a complete feature transfer mapping table between levels is constructed, where each element represents the feature transfer transformation from one level to another, thus obtaining the feature transfer mapping.

[0046] According to one aspect of this application, the steps of applying a boundary attention mechanism to enhance boundary features include:

[0047] Design a boundary-sensitive filter by convolving a directional Gaussian kernel function with the image gradient to enhance the sensitivity to the occlusion direction and obtain a boundary response map;

[0048] A nonlinear activation function is applied to the boundary response map, where the activation function parameters are adaptively adjusted according to the occlusion complexity, to obtain the boundary attention map.

[0049] By applying the boundary attention map to a multi-level feature set, the feature weights of the occlusion boundary region are enhanced, resulting in an enhanced feature map.

[0050] Based on the enhanced feature map and the hierarchical association map, an improved dynamic programming algorithm is used to trace the occlusion boundary along the gradient direction to obtain the occlusion boundary map; and the topological relationship of occlusion is analyzed based on the occlusion boundary map to determine the spatial relationship between the foreground and the background, thus obtaining the occlusion topology map.

[0051] According to one aspect of this application, the steps of designing a boundary-sensitive filter and generating a boundary attention map include:

[0052] Construct a directional filter bank containing Gaussian derivative filters in multiple principal directions;

[0053] The multi-scale gradient operator is applied to the standardized image to calculate the image gradient. The calculation is performed at multiple different scales to obtain a multi-scale gradient map.

[0054] The directional filter bank is convolved with the multi-scale gradient map to calculate the boundary response in each direction, thus obtaining the directional boundary response.

[0055] Non-maximum suppression is applied to the directional boundary response, retaining the direction of the strongest response at each pixel location, and recording this direction to obtain the maximum response map and the direction map;

[0056] By combining the maximum response map and the orientation map, a boundary response map is generated, and regions with high orientation consistency are enhanced to obtain the boundary response map.

[0057] Read the boundary response graph and the hierarchical relationship graph, calculate the scene occlusion complexity index, and obtain the occlusion complexity index;

[0058] Based on the occlusion complexity index, the adaptive parameters of the activation function are calculated. The higher the complexity, the larger the parameter value, thus obtaining the adaptive parameters.

[0059] Read the boundary response map and adaptive parameters, apply an improved activation function to process the boundary response values, and generate an initial attention map; then apply attention enhancement algorithms, including local contrast enhancement and importance diffusion, to the initial attention map to enhance the boundary region and obtain a boundary attention map.

[0060] According to one aspect of this application, the steps for performing a hierarchical consistency assessment include:

[0061] Design a hierarchical consistency evaluation function to evaluate the segmentation consistency between adjacent layers. In this function, a spatial position weighting function is introduced to enable the evaluation function to take into account the spatial relationship of occlusion, thereby obtaining a hierarchical consistency matrix.

[0062] Regions with consistency below a threshold are identified from the hierarchical consistency matrix and marked as inconsistent regions, thus obtaining an inconsistent region map.

[0063] For regions in the inconsistency region map, a sparse human structure prior is introduced. This prior is obtained by sparse encoding of a large amount of pedestrian pose data. Based on the structure prior, the region features are re-analyzed, the hierarchical boundaries are adjusted, and a repair candidate set is obtained.

[0064] Each candidate solution in the repair candidate set is verified, and the consistency score with the global structure is calculated. The solution with the highest score is selected as the final repair result, and the repaired hierarchical segmentation is obtained. Based on the repaired hierarchical segmentation, the hierarchical association graph and the occlusion topology graph are updated to obtain the optimized hierarchical graph.

[0065] According to one aspect of this application, the steps for designing a hierarchical consistency evaluation function and a structure priori-based repair include:

[0066] Spatial location features of each level are extracted from the occlusion topology map, including center coordinates, orientation and coverage area, to obtain a spatial location feature set;

[0067] Based on the spatial location feature set, a spatial location weighting function is constructed, which takes into account the distance and directional differences between levels to obtain the spatial location weighting function;

[0068] Calculate the intersection and union regions between any two levels, establish a cross relationship table between levels, and obtain the level cross table;

[0069] By combining the hierarchical cross-tabulation and the spatial location weighting function, the complete hierarchical consistency matrix is ​​calculated, and the hierarchical consistency matrix is ​​obtained.

[0070] By pre-coding a large amount of multi-view pedestrian pose data, a structural prior dictionary of human pose is constructed, and a human structure dictionary is obtained.

[0071] Read the region features marked in the inconsistency region map, project them onto the human body structure dictionary space, and obtain sparse representation coefficients;

[0072] Based on sparse representation coefficients and human body structure dictionary, the structural prior constraints are reconstructed and obtained.

[0073] Read the inconsistent region map and structural prior constraints, generate a series of candidate boundary adjustment schemes near the original boundary based on the structural priors, and obtain the boundary adjustment candidate set; and apply the boundary adjustment candidate set to the original segmentation results to generate multiple sets of repair candidate schemes, and obtain the repair candidate set.

[0074] According to one aspect of this application, the steps for decoupling features at each level include:

[0075] Based on the optimized hierarchical graph and occlusion topology graph, an occlusion relationship matrix is ​​constructed, where the matrix elements represent the degree of occlusion of one layer on another, thus obtaining the occlusion relationship matrix;

[0076] Constrained matrix decomposition is performed on the observed mixed features and occlusion relationship matrix to extract independent features from each layer, resulting in a decoupled feature set;

[0077] Based on the decoupled feature set and prior knowledge of human structure, complete pedestrian features at each layer are reconstructed, resulting in a reconstructed pedestrian feature set; and

[0078] A pedestrian detector is applied to the reconstructed pedestrian feature set to locate the position and bounding box of each pedestrian, thus obtaining hierarchical pedestrian detection results.

[0079] By employing similarity gradient calculation and adaptive depth determination techniques, this method achieves intelligent adjustment of decomposition depth for scenarios with varying complexity. Traditional quadtree decomposition methods use a fixed depth (typically only 1-2 layers), which cannot handle complex multi-layered occlusion. This method, however, determines whether to continue decomposition by calculating the rate of change (gradient) of similarity with respect to decomposition depth. Combined with a dynamic threshold function Tg(d) = T0·e^(-λd), complex regions are decomposed deeper, while simple regions are decomposed to the next level. For example, in the test scenario, densely populated areas are automatically decomposed to layer 4, while open areas are decomposed only to layer 2, avoiding computational redundancy caused by over-decomposition. Experiments show that this method improves scene layering accuracy from 72% to 91% compared to traditional methods. Particularly in overlapping "people-on-people" regions, the layering error rate is reduced from 25% to 8.2%, significantly improving the basic accuracy of subsequent detection.

[0080] By employing inter-level feature transfer and a bidirectional constraint mechanism, the hierarchical isolation problem in traditional methods is effectively solved. An adaptive feature transfer kernel function Ktrans(i,j,Gsim) = Wsim(i,j)·D(Gsim) based on similarity gradients is used to dynamically adjust the transfer intensity of features as they flow between levels, preserving more detailed features in regions with large gradients (such as occlusion boundaries) and providing more contextual information in regions with small gradients. Simultaneously, the designed bidirectional constraint mechanism (top-down constraint and bottom-up verification) forms a closed-loop feedback, enabling mutual verification and complementation of features at each level. In peak-hour congested platform tests, this mechanism improved the efficiency of inter-level feature utilization by 68% and boundary accuracy by 21 percentage points. Particularly for partially occluded pedestrians, the correct recognition rate increased from 63% to 87%, effectively overcoming the technical bottleneck of traditional methods' inability to utilize multi-level complementary information.

[0081] Traditional edge detection often produces blurred boundaries in occluded areas, while this method designs a directional Gaussian derivative filter Gθ(x,y) = -x·e^(-(x 2 +y 2 ) / 2σ 2 )·cos(θ) - y·e^(-(x 2 +y²) / 2σ 2The function β is specifically designed to enhance sensitivity to occlusion direction. More importantly, an adaptive boundary attention activation function AB(x,y) = 1 / (1+e^(-β·B(x,y))) with parameters β=β0·(1+λ·Cocc) is introduced, enabling the system to automatically adjust its sensitivity based on scene occlusion complexity. For example, in a scenario with a complexity index Cocc=6.1, the β value is automatically adjusted to 4.44, significantly enhancing boundary detection capabilities. This mechanism improves the boundary detection accuracy of occlusion junctions from 68% in traditional methods to 94%, particularly in distinguishing the boundaries of pedestrians with similar appearances (such as similar clothing), reducing the misclassification rate from 18% to 3.5%, thus solving the critical problem of accurate occlusion boundary localization in dense pedestrian flow detection.

[0082] By introducing spatial location weighting into the hierarchical consistency evaluation function, the shortcomings of traditional methods in ignoring spatial geometric relationships are addressed. In the evaluation function C(Li, Lj) = |Li ∩ Lj| / |Li ∪ Lj|·Wij, the spatial location weight Wij = exp(-dij) 2 / 2σd 2 )·exp(-θij 2 / 2σθ 2 This method considers the distance and directional differences between levels, making the evaluation more consistent with the actual situation of human occlusion. For example, between two pedestrians overlapping vertically, the function can accurately evaluate the occlusion relationship between the pedestrian above and the pedestrian below, while between pedestrians separated horizontally, even if there is projection overlap, it can be correctly judged as no occlusion. Experiments show that this method improves the accuracy of hierarchical relationship recognition from 75% to 93% of traditional methods, especially in complex occlusion topology scenarios (such as when one person simultaneously occludes multiple people or is occluded by multiple people), where the accuracy improvement reaches 32%, laying an accurate hierarchical relationship foundation for subsequent occlusion decoupling.

[0083] By employing a sparse human structure prior and hierarchical repair mechanism, the problem of insufficient visual features is effectively addressed. This method constructs a human structure prior dictionary, Dstruct, containing 200 typical pose primitives, through sparse encoding of a large amount of multi-view pedestrian pose data, enabling the system to infer the complete human structure based on limited visible features. A sparse representation s = argmin ||Φ(f) - Dstruct·s|| is applied to inconsistent regions. 2The structural constraint Sp = Dstruct·s, defined by +λ||s||1, provides a strong semantic constraint for boundary optimization. In tests on severely occluded scenes (occlusion rate > 80%), this method improves the correct reconstruction rate by 35 percentage points compared to purely visual feature methods, especially in cases of multi-layered occlusion such as "people stacked on top of each other," where the accuracy increases from 54% to 87%. This technique solves the fundamental problem of traditional methods lacking sufficient features for judgment under severe occlusion, enabling the system to maintain a high detection rate even under extreme occlusion conditions, significantly improving the system's applicability in real-world high-density scenes.

[0084] By employing constraint matrix factorization and feature decoupling techniques, the occlusion problem is modeled as a feature mixing problem. This invention constructs an occlusion relation matrix Omat to represent the degree of occlusion between different levels, and then designs an optimization objective function min ||Fobs - FL·Omat|| 2 The method + λ1·Cspatial(FL) + λ2·Cshape(FL) decomposes the mixed observation features into independent features at each layer. Unlike traditional methods, this process incorporates spatial continuity constraints and human body shape constraints to ensure that the decoupling results conform to real-world scenarios. In a test on a platform with 26 overlapping people, this method successfully and accurately decomposed the mixed features in three layers of occlusion, recovering the complete features of 27 pedestrians, maintaining a detection accuracy of 91% even with an 80% occlusion rate. Compared to the traditional detection method's accuracy of only 32% under the same conditions, this technology represents a qualitative leap, fundamentally solving the problem of missed detections caused by severe occlusion in high-density crowds, reducing the system's missed detection rate from 45% to 8%, meeting the basic requirements for station security monitoring (missed detection rate ≤10%).

[0085] In summary, this invention provides a systematic solution to the problem of multi-layered occlusion in dense passenger flow scenarios at train stations. Compared to existing technologies, the detection miss rate in heavily occluded scenarios (occlusion rate >70%) is reduced from a minimum of 29% to 8%, meeting safety monitoring requirements while maintaining a processing speed of 12 frames per second, achieving near real-time monitoring needs. These technological breakthroughs enable the dense passenger flow monitoring system to accurately detect almost all passengers during peak hours, providing reliable technical support for station safety management, passenger flow management, and emergency response, and possessing significant practical value.

[0086] According to one aspect of this application, in a certain embodiment, the following steps are included:

[0087] S1: Data Acquisition and Preprocessing

[0088] S11: Acquire station monitoring video data, read multi-view video streams through the monitoring system API interface, and output the original video frame sequence Vraw.

[0089] S12: Read the original video frame sequence Vraw, perform denoising, illumination equalization and geometric correction, and output the preprocessed image Ipre.

[0090] S13: Perform size adjustment and pixel value normalization on the preprocessed image Ipre to generate a standardized image Istd with a standard size of H×W.

[0091] S2: Similarity Gradient-Driven Adaptive Hierarchical Decomposition

[0092] S21: Perform initial quadtree decomposition on the standardized image Istd, dividing the image into four regions: NW, NE, SW, and SE, and output the first-level decomposition result Q1.

[0093] S22: Read the decomposition result Qi, calculate the feature similarity Si for each region, and calculate the similarity gradient using the formula: Gsim = dS / dd, where d is the decomposition depth. Output the similarity gradient map Gsim. Use the gradient instead of a fixed threshold to determine the necessity of decomposition.

[0094] S23: Analyze the similarity gradient map Gsim. When the Gsim value of a region is greater than the dynamic threshold Tg(d) (indicating that deeper decomposition can obtain more information), continue decomposing the region; when Gsim tends to stabilize (below the threshold), stop the decomposition and output the optimal decomposition depth matrix Dopt. Use the dynamic threshold Tg(d), which is adaptively adjusted with the decomposition depth d: Tg(d) = T0 · e-λd.

[0095] S24: Based on the optimal decomposition depth matrix Dopt, recursively decompose the normalized image Istd, perform quadtree decomposition on regions that need further decomposition, and output the multi-level region decomposition result Qmul.

[0096] S25: Organize the multi-level domain decomposition result Qmul into a tree structure, establish parent-child node relationships, and output the domain decomposition tree Treg.

[0097] S3: Cross-level feature transfer and constraints

[0098] S31: Extract features from each node region in the region decomposition tree Treg, and output a multi-level feature set Fmul using gradient histograms and texture feature descriptors.

[0099] S32: Based on the multi-level feature set Fmul and the similarity gradient map Gsim, a feature transfer function between levels is constructed: Fi = f(Fi-1, Gsim), where f is a non-linear mapping function, realizing the flow of information between levels and outputting the feature transfer mapping Mtrans. An adaptive weight transfer function based on the similarity gradient enables the feature transfer process to be dynamically adjusted according to the differences between levels.

[0100] S33: Using the feature transfer mapping Mtrans, feature constraints are passed from the upper layer to the lower layer. The upper layer features provide spatial location priors for the lower layer, and the output is the top-down constraint features Ftop-down.

[0101] S34: Utilize the top-down constraint feature Ftop-down and the multi-level feature set Fmul to perform bottom-up verification. The lower-level features provide feedback to verify the upper-level segmentation results, correct boundary errors, and output the bottom-up verification feature Fbottom-up.

[0102] S35: Combine top-down constraint features (Ftop-down) and bottom-up validation features (Fbottom-up) to construct a hierarchical association graph (LAG), record the feature correspondence and spatial dependencies between different levels, and output the hierarchical association graph (Glag).

[0103] S4: Boundary Attention Enhancement and Precise Localization of Occlusion Boundaries

[0104] S41: Design a boundary-sensitive filter using the formula: Where G(x,y) is the directional Gaussian kernel function. The image gradient is used to output the boundary response map Bresp. A directional Gaussian kernel is introduced to enhance the sensitivity to occlusion direction and solve the blurring problem in occluded areas in traditional edge detection.

[0105] S42: Apply a non-linear activation function to the boundary response map Bresp: AB = σ(B(x,y)), where σ is a modified sigmoid function: σ(x) = 1 / (1+e-βx), and β is a parameter adaptively adjusted according to the occlusion complexity, outputting the boundary attention map AB. The design of the adaptive parameter β enables the activation function to dynamically adjust its sensitivity according to the scene complexity.

[0106] S43: Apply the boundary attention map AB to the multi-level feature set Fmul using the formula: Fenh = Fmul * (1 + α · AB), where α is the enhancement coefficient, to enhance the feature weights of the occlusion boundary region and output the enhanced feature map Fenh.

[0107] S44: Based on the enhanced feature map Fenh and the hierarchical association map Glag, an improved dynamic programming algorithm is used to trace the occlusion boundary along the gradient direction, and the occlusion boundary map Bocc is output.

[0108] S45: Analyze the topological relationships of occlusion based on the occlusion boundary map Bocc, determine the spatial relationship between the foreground and background, and output the occlusion topology map Tocc.

[0109] S5: Hierarchical self-verification and repair

[0110] S51: Design a hierarchical consistency evaluation function: C(Li, Lj) = |Li ∩ Lj| / |Li ∪ Lj| ·Wij, where Wij is a spatially weighted function that evaluates the segmentation consistency between adjacent layers and outputs a hierarchical consistency matrix Cmat. Introducing the spatially weighted Wij allows the evaluation function to consider the spatial relationships of occlusion, improving its sensitivity to partially overlapping regions.

[0111] S52: Identify regions with consistency below the threshold Tc from the hierarchical consistency matrix Cmat, mark them as inconsistent regions, and output the inconsistent region map Iincon.

[0112] S53: For regions in the inconsistency region map Iincon, a sparse human structure prior, Sp, is introduced. This prior is obtained through sparse encoding of a large amount of pedestrian pose data. Based on the structural prior, region features are re-analyzed, hierarchical boundaries are adjusted, and a repair candidate set Rcand is output. Using the sparsely encoded human structure prior provides stronger semantic constraints and solves the problem of insufficient pure visual features in traditional methods.

[0113] S54: Verify each candidate scheme in the repair candidate set Rcand, calculate the consistency score with the global structure, select the scheme with the highest score as the final repair result, and output the repaired hierarchical segmentation Lrep.

[0114] S55: Based on the repaired hierarchical segmentation Lrep, update the hierarchical association graph Glag and the occlusion topology graph Tocc, and output the optimized hierarchical graph Gopt.

[0115] S6: Occlusion Decoupling and Pedestrian Reconstruction

[0116] S61: Based on the optimized hierarchical graph Gopt and the occlusion topology graph Tocc, construct the occlusion relationship matrix O, where Oij represents the degree of occlusion of the i-th layer on the j-th layer, and output the occlusion relationship matrix Omat.

[0117] S62: Perform constrained matrix factorization on the observed mixed features Fobs and occlusion relation matrix Omat: FL = Fobs · Omat-1, extract independent features from each layer, and output the decoupled feature set FL. By using a constrained matrix factorization algorithm suitable for occlusion scenarios, spatial continuity and human body shape constraints are added, making the decomposition results more consistent with reality.

[0118] S63: Based on the decoupled feature set FL and human structure prior Sp, reconstruct the complete pedestrian features of each layer: Pi = R(FL_i, Sp), where R is the reconstruction function, and the output is the reconstructed pedestrian feature set Prec.

[0119] S64: Pedestrian Detection and Localization. Apply a pedestrian detector to the reconstructed pedestrian feature set Prec to locate the position and bounding box of each pedestrian and output the hierarchical pedestrian detection result Dped.

[0120] S7: Parameter Adaptive Optimization

[0121] S71: Based on the standardized image Istd and the occlusion topology graph Tocc, calculate the scene complexity index, including occlusion rate, personnel density and pose change degree, and output the scene complexity index Scomp.

[0122] S72: Analyze the impact of key parameters (such as Tg, β, α, Tc) on detection performance, establish a parameter sensitivity model, and output the parameter sensitivity matrix Psens.

[0123] S73: Based on the scene complexity index Scomp and the parameter sensitivity matrix Psens, dynamically adjust the system parameters, optimize the detection performance, and output the optimized parameter set Popt.

[0124] S74: Apply the optimized parameter set Popt to the previous processing steps (S2-S6) to form a feedback loop, iteratively optimize the processing results, and output the optimized control signal Copt.

[0125] S8: Detection Result Integration and Output

[0126] S81: Analyze the possible redundant detections in the hierarchical pedestrian detection results Dped, merge or delete redundant items based on spatial overlap and feature similarity, and output the deredundant detection result Dnonred.

[0127] S82: Perform cross-level consistency verification on the redundancy removal detection result Dnonred to ensure that the detection result is consistent with the hierarchical structure, and output the verified detection result Dver.

[0128] S83: Perform temporal correlation and smoothing between the verified detection result Dver of the current frame and the detection results of historical frames to improve detection stability and output the temporally smoothed detection result Dsmooth.

[0129] S84: Integrate the temporal smoothing detection results Dsmooth, format the output detection information, including pedestrian location, occlusion relationship and density statistics, and generate the final passenger flow detection result Dfinal.

[0130] According to another aspect of this application, S22 is also provided, specifically as follows:

[0131] S221: Read each region in the decomposition result Qi, and use HOG (Histogram of Oriented Gradients) and LBP (Local Binary Pattern) feature extractors to extract features from each region, and output the region feature vector Fregion.

[0132] S222: Read the region feature vector Fregion, calculate the feature similarity between adjacent regions using the cosine similarity formula: Scos(Fi, Fj) = (Fi·Fj) / (||Fi||·||Fj||), and perform the calculation on multiple feature scales to output the multi-scale similarity matrix Smulti.

[0133] S223: Read the multi-scale similarity matrix Smulti, calculate the similarity change rate for each decomposition level d: dS / dd = (Sd-Sd-1) / 1, and retain the gradient direction information to form a vectorized similarity gradient, and output the vectorized similarity gradient Vgrad.

[0134] S224: Based on the vectorized similarity gradient Vgrad, the gradient value of each region is mapped back to the image space to construct a two-dimensional gradient map. Noise is eliminated by Gaussian smoothing, and the similarity gradient map Gsim is output.

[0135] According to another aspect of this application, step S23 specifically comprises:

[0136] S231: Construct a dynamic threshold function that adaptively adjusts with the decomposition depth d: Tg(d) = T0 · e-λd, where T0 is the baseline threshold (taken as 0.3), λ is the attenuation coefficient (taken as 0.15), and the threshold decreases as d increases, outputting the dynamic threshold function Tg.

[0137] S232: Read the similarity gradient map Gsim and the dynamic threshold function Tg. Compare the gradient value Gsim(r) of each region with the threshold Tg(d) corresponding to the current depth. If Gsim(r) > Tg(d), mark the region as needing further decomposition and output the region decomposition label map Mdiv.

[0138] S233: Read the region decomposition marker map Mdiv, combine the local entropy value Elocal and the gradient direction consistency Cdir, comprehensively evaluate the necessity of decomposition for each region, and calculate the decision score through the decision function: D(r) = w1·Gsim(r) + w2·Elocal(r) + w3·Cdir(r). If D(r) > Td, continue decomposition and output the optimized decomposition decision Ddec.

[0139] S234: Based on the optimization decomposition decision Ddec, the optimal decomposition depth is assigned to each region in the image, a depth matrix is ​​constructed, and the depth difference between adjacent regions is smoothed by median filtering to ensure decomposition continuity. The optimal decomposition depth matrix Dopt is then output.

[0140] According to one aspect of this application, step S32 specifically includes:

[0141] S321: Read the multi-level feature set Fmul, perform principal component analysis (PCA) decomposition on the feature vectors, extract the main feature components, decompose the features into basic features Fbase and detail features Fdetail, and output the decomposed feature set {Fbase, Fdetail}.

[0142] S322: Read the similarity gradient map Gsim, calculate the similarity weight matrix Wsim between adjacent levels. The weight values ​​are calculated using the function: Wsim(i,j) = 1 / (1+exp(-α·Gsim(i,j))), where α is the sensitivity parameter (taken as 5.0), and output the similarity weight matrix Wsim.

[0143] S323: Based on the similarity weight matrix Wsim, a feature transfer kernel function K(i,j,Gsim) is designed. This kernel function adaptively adjusts the transfer weights according to the magnitude and direction of the similarity gradient. When the gradient is large, the transfer weights are reduced to preserve boundary information, and the feature transfer kernel Ktrans is output. Unlike traditional fixed-weight methods, this kernel function can adaptively adjust the feature transfer intensity.

[0144] S324: Combining the feature transfer kernel Ktrans and the decomposed feature set {Fbase, Fdetail}, a nonlinear mapping function f is constructed: Fi = f(Fi-1, Gsim) = Ktrans·Fbase,i-1 + (1-Ktrans)·Fdetail,i, to realize adaptive feature transfer between layers and output the nonlinear mapping function fmap.

[0145] S325: Apply the nonlinear mapping function fmap to construct a complete inter-level feature transfer mapping table. Each element in the table represents the feature transfer transformation from one level to another, and the feature transfer mapping Mtrans is output.

[0146] According to one aspect of this application, S41, specifically:

[0147] S411: Construct a directional filter bank containing Gaussian derivative filters in 8 principal directions (0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°). The filter kernel function is: Gθ(x,y) = -xe-(x2 +y 2 ) / 2σ 2 cos(θ) - ye-(x 2 +y 2 ) / 2σ 2 sin(θ), where θ is the filter direction, σ is the scaling parameter, and the output is the directional filter bank Fdir.

[0148] S412: Read the normalized image Istd, apply multi-scale gradient operators (including Sobel, Scharr, and the optimized Roberts operator) to calculate the image gradient, perform the calculation at three different scales (3×3, 5×5, 7×7), and output the multi-scale gradient map. .

[0149] S413: Reading multi-scale gradient maps Convolution operation is performed on the image using the directional filter bank Fdir: Calculate the boundary response in each direction and output the directional boundary response Bθ.

[0150] S414: Apply non-maximum suppression to the directional boundary response Bθ, retain the direction with the strongest response at each pixel location, record the direction, and output the maximum response map Bmax and the direction map Dmax.

[0151] S415: Combining the maximum response map Bmax and the orientation map Dmax, a boundary response map B(x,y) is generated. Regions with high directional consistency are enhanced using the formula: B(x,y) = Bmax(x,y) · (1 + γ · Cdir(x,y)), where Cdir is the directional consistency metric and γ is the enhancement coefficient (set to 0.5). The resulting boundary response map Bresp is output. Using directional consistency as an enhancement factor more effectively captures occlusion boundaries.

[0152] According to one aspect of this application, S42 specifically includes:

[0153] S421: Read the hierarchical association graph Glag and the boundary response graph Bresp, calculate the scene occlusion complexity index: Cocc = w1·Nlayer + w2·∑∑Glag(i,j) + w3·Var(Bresp), where Nlayer is the number of layers and w is the weight coefficient, and output the occlusion complexity index Cocc.

[0154] S422: Based on the occlusion complexity index Cocc, calculate the adaptive parameter β of the sigmoid function: β = β0 · (1 + λ · Cocc), where β0 is the baseline parameter (taken as 2.0), and λ is the adjustment coefficient (taken as 0.2). The higher the complexity, the larger the value of β, and the steeper the sigmoid function. Output the adaptive parameter βadapt. Traditional methods use fixed parameters and cannot adapt to scene changes.

[0155] S423: Read the boundary response map Bresp and the adaptive parameter βadapt, apply the improved sigmoid function: σ(x) = 1 / (1+e-β·x) to process the boundary response value, generate the initial attention map, and output the initial attention map Ainit.

[0156] S424: Apply the attention enhancement algorithm to the initial attention map Ainit, including local contrast enhancement and importance diffusion. Enhance the boundary region through iterative update formula: At+1 = At ​​+ δ·(At - GaussianBlur(At)), where δ is the diffusion coefficient (taken as 0.1), and output the final boundary attention map AB.

[0157] According to another aspect of this application, step S51 specifically comprises:

[0158] S511: Extract the spatial location features of each level from the occlusion topology graph Tocc, including center coordinates, orientation and coverage area, to establish a spatial reference system and output the spatial location feature set Pspatial.

[0159] S512: Based on the spatial location feature set Pspatial, construct the spatial location weighting function: Wij = exp(-dij 2 / 2σd 2 ) · exp(-θij 2 / 2σθ 2 ), where dij is the normalized distance between the center points of levels i and j, θij is the directional difference, σd and σθ are the scale parameters of distance and direction, and the output is the spatial location weighting function Wsp. Traditional methods ignore the spatial geometric relationships of occlusion.

[0160] S513: Read the segmentation results of each level, calculate the intersection region |Li ∩ Lj| and the union region |Li ∪ Lj| between any two levels i and j, establish the intersection relationship table between levels, and output the level intersection table Ccross.

[0161] S514: Combine the hierarchical cross-tabulation Ccross and the spatial location weighting function Wsp to calculate the complete hierarchical consistency matrix: C(Li, Lj) = |Li ∩ Lj| / |Li ∪ Lj| · Wij, and output the hierarchical consistency matrix Cmat.

[0162] According to one aspect of this application, step S53 specifically comprises:

[0163] S531: Beforehand, a structural prior dictionary Dstruct for human pose is constructed by sparsely encoding a large amount of multi-view pedestrian pose data. This dictionary contains K typical pose primitives (let K=200), each primitive describes the human body structural features under a specific viewpoint, and outputs the human body structure dictionary Dstruct.

[0164] S532: Read the region features marked in the inconsistency region map Iincon and project them onto the human body structure dictionary space: s = argmin ||Φ(f) - Dstruct·s|| 2 + λ||s||1, where Φ(f) is the feature transformation function, s is the sparse coefficient vector, λ is the regularization parameter (taken as 0.1), and the output is the sparse representation coefficients ssparse.

[0165] S533: Based on the sparse representation coefficients ssparse and the human body structure dictionary Dstruct, reconstruct the structural prior constraint: Sp = Dstruct·ssparse. This constraint reflects the human body structure characteristics that should exist in the current region, and outputs the structural prior constraint Sp.

[0166] S534: Read the inconsistency region map Iincon and the structural prior constraint Sp, generate a series of candidate boundary adjustment schemes near the original boundary based on the structural prior, randomly sample using the Monte Carlo method, and output the boundary adjustment candidate set Bcand based on the consistency score with the structural prior.

[0167] S535: Apply the boundary adjustment candidate set Bcand to the original segmentation result to generate multiple sets of repair candidate schemes. Each scheme contains the adjusted hierarchical boundary and region segmentation, and outputs the repair candidate set Rcand.

[0168] According to one aspect of this application, step S62 specifically comprises:

[0169] S621: Read the mixed features Fobs and the occlusion relation matrix Omat, establish a linear mixture model: Fobs = FL · Omat, where FL is the independent feature of each layer, and output the linear mixture model Mmix.

[0170] S622: Design two types of constraints: 1) Spatial continuity constraint Cspatial, to ensure that the decoupled features are continuous and smooth in space; 2) Human shape constraint Cshape, to ensure that the decoupled features conform to the characteristics of human shape, and output the constraint set {Cspatial, Cshape}.

[0171] S623: Read the linear mixed model Mmix and the constraint set {Cspatial, Cshape}, and construct the optimization objective function: min ||Fobs - FL·Omat|| 2 + λ1Cspatial(FL) + λ2Cshape(FL) are solved by iterative least squares method. The estimated value of FL is updated in each iteration, and the iterative optimization sequence {FL(t)} is output.

[0172] S624: Select the optimal solution from the iterative optimization sequence {FL(t)}, score it according to the reconstruction error and the degree of constraint satisfaction, select the solution with the highest score as the final decoupling result, and output the decoupling feature set FL.

[0173] Example 1

[0174] 1. Acquisition and preprocessing of station surveillance video data

[0175] In this embodiment, surveillance video data from a large subway transfer station during the morning rush hour from 7:30 to 8:30 was used. The surveillance camera was installed at a height of 4.5 meters, with a downward viewing angle, covering an area of ​​approximately 25 square meters on the platform. The video resolution was 1920×1080 pixels, and the frame rate was 25 frames per second.

[0176] First, the raw video data is preprocessed. The preprocessing steps include: applying a 5×5 Gaussian filter (σ=1.2) to remove video noise; using the CLAHE (Contrast-Limited Adaptive Histogram Equalization) algorithm with parameters set to: block size 8×8, contrast limit parameter 3.0; performing geometric correction using the 4-point correspondence method (marked points at the four corners of the platform) to eliminate viewpoint distortion; scaling the image to a uniform size of 640×480 pixels and normalizing the pixel values ​​(0-1 range);

[0177] After the above processing, the standardized image Istd is obtained. In this embodiment, the 375th frame of the video sequence is selected as the demonstration sample. This frame contains 27 passengers and has multiple overlapping occlusions of 3-4 layers.

[0178] 2. Adaptive quadtree decomposition of standardized images

[0179] First, the standardized image Istd is decomposed into an initial quadtree, dividing the 640×480 image into four 320×240 regions, labeled as NW (northwest), NE (northeast), SW (southwest) and SE (southeast), respectively, to obtain the first-level decomposition result Q1.

[0180] Next, feature similarity is calculated for each region in the first-level decomposition results. The calculation process is as follows:

[0181] (1) Region Feature Extraction: HOG (Histogram of Oriented Gradients) and LBP (Local Binary Pattern) features are extracted for each region. HOG feature parameters: 8×8 pixels per cell, 2×2 cells per block, 9 oriented gradient bins; LBP feature parameters: radius of 2, number of sampling points of 8; for example, the HOG feature vector FH_NW extracted for the NW region (0,0,320,240) has a dimension of 1764, and the LBP feature vector FL_NW has a dimension of 256. The two features are concatenated to form the region feature vector F_NW = [FH_NW,FL_NW], with a total dimension of 2020.

[0182] (2) Similarity Calculation: Calculate the feature similarity between adjacent regions using the cosine similarity formula:

[0183] Similarity calculation: Scos(Fi, Fj) = (Fi·Fj) / (||Fi||·||Fj||); where: Fi is the feature vector of region i; Fj is the feature vector of region j; Fi·Fj is the dot product of the two feature vectors; ||Fi|| is the Euclidean norm of feature vector Fi; the value range of Scos(Fi, Fj) is [-1,1], and the larger the value, the higher the similarity. In this embodiment, the similarity of each adjacent region is calculated as follows: S(NW,NE) = 0.78; S(NW,SW) = 0.65; S(NE,SE) = 0.82; S(SW,SE) = 0.71;

[0184] Furthermore, similarity is calculated at multiple feature scales. The region is further divided into sub-regions, and the similarity between sub-regions is calculated to form a multi-scale similarity matrix Smulti. In this embodiment, three scales are used: Scale 1 (320×240): original decomposed region; Scale 2 (160×120): secondary decomposed region (each primary region is divided into 4 sub-regions); Scale 3 (80×60): tertiary decomposed region (each secondary region is divided into 4 sub-regions);

[0185] (3) Similarity gradient calculation: For each decomposition level d, calculate the rate of change of similarity, i.e., the similarity gradient. The calculation formula is:

[0186] Similarity gradient calculation method: Gsim = dS / dd = (S_d - S_(d-1)) / 1; where: S_d is the similarity value of the d-th layer; S_(d-1) is the similarity value of the (d-1)-th layer; Gsim is the rate of change of similarity with decomposition depth, i.e., the similarity gradient; a negative value indicates that the similarity decreases with increasing depth, indicating that there is heterogeneity in the region, which may require further decomposition. For example, for the NW region: the similarity change from level 1 to 2: S1 = 0.78, S2 = 0.56, Gsim = (0.56 - 0.78) = -0.22; the similarity change from level 2 to 3: S2 = 0.56, S3 = 0.31, Gsim = (0.31 - 0.56) = -0.25; the similarity gradient values ​​of each region are mapped back to the image space to form the similarity gradient map Gsim. In this embodiment, the gradient values ​​(absolute values) of the NW and SE regions are the largest, at -0.25 and -0.29 respectively, indicating that these two regions have greater heterogeneity and may require deeper decomposition.

[0187] (4) Constructing a dynamic threshold function: Constructing a dynamic threshold function that adaptively adjusts with the decomposition depth:

[0188] Dynamic threshold function: Tg(d) = T0·e^(-λd); where: T0 is the baseline threshold, set to 0.3; λ is the attenuation coefficient, set to 0.15; d is the decomposition depth; Tg(d) is the dynamic threshold function, which decreases as the depth increases.

[0189] Calculate the thresholds for each level: Tg(1) = 0.3·e^(-0.15×1) = 0.26; Tg(2) = 0.3·e^(-0.15×2) = 0.22; Tg(3) = 0.3·e^(-0.15×3) = 0.19;

[0190] (5) Region decomposition decision: Compare the absolute value of the similarity gradient with the threshold of the corresponding depth. If the absolute value of the gradient is greater than the threshold, continue to decompose the region.

[0191] In this embodiment: NW region: |Gsim| = 0.25 > Tg(2) = 0.22, decomposition needs to continue; NE region: |Gsim| = 0.18 < Tg(2) = 0.22, decomposition stops; SW region: |Gsim| = 0.21 < Tg(2) = 0.22, decomposition stops; SE region: |Gsim| = 0.29 > Tg(2) = 0.22, decomposition needs to continue.

[0192] Furthermore, by combining the local entropy value Elocal and the gradient direction consistency Cdir, the necessity of decomposition is comprehensively evaluated:

[0193] Decision function: D(r) = w1·|Gsim(r)| + w2·Elocal(r) + w3·Cdir(r); where: Gsim(r) is the similarity gradient of region r; Elocal(r) is the local entropy of region r, reflecting the complexity within the region; Cdir(r) is the gradient direction consistency of region r, reflecting the degree of uniformity of gradient directions within the region; w1, w2, and w3 are weight coefficients, set to 0.5, 0.3, and 0.2 respectively; D(r) is the decision score, which is further decomposed if it is greater than the threshold Td (set to 0.25). Taking the NW region as an example: Gsim(NW) = -0.25, |Gsim(NW)| = 0.25; Elocal(NW) = 0.38 (calculated local entropy value); Cdir(NW) = 0.15 (calculated gradient direction consistency); D(NW) = 0.5×0.25 + 0.3×0.38 +0.2×0.15 = 0.264 > Td = 0.25; therefore, the NW region needs to be further decomposed.

[0194] (6) Generate the optimal decomposition depth matrix: Based on the above decision results, assign the optimal decomposition depth to each region in the image. In this embodiment: NW region: decompose to depth 3; NE region: decompose to depth 2; SW region: decompose to depth 2; SE region: decompose to depth 3; To ensure the continuity of decomposition, apply a 5×5 median filter to the depth matrix to smooth the depth difference between adjacent regions and obtain the final optimal decomposition depth matrix Dopt.

[0195] (7) Recursive Region Decomposition: Based on the optimal decomposition depth matrix Dopt, the normalized image Istd is recursively decomposed into a quadtree. For example, the NW region needs to be decomposed to level 3, so it is divided into 16 sub-regions of 80×60; while the NE region only needs to be decomposed to level 2, so it is divided into 4 sub-regions of 160×120. The final multi-level region decomposition result Qmul contains region blocks of different sizes, totaling 41 region blocks (due to different decomposition depths in different regions). These region blocks are organized into a tree structure, establishing parent-child node relationships, to obtain the region decomposition tree Treg.

[0196] 3. Perform feature extraction on the multi-level region decomposition results and establish feature transfer and constraint relationships between levels.

[0197] First, features are extracted from each node region in the region decomposition tree Treg to generate a multi-level feature set Fmul. The feature extraction method is the same as in step 2, extracting HOG features and LBP features for each region and concatenating them into a feature vector.

[0198] Next, we construct a feature transfer function between layers to enable information flow between different layers. The specific steps are as follows:

[0199] (1) Eigenvector decomposition: Principal component analysis (PCA) is performed on each eigenvector in the multi-level feature set Fmul to extract the main feature components. In this embodiment, the original 2020-dimensional feature vector is decomposed into two parts: basic features Fbase (retaining the first 100 principal components) and detailed features Fdetail (the remaining part).

[0200] For example, PCA decomposition is performed on the feature vector F_NW of the NW region: F_NW = [FH_NW, FL_NW] ->{Fbase_NW, Fdetail_NW};

[0201] (2) Similarity weight generation: Based on the similarity gradient map Gsim, the similarity weight between adjacent layers is calculated: similarity weight calculation: Wsim(i,j) = 1 / (1+exp(-α·Gsim(i,j))); where: Gsim(i,j) is the similarity gradient between regions i and j; α is the sensitivity parameter, set to 5.0; Wsim(i,j) is the similarity weight, with a value range of (0,1).

[0202] Taking the NW region as an example, calculate its weight with the next-level sub-region NW1 (top-left sub-region): Gsim(NW,NW1) = -0.25; Wsim(NW,NW1) = 1 / (1+exp(-5.0×(-0.25))) = 1 / (1+exp(1.25)) = 1 / (1+3.49) = 0.223;

[0203] (3) Feature Transfer Kernel Design: Design a feature transfer kernel function to adaptively adjust the transfer weights based on the magnitude and direction of the similarity gradient: Feature transfer kernel function: Ktrans(i,j,Gsim) = Wsim(i,j)·D(Gsim); where: Wsim(i,j) is the similarity weight; D(Gsim) is the direction modulation factor, when Gsim<0, D(Gsim)=1-|Gsim|, when Gsim≥0, D(Gsim)=1; Ktrans is the feature transfer kernel, which determines the transfer intensity of features from one level to another. Continuing with the example of the NW region: Gsim(NW,NW1) = -0.25; D(Gsim) = 1-|Gsim| = 1-0.25 = 0.75; Ktrans(NW,NW1) = 0.223×0.75 = 0.167; This means that the intensity of feature transfer from the NW region to the NW1 sub-region is 0.167.

[0204] (4) Construction of nonlinear mapping function: Combining feature transfer kernel and decomposed feature set, construct nonlinear mapping function:

[0205] Nonlinear mapping function: Fi = f(Fi-1, Gsim) = Ktrans·Fbase,i-1 + (1-Ktrans)·Fdetail,i; where: Fi is the feature of layer i; Fi-1 is the feature of layer i-1; Fbase,i-1 is the base feature of layer i-1; Fdetail,i is the detail feature of layer i; Ktrans is the feature transfer kernel; f is the nonlinear mapping function.

[0206] Taking the NW region and its sub-region NW1 as an example: Ktrans(NW,NW1) = 0.167; Fi = 0.167×Fbase_NW+ (1-0.167)×Fdetail_NW1 = 0.167×Fbase_NW + 0.833×Fdetail_NW1;

[0207] (5) Top-down feature constraints: Using the feature transfer mapping Mtrans, feature constraints are passed from the upper layer to the lower layer, and the features of the upper layer provide spatial location priors for the lower layer. For example, the feature constraints of the NW region are passed to all its sub-regions NW1-NW16.

[0208] (6) Bottom-up feature verification: The segmentation results of the upper region are verified by using the feature feedback of the lower sub-region. For example, if the consistency between the features of all sub-regions of the NW region and the NW features is lower than the threshold (set to 0.6 in this embodiment), it may be necessary to adjust the segmentation boundary of the NW region.

[0209] (7) Construction of Hierarchical Association Graph: By combining top-down constraint features and bottom-up verification features, a hierarchical association graph Glag is constructed to record the feature correspondence and spatial dependencies between different levels. In this embodiment, Glag is represented as an N×N matrix (N is the total number of regions, 41), and the matrix element Glag(i,j) represents the association strength between regions i and j.

[0210] 4. For occluded boundary regions in the hierarchical relationship graph, apply a boundary attention mechanism to enhance boundary features.

[0211] The main focus is on enhancing the boundary of occlusion areas. The specific implementation is as follows:

[0212] (1) Construction of Directional Filter Bank: Construct a directional filter bank containing Gaussian derivative filters in eight principal directions (0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°). The filter kernel function is:

[0213] Directional Gaussian derivative filter: Gθ(x,y) = -x·e^(-(x 2 +y 2 ) / 2σ 2 )·cos(θ) - y·e^(-(x 2 +y 2 ) / 2σ 2 )·sin(θ); where: θ is the filter direction; σ is the scale parameter, set to 1.5; x and y are the filter kernel coordinates; Gθ(x,y) is the Gaussian derivative filter in the θ direction.

[0214] For example, the partial values ​​calculated for the filter kernel (7×7) at 0° are: G0(0,0) = 0, G0(1,0) = -0.242, G0(0,1) = 0, G0(-1,0) = 0.242

[0215] (2) Multi-scale gradient extraction: Multi-scale gradient operators are applied to the normalized image Istd to calculate the image gradient. In this embodiment, the gradient is calculated using three different scales (3×3, 5×5, 7×7) of the Sobel operator, the Scharr operator, and an optimized Roberts operator.

[0216] Taking the 5×5 Sobel operator as an example, the gradients Gx and Gy in the x-direction and y-direction are calculated, and then the gradient magnitude and direction are calculated: Gradient Magnitude The gradient direction θ = arctan(Gy / Gx) is obtained by weighted fusion of multi-scale gradients with weights of 0.2 (3×3), 0.5 (5×5), and 0.3 (7×7).

[0217] (3) Boundary Response Enhancement: Convolve the directional filter bank with the multi-scale gradient map to calculate the boundary response in each direction: Boundary Response Calculation: Where: Gθ(x,y) is the Gaussian derivative filter in the θ direction; This is a multi-scale gradient map; * indicates a convolution operation; Bθ(x,y) is the boundary response in the θ direction.

[0218] For each pixel position (x,y) in the image, calculate the boundary response in 8 directions to form a boundary response vector B(x,y) = [B0(x,y), B45(x,y), ..., B315(x,y)].

[0219] (4) Non-maximum suppression: Non-maximum suppression is applied to the directional boundary response to retain the direction with the strongest response at each pixel position. Specifically, for each pixel (x,y), find the maximum value Bmax(x,y) and the corresponding direction θmax(x,y) in B(x,y); construct the maximum response map Bmax and the direction map Dmax;

[0220] (5) Boundary response map synthesis: Combine the maximum response map Bmax and the orientation map Dmax to generate the boundary response map B(x,y): Boundary response map generation: B(x,y) = Bmax(x,y)·(1 + γ·Cdir(x,y)); where: Bmax(x,y) is the maximum response value; Cdir(x,y) is the orientation consistency measure, calculated as the proportion of pixels with similar orientations in the local area; γ is the enhancement coefficient, set to 0.5; B(x,y) is the final boundary response map.

[0221] (6) Occlusion Complexity Estimation: Based on the hierarchical association graph Glag and the boundary response graph B, the scene occlusion complexity index is calculated: Occlusion complexity calculation: Cocc = w1·Nlayer + w2·∑∑Glag(i,j) + w3·Var(B); where: Nlayer is the number of layers; Glag(i,j) is the element in the hierarchical association graph; Var(B) is the variance of the boundary response graph; w1, w2, and w3 are weight coefficients, set to 0.4, 0.3, and 0.3 respectively; Cocc is the occlusion complexity index. In this embodiment, the calculated Cocc = 0.4×3 + 0.3×15.6 + 0.3×0.73 = 1.2 + 4.68 + 0.22 = 6.1 indicates that the scene occlusion complexity is high.

[0222] (7) Calculation of adaptive parameter β: Based on the occlusion complexity index Cocc, the adaptive parameter β of the sigmoid function is calculated: Adaptive parameter calculation: β = β0·(1 + λ·Cocc); where: β0 is the baseline parameter, set to 2.0; λ is the adjustment coefficient, set to 0.2; Cocc is the occlusion complexity index; β is the adaptive parameter.

[0223] In this embodiment: β = 2.0·(1 + 0.2×6.1) = 2.0·(1 + 1.22) = 2.0×2.22 = 4.44

[0224] (8) Boundary Attention Map Generation: An improved sigmoid function is applied to the boundary response map B to generate the boundary attention map: Boundary attention map generation: AB(x,y) = 1 / (1+e^(-β·B(x,y))); where: B(x,y) is the boundary response map; β is the adaptive parameter; AB(x,y) is the boundary attention map, with a value range of (0,1). When β is large (complex scenarios), the sigmoid function curve is steeper, and the boundary response is more sensitive; when β is small (simple scenarios), the sigmoid function curve is flatter, reducing false detections.

[0225] (9) Boundary attention enhancement: Apply the boundary attention map AB to the multi-level feature set Fmul to enhance the feature weights of the occlusion boundary region: Feature enhancement: Fenh = Fmul·(1 + α·AB); where: Fmul is the multi-level feature set; AB is the boundary attention map; α is the enhancement coefficient, set to 1.5; Fenh is the enhanced feature map.

[0226] For regions with high boundary attention values ​​(e.g., AB(x,y) = 0.8), the feature enhancement is: Fenh(x,y) = Fmul(x,y)·(1 + 1.5×0.8) = Fmul(x,y)×2.2.

[0227] (10) Precise localization of occlusion boundaries: Based on the enhanced feature map Fenh and the hierarchical relationship map Glag, an improved dynamic programming algorithm is used to trace the occlusion boundaries along the gradient direction. The algorithm starts from the point with the highest boundary attention value and extends along the gradient direction to form a complete boundary curve. In this embodiment, five main occlusion boundaries are identified, each corresponding to the occlusion relationship between different pedestrians, forming an occlusion boundary map Bocc.

[0228] (11) Establishing Occlusion Topology: Based on the occlusion boundary graph Bocc, the topology of occlusion is analyzed to determine the spatial relationship between the foreground and background. By analyzing the depth levels on both sides of the boundary, it is determined which side is the foreground (occluder) and which side is the background (occluded). In this embodiment, an occlusion topology graph Tocc is constructed, which is represented as a directed graph, where nodes are the various segmented regions, edges represent occlusion relationships, and arrows point from the occluder to the occluded.

[0229] 5. Perform a hierarchical consistency assessment to identify and correct hierarchical errors.

[0230] This step primarily addresses the issue of hierarchical segmentation errors, improving hierarchical accuracy through consistency assessment and prior structural repair. The specific implementation is as follows:

[0231] (1) Spatial location feature extraction: Spatial location features of each level are extracted from the occlusion topology map Tocc, including center coordinates, orientation, and coverage area, to establish a spatial reference system. For example, for the NW region: center coordinates: (160, 120); main orientation: 135° (obtained statistically from the boundary orientation); coverage area: 0-320 (x-axis), 0-240 (y-axis);

[0232] (2) Construction of Spatial Location Weighting Function: Based on spatial location features, a spatial location weighting function is constructed: Spatial Location Weighting Function: Wij = exp(-dij) 2 / 2σd 2 )·exp(-θij 2 / 2σθ 2 ); where: dij is the normalized distance between the center points of level i and j; θij is the directional difference; σd and σθ are the scale parameters of distance and direction, set to 0.5 and 0.7 respectively; Wij is the spatial location weight, with a value range of (0,1).

[0233] Calculate the spatial location weights between regions NW and NE:

[0234] dij = ||(160,120)-(480,120)|| / 640 = 320 / 640 = 0.5; θij = |135°-45°| =90°;

[0235] Wij=exp(-0.5 2 / 2×0.5 2 )·exp(-90 2 / 2×0.7 2 = exp(-0.25)·exp(-4085.1)≈ 0.78×0 ≈ 0; This indicates that the NW and NE regions are weakly correlated in terms of spatial location.

[0236] (3) Hierarchical cross-analysis: Calculate the cross region |Li ∩ Lj| and the union region |Li ∪ Lj| between any two levels i and j to establish the cross relationship between levels.

[0237] (4) Hierarchical Consistency Evaluation Function: Combining hierarchical cross-relationships and spatial location weights, calculate the hierarchical consistency matrix:

[0238] Hierarchical consistency evaluation function: C(Li, Lj) = |Li ∩ Lj| / |Li ∪ Lj|·Wij; where: |Li ∩ Lj| is the intersection region of levels i and j; |Li ∪ Lj| is the union region of levels i and j; Wij is the spatial location weight; C(Li, Lj) is the hierarchical consistency, with a value range of (0,1).

[0239] For example, calculating the consistency between subregions NW1 and NW2: |NW1 ∩ NW2| / |NW1 ∪ NW2| = 0.05 (5% overlap); W(NW1,NW2) = 0.85 (spatial proximity); C(NW1,NW2) = 0.05 × 0.85 = 0.0425;

[0240] Regions with consistency below a threshold Tc (set to 0.1) in the hierarchical consistency matrix Cmat are identified and marked as inconsistent regions, forming an inconsistency region map Iincon. In this embodiment, eight inconsistent regions were identified, mainly distributed at the pedestrian occlusion boundary.

[0241] (5) Construction of a sparse human body structure dictionary: A priori dictionary Dstruct for human body posture is constructed in advance by sparsely encoding a large amount of multi-view pedestrian posture data. This dictionary contains 200 typical posture primitives, each of which describes the structural features of the human body from a specific viewpoint.

[0242] (6) Generation of structural prior constraints: Sparse representation of features of inconsistent regions:

[0243] Sparse representation solution: s = argmin ||Φ(f) - Dstruct·s|| 2+ λ||s||1; where: Φ(f) is the feature transformation function, mapping the original features to the structure dictionary space; Dstruct is the human structure dictionary; s is the sparse coefficient vector; λ is the regularization parameter, set to 0.1; ||s||1 is the L1 norm of s, promoting sparse coefficients. Taking an inconsistent region (located at the overlap of two pedestrians) as an example, the above formula is applied to solve for the sparse coefficients s. In this embodiment, after the feature f of this region is mapped by the transformation function Φ, the matching result with the structure dictionary shows that pose primitives numbered 25, 78, and 136 are mainly activated, with corresponding coefficients of 0.42, 0.31, and 0.15, respectively, while the remaining coefficients are close to 0.

[0244] Based on the sparse representation coefficients *s* and the human body structure dictionary *Dstruct*, the structural prior constraints are reconstructed: Structural prior constraint *Sp* = *Dstruct*·s; where: *Dstruct* is the human body structure dictionary; *s* is the sparse coefficient vector; and *Sp* is the structural prior constraint, reflecting the expected human body structural features of the current region. For example, the structural prior constraint *Sp* of the aforementioned inconsistent region indicates that the region is most likely to belong to the "waist region of a sideways standing posture" and should form a continuous human body structure with the adjacent "upper body" and "lower body" regions.

[0245] (7) Boundary optimization resampling: A series of candidate boundary adjustment schemes are generated near the original boundary based on the structural prior. Using the Monte Carlo method, 50 boundary variants are randomly sampled within ±10 pixels of the original boundary, and the optimal candidate is selected based on the consistency score with the structural prior.

[0246] Boundary adjustment score: Score(B) = w1·SIMstructure(B, Sp) + w2·SIMappearance(B, Forig) + w3·SMOOTHboundary(B); where: SIMstructure is the structural similarity between boundary B and the structural prior Sp; SIMappearance is the appearance similarity between boundary B and the original feature Forig; SMOOTHboundary is the boundary smoothness; w1, w2, and w3 are weight coefficients, set to 0.5, 0.3, and 0.2 respectively; Score(B) is the boundary adjustment score. In this embodiment, among the 50 boundary candidates generated for the above-mentioned inconsistent regions, the boundary adjustment scheme with the highest score moves the original boundary 6 pixels to the upper right, with a score of 0.87.

[0247] (8) Repair Candidate Generation and Validation: The boundary adjustment candidate set is applied to the original segmentation result to generate multiple repair candidate schemes. Each repair candidate scheme is validated, and the consistency score with the global structure is calculated. The scheme with the highest score is selected as the final repair result.

[0248] In this embodiment, the repair of eight inconsistent regions led to an adjustment in the global hierarchy, with 27 pedestrians correctly assigned to three different depth levels. After the repair, the hierarchy graph Glag and the occlusion topology graph Tocc were updated, forming an optimized hierarchy graph Gopt.

[0249] 6. Construct an occlusion relationship matrix and decouple features at each level through matrix decomposition.

[0250] Based on the optimized hierarchical graph Gopt and the occlusion topology graph Tocc, an occlusion relationship matrix Omat is constructed. The matrix element Oij represents the degree of occlusion of the i-th layer on the j-th layer, and the value range is [0,1], where 0 represents no occlusion and 1 represents complete occlusion.

[0251] In this embodiment, the scene is divided into 3 main levels (1 is the foremost and 3 is the last), and the constructed occlusion relationship matrix is: Omat = [1.00, 0.38, 0.12; 0.00, 1.00, 0.45; 0.00, 0.00, 1.00].

[0252] This indicates that the occlusion of layer 1 on layer 2 is 0.38, and the occlusion of layer 3 is 0.12; the occlusion of layer 2 on layer 3 is 0.45; and a diagonal value of 1 indicates that it has no occlusion.

[0253] Next, constrained matrix decomposition is performed on the observed blended features Fobs and the occlusion relation matrix Omat. First, a linear blending model is established: Linear blending model: Fobs = FL·Omat; where: Fobs are the observed blended features; FL are the independent features at each level; Omat is the occlusion relation matrix.

[0254] Then, two types of constraints are designed: spatial continuity constraint Cspatial, to ensure that the decoupled features are continuous and smooth in space; and human body shape constraint Cshape, to ensure that the decoupled features conform to human body shape characteristics.

[0255] Constructing the objective function: Constraint matrix decomposition: min ||Fobs - FL·Omat|| 2 + λ1·Cspatial(FL) + λ2·Cshape(FL); where: ||Fobs - FL·Omat||² is the reconstruction error; Cspatial(FL) is the spatial continuity constraint; Cshape(FL) is the human body shape constraint; λ1 and λ2 are weight coefficients, set to 0.3 and 0.4 respectively. The above optimization problem is solved by iterative least squares method. In this embodiment, the maximum number of iterations is set to 100, and the convergence threshold is 1e-4. After 67 iterations, the algorithm converges, and the decoupled feature set FL is obtained.

[0256] Based on the decoupled feature set FL and the human structure prior Sp, the complete pedestrian features of each layer are reconstructed: Pedestrian feature reconstruction: Pi = R(FL_i, Sp); where: FL_i is the decoupled feature of the i-th layer; Sp is the human structure prior; R is the reconstruction function; Pi is the reconstructed pedestrian feature.

[0257] The reconstruction function R is based on a conditional generative model, which uses visible features and structural priors to infer the features of the occluded parts. In this embodiment, for some pedestrians in the second layer, whose lower bodies are occluded by about 40% by pedestrians in the first layer, the complete pedestrian features are obtained through reconstruction.

[0258] Finally, an improved Faster R-CNN pedestrian detector was applied to the reconstructed pedestrian feature set to locate the position and bounding box of each pedestrian. The detector parameters were set as follows: anchor scale [64, 128, 256]; aspect ratio [0.5, 1.0, 2.0]; NMS threshold 0.6; confidence threshold 0.75.

[0259] In this embodiment, 27 pedestrians were successfully detected, including those with severe occlusion, resulting in the hierarchical pedestrian detection result Dped.

[0260] 7. Dynamically adjust system parameters based on scene complexity and detection results.

[0261] Based on the standardized image Istd and the occlusion topology graph Tocc, scene complexity metrics are calculated, including occlusion rate, crowd density, and pose variation:

[0262] The scene complexity metric in step S71 is: Scomp = w1·OR + w2·PD + w3·PV; where: OR is the occlusion rate, calculated as the ratio of the number of occluded pixels to the total number of pixels; PD is the pedestrian density, calculated as the number of pedestrians per unit area; PV is the degree of pose change, calculated as the standard deviation of pedestrian poses in the scene; w1, w2, and w3 are weight coefficients, set to 0.4, 0.4, and 0.2 respectively; and Scomp is the scene complexity metric.

[0263] In this embodiment: OR = 0.68 (68% of the pixel area is occluded); PD = 1.08 people / square meter; PV = 0.35; Scomp = 0.4×0.68 + 0.4×1.08 + 0.2×0.35 = 0.272 + 0.432 + 0.07 = 0.774;

[0264] Next, we analyze the impact of key parameters on detection performance and establish a parameter sensitivity model. Four key parameters are selected: dynamic threshold baseline Tg; boundary attention activation parameter β; boundary feature enhancement coefficient α; and hierarchical consistency threshold Tc. By perturbing these parameters by ±20% and observing changes in detection performance, the parameter sensitivity is calculated.

[0265] The parameter sensitivity in step S72 is: Sens(P) = |dPerf / dP|·P / Perf; where: dPerf / dP is the partial derivative of performance with respect to parameter P; P is the parameter value; Perf is the current performance index; and Sens(P) is the sensitivity of parameter P.

[0266] In this embodiment, the parameter sensitivity matrix is ​​calculated as: Psens = [0.62, 1.45, 0.83, 0.51]. This indicates that the β parameter (boundary attention activation parameter) has the highest sensitivity, followed by the α parameter, then the Tg parameter, and the Tc parameter has the lowest sensitivity.

[0267] The system parameters are dynamically adjusted based on the scene complexity index Scomp and the parameter sensitivity matrix Psens. The adjustment formula is: adaptive parameter adjustment: Popt = Porig·(1 + δ·Sens(P)·(Scomp - Sref)); where: Porig is the original parameter value; Sens(P) is the parameter sensitivity; Scomp is the current scene complexity; Sref is the reference scene complexity, set to 0.5; δ is the adjustment coefficient, set to 0.6; Popt is the optimized parameter value.

[0268] In this embodiment, the optimized parameter set is calculated as follows: Tg_opt = 0.3·(1 + 0.6×0.62×(0.774- 0.5)) = 0.3×(1 + 0.6×0.62×0.274) = 0.3×(1 + 0.102) = 0.331; β_opt = 2.0·(1 + 0.6×1.45×0.274) = 2.0×(1 + 0.238) = 2.476; α_opt = 1.5·(1 + 0.6×0.83×0.274) = 1.5×(1 + 0.136) = 1.704; Tc_opt = 0.1·(1 + 0.6×0.51×0.274) = 0.1×(1 + 0.084) = 0.108;

[0269] The optimized parameter set Popp is applied to the aforementioned processing steps (S2-S6) to form a feedback loop, iteratively optimizing the processing results. In this embodiment, after three rounds of iteration, the detection performance tends to stabilize, and the final optimized control signal Copt is output.

[0270] 8. Integrate pedestrian detection results from different levels, eliminate redundancy, and form the final dense passenger flow detection results.

[0271] Redundant detections in the hierarchical pedestrian detection result Dped are analyzed. Redundant detections mainly arise from the situation where the same pedestrian is detected in different layers. The analysis is based on spatial overlap and feature similarity: Redundant detection analysis: Red(Di, Dj) = λ·IoU(Di, Dj) + (1-λ)·Fsim(Di, Dj); where: IoU(Di, Dj) is the intersection-union ratio of detection boxes Di and Dj; Fsim(Di, Dj) is the feature similarity; λ is the weight coefficient, set to 0.7; Red(Di, Dj) is the redundancy score. When Red(Di, Dj) > 0.85, detections Di and Dj are considered redundant, the detection with higher confidence is retained, and the other is deleted. In this embodiment, 5 redundant detections are identified and deleted, resulting in the deredundant detection result Dnonred, which contains 27 independent pedestrian detections. Cross-layer consistency verification is performed on the deredundant detection result to ensure that the detection result is consistent with the hierarchical structure. The specific verification method is as follows: Check whether the overlap rate of each detection box with its corresponding layer exceeds 75%; check whether the detection boxes in the foreground layer reasonably occlude the detection boxes in the background layer; check whether there is a reasonable spatial relationship between detection boxes in adjacent layers; for detections that do not meet the above conditions, adjustments are made according to the layer relationship. In this embodiment, the layer allocation of the two detection boxes was corrected, resulting in the verified detection result Dver. The verified detection result Dver of the current frame is temporally correlated and smoothed with the detection results of historical frames to improve detection stability.

[0272] A Kalman filter is used to smooth the position and size of the detection box: temporal smoothing: Xk = A·Xk-1 + wk, Zk = H·Xk + vk; where: Xk is the state vector, containing position, size, and velocity; A is the state transition matrix; wk is the process noise; Zk is the observation vector; H is the observation matrix; and vk is the observation noise. In this embodiment, the detection results of 5 consecutive frames are correlated and smoothed to obtain the temporally smoothed detection result Dsmooth.

[0273] Finally, the temporal smoothing detection results (Dsmooth) are integrated, and the detection information is output in a formatted manner, including pedestrian location, occlusion relationship, and density statistics. The detection results include the following information: pedestrian ID (unique identifier); bounding box coordinates (coordinates of the top left and bottom right corners); pedestrian's level (1-3); occlusion relationship (occluder ID and occluded ID); occlusion rate (the proportion of occluded pixels to total pixels).

[0274] In this embodiment, the final output is complete detection information for 27 pedestrians, with 11 people in the first layer (front), 9 people in the second layer (middle), and 7 people in the third layer (back). The detection results accurately reflect the dense pedestrian flow distribution and multi-layer occlusion relationships in the scene.

[0275] To verify the effectiveness of this invention, it was compared with three existing methods: the basic Faster R-CNN method (without special occlusion processing); the traditional fixed-level quadtree decomposition method (2 layers); and a detection method based on partially visible features.

[0276] The test dataset consists of 50 video clips collected during peak hours from 5 subway stations, totaling 25,000 frames. 71,350 pedestrian instances were manually labeled, of which 18,672 instances had an occlusion rate >70%.

[0277] Evaluation metrics include: Recall (detection rate): number of successfully detected pedestrians / total number of actual pedestrians; Precision (accuracy): number of correctly detected pedestrians / total number of detected pedestrians; AP (average precision): area under the precision-recall curve; MR (missed detection rate): number of undetected pedestrians / total number of actual pedestrians; special attention is paid to performance in heavily occluded scenes (occlusion rate > 70%).

[0278] The test results are as follows:

[0279] method Overall AP Severely obscured AP Overall MR Severely obscured MR Faster R-CNN 0.76 0.32 0.14 0.45 Fixed-level quadtree 0.81 0.4 0.12 0.3 Partially visible features 0.84 0.5 0.10 0.29 This method 0.91 0.78 0.06 0.08

[0280] The test results show that the method of this invention significantly outperforms existing methods in both overall performance and performance in heavily occluded scenarios. In particular, in heavily occluded scenarios, the false negative rate is reduced from a minimum of 0.29 to 0.08, meeting the basic requirements for security monitoring (false negative rate ≤10%).

[0281] The performance improvement of this invention mainly comes from:

[0282] 1. Adaptive hierarchical decomposition driven by similarity gradient enables the decomposition depth to be dynamically adjusted according to the complexity of the scene.

[0283] 2. The boundary attention mechanism significantly improves the sensitivity to occlusion boundary regions, and in particular, the improved adaptive parameter β enhances the boundary discrimination capability in complex scenes.

[0284] 3. The hierarchical consistency evaluation function incorporates spatial location weighting, enhancing its ability to model occlusion spatial relationships.

[0285] Furthermore, this invention also demonstrates excellent real-time performance. On a computing platform configured with an Intel Core i7-9700K CPU and an NVIDIA RTX 2080 GPU, the average processing time for a 640×480 resolution image is 85ms (approximately 12 frames per second), meeting the requirements for near real-time monitoring.

[0286] In summary, this embodiment details a method for detecting dense passenger flow in train stations based on adaptive hierarchical decomposition of occlusion levels. This method effectively solves the occlusion problem in dense passenger flow detection in train stations by employing techniques such as similarity gradient-driven adaptive hierarchical decomposition, cross-level feature transfer and constraints, boundary attention mechanisms, and hierarchical consistency evaluation. Experimental results show that this method significantly outperforms existing methods in heavily occluded scenarios, reducing the false negative rate from 29% to 8%, thus meeting the basic requirements of security monitoring. This invention is applicable to intelligent monitoring systems in densely populated areas such as train stations, airports, and plazas, and has significant practical value.

[0287] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the protection scope of the present invention.

Claims

1. A method for detecting dense passenger flow in stations based on adaptive decomposition of occlusion levels, characterized in that, include: Acquire station surveillance video data, preprocess it to obtain standardized images, perform quadtree decomposition to obtain multi-level region decomposition results, perform feature extraction on them, and obtain a hierarchical association graph. For the occlusion boundary region in the hierarchical relationship graph, a boundary attention mechanism is applied to enhance the boundary features, locate the occlusion boundary, obtain the occlusion boundary map and occlusion topology map, and perform hierarchical consistency evaluation based on them to identify and correct hierarchical errors, and obtain an optimized hierarchical graph. Based on the optimized hierarchical graph, an occlusion relationship matrix is ​​constructed and decomposed, features of each level are decoupled, pedestrian detection results of each level are obtained and integrated, redundancy is eliminated, and dense passenger flow detection results are formed.

2. The method according to claim 1, characterized in that, Quadtree decomposition of the normalized image includes: The standardized image is decomposed into four regions using an initial quadtree decomposition. The first-level decomposition results are obtained, and the feature similarity is calculated for each region. The similarity gradient is then calculated to obtain a similarity gradient map. Based on the similarity gradient map, when the similarity gradient value of a region is greater than the dynamic threshold, the decomposition continues to obtain the optimal decomposition depth matrix. Based on this, the standardized image is recursively decomposed to obtain multi-level region decomposition results, which are then organized into a region decomposition tree as the multi-level region decomposition result.

3. The method according to claim 2, characterized in that, Calculating the similarity gradient includes: Each region in the first-level decomposition result is read, and features are extracted using histogram of directional gradients and local binary mode feature extractor to obtain the region feature vector. Based on this, the feature similarity between adjacent regions is calculated using the cosine similarity formula, and a multi-scale similarity matrix is ​​calculated. Based on the multi-scale similarity matrix, the similarity change rate is calculated for each decomposition level, while retaining the gradient direction information to form a vectorized similarity gradient. The gradient value of each region is then mapped back to the image space to construct a two-dimensional gradient map. Noise is eliminated by Gaussian smoothing to obtain the similarity gradient map.

4. The method according to claim 2, characterized in that, The optimal decomposition depth matrix is ​​obtained, including: Construct a dynamic threshold function that decreases as the decomposition depth increases; Read the similarity gradient map and dynamic threshold function, compare the gradient value of each region with the threshold corresponding to the current depth, mark the regions that need to be further decomposed, and obtain the region decomposition label map; Read the region decomposition marker map, combine local entropy value and gradient direction consistency to comprehensively evaluate the decomposition necessity of each region, calculate the decision score, obtain the optimal decomposition decision, assign the best decomposition depth to each region in the image accordingly, form a depth matrix and smooth it to obtain the optimal decomposition depth matrix.

5. The method according to claim 1, characterized in that, To form a hierarchical relationship diagram, including: Features are extracted from each node region in the multi-level region decomposition results to obtain a multi-level feature set. Combined with the similarity gradient map, a feature transfer function between levels is constructed to obtain the feature transfer mapping. Using feature transitive mapping, feature constraints are passed from upper to lower layers. Upper-layer features provide spatial location priors for lower layers, resulting in top-down constraint features. These features are then combined with multi-level feature sets for bottom-up verification. Lower-layer features provide feedback to verify the upper-layer segmentation results, correcting boundary errors and yielding bottom-up verification features. By combining top-down constraint features and bottom-up verification features, a hierarchical association graph is constructed to record the feature correspondence and spatial dependencies between different levels, thus obtaining the hierarchical association graph.

6. The method according to claim 5, characterized in that, Construct inter-layer feature transfer functions to obtain feature transfer mappings, including: Read the multi-level feature set, perform principal component analysis decomposition on the feature vector, extract the main feature components, decompose the features into basic features and detailed features, and obtain the decomposed feature set; Read the similarity gradient map, calculate the similarity weight matrix between adjacent levels, and obtain the similarity weight matrix; Based on the similarity weight matrix, a feature transfer kernel function is constructed to obtain the feature transfer kernel; By combining the feature transfer kernel and the decomposed feature set, a nonlinear mapping function is constructed to realize adaptive feature transfer between levels, thus obtaining the nonlinear mapping function; A complete inter-level feature transfer mapping table is constructed using a nonlinear mapping function to obtain the feature transfer mapping.

7. The method according to claim 1, characterized in that, Obtain the occlusion boundary map and occlusion topology map, including: A boundary-sensitive filter is constructed by convolving a directional Gaussian kernel function with the image gradient to improve the sensitivity to the occlusion direction and obtain the boundary response map. A nonlinear activation function is applied to the boundary response map to obtain a boundary attention map, which is then applied to a multi-level feature set to enhance the feature weights of the occlusion boundary region, resulting in an enhanced feature map. Based on the enhanced feature map and the hierarchical association map, the occlusion boundary is traced along the gradient direction to obtain the occlusion boundary map; Analyze the topological relationships of occlusion based on the occlusion boundary map, determine the spatial relationship between the foreground and background, and obtain the occlusion topology map.

8. The method according to claim 7, characterized in that, The boundary response map is obtained, including: Construct a directional filter bank containing Gaussian derivative filters in multiple principal directions; For a standardized image, the image gradient is calculated at each scale to obtain a multi-scale gradient map; The directional filter bank is convolved with the multi-scale gradient map to calculate the boundary response in each direction, thus obtaining the directional boundary response. Non-maximum suppression is then applied to it to retain the direction with the strongest response at each pixel position. This direction is recorded to obtain the maximum response map and the direction map. Based on this, a boundary response map is generated to enhance the region with high directional consistency, thus obtaining the boundary response map.

9. The method according to claim 7, characterized in that, Obtain the boundary attention map, including: Read the boundary response graph and the hierarchical relationship graph, calculate the scene occlusion complexity index, and obtain the occlusion complexity index; Based on the occlusion complexity index, the adaptive parameters of the activation function are calculated. The higher the complexity, the larger the parameter value, thus obtaining the adaptive parameters. Read the boundary response map and adaptive parameters, apply an improved activation function to process the boundary response values, and generate an initial attention map; and An attention enhancement algorithm, including local contrast enhancement and importance diffusion, is applied to the initial attention map to enhance the boundary region, resulting in a boundary attention map.

10. The method according to claim 1, characterized in that, The resulting optimized hierarchical graph includes: A hierarchical consistency evaluation function is constructed to evaluate the segmentation consistency between adjacent layers. A spatial location weighting function is introduced to enable the evaluation function to consider the spatial relationship of occlusion, thus obtaining the hierarchical consistency matrix. Regions with consistency below a threshold are identified from the hierarchical consistency matrix and marked as inconsistent regions, thus obtaining an inconsistent region map. For regions in the inconsistency region map, the region features are analyzed by sparse human body structure prior analysis, and the hierarchical boundaries are adjusted to obtain a repair candidate set; Each candidate solution in the repair candidate set is verified, and the consistency score with the global structure is calculated. The solution with the highest score is selected as the final repair result, and the repaired hierarchical segmentation is obtained. Based on the repaired hierarchical segmentation, the hierarchical association graph and occlusion topology graph are updated to obtain an optimized hierarchical graph.