A security check hidden danger identification method and system based on visual analysis

CN122906682APending Publication Date: 2026-10-13HANGZHOU YAOYI ENGINEERING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611252929.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0002]在视觉分析与安防监管领域,随着安检场景视频数据的高维化与复杂化,经典计算机在三维空间隐患的精准感知与实时判别方面面临着严峻的算力与建模挑战

Benefits of technology

本发明通过引入基于弹道导弹末端制导机制的语义边界修正与情境自适应闭环反馈优化流程,显著提高了安检场景隐患识别过程中三维空间测量的物理保真能力与动态判别精度。通过创新性地在改进CSPN模型中引入弹道导弹末端制导机制,将深度梯度场跨越语义边界视为越界渗透偏差并触发末端制导,利用语义边界掩膜生成法向推力向量执行反向推力补偿与截断衰减,有效消除了传统空间传播校正中目标边缘深度渗透与跨语义边界数值延伸的结构失真,实现了深度估计与实体物理边界的严格一致性约束。同时,采用自适应动态加权策略构建本体拓扑关系矩阵,深度挖掘了场景实体间隐含的交互合规逻辑,并在动态距离阈值生成阶段融合历史全局分布特征与实时动态趋势,结合违章记录元组的回传更新构建情境自适应进化闭环,从而显著提升了复杂动态安检场景下违章判别的准确度、鲁棒性与系统的自学习进化能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122906682A_ABST
    Figure CN122906682A_ABST
Patent Text Reader

Abstract

The application discloses a kind of security check hidden danger identification method and system based on visual analysis, it is related to safety engineering and hidden danger assessment technical field, including the following steps: S1, construct scene ontology atlas;S2, construct ontology topological relationship matrix;S3, by improving CSPN model, introduce ballistic missile terminal guidance mechanism to the out-of-bound penetration deviation is executed based on semantic boundary reverse thrust compensation and truncation attenuation;S4, construct scene three-dimensional space coordinate set;S5, construct space topological graph;S6, output three-dimensional physical spacing;S7, generate dynamic distance threshold;S8, output the result of illegal discrimination.The application effectively overcomes the limitations of traditional method two-dimensional projection distortion, depth edge penetration and rigid threshold misjudgment, realizes the technical effect of improving hidden danger discrimination precision and self-adaptability while maintaining efficient three-dimensional reconstruction performance, provides an efficient solution for security scene intelligent supervision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of safety engineering and hazard assessment technology, and in particular to a method and system for identifying safety hazards based on visual analysis. Background Technology

[0002] In the fields of visual analytics and security monitoring, with the increasing dimensionality and complexity of video data in security inspection scenarios, classical computers face severe challenges in terms of computational power and modeling for accurate perception and real-time identification of potential hazards in three-dimensional space. Existing vision-based methods for identifying security hazards, such as rule-based judgment models based on two-dimensional image semantic segmentation or traditional target detection, while improving target recognition efficiency through pixel features and bounding box extraction, primarily rely on spatial relationships in two-dimensional projection planes and static distance thresholds for compliance verification. This method, based solely on two-dimensional geometric projection and rigid thresholds, ignores the complex ontological topological constraints implicit in security inspection scenarios (such as compliance of interactions between entities and exclusionary associations between category attributes) and the physical spatial structure of the depth dimension. This leads to deep edge penetration and cross-semantic boundary confusion during spatial mapping, thus limiting the accuracy of three-dimensional physical distance measurement. Furthermore, classical judgment methods typically employ fixed threshold mechanisms, making it difficult to fully utilize historical violation distribution characteristics and real-time dynamic trends to constrain the verification space. They cannot achieve context-adaptive dynamic threshold adjustment, often resulting in a large number of false alarms or false negatives when handling different combinations of entity categories and dynamic interaction scenarios, reducing the robustness and adaptive evolutionary capability of hazard identification.

[0003] Therefore, how to provide a method and system for identifying safety hazards based on visual analysis is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] This invention proposes a visual analysis-based method and system for identifying security inspection hazards. Through a hazard discrimination optimization mechanism based on semantic guidance correction and context-adaptive closed-loop, spatial propagation correction and ballistic missile terminal guidance correction are performed on the initial depth map output by the integrated and improved CSPN model and the dynamically interactive security inspection scenario, respectively. The depth penetration deviation at the target edge is extracted and introduced into the semantic boundary as an active detection signal. The out-of-bounds penetration deviation of the depth gradient field across the semantic boundary is calculated to trigger terminal guidance. The normal thrust vector is generated based on the boundary mask, and reverse thrust compensation and truncation attenuation are performed. The ballistic missile terminal guidance mechanism is embedded as a depth penetration correction constraint in the spatial propagation process. By iteratively correcting the affinity weight and depth value, the depth numerical extension across entity edges is effectively eliminated. Simultaneously, based on ontological topological relationships and three-dimensional physical distances, historical global distribution features and real-time dynamic trend solutions are fused to calculate the dynamic distance threshold, and the violation record tuple is fed back to update the global violation statistical distribution features. This mechanism effectively overcomes the limitations of traditional methods, such as two-dimensional projection distortion, deep edge penetration, and rigid threshold misjudgment, by establishing a closed-loop feedback path from "semantic boundary detection" to "deep penetration compensation" and from "violation result feedback" to "contextual threshold evolution." It achieves the technical effect of improving the accuracy and adaptability of hidden danger identification in dynamic scenes while maintaining efficient three-dimensional reconstruction performance, providing an efficient solution for intelligent supervision of security inspection scenarios.

[0005] A method for identifying safety hazards based on visual analysis according to an embodiment of the present invention includes the following steps: S1. Acquire security inspection scene image frames, extract entity categories and entity attributes and map them to ontology nodes, and construct scene ontology graphs based on spatial proximity features between ontology nodes. S2. Based on the entity categories and entity attributes in the scene ontology graph, assess security compliance to extract interaction constraint relationships. After adaptive dynamic weighting, associate entity nodes and encode to construct an ontology topology relationship matrix. S3. Input the security inspection scene image frame into the improved CSPN model, correct the target edge depth penetration through spatial propagation, and introduce the ballistic missile terminal guidance mechanism to perform reverse thrust compensation and truncation attenuation based on semantic boundary for the cross-boundary penetration deviation, so as to output a semantic guidance correction depth map. S4. Based on the scene ontology map, filter the entity targets to be tested and extract the spatial projection area, calculate the two-dimensional positioning coordinates of the spatial projection area, and extract the depth features of the corresponding area from the semantically guided correction depth map, and fuse them to generate the three-dimensional centroid coordinates of the entity targets to construct a set of three-dimensional spatial coordinates of the scene. S5. Extract the interaction constraint relationships from the ontology topology relationship matrix and the three-dimensional centroid coordinates from the scene three-dimensional space coordinate set, and use them as edges and nodes to construct a spatial topology graph; S6. Extract the three-dimensional centroid coordinates of associated node pairs based on spatial topology graph traversal, calculate the three-dimensional spatial distance between associated nodes and map it to three-dimensional physical distance; S7. Extract the entity attributes of the associated node pairs in the spatial topology graph, solve the static situation constraints by combining historical global distribution characteristics, calculate the dynamic situation adjustment coefficient by combining real-time dynamic trends, and generate a dynamic distance threshold by fusing static situation constraints and dynamic situation adjustment coefficients. S8. Calculate the difference between the three-dimensional physical distance and the dynamic distance threshold, and output the violation judgment result based on the positive and negative attribute mapping of the difference calculation result.

[0006] Optionally, S1 specifically includes: S11. Perform target detection on the security inspection scene image frame to output entity detection boxes and classification confidence scores. Filter entity detection boxes based on classification confidence scores. Crop the corresponding image regions of the filtered entity detection boxes. Perform attribute recognition on the cropped image regions to output entity attributes. Analyze and output entity categories based on the peak index of classification confidence scores. S12. Map entity categories and entity attributes to graph node features. Perform pairwise combinations of graph node features within the same frame to generate candidate node pairs. Calculate the spatial distance between the center points of the entity detection boxes to which the candidate node pairs belong. Statistically analyze the distribution characteristics of the spatial distance between the center points and calculate the adaptive proximity threshold. S13. Compare the spatial distance between the center points of candidate node pairs with the adaptive proximity threshold, filter out candidate node pairs that are lower than the adaptive proximity threshold, retain and connect candidate node pairs that are higher than the adaptive proximity threshold, and output the scene ontology map.

[0007] Optionally, S2 specifically includes: S21. Based on the entity categories and entity attributes in the scene ontology graph, perform Cartesian product combination to generate category attribute pairs, calculate the security compliance of category attribute pairs, extract category attribute pairs below the security compliance threshold as violation combinations, and perform parsing on the violation combinations to output inter-class interaction constraint relationships. S22. Extract the category combination labels corresponding to the inter-class interaction constraint relationship, count the historical trigger frequency of the category combination labels in the continuous security inspection scene image frames, calculate the adaptive constraint weight based on the distribution characteristics of the historical trigger frequency, allocate the adaptive constraint weight to the corresponding inter-class interaction constraint relationship, and output the inter-class weighted constraint relationship. S23. Match the candidate node pairs in the scene ontology graph with the entity category combination and inter-class weighted constraint relationship to determine the constraint weights of multiple instances associated with the candidate node pairs. Perform aggregation calculation on the constraint weights of multiple instances to output the constraint weights of the target instance. Map the constraint weights of the target instance to non-zero element values ​​of the matrix. Determine the matrix row and column indices based on the candidate node pairs. Fill the matrix row and column indices with non-zero element values ​​of the matrix and output the ontology topology relation matrix.

[0008] Optionally, the improved CSPN model includes an initial deep feature extraction layer, a boundary-aware affinity prediction layer, a spatial propagation correction layer, a semantically guided correction layer, and a depth-refined output layer: The initial depth feature extraction layer is used to receive security inspection scene image frames, extract multi-scale image features through downsampling convolution and cross-layer skip stitching, and after multi-receptive field fusion and channel dimensionality reduction, perform depth convolution mapping to output a rough relative depth map; The boundary-aware affinity prediction layer is used to extract entity boundary features from multi-scale image features and calculate the feature difference between adjacent pixel nodes. The initial affinity score is generated by mapping through an activation function. Taking the initial affinity score as the operation object, negative penalty suppression is performed on the score that crosses the entity edge, and positive weighted enhancement is performed on the score that is inside the entity. The modulated affinity score is output and a sparse affinity matrix with boundary constraints is generated. The spatial propagation correction layer is used to take a coarse relative depth map as input and a sparse affinity matrix of boundary constraints as propagation constraints. It performs spatial propagation correction through iterative convolution operations: In each iteration, each pixel node in the current coarse relative depth map performs weighted aggregation on the depth values ​​of adjacent pixels with high affinity based on the weights in the sparse affinity matrix of boundary constraints to update its own depth. At the same time, it performs nullification masking on the depth values ​​of pixels across the edge and outputs the target relative depth map after iterative correction. The semantic guidance correction layer is used to introduce the terminal guidance mechanism of ballistic missiles, and the specific execution process includes: The target relative depth map after iterative correction is regarded as an inertial flight trajectory, and the semantic segmentation features in the multi-scale image features are regarded as active radar detection signals. The depth gradient field of the target relative depth map after iterative correction is calculated as the ballistic deviation vector and aligned with the semantic boundary field of the semantic segmentation feature for detection. When the depth gradient field is detected to cross the semantic boundary field, it is determined to be an over-boundary penetration deviation and the terminal guidance is triggered. The boundary mask is extracted based on the semantic boundary field, and the normal thrust vector is generated according to the boundary mask. The reverse thrust compensation is performed on the depth gradient field of the over-boundary penetration. At the same time, the depth value of the region outside the boundary is forcibly truncated and attenuated according to the boundary mask to eliminate the extension of the depth value across the boundary and output the semantically constrained depth map. The depth refinement output layer is used to perform residual connection and upsampling processing on the semantically constrained depth map, and output a semantically guided corrected depth map.

[0009] Optionally, S4 specifically includes: S41. Based on the features of the graph nodes in the scene ontology graph and the ontology topology relationship matrix, abnormal graph nodes are selected as the entities to be tested. The geometric region of the entity detection box corresponding to the entity to be tested is extracted as the spatial projection region. The boundary extreme coordinates and center point coordinates of the spatial projection region are calculated and the two-dimensional positioning coordinates are output. S42. Map the two-dimensional positioning coordinates to the semantic guidance correction depth map to extract the local depth distribution of the corresponding image region, calculate the adaptive depth confidence interval based on the histogram features of the local depth distribution, filter out the outlier depth values ​​in the local depth distribution based on the adaptive depth confidence interval, and perform statistical averaging on the filtered local depth values ​​to output the target observation depth. S43. Integrate the two-dimensional positioning coordinates and the target observation depth to perform coordinate space transformation, calculate the three-dimensional spatial coordinates of the target entity, determine the three-dimensional spatial coordinates as the three-dimensional centroid coordinates of the target entity, and aggregate the three-dimensional centroid coordinates of all the target entities in the scene to construct the scene three-dimensional spatial coordinate set.

[0010] Optionally, S5 specifically includes: S51. Extract the three-dimensional centroid coordinates from the three-dimensional spatial coordinate set of the scene as spatial topology nodes. Extract the non-zero element values ​​and matrix row and column indices from the ontology topology relation matrix and map them to topology edge weights and topology edge endpoint indices, respectively. Associate and match the spatial topology nodes with the topology edge endpoint indices and assign topology edge weights. Output the initial spatial topology graph. S52. Calculate the Euclidean distance of the three-dimensional centroid coordinates of the connected spatial topology nodes in the initial spatial topology graph as the node spatial distance, statistically analyze the distribution characteristics of the global node spatial distance to calculate the adaptive distance benchmark threshold, and compare the node spatial distance with the adaptive distance benchmark threshold to calculate the topology edge weight decay coefficient. S53. Perform multiplicative correction on the topological edge weights in the initial spatial topological graph based on the topological edge weight attenuation coefficient, output the target topological edge weights, re-encode the target topological edge weights and spatial topological nodes, and output the spatial topological graph.

[0011] Optionally, S6 specifically includes: S61. Traverse the target topological edge in the spatial topological graph to extract the associated spatial topological node pairs. Extract the three-dimensional centroid coordinates of the associated spatial topological node pairs, perform absolute value difference calculation to output the three-dimensional coordinate difference vector, and perform norm calculation on the three-dimensional coordinate difference vector to output the three-dimensional spatial distance. S62. Calculate the adaptive baseline scale for the three-dimensional spatial distance distribution characteristics of globally associated spatial topology node pairs in the statistical spatial topology graph, and perform normalization mapping on the three-dimensional spatial distance based on the adaptive baseline scale to output the relative spatial scale coefficient. S63. Extract the entity category and entity attribute of the associated spatial topology node pair to form a category attribute pair. Calculate the adaptive baseline physical distance by statistically analyzing the actual physical distance distribution characteristics of the same category attribute pairs in historical scenes. Perform multiplicative scaling calculation on the adaptive baseline physical distance and the relative spatial ratio coefficient to output the three-dimensional physical distance.

[0012] Optionally, S7 specifically includes: S71. Extract the entity category and entity attribute combination of the entity target to which the associated spatial topology node pair belongs in the spatial topology map into the category attribute pair to be inspected. Statistically analyze the global distribution features of the three-dimensional physical distance of the same category attribute pair to be inspected in historical scenarios. Extract the extreme value distance and high frequency clustering distance in the global distribution features and map them into static compliance distance intervals respectively. Statistically analyze the frequency ratio of the same category attribute pair to be inspected in historical scenarios that triggers abnormal alarms and map it into a static risk coefficient. Encode the static compliance distance interval and the static risk coefficient and output the static context feature vector. S72. Extract the three-dimensional physical distance time series of the associated spatial topology node pairs in the continuous security inspection scene image frames, statistically analyze the time series distribution characteristics of the three-dimensional physical distance time series, calculate the distance fluctuation variance and distance change trend, and calculate the dynamic situation adjustment coefficient based on the distance fluctuation variance and distance change trend. S73. Multiply the static compliance distance interval in the static situation feature vector by the dynamic situation adjustment coefficient to perform interval scaling calculation and output the dynamic compliance distance interval. Perform weighted fusion calculation with the lower bound of the dynamic compliance distance interval and the static risk coefficient to output the dynamic distance threshold.

[0013] Optionally, S8 specifically includes: S81. Extract the three-dimensional physical distance between the associated spatial topology node pairs and the dynamic distance threshold, perform difference calculation, and output the distance threshold difference; S82. Compare the difference between the spacing threshold and the zero value to extract the positive and negative attributes of the difference, and perform state mapping based on the positive and negative attributes of the difference to output the violation status identifier; S83. Extract global violation statistical distribution features of similar entity attributes based on the entity attributes of associated spatial topology node pairs. Concatenate the violation status identifier with the entity attributes of associated spatial topology node pairs to form a violation record tuple as the violation judgment result. Perform fusion update on the violation record tuple and the global violation statistical distribution features to output the current violation statistical distribution features.

[0014] A safety inspection hazard identification system based on visual analysis according to an embodiment of the present invention includes the following modules: The scene ontology graph construction module is used to acquire security inspection scene image frames, extract entity categories and entity attributes and map them to ontology nodes, and construct the scene ontology graph based on the spatial proximity features between ontology nodes. The topology relation matrix construction module is used to evaluate security compliance based on entity categories and entity attributes in the scene ontology graph to extract interaction constraint relationships. After adaptive dynamic weighting, entity nodes are associated and encoded to construct the ontology topology relation matrix. The semantic guidance depth estimation module is used to input security inspection scene image frames into the improved CSPN model, correct the target edge depth penetration through spatial propagation, and introduce the ballistic missile terminal guidance mechanism to perform reverse thrust compensation and truncation attenuation based on semantic boundaries for the cross-boundary penetration deviation, so as to output a semantic guidance corrected depth map. The 3D centroid coordinate calculation module is used to filter the entity target to be tested based on the scene ontology map and extract the spatial projection area, calculate the 2D positioning coordinates of the spatial projection area, extract the depth features of the corresponding area from the semantically guided correction depth map, and fuse them to generate the 3D centroid coordinates of the entity target to construct the 3D spatial coordinate set of the scene. The spatial topology graph construction module is used to extract the interaction constraint relationships in the ontology topology relationship matrix and the three-dimensional centroid coordinates in the scene three-dimensional spatial coordinate set, and use them as edges and nodes to construct the spatial topology graph. The 3D physical distance calculation module is used to extract the 3D centroid coordinates of associated node pairs based on the traversal of the spatial topology graph, calculate the 3D spatial distance between associated nodes and map it to the 3D physical distance. The dynamic distance threshold generation module is used to extract the entity attributes of related node pairs in the spatial topology graph, solve the static situation constraints by combining historical global distribution features, calculate the dynamic situation adjustment coefficient by combining real-time dynamic trends, and generate the dynamic distance threshold by fusing the static situation constraints and the dynamic situation adjustment coefficient. The violation judgment result output module is used to calculate the difference between the three-dimensional physical distance and the dynamic distance threshold, and output the violation judgment result based on the positive and negative attribute mapping of the difference calculation result.

[0015] The beneficial effects of this invention are: This invention significantly improves the physical fidelity and dynamic discrimination accuracy of 3D spatial measurements during the identification of potential hazards in security inspection scenarios by introducing a semantic boundary correction and context-adaptive closed-loop feedback optimization process based on the ballistic missile terminal guidance mechanism. By innovatively introducing a ballistic missile terminal guidance mechanism into the improved CSPN model, the depth gradient field crossing the semantic boundary is treated as an over-boundary penetration deviation that triggers terminal guidance. A semantic boundary mask is used to generate a normal thrust vector to perform reverse thrust compensation and truncation attenuation, effectively eliminating the structural distortion caused by target edge depth penetration and numerical extension across semantic boundaries in traditional spatial propagation correction, achieving strict consistency constraints between depth estimation and entity physical boundaries. Simultaneously, an adaptive dynamic weighting strategy is used to construct an ontology topology relation matrix, deeply mining the implicit interactive compliance logic between scene entities. In the dynamic distance threshold generation stage, historical global distribution features and real-time dynamic trends are integrated, and a context-adaptive evolutionary closed loop is constructed by combining the back-propagation update of violation record tuples. This significantly improves the accuracy, robustness, and self-learning evolution capability of violation discrimination in complex dynamic security inspection scenarios. Attached Figure Description

[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is an overall flowchart of a visual analysis-based safety inspection hazard identification method proposed in this invention; Figure 2 This is a flowchart illustrating the working principle of an improved CSPN model for a visual analysis-based safety inspection hazard identification method proposed in this invention. Figure 3 This is a schematic diagram of a safety inspection hazard identification system based on visual analysis proposed in this invention. Detailed Implementation

[0017] The invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0018] refer to Figure 1 and Figure 2 A method for identifying safety hazards during inspections based on visual analysis includes the following steps: S1. Acquire security inspection scene image frames, extract entity categories and entity attributes and map them to ontology nodes, and construct scene ontology graphs based on spatial proximity features between ontology nodes. S2. Based on the entity categories and entity attributes in the scene ontology graph, assess security compliance to extract interaction constraint relationships. After adaptive dynamic weighting, associate entity nodes and encode to construct an ontology topology relationship matrix. S3. Input the security inspection scene image frame into the improved CSPN model, correct the target edge depth penetration through spatial propagation, and introduce the ballistic missile terminal guidance mechanism to perform reverse thrust compensation and truncation attenuation based on semantic boundary for the cross-boundary penetration deviation, so as to output a semantic guidance correction depth map. S4. Based on the scene ontology map, filter the entity targets to be tested and extract the spatial projection area, calculate the two-dimensional positioning coordinates of the spatial projection area, and extract the depth features of the corresponding area from the semantically guided correction depth map, and fuse them to generate the three-dimensional centroid coordinates of the entity targets to construct a set of three-dimensional spatial coordinates of the scene. S5. Extract the interaction constraint relationships from the ontology topology relationship matrix and the three-dimensional centroid coordinates from the scene three-dimensional space coordinate set, and use them as edges and nodes to construct a spatial topology graph; S6. Extract the three-dimensional centroid coordinates of associated node pairs based on spatial topology graph traversal, calculate the three-dimensional spatial distance between associated nodes and map it to three-dimensional physical distance; S7. Extract the entity attributes of the associated node pairs in the spatial topology graph, solve the static situation constraints by combining historical global distribution characteristics, calculate the dynamic situation adjustment coefficient by combining real-time dynamic trends, and generate a dynamic distance threshold by fusing static situation constraints and dynamic situation adjustment coefficients. S8. Calculate the difference between the three-dimensional physical distance and the dynamic distance threshold, and output the violation judgment result based on the positive and negative attribute mapping of the difference calculation result.

[0019] In this embodiment, S1 specifically includes: S11. Perform target detection on the security inspection scene image frame to output entity detection boxes and classification confidence scores. Filter out entity detection boxes with classification confidence scores below 0.5. Crop the corresponding image regions of the filtered entity detection boxes and input them into the attribute recognition network to output entity attributes. At the same time, extract the peak index of the classification confidence score to parse and output the entity category. Concatenate the entity category and entity attribute to map them into a graph node feature vector with a dimension of 256.

[0020] S12. Based on the previously generated map node feature vectors, perform pairwise combinations of map node feature vectors within the same frame to generate candidate node pairs. Extract the center pixel coordinates of the entity detection boxes to which the candidate node pairs belong. Calculate the Euclidean distance between the two center pixel coordinates as the center point spatial distance. Calculate the mean and standard deviation of all center point spatial distances within the same frame. Calculate the mean plus 1.5 times the standard deviation as the initial proximity threshold. Compare the initial proximity threshold with the value 0 to the maximum value and output an adaptive proximity threshold that is not lower than 0.

[0021] S13. Compare the spatial distance between the center points of the candidate node pair with the previously calculated adaptive proximity threshold. If the spatial distance between the center points is higher than the adaptive proximity threshold, filter out the candidate node pair. If the spatial distance between the center points is lower than or equal to the adaptive proximity threshold, retain and connect the candidate node pair. Combine and encode the retained candidate node pair with the corresponding graph node feature vector to output the scene ontology graph.

[0022] In this embodiment, S2 specifically includes: S21. Extract entity categories and entity attributes from the scene ontology graph, perform Cartesian product combination to generate category attribute pairs, input the category attribute pairs into the Sigmoid activation function to map them to a security compliance level between 0 and 1, extract category attribute pairs with a security compliance level lower than 0.5 as violation combinations, parse the entity categories contained in the violation combinations to extract category combination labels, bind the category combination labels with the corresponding constraint rules and output them as inter-class interaction constraint relationships.

[0023] S22. Extract the category combination labels bound in the previous inter-class interaction constraint relationship, count the historical trigger frequency of the category combination labels in 100 consecutive security inspection scene image frames, calculate the historical trigger frequency divided by 100 frames to obtain the trigger ratio, multiply the trigger ratio by the value of 10 to calculate the output adaptive constraint weight, allocate the adaptive constraint weight to the corresponding inter-class interaction constraint relationship, and output the inter-class weighted constraint relationship.

[0024] S23. Extract the entity category combination of candidate node pairs in the scene ontology graph, perform string matching with the category combination label in the weighted constraint relationship between preceding classes, extract the adaptive constraint weight in the successfully matched weighted constraint relationship as the instance constraint weight, extract the maximum value of multiple instance constraint weights associated with the same candidate node pair and output it as the target instance constraint weight, map the target instance constraint weight to the non-zero element value of the ontology topology relation matrix, determine the matrix row and column index based on the index number of the two graph nodes in the candidate node pair, fill the matrix row and column index with non-zero element values, and output the ontology topology relation matrix.

[0025] In this embodiment, the improved CSPN model includes an initial deep feature extraction layer, a boundary-aware affinity prediction layer, a spatial propagation correction layer, a semantic guidance correction layer, and a depth refinement output layer: The initial depth feature extraction layer is used to receive image frames of the security inspection scene. It performs downsampling convolution with a stride of 2 and a kernel size of 3 pixels by 3 pixels to extract shallow features. The shallow features and the corresponding deep features are spliced ​​together across layers to output spliced ​​features. The spliced ​​features are input into three parallel convolutional layers with dilation rates of 1, 2 and 4 to perform multi-receptive field fusion. Then, a 1x1 convolution is performed to reduce the dimensionality to 16 dimensions. Finally, a 3x3 depth convolution is mapped with the Sigmoid activation function to output a single-channel coarse relative depth map.

[0026] The boundary-aware affinity prediction layer is used to extract features from the front-end multi-receptive field fusion output as multi-scale image features. It extracts entity boundary features through 3x3 convolution and Sobel gradient operator, calculates the feature Euclidean distance between adjacent pixel nodes as feature difference, and inputs the feature difference into the Sigmoid activation function to generate an initial affinity score between 0 and 1. Set a boundary threshold of 0.3, multiply the score of crossing entity edges below the boundary threshold of 0.3 by a value of 0.1 to perform negative penalty suppression, and multiply the score of the entity interior region above or equal to the boundary threshold of 0.3 by a value of 2.0 to perform positive weighted enhancement, output the modulation affinity score, and retain only pixel node pairs with modulation affinity scores greater than 0.01 to generate a sparse affinity matrix with boundary constraints.

[0027] The spatial propagation correction layer is used to extract the sparse affinity matrix of the previous coarse relative depth map and boundary constraints. The spatial propagation correction is performed with 3 iterations: In each iteration, each pixel node in the current coarse relative depth map extracts the top 4 neighboring pixels with the highest weights in the sparse affinity matrix as high affinity neighboring pixels. The depth values ​​of the high affinity neighboring pixels are weighted and summed to update their own depth. At the same time, the depth values ​​of cross-edge pixels with weights lower than 0.01 in the sparse affinity matrix are multiplied by 0 to perform nullification masking. After 3 iterations, the target relative depth map after iterative correction is output.

[0028] The semantic guidance correction layer is used to introduce the terminal guidance mechanism of ballistic missiles. The specific execution process includes: The relative depth map of the foreground target is extracted and regarded as the inertial flight trajectory. The semantic segmentation features of the foreground multi-scale image are extracted, processed by 1x1 convolution and Softmax activation function, and regarded as the active radar detection signal. The difference between the target and the depth map along the horizontal and vertical directions is calculated as the depth gradient field and used as the ballistic deviation vector. The category mutation position of the semantic segmentation feature is extracted as the semantic boundary field. The depth gradient field and the semantic boundary field are then used to perform coordinate alignment detection. When a depth gradient field value greater than 0.5 is detected and crosses the semantic boundary field, it is determined to be an over-boundary penetration deviation and the terminal guidance is triggered. A boundary mask with a width of 2 pixels is extracted based on the semantic boundary field. A normal thrust vector with a modulus of 1.0 is generated according to the normal direction of the boundary mask. Reverse thrust compensation is performed on the depth gradient field of the over-boundary penetration. At the same time, the depth value of the region outside the boundary is forcibly truncated and attenuated by multiplying the boundary mask value by 0.1 to eliminate the extension of the depth value across the boundary and output a semantically constrained depth map.

[0029] The depth-refined output layer is used to extract the preceding semantically constrained depth map, and performs pixel-by-pixel addition calculation with the initial coarse relative depth map to achieve residual connection. The residual connection result is subjected to bilinear interpolation upsampling processing with a magnification factor of 2 to restore the spatial resolution to the original security inspection scene image frame size, and outputs a semantically guided corrected depth map.

[0030] The improved CSPN model proposed in this step is similar to the traditional CSPN model in that it is based on the spatial propagation correction theory and the local affinity prediction mechanism. That is, by extracting multi-scale image features, the affinity scores between adjacent pixels are predicted to construct a propagation weight matrix. With the initial coarse depth map as input, under the constraint of the affinity matrix, it performs pixel-level depth value weighted aggregation and neighborhood propagation through iterative convolution operation. At the same time, both models use boundary features to suppress cross-edge propagation, and finally output a refined depth map.

[0031] The difference lies in that this invention breaks through the limitation of traditional CSPN, which relies solely on the affinity matrix for soft penalties and cannot completely block edge-depth penetration. After spatial propagation correction, a semantic guidance correction layer is added to introduce the ballistic missile terminal guidance mechanism. The corrected depth map is regarded as an inertial flight trajectory, and the semantic segmentation features are regarded as active radar detection signals. The deviation of the over-boundary penetration is determined by calculating the depth gradient field and aligning it with the semantic boundary field. Once terminal guidance is triggered, the normal thrust vector generated by the boundary mask is used to perform reverse thrust compensation on the over-boundary gradient, and the depth outside the boundary is subject to forced truncation attenuation, rather than the passive defense of the traditional method that only performs zeroing masking on the affinity score across the edge.

[0032] The beneficial effects of the improvements are that, by introducing a ballistic missile terminal guidance mechanism, the present invention forcibly embeds the active hard constraint of semantic boundary into the gradient correction process of depth propagation, breaking the limitations of traditional CSPN in terms of depth numerical propagation and structural distortion caused by affinity residue at complex edges, and realizing the precise conversion from passive masking to active truncation correction; this design significantly enhances the ability to eliminate the deep penetration of target edges, can accurately eliminate cross-entity numerical extension at semantic boundaries, and combined with residual refinement output, effectively improves the physical fidelity of depth estimation and the absolute accuracy of 3D measurement in complex occlusion and high-contrast scenarios.

[0033] In this embodiment, S4 specifically includes: S41. Extract the features of the graph nodes and the topological relationship matrix of the ontology graph. Calculate the sum of the elements of the row vectors corresponding to each node in the ontology topological relationship matrix as the anomaly association score. Select graph nodes with anomaly association scores greater than 2.0 as the entities to be tested. Extract the coordinates of the top left and bottom right vertices of the entity detection box corresponding to the entity to be tested as the boundary extreme value coordinates. Calculate the mean of the horizontal and vertical coordinates of the top left and bottom right vertices as the center point coordinates. Combine the boundary extreme value coordinates and the center point coordinates to output the two-dimensional positioning coordinates.

[0034] S42. Map the boundary extreme coordinates in the previous two-dimensional positioning coordinates to the semantic constraint depth map to construct a rectangular mask region. Extract all pixel depth values ​​in the rectangular mask region as local depth distribution. Calculate the histogram features by counting the frequency of each 0.1-meter interval in the local depth distribution. Extract the interval where the depth value corresponding to the center point coordinates in the previous two-dimensional positioning coordinates falls into the histogram features as the main depth interval. Mask outlier depth values ​​outside the main depth interval and replace them with the mean of the main depth interval. Calculate the target observation depth by performing an arithmetic mean on all depth values ​​in the replaced rectangular mask region.

[0035] S43. Extract the center point coordinates from the previous two-dimensional positioning coordinates, multiply by 0.001 meters per pixel to convert them into physical plane horizontal and vertical coordinates, extract the previous target observation depth as physical plane depth coordinates, concatenate the physical plane horizontal and vertical coordinates with the physical plane depth coordinates to perform coordinate space transformation, solve the three-dimensional spatial coordinates of the entity to be measured and determine them as the three-dimensional centroid coordinates of the entity, and aggregate the three-dimensional centroid coordinates of all entity targets to be measured in the scene to construct a set of scene three-dimensional spatial coordinates.

[0036] In this embodiment, S5 specifically includes: S51. Extract the 3D centroid coordinates from the 3D spatial coordinate set of the previous scene as spatial topology nodes. Extract the non-zero element values ​​of the matrix in the topology relation matrix of the previous ontology as topology edge weights and the matrix row and column indices as topology edge endpoint indices. Perform number association matching between the spatial topology nodes and the topology edge endpoint indices and assign the corresponding topology edge weights. Output the initial spatial topology graph.

[0037] S52. Calculate the Euclidean distance of the three-dimensional centroid coordinates of the connected spatial topology nodes in the initial spatial topology graph as the node spatial distance. Calculate the mean of all node spatial distances plus 1.0 times the standard deviation as the adaptive distance benchmark threshold. Calculate the difference between 1.0 and the node spatial distance divided by the adaptive distance benchmark threshold, and output the relative distance ratio. Input the relative distance ratio into the Sigmoid activation function and map it to the topology edge weight decay coefficient between 0 and 1.

[0038] S53. Extract the pre-existing topological edge weight attenuation coefficient, perform multiplicative correction on the topological edge weights in the pre-existing initial spatial topological graph, output the target topological edge weights, re-encode the target topological edge weights and pre-existing spatial topological nodes, and output the spatial topological graph.

[0039] In this embodiment, S6 specifically includes: S61. Traverse the target topological edge in the previous spatial topological graph to extract the associated spatial topological node pairs. Calculate the absolute value of the difference between the three-dimensional centroid coordinates of the associated spatial topological node pairs on the horizontal axis, vertical axis and depth axis to form a three-dimensional coordinate difference vector. Perform 2-norm calculation on the three-dimensional coordinate difference vector to output the three-dimensional spatial distance.

[0040] S62. The mean of the three-dimensional spatial distances of globally associated spatial topology node pairs in the statistical preceding spatial topology graph is added to 1.0 times the standard deviation as the adaptive baseline scale. The preceding three-dimensional spatial distance is calculated and divided by the adaptive baseline scale to output the relative spatial scale coefficient. The difference between the numerical value 2.0 and the preceding relative spatial scale coefficient is input into the Sigmoid activation function to map the observation confidence weights in the range of 0 to 1.

[0041] S63. Extract the entity category and entity attribute combination of the entity target to which the preceding associated spatial topology node pair belongs into a category attribute pair. Calculate the average actual physical distance of the same category attribute pair in the historical scene as the adaptive baseline physical distance. Calculate the preceding observation confidence weight multiplied by the difference between the preceding three-dimensional spatial distance plus the value 1.0 minus the preceding observation confidence weight, multiplied by the adaptive baseline physical distance. Perform weighted fusion calculation to output the three-dimensional physical distance in meters.

[0042] In this embodiment, S7 specifically includes: S71. Extract the entity category and entity attribute combination of the associated spatial topology node pairs in the previous spatial topology map to form the target category attribute pair to be inspected. Statistically analyze the global distribution features of the three-dimensional physical distance of the same target category attribute pair in historical scenarios. Extract the extreme value distance from the global distribution features and map it to the upper limit of 1.0 meter and the high frequency clustering distance to the lower limit of 0.3 meters to construct a static compliance distance interval. Statistically analyze the frequency ratio of the same target category attribute pair to trigger abnormal alarms in historical scenarios. Input the frequency ratio into the Sigmoid activation function to map and output a static risk coefficient in the range of 0 to 1. Encode the static compliance distance interval and the static risk coefficient to output a static context feature vector.

[0043] S72. Extract the three-dimensional physical distance of the preceding associated spatial topology node pairs in the continuous security inspection scene image frames to construct a time series sequence. Calculate the distance fluctuation variance and distance change slope of the preceding three-dimensional physical distance time series. Calculate the fluctuation amplification factor by adding the preceding distance fluctuation variance to the value 1.0 and dividing it by the quotient of the preceding distance fluctuation variance plus the value 1.0. Calculate the trend amplification factor by multiplying the absolute value of the preceding distance change slope plus the value 0.5. Multiply the fluctuation amplification factor by the trend amplification factor to output the dynamic situation adjustment coefficient.

[0044] S73. Multiply the static compliance distance interval in the previous static situation feature vector by the previous dynamic situation adjustment coefficient to perform interval scaling calculation and output the dynamic compliance distance interval. Calculate the lower bound of the previous dynamic compliance distance interval by multiplying the value 1.0 by the difference between the value and the static risk coefficient in the previous static situation feature vector, add the value 0.1 and multiply by the previous static risk coefficient to perform bottom-line fault tolerance offset calculation, and output the dynamic distance threshold in meters.

[0045] The dynamic distance threshold generation process proposed in this step is similar to the traditional safety distance judgment threshold setting process in that both are based on the spatiotemporal feature extraction and threshold mapping theory. That is, by extracting the attribute features and distance sequences of the target object for statistical regularity analysis, the baseline range of the safety boundary is established using historical prior data, and the baseline boundary is corrected by combining real-time state features, and finally the distance threshold used for compliance judgment is output.

[0046] The difference lies in that this invention breaks away from the limitations of traditional methods that rely on expert experience to set rigid fixed thresholds and ignore the dynamic evolution of the scene. It adds time-series statistics and interval scaling steps to extract dynamic situation adjustment coefficients, and replaces the traditional static scalar mapping with a time-space dual-driven interval scaling and weighted fusion mechanism. It maps the extreme values ​​and high-frequency clustering intervals of the historical global distribution to static compliance intervals, and calculates dynamic adjustment coefficients by combining the interval fluctuation variance and change trend of continuous frames to perform interval scaling. Finally, it outputs a dynamic threshold by combining the lower bound of the scaled interval and the static danger coefficient, rather than a single static experience value judgment.

[0047] The beneficial effects of the improvements are that, by decoupling and fusing historical prior statistics with real-time temporal dynamics, the present invention rigidly embeds scene dynamic constraints into the threshold generation mechanism, breaking the limitations of traditional methods that are prone to missed or false alarms due to threshold rigidity in complex, variable, and sudden proximity conditions. It achieves a precise transformation from static experience-based constraints to spatiotemporally adaptive dynamic reasoning. This design significantly enhances the ability to perceive and defend against dynamic fluctuations and trend evolution of entity spacing, and can accurately predict potential collision risks in the temporal distribution space. Combined with the weighted fusion of risk coefficients, it effectively improves the environmental adaptability of violation judgment thresholds and the absolute reliability of security inspection warnings.

[0048] In this embodiment, S8 specifically includes: S81. Extract the three-dimensional physical distance between the preceding associated spatial topology node pairs and subtract the preceding dynamic distance threshold to perform difference calculation, and output the distance threshold difference in meters.

[0049] S82. Compare the difference between the previous spacing threshold and the value 0 to extract the positive or negative attribute of the difference. When the difference between the previous spacing threshold and the value 0 is less than the value 0, the value 1 is mapped and output as the violation status identifier. When the difference between the previous spacing threshold and the value 0 is greater than or equal to the value 0, the value 0 is mapped and output as the violation status identifier.

[0050] S83. Extract the entity attributes of the preceding associated spatial topology node pairs and retrieve the global violation statistical distribution features of the same type of entity attributes. When the preceding violation status identifier is equal to the value 1, increment the number of violations in the preceding global violation statistical distribution features by 1. When the preceding violation status identifier is equal to the value 0, increment the number of compliances in the preceding global violation statistical distribution features by 1. Calculate the updated number of violations divided by the sum of the number of violations plus the number of compliances plus the value 1.0, and output the current violation statistical distribution features in the range of 0 to 1.

[0051] refer to Figure 3 A safety inspection hazard identification system based on visual analysis, specifically including the following modules: The scene ontology graph construction module is used to acquire security inspection scene image frames, extract entity categories and entity attributes and map them to ontology nodes, and construct the scene ontology graph based on the spatial proximity features between ontology nodes. The topology relation matrix construction module is used to evaluate security compliance based on entity categories and entity attributes in the scene ontology graph to extract interaction constraint relationships. After adaptive dynamic weighting, entity nodes are associated and encoded to construct the ontology topology relation matrix. The semantic guidance depth estimation module is used to input security inspection scene image frames into the improved CSPN model, correct the target edge depth penetration through spatial propagation, and introduce the ballistic missile terminal guidance mechanism to perform reverse thrust compensation and truncation attenuation based on semantic boundaries for the cross-boundary penetration deviation, so as to output a semantic guidance corrected depth map. The 3D centroid coordinate calculation module is used to filter the entity target to be tested based on the scene ontology map and extract the spatial projection area, calculate the 2D positioning coordinates of the spatial projection area, extract the depth features of the corresponding area from the semantically guided correction depth map, and fuse them to generate the 3D centroid coordinates of the entity target to construct the 3D spatial coordinate set of the scene. The spatial topology graph construction module is used to extract the interaction constraint relationships in the ontology topology relationship matrix and the three-dimensional centroid coordinates in the scene three-dimensional spatial coordinate set, and use them as edges and nodes to construct the spatial topology graph. The 3D physical distance calculation module is used to extract the 3D centroid coordinates of associated node pairs based on the traversal of the spatial topology graph, calculate the 3D spatial distance between associated nodes and map it to the 3D physical distance. The dynamic distance threshold generation module is used to extract the entity attributes of related node pairs in the spatial topology graph, solve the static situation constraints by combining historical global distribution features, calculate the dynamic situation adjustment coefficient by combining real-time dynamic trends, and generate the dynamic distance threshold by fusing the static situation constraints and the dynamic situation adjustment coefficient. The violation judgment result output module is used to calculate the difference between the three-dimensional physical distance and the dynamic distance threshold, and output the violation judgment result based on the positive and negative attribute mapping of the difference calculation result.

[0052] Example 1: To verify the feasibility of this invention in intelligent supervision and hazard identification in security inspection scenarios, the method of this invention was applied to a smart security inspection and prevention system (hereinafter referred to as "System A") of a large hub airport. In traditional security violation identification systems, object detection based on two-dimensional images combined with judgment algorithms based on fixed geometric rules are typically used to verify the compliance of personnel and luggage. These methods are not only limited by the physical space distortion of the two-dimensional projection perspective, but also cannot effectively handle the penetration blur of the target depth edge and the complex dynamic interaction constraints of the scene, which easily leads to frequent missed detections and false alarms, seriously consuming security inspection resources. To solve the above problems, System A decided to adopt the security inspection hazard identification method based on visual analysis proposed in this invention.

[0053] During implementation, System A first utilizes its front-end visual acquisition equipment to acquire continuous video streams of the security checkpoint in real time. After decoding, frame extraction, and preprocessing, high-quality security checkpoint scene image frames are formed. Simultaneously, System A uses an object detection and attribute recognition network to accurately extract entity categories such as luggage, personnel, and contraband, as well as their entity attributes such as color and shape. This constructs a multi-dimensional scene ontology graph and ontology topology matrix, deeply exploring the security compliance and interaction constraints between entities.

[0054] System A maps security inspection scene image frames into a three-dimensional spatial representation by introducing an improved CSPN model. Particularly noteworthy is its innovative use of a ballistic missile terminal guidance mechanism in the depth estimation stage. This mechanism treats the depth gradient field crossing semantic boundaries during spatial propagation correction as "boundary infiltration deviation" and semantic boundary features as "active radar detection signals." Upon detecting depth infiltration exceeding the boundary, terminal guidance is immediately triggered, generating a normal thrust vector to perform reverse thrust compensation and truncation attenuation on the infringing depth, effectively eliminating depth infiltration distortion at the target edge. Based on the fusion of high-precision depth maps and two-dimensional positioning, System A accurately calculates the three-dimensional centroid coordinates of the target entity, constructing a set of three-dimensional spatial coordinates and a spatial topology map of the scene. This elevates compliance determination in a two-dimensional plane to a precise measurement of real three-dimensional physical distances.

[0055] Furthermore, in the violation judgment threshold generation stage, System A breaks through the limitations of traditional static rigid thresholds by combining historical global distribution characteristics with real-time dynamic trends to adaptively calculate dynamic distance thresholds. Simultaneously, it fuses and updates the violation record tuples generated in each frame with the global violation statistical distribution characteristics of similar entity attributes, forming a closed-loop adaptive mechanism of "judgment result feedback - context threshold evolution".

[0056] During implementation, the technical team of System A discovered that, compared with traditional two-dimensional rule-based judgment methods and fixed threshold models, the method of this invention significantly improves the accuracy and scenario adaptability of security inspection hazard identification. This invention, by improving the CSPN and ballistic missile terminal guidance mechanism, effectively achieves precise measurement of three-dimensional spatial physical distances and adaptive early warning for dynamic situations.

[0057] To further verify the actual performance of the method of the present invention, System A conducted a detailed comparative test between the method of the present invention and the traditional method. The specific performance data is shown in Table 1: Table 1 Performance Comparison of Security Hazard Identification Methods in System A

[0058] As shown in Table 1, the performance of the security hazard identification system has been comprehensively improved after applying the method of this invention. The relative error of three-dimensional spacing measurement has been significantly reduced from 18.5% in the traditional method to 3.2%, and the deep edge penetration elimination rate has jumped from 25.0% to 94.5%, fundamentally solving the pain points of inaccurate measurement of two-dimensional projection space and deep edge penetration. The hazard underreporting rate and false alarm rate have been significantly reduced by 85.6% and 79.5% respectively, directly improving the reliability of security inspection judgment and commercial security value. The dynamic scene adaptation response time has been reduced from 350 milliseconds to 65 milliseconds, and the recognition accuracy under complex occlusion has been improved to 92.3%, greatly enhancing the system efficiency and dynamic robustness. In addition, due to the self-evolving closed-loop mechanism of dynamic thresholds, the system does not require frequent manual threshold calibration, the security inspection efficiency has increased from 15 people / minute to 28 people / minute, and the manual review rate of security inspectors has decreased from 35.0% to 8.2%, greatly reducing the cost of human security personnel.

[0059] Through the method of this invention, System A successfully achieved three-dimensional accurate identification of potential hazards in security inspection scenarios and situation-adaptive dynamic early warning, effectively improving the efficiency and accuracy of security inspection and prevention, ensuring the operational safety and traffic efficiency of hub airports, significantly improving the intelligence and automation level of security inspection supervision, significantly reducing the verification cost of invalid alarms, enhancing the robustness of the system in complex dynamic scenarios, and providing strong technical support for intelligent security supervision.

[0060] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for identifying safety hazards during inspections based on visual analysis, characterized in that, Includes the following steps: S1. Acquire security inspection scene image frames, extract entity categories and entity attributes and map them to ontology nodes, and construct scene ontology graphs based on spatial proximity features between ontology nodes. S2. Based on the entity categories and entity attributes in the scene ontology graph, assess security compliance to extract interaction constraint relationships. After adaptive dynamic weighting, associate entity nodes and encode to construct an ontology topology relationship matrix. S3. Input the security inspection scene image frame into the improved CSPN model, correct the target edge depth penetration through spatial propagation, and introduce the ballistic missile terminal guidance mechanism to perform reverse thrust compensation and truncation attenuation based on semantic boundary for the cross-boundary penetration deviation, so as to output a semantic guidance correction depth map. S4. Based on the scene ontology map, filter the entity targets to be tested and extract the spatial projection area, calculate the two-dimensional positioning coordinates of the spatial projection area, and extract the depth features of the corresponding area from the semantically guided correction depth map, and fuse them to generate the three-dimensional centroid coordinates of the entity targets to construct a set of three-dimensional spatial coordinates of the scene. S5. Extract the interaction constraint relationships from the ontology topology relationship matrix and the three-dimensional centroid coordinates from the scene three-dimensional space coordinate set, and use them as edges and nodes to construct a spatial topology graph; S6. Extract the three-dimensional centroid coordinates of associated node pairs based on spatial topology graph traversal, calculate the three-dimensional spatial distance between associated nodes and map it to three-dimensional physical distance; S7. Extract the entity attributes of the associated node pairs in the spatial topology graph, solve the static situation constraints by combining historical global distribution characteristics, calculate the dynamic situation adjustment coefficient by combining real-time dynamic trends, and generate a dynamic distance threshold by fusing static situation constraints and dynamic situation adjustment coefficients. S8. Calculate the difference between the three-dimensional physical distance and the dynamic distance threshold, and output the violation judgment result based on the positive and negative attribute mapping of the difference calculation result.

2. The method for identifying safety hazards based on visual analysis according to claim 1, characterized in that, S1 includes: S11. Perform target detection on the security inspection scene image frame to output entity detection boxes and classification confidence scores. Filter entity detection boxes based on classification confidence scores. Crop the corresponding image regions of the filtered entity detection boxes. Perform attribute recognition on the cropped image regions to output entity attributes. Analyze and output entity categories based on the peak index of classification confidence scores. S12. Map entity categories and entity attributes to graph node features. Perform pairwise combinations of graph node features within the same frame to generate candidate node pairs. Calculate the spatial distance between the center points of the entity detection boxes to which the candidate node pairs belong. Statistically analyze the distribution characteristics of the spatial distance between the center points and calculate the adaptive proximity threshold. S13. Compare the spatial distance between the center points of candidate node pairs with the adaptive proximity threshold, filter out candidate node pairs that are lower than the adaptive proximity threshold, retain and connect candidate node pairs that are higher than the adaptive proximity threshold, and output the scene ontology map.

3. The method for identifying safety hazards based on visual analysis according to claim 1, characterized in that, S2 specifically includes: S21. Based on the entity categories and entity attributes in the scene ontology graph, perform Cartesian product combination to generate category attribute pairs, calculate the security compliance of category attribute pairs, extract category attribute pairs below the security compliance threshold as violation combinations, and perform parsing on the violation combinations to output inter-class interaction constraint relationships. S22. Extract the category combination labels corresponding to the inter-class interaction constraint relationship, count the historical trigger frequency of the category combination labels in the continuous security inspection scene image frames, calculate the adaptive constraint weight based on the distribution characteristics of the historical trigger frequency, allocate the adaptive constraint weight to the corresponding inter-class interaction constraint relationship, and output the inter-class weighted constraint relationship. S23. Match the candidate node pairs in the scene ontology graph with the entity category combination and inter-class weighted constraint relationship to determine the constraint weights of multiple instances associated with the candidate node pairs. Perform aggregation calculation on the constraint weights of multiple instances to output the constraint weights of the target instance. Map the constraint weights of the target instance to non-zero element values ​​of the matrix. Determine the matrix row and column indices based on the candidate node pairs. Fill the matrix row and column indices with non-zero element values ​​of the matrix and output the ontology topology relation matrix.

4. The method for identifying safety hazards based on visual analysis according to claim 1, characterized in that, The improved CSPN model includes an initial deep feature extraction layer, a boundary-aware affinity prediction layer, a spatial propagation correction layer, a semantically guided correction layer, and a depth-refined output layer. The initial depth feature extraction layer is used to receive security inspection scene image frames, extract multi-scale image features through downsampling convolution and cross-layer skip stitching, and after multi-receptive field fusion and channel dimensionality reduction, perform depth convolution mapping to output a rough relative depth map; The boundary-aware affinity prediction layer is used to extract entity boundary features from multi-scale image features and calculate the feature difference between adjacent pixel nodes, and generate an initial affinity score through activation function mapping. Using the initial affinity score as the operation object, negative penalty suppression is applied to the score that crosses the edge of the entity, and positive weighted enhancement is applied to the score in the internal region of the entity. The output modulates the affinity score and generates a sparse affinity matrix with boundary constraints. The spatial propagation correction layer is used to take a coarse relative depth map as input and a sparse affinity matrix of boundary constraints as propagation constraints. It performs spatial propagation correction through iterative convolution operations: In each iteration, each pixel node in the current coarse relative depth map performs weighted aggregation on the depth values ​​of adjacent pixels with high affinity based on the weights in the sparse affinity matrix of boundary constraints to update its own depth. At the same time, it performs nullification masking on the depth values ​​of pixels across the edge and outputs the target relative depth map after iterative correction. The semantic guidance correction layer is used to introduce the terminal guidance mechanism of ballistic missiles, and the specific execution process includes: The target relative depth map after iterative correction is regarded as an inertial flight trajectory, and the semantic segmentation features in the multi-scale image features are regarded as active radar detection signals. The depth gradient field of the target relative depth map after iterative correction is calculated as the ballistic deviation vector and aligned with the semantic boundary field of the semantic segmentation feature for detection. When the depth gradient field is detected to cross the semantic boundary field, it is determined to be an over-boundary penetration deviation and the terminal guidance is triggered. The boundary mask is extracted based on the semantic boundary field, and the normal thrust vector is generated according to the boundary mask. The reverse thrust compensation is performed on the depth gradient field of the over-boundary penetration. At the same time, the depth value of the region outside the boundary is forcibly truncated and attenuated according to the boundary mask to eliminate the extension of the depth value across the boundary and output the semantically constrained depth map. The depth refinement output layer is used to perform residual connection and upsampling processing on the semantically constrained depth map, and output a semantically guided corrected depth map.

5. The safety inspection hazard identification method and system based on visual analysis according to claim 1, characterized in that, S4 specifically includes: S41. Based on the features of the graph nodes in the scene ontology graph and the ontology topology relationship matrix, abnormal graph nodes are selected as the entities to be tested. The geometric region of the entity detection box corresponding to the entity to be tested is extracted as the spatial projection region. The boundary extreme coordinates and center point coordinates of the spatial projection region are calculated and the two-dimensional positioning coordinates are output. S42. Map the two-dimensional positioning coordinates to the semantic guidance correction depth map to extract the local depth distribution of the corresponding image region, calculate the adaptive depth confidence interval based on the histogram features of the local depth distribution, filter out the outlier depth values ​​in the local depth distribution based on the adaptive depth confidence interval, and perform statistical averaging on the filtered local depth values ​​to output the target observation depth. S43. Integrate the two-dimensional positioning coordinates and the target observation depth to perform coordinate space transformation, calculate the three-dimensional spatial coordinates of the target entity, determine the three-dimensional spatial coordinates as the three-dimensional centroid coordinates of the target entity, and aggregate the three-dimensional centroid coordinates of all the target entities in the scene to construct the scene three-dimensional spatial coordinate set.

6. The safety inspection hazard identification method and system based on visual analysis according to claim 1, characterized in that, S5 specifically includes: S51. Extract the three-dimensional centroid coordinates from the three-dimensional spatial coordinate set of the scene as spatial topology nodes. Extract the non-zero element values ​​and matrix row and column indices from the ontology topology relation matrix and map them to topology edge weights and topology edge endpoint indices, respectively. Associate and match the spatial topology nodes with the topology edge endpoint indices and assign topology edge weights. Output the initial spatial topology graph. S52. Calculate the Euclidean distance of the three-dimensional centroid coordinates of the connected spatial topology nodes in the initial spatial topology graph as the node spatial distance, statistically analyze the distribution characteristics of the global node spatial distance to calculate the adaptive distance benchmark threshold, and compare the node spatial distance with the adaptive distance benchmark threshold to calculate the topology edge weight decay coefficient. S53. Perform multiplicative correction on the topological edge weights in the initial spatial topological graph based on the topological edge weight attenuation coefficient, output the target topological edge weights, re-encode the target topological edge weights and spatial topological nodes, and output the spatial topological graph.

7. The safety inspection hazard identification method and system based on visual analysis according to claim 1, characterized in that, S6 specifically includes: S61. Traverse the target topological edge in the spatial topological graph to extract the associated spatial topological node pairs. Extract the three-dimensional centroid coordinates of the associated spatial topological node pairs, perform absolute value difference calculation to output the three-dimensional coordinate difference vector, and perform norm calculation on the three-dimensional coordinate difference vector to output the three-dimensional spatial distance. S62. Calculate the adaptive baseline scale for the three-dimensional spatial distance distribution characteristics of globally associated spatial topology node pairs in the statistical spatial topology graph, and perform normalization mapping on the three-dimensional spatial distance based on the adaptive baseline scale to output the relative spatial scale coefficient. S63. Extract the entity category and entity attribute of the associated spatial topology node pair to form a category attribute pair. Calculate the adaptive baseline physical distance by statistically analyzing the actual physical distance distribution characteristics of the same category attribute pairs in historical scenes. Perform multiplicative scaling calculation on the adaptive baseline physical distance and the relative spatial ratio coefficient to output the three-dimensional physical distance.

8. The method and system for identifying safety hazards based on visual analysis according to claim 1, characterized in that, Specifically, S7 includes: S71. Extract the entity category and entity attribute combination of the associated spatial topology node pairs in the spatial topology map to form the target category attribute pair to be inspected. Statistically analyze the global distribution features of the three-dimensional physical distance of the same target category attribute pair in historical scenarios. Extract the extreme value distance and high frequency clustering distance in the global distribution features and map them to the static compliance distance interval respectively. Statistically analyze the frequency ratio of the same target category attribute pair to trigger abnormal alarms in historical scenarios and map it to the static risk coefficient. Encode the static compliance distance interval and the static risk coefficient to output the static context feature vector. S72. Extract the three-dimensional physical distance time series of the associated spatial topology node pairs in the continuous security inspection scene image frames, statistically analyze the time series distribution characteristics of the three-dimensional physical distance time series, calculate the distance fluctuation variance and distance change trend, and calculate the dynamic situation adjustment coefficient based on the distance fluctuation variance and distance change trend. S73. Multiply the static compliance distance interval in the static situation feature vector by the dynamic situation adjustment coefficient to perform interval scaling calculation and output the dynamic compliance distance interval. Perform weighted fusion calculation with the lower bound of the dynamic compliance distance interval and the static risk coefficient to output the dynamic distance threshold.

9. The safety inspection hazard identification method and system based on visual analysis according to claim 1, characterized in that, S8 specifically includes: S81. Extract the three-dimensional physical distance between the associated spatial topology node pairs and the dynamic distance threshold, perform difference calculation, and output the distance threshold difference; S82. Compare the difference between the spacing threshold and the zero value to extract the positive and negative attributes of the difference, and perform state mapping based on the positive and negative attributes of the difference to output the violation status identifier; S83. Extract global violation statistical distribution features of similar entity attributes based on the entity attributes of associated spatial topology node pairs. Concatenate the violation status identifier with the entity attributes of associated spatial topology node pairs to form a violation record tuple as the violation judgment result. Perform fusion update on the violation record tuple and the global violation statistical distribution features to output the current violation statistical distribution features.

10. A safety inspection hazard identification system based on visual analysis, comprising the safety inspection hazard identification method based on visual analysis as described in any one of claims 1 to 9, characterized in that, Includes the following modules: The scene ontology graph construction module is used to acquire security inspection scene image frames, extract entity categories and entity attributes and map them to ontology nodes, and construct the scene ontology graph based on the spatial proximity features between ontology nodes. The topology relation matrix construction module is used to evaluate security compliance based on entity categories and entity attributes in the scene ontology graph to extract interaction constraint relationships. After adaptive dynamic weighting, entity nodes are associated and encoded to construct the ontology topology relation matrix. The semantic guidance depth estimation module is used to input security inspection scene image frames into the improved CSPN model, correct the target edge depth penetration through spatial propagation, and introduce the ballistic missile terminal guidance mechanism to perform reverse thrust compensation and truncation attenuation based on semantic boundaries for the cross-boundary penetration deviation, so as to output a semantic guidance corrected depth map. The 3D centroid coordinate calculation module is used to filter the entity target to be tested based on the scene ontology map and extract the spatial projection area, calculate the 2D positioning coordinates of the spatial projection area, extract the depth features of the corresponding area from the semantically guided correction depth map, and fuse them to generate the 3D centroid coordinates of the entity target to construct the 3D spatial coordinate set of the scene. The spatial topology graph construction module is used to extract the interaction constraint relationships in the ontology topology relationship matrix and the three-dimensional centroid coordinates in the scene three-dimensional spatial coordinate set, and use them as edges and nodes to construct the spatial topology graph. The 3D physical distance calculation module is used to extract the 3D centroid coordinates of associated node pairs based on the traversal of the spatial topology graph, calculate the 3D spatial distance between associated nodes and map it to the 3D physical distance. The dynamic distance threshold generation module is used to extract the entity attributes of related node pairs in the spatial topology graph, solve the static situation constraints by combining historical global distribution features, calculate the dynamic situation adjustment coefficient by combining real-time dynamic trends, and generate the dynamic distance threshold by fusing the static situation constraints and the dynamic situation adjustment coefficient. The violation judgment result output module is used to calculate the difference between the three-dimensional physical distance and the dynamic distance threshold, and output the violation judgment result based on the positive and negative attribute mapping of the difference calculation result.