A safety state determination method and system based on construction phase context
Patent Information
- Application Number
- CN202610883841.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-10-30
AI Technical Summary
通过将防护装备未检出结果先写入候选安全异常记录,再结合遮挡反证项、姿态反证项、历史佩戴反证项和阶段未成立反证项分流,能够相对抑制由遮挡、姿态变化或阶段未成立引起的误报警;
Smart Images

Figure CN123016318A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent monitoring technology for construction safety, and more specifically, to a method and system for determining the safety status based on the context of the construction stage. Background Technology
[0002] In high-altitude operation safety monitoring, existing processing methods mostly revolve around video target recognition results to form early warning judgments. The camera captures images of the construction area, and the edge computing device or back-end server identifies personnel, safety helmets, safety belts, ladders and lifting platforms. Then, based on the confidence of the detection frame, the number of consecutive frame hits, or whether the equipment target appears, the qualified or abnormal result is output. In scenarios involving high-altitude operations such as rail transit depots, electromechanical installation, and wind and water power, construction workers are often working at heights of over 8 meters. Safety belts, hooks, and head protection equipment occupy few pixels in distant images and are affected by railings, air ducts, supports, tool bags, human turning, and motion blur. At the edge computing end, it is necessary to simultaneously meet the requirements of local real-time reminders, low computing power operation, and remote small-scale data push. Under these conditions, relying solely on whether the detection frame appears or whether the confidence level reaches the set value will directly write situations such as the safety belt being blocked by a railing, the safety helmet being lost temporarily due to the person looking down, or the person still being in the ground preparation stage but the safety belt not being detected as abnormal. It will also repeatedly push alarms to people who have been confirmed to be wearing the safety belt in the previous stage but whose safety belt is blocked in the current frame. On-site manifestations include the same person repeatedly experiencing short-term false alarms, delayed confirmations, and remote invalid prompts during the process of turning around, approaching the platform, entering the platform, and leaving the platform. The technical problem this application aims to solve is: how to use edge computing to verify the non-detection results of safety equipment in conjunction with the construction phase context, so as to avoid directly judging the non-detection results caused by obstruction, posture change or phase failure as high-altitude operation safety anomalies. Summary of the Invention
[0003] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a security status determination method and system based on the construction phase context. By writing the construction phase relational quantities into the phase-aware ant colony graph at the edge computing end to reconstruct the YOLOv8 feature routing, and performing occlusion, posture, historical wearing, and phase non-establishment counter-evidence determinations on the undetected results of protective equipment, the present invention addresses the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for determining the safety status based on the construction phase context, comprising: S1. Collect the current video frame and the context record of the previous construction phase in the construction area. Input the current video frame into the YOLOv8 backbone network, extract the four-level feature maps P2, P3, P4, and P5, and output personnel targets, protective equipment targets, work equipment targets, and high-altitude boundary targets from each level of feature map to generate the current target record. S2. Using the four-level feature maps P2, P3, P4, and P5 as nest points, and feature upsampling, feature splicing, feature refeedback, and detection head access as migration edges, the inclusion area of personnel targets and protective equipment targets, the overlap area of personnel targets and operating equipment targets, the intersection length of personnel targets and high-altitude boundary targets, and the number of continuous frames of each target are written into the migration edge pheromones to generate a stage perception ant colony map. S3. In the stage-aware ant colony map, the ant colony searches for feature migration chains along the direction from P5 to P2. During each migration, the migration edge that can simultaneously increase the area of protective equipment, the overlapping area of working equipment, the intersection length of the high-altitude boundary, and the number of target continuation frames is selected first. The searched feature migration chains are written in reverse into the feature fusion layer and the detection head access layer of the YOLOv8 backbone network to generate the ant colony mutation YOLOv8 network. S4. Input the current video frame into the ant colony mutation YOLOv8 network, re-output personnel targets, protective equipment targets, working equipment targets and high-altitude boundary targets, and generate the current construction stage record and candidate safety anomaly records based on the overlap relationship between personnel targets and working equipment targets, the intersection relationship between personnel targets and high-altitude boundary targets, and the inclusion relationship of protective equipment targets within personnel targets. S5. Based on the current construction phase record, candidate safety anomaly record, and the context record of the previous construction phase, write the occlusion counter-evidence item, posture counter-evidence item, historical wearing counter-evidence item, and phase not established counter-evidence item. Write the candidate safety anomaly record with counter-evidence item into the unexplained safety status. Write the candidate safety anomaly record with no counter-evidence item and the current construction phase record points to high-altitude operation into the valid safety anomaly status. Generate the context record of the next construction phase, local early warning data, remote prompt data, and central control display data.
[0005] In a preferred embodiment, S1 includes: S1-1: Read the current video frame of the construction area and the context record of the previous construction phase, perform pixel normalization and frame number attachment on the current video frame, and generate a current frame record with area number, acquisition time and frame sequence number. S1-2. Input the current frame record into the YOLOv8 backbone network, extract the four-level feature maps P2, P3, P4 and P5 with different downsampling scales in sequence, and attach the personnel target position, operation equipment position and high-altitude boundary position in the context record of the previous construction stage to the feature map index of the corresponding scale to generate the context attachment feature map set. S1-3: Perform detection head mapping on the four level feature maps P2, P3, P4, and P5 in the context-attached feature map set respectively, output personnel targets, protective equipment targets, work equipment targets, and high-altitude boundary targets, and generate the current target record according to the target category, target box coordinates, corresponding feature map level, confidence value, and frame number.
[0006] In a preferred embodiment, S2 includes: S2-1. Read the four-level feature maps P2, P3, P4, and P5 and the current target record. Register P2, P3, P4, and P5 as nesting points. Establish feature upsampling edges and feature splicing edges between P5 and P4, P4 and P3, and P3 and P2. Establish feature recharge edges between P2 and P3, P3 and P4, and P4 and P5. Establish detection head access edges between P2, P3, P4, and P5 and the detection head respectively to generate the initial ant colony map. S2-2. Read the personnel target, protective equipment target, work equipment target and high-altitude boundary target in the current target record. Calculate the pixel area of the protective equipment target within the personnel target as the included area. Calculate the pixel area of the overlapping area between the personnel target and the work equipment target as the overlapping area. Calculate the pixel length of the overlapping edge of the personnel target and the edge of the high-altitude boundary target as the intersection edge length. Then, attach the current target record to the target of the same category in the context record of the previous construction stage that is ranked first in terms of distance from the center point of the target box. Generate the number of continuous frames according to the number of consecutive attachment frames. S2-3. Write the included area into the pheromone field of the feature upsampling edge, write the overlapping area into the pheromone field of the feature splicing edge, write the intersection edge length into the pheromone field of the feature backfeeding edge, and write the continuous frame number into the pheromone field of the detection head access edge to generate a stage-aware ant colony graph composed of nest points, migration edges, pheromone fields and target attachment relationships.
[0007] In a preferred embodiment, S3 includes: S3-1. In the reading phase, the nest points, migration edges, pheromone fields and target attachment relationships in the ant colony graph are perceived. Starting with P5 and ending with P2, the migration edges between adjacent nest points are arranged in the order of nest points from P5 to P4, P4 to P3, and P3 to P2 to generate a set of candidate feature migration chains. S3-2. Read the candidate feature migration chains in the candidate feature migration chain set one by one, accumulate the pheromone field of the feature upsampling edge contained in it to form the included area chain value, accumulate the pheromone field of the feature splicing edge contained in it to form the overlapping area chain value, accumulate the pheromone field of the feature backfeeding edge contained in it to form the intersecting edge length chain value, and accumulate the pheromone field of the detection head access edge contained in it to form the continuous frame number chain value, and generate chain value records.
[0008] In a preferred embodiment, S3 further includes: S3-3. Sort the chain value records in descending order of the included area chain value, overlapping area chain value, intersecting side length chain value, and continuous frame number chain value to obtain the target chain value record at the top, and write the candidate feature migration chain corresponding to the target chain value record into the target feature migration chain. S3-4. Following the migration edge order in the target feature migration chain, write the feature upsampling edge into the upsampling input of the YOLOv8 backbone network, write the feature splicing edge into the channel splicing end of the feature fusion layer, write the feature backfeeding edge into the backfeeding input of the adjacent high-level feature map, and write the detection head access edge into the detection head input to generate the ant colony mutation YOLOv8 network.
[0009] In a preferred embodiment, S4 includes: S4-1. Input the current video frame into the ant colony mutation YOLOv8 network, output personnel targets, head protection equipment targets, torso protection equipment targets, work equipment targets and high-altitude boundary targets, and generate the current target record according to target category, target box coordinates, target box center point, target box area and frame number; S4-2. Read the current target record, use the number of overlapping pixels between the personnel target frame and the working equipment target frame as the overlapping area of the working equipment, use the number of overlapping pixels between the edge of the personnel target frame and the edge of the high-altitude boundary target frame as the intersection length of the high-altitude boundary, and use the number of pixels of the head protection equipment target frame falling into the upper half of the personnel target frame and the number of pixels of the torso protection equipment target frame falling into the middle half of the personnel target frame as the coverage area of the protection equipment, and generate a personnel phase quantity record.
[0010] In a preferred embodiment, S4 further includes: S4-3. Read the personnel phase quantity record, write personnel targets with overlapping areas of working equipment not being 0 and intersection lengths of high-altitude boundaries not being 0 into the climbing approach record, write personnel targets with overlapping areas of working equipment not being 0 and intersection lengths of high-altitude boundaries not being 0 into the high-altitude operation record, and use the writing result as the current construction phase record. S4-4. Read the current construction phase record and personnel phase quantity record. Write personnel targets with a head protection equipment coverage area of 0 or a torso protection equipment coverage area of 0 in the high-altitude operation record into the protection missing candidate anomaly. Write personnel targets with a head protection equipment coverage area of not 0 and a torso protection equipment coverage area of not 0 in the high-altitude operation record into the protection established record, and generate candidate safety anomaly records.
[0011] In a preferred embodiment, S5 includes: S5-1. Read the current target record, the current construction stage record, and the candidate safety anomaly record. Take the personnel target box corresponding to the candidate anomaly of lack of protection as the personnel box to be verified. Calculate the number of pixels covered by the target box of the working equipment and the number of pixels covered by the target box of the high-altitude boundary. If the number of any covered pixels is not 0, write the target category, the number of covered pixels, and the frame number of the personnel box to be verified into the occlusion counter-proof item. S5-2. Read the top edge, middle edge, bottom edge and center point of the target frame of the personnel to be verified. Calculate the pixel height from the top edge to the center point of the target frame as the top height. Calculate the pixel height from the center point of the target frame to the bottom edge as the bottom height. Write the frame number, top height and bottom height of the personnel frame of the personnel to be verified with a top height less than the bottom height and a head protection equipment area of 0 into the attitude counter-proof item. S5-3. Read the historical personnel records in the context record of the previous construction phase that are of the same category as the personnel frame to be verified and are ranked first in terms of distance from the center point of the target frame. For historical personnel records where the area of head protective equipment and the area of torso protective equipment are both not 0 and the frame number of the historical personnel record is adjacent to the frame number of the personnel frame to be verified, write the frame number of the historical personnel record, the area of head protective equipment, and the area of torso protective equipment into the historical wearing counter-evidence item.
[0012] In a preferred embodiment, S5 further includes: S5-4. Read the current construction stage record, write the target frame coordinates, frame number, and current construction stage name of the personnel frame to be verified that has not been written into the high-altitude operation record into the "Stage Not Established Counter-Evidence" item, write the personnel frame to be verified that has occlusion counter-evidence, posture counter-evidence, historical wearing counter-evidence, or "Stage Not Established Counter-Evidence" item into the "Unexplained Safety Status", write the personnel frame to be verified that does not have any counter-evidence item and is written into the high-altitude operation record into the "Valid Safety Anomaly Status", generate local early warning data based on the "Unexplained Safety Status", generate remote prompt data and central control display data based on the "Valid Safety Anomaly Status", and generate the next round of construction stage context record based on the personnel frame to be verified, counter-evidence items, and safety status.
[0013] A safety status determination system based on the construction phase context includes: The acquisition and recognition module is used to acquire the current video frame and the context record of the previous construction phase in the construction area. The current video frame is input into the YOLOv8 backbone network to extract four-level feature maps of P2, P3, P4 and P5. The feature maps of each level are used to output personnel targets, protective equipment targets, working equipment targets and high-altitude boundary targets respectively, and generate the current target record. The ant colony mapping module is used to take the four-level feature maps P2, P3, P4, and P5 as nest points, and feature upsampling, feature splicing, feature refeedback, and detection head access as migration edges. It writes the area of personnel targets and protective equipment targets, the overlap area of personnel targets and operating equipment targets, the intersection edge length of personnel targets and high-altitude boundary targets, and the number of continuous frames of each target into the migration edge pheromones to generate a stage perception ant colony map. The migration mutation module is used to enable the ant colony to search for feature migration chains along the P5 to P2 direction in the stage perception ant colony map. During each migration, it prioritizes the migration edges that can simultaneously increase the area of protective equipment, the overlapping area of operating equipment, the intersection length of high-altitude boundaries, and the number of target continuation frames. The searched feature migration chains are written in reverse into the feature fusion layer and the detection head access layer of the YOLOv8 backbone network to generate the ant colony mutation YOLOv8 network. The phase determination module is used to input the current video frame into the ant colony mutation YOLOv8 network, re-output personnel targets, protective equipment targets, working equipment targets and high-altitude boundary targets, and generate the current construction phase record and candidate safety anomaly records based on the overlap relationship between personnel targets and working equipment targets, the intersection relationship between personnel targets and high-altitude boundary targets, and the inclusion relationship of protective equipment targets within personnel targets. The counter-evidence warning module is used to write counter-evidence items such as occlusion, posture, historical wearing, and stage not established based on the current construction stage record, candidate safety anomaly record, and the context record of the previous construction stage. It writes candidate safety anomaly records with counter-evidence items into the unexplained safety status, and writes candidate safety anomaly records with no counter-evidence items and whose current construction stage record points to high-altitude operations into the valid safety anomaly status. It also generates the context record of the next construction stage, local warning data, remote prompt data, and central control display data.
[0014] The technical effects and advantages of this invention are as follows: By first writing the undetected results of protective equipment into the candidate safety anomaly record, and then combining the occlusion counter-evidence items, posture counter-evidence items, historical wearing counter-evidence items, and phase failure counter-evidence items for diversion, false alarms caused by occlusion, posture changes, or phase failure can be relatively suppressed. By using a phase-aware ant colony graph, the area, overlapping area, intersection edge length, and number of continuous frames are written into the migration edge pheromone and then written into the YOLOv8 feature route in reverse. This links the feature fusion process with the construction phase, which helps to improve the identification and interpretation process of small target protective equipment. By generating a record of the current construction stage through the pixel relationship between personnel targets, work equipment targets and high-altitude boundary targets, and then writing candidate anomalies for protection deficiencies in the high-altitude work stage, it is possible to relatively reduce the misjudgment of anomalies caused by non-work stages such as ground preparation and approaching height. By generating unexplained security states, valid security anomaly states, local early warning data, remote prompt data, and central control display data at the edge computing end, different security states can enter different feedback links, which can relatively reduce the number of invalid remote prompts while retaining the ability to provide real-time on-site prompts. Attached Figure Description
[0015] Figure 1 This is a flowchart of the method steps of the present invention.
[0016] Figure 2 This is a schematic diagram of the system modules of the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Refer to the instruction manual appendix Figure 1-2 The present invention provides a method for determining the safety status based on the construction phase context, comprising: S1. Collect the current video frame and the context record of the previous construction phase in the construction area. Input the current video frame into the YOLOv8 backbone network, extract the four-level feature maps P2, P3, P4, and P5, and output personnel targets, protective equipment targets, work equipment targets, and high-altitude boundary targets from each level of feature map to generate the current target record. In this embodiment, S1 is used to organize the video frames of the construction area into target detection data with historical location linkage at the edge computing end. During processing, the region number, acquisition time and frame number are first written to the current video frame. Then, the YOLOv8 backbone network extracts four-level feature maps of P2, P3, P4 and P5. The historical target positions in the context record of the previous construction stage are converted to the corresponding feature map index. Then, the current target record with target category, pixel coordinates and scale source is output through the detection head, which provides a data source for the generation of the stage perception ant colony map in S2. In S1-1, the edge computing terminal reads the current video frame, area number, acquisition time, and previous construction phase context record from the cameras in the construction area. The previous construction phase context record includes at least the previous frame number, historical personnel target location, historical operating equipment location, historical high-altitude boundary location, historical construction phase name, and historical safety status. The current video frame is normalized by dividing each pixel channel value by 255. The previous frame number under the same area number is read, and the previous frame number is incremented by 1 to become the current frame number. If there is no previous construction phase context record, the current frame number is recorded as 1, and the historical personnel target location, historical operating equipment location, and historical high-altitude boundary location are recorded as empty. Then, the normalized current video frame, area number, acquisition time, and current frame number are written into the current frame record for S1-2 to read. In S1-2, the current frame record is input into the YOLOv8 backbone network. The YOLOv8 backbone network includes a backbone feature extraction layer, a feature fusion layer, and a detection head access layer. P2, P3, P4, and P5 are outputs from the backbone feature extraction layer. Among them, P2 corresponds to a feature map with the width and height downsampled by 4 times, P3 corresponds to a feature map downsampled by 8 times, P4 corresponds to a feature map downsampled by 16 times, and P5 corresponds to a feature map downsampled by 32 times. The historical personnel target positions, historical operating equipment positions, and historical high-altitude boundary positions in the context record of the previous construction phase are read, and the upper left and lower right pixel coordinates of each historical target box are respectively... Downsampling is performed at multiples of 4, 8, 16, and 32 to P2, P3, P4, and P5, respectively, to obtain the upper left and lower right feature map indices at the corresponding scales. If the downsampled indexes exceed the feature map boundaries, they are truncated according to the boundary indices of the corresponding feature maps. If the context records of the previous construction phase lack historical target locations, only the corresponding feature maps are retained, and the attachment index for that historical target location is not written. This generates a context attachment feature map set, which includes four levels of feature maps (P2, P3, P4, and P5) as well as historical personnel target indices, historical operating equipment indices, and historical high-altitude boundary indices on each level of feature map, for S1-3 to read. In steps S1-3, the four levels of feature maps P2, P3, P4, and P5 from the context-attached feature map set are read respectively, and each level of feature map is connected to the detection head of the same category set. The category set includes personnel targets, protective equipment targets, work equipment targets, and high-altitude boundary targets. Among them, protective equipment targets include head protection equipment targets and torso protection equipment targets. Head protection equipment targets correspond to safety helmets, and torso protection equipment targets correspond to the safety belt or safety rope attachment area. The detection head outputs the target category, target bounding box coordinates, confidence value, and the feature map level to which each level of feature map belongs, and sets the target bounding box coordinates according to the category. The downsampling factor corresponding to the feature map level is restored to the pixel coordinate system of the current video frame; if multiple targets of the same target category are output at different feature map levels, they are all written into the current target record, and the source is distinguished by the feature map level to which they belong; the current target record includes at least the region number, frame number, target category, target box coordinates, target box center point, target box area, feature map level to which it belongs, and confidence value, so that S2 can calculate the area of personnel targets and protective equipment targets, the overlap area of personnel targets and operating equipment targets, the intersection length of personnel targets and high-altitude boundary targets, and the number of consecutive frames of each target; In practical applications, edge computing terminals are deployed in high-altitude construction areas. After the camera captures the current video frame, it normalizes the current video frame and writes the area number, acquisition time, and frame sequence number. The YOLOv8 backbone network extracts four-level feature maps (P2, P3, P4, and P5) and converts the positions of personnel targets, elevator platform targets, and high-altitude boundary targets in the context record of the previous construction stage to the corresponding scale feature map indexes. The detection head then outputs personnel targets, safety helmet targets, safety belt targets, elevator platform targets, and high-altitude boundary targets on the four-level feature maps, forming the current target record. This processing ensures that the current target record output by S1 includes both the target detection results in the current video frame and the attachment positions of historical target positions in the feature map, enabling S2 to continue generating the stage-aware ant colony map.
[0019] S2. Using the four-level feature maps P2, P3, P4, and P5 as nest points, and feature upsampling, feature splicing, feature refeedback, and detection head access as migration edges, the inclusion area of personnel targets and protective equipment targets, the overlap area of personnel targets and operating equipment targets, the intersection length of personnel targets and high-altitude boundary targets, and the number of continuous frames of each target are written into the migration edge pheromones to generate a stage perception ant colony map. In this embodiment, S2 is used to convert the fourth-level feature map obtained in S1 and the current target record into a stage-aware ant colony map, so that the pixel relationship between personnel targets, protective equipment targets, work equipment targets, and high-altitude boundary targets can be entered into the subsequent feature migration chain search. During processing, P2, P3, P4, and P5 are first registered as nest points, and migration edges are established according to the feature flow direction. Then, the included area, overlapping area, intersection edge length, and number of continuous frames are calculated based on the current target record. Subsequently, the above stage relationship quantities are written into the pheromone field of the corresponding migration edge. Here, the pheromone field is the edge field obtained by pixel calculation and frame sequence number attachment, and random evaporation, probability selection, or iteration parameters are not used. This implementation process includes the following steps: S2-1 is used to construct the graph data structure for feature transfer, enabling the feature transfer relationships between P2, P3, P4, and P5 to be read by subsequent chain searches. It reads the four-level feature maps (P2, P3, P4, P5) generated by S1 and the current target record, registering P2, P3, P4, and P5 as nesting points. Each nesting point record includes a nesting point number, feature map level, feature map size, input feature source, and output feature destination. Feature upsampling edges and feature concatenation edges are established between P5 and P4, P4 and P3, and P3 and P2. Feature upsampling edges are used to transform the size of high-level feature maps to the size of adjacent low-level feature maps, and feature concatenation edges are used to connect the upsampled high-level feature maps with the adjacent low-level feature maps. The lower-level feature maps are stitched together according to the channel dimension; feature backfilling edges are established between P2 and P3, P3 and P4, and P4 and P5. These feature backfilling edges are used to convert local feature regions in the lower-level nest points that are related to the construction stage into the corresponding index range of the adjacent high-level feature maps after being scaled according to the scale of the adjacent high-level feature maps; detection head access edges are established between P2, P3, P4, and P5 and the detection head; this generates an initial ant colony map, which includes nest point records and migration edge records. The migration edge records include the starting nest point, ending nest point, edge type, pheromone field, and target attachment relationship; if any feature map is not output, the corresponding nest point is not registered, and the migration edge connected to that nest point is deleted; S2-2 is used to calculate the spatial relationships and cross-frame continuation relationships between current targets as stage relationship quantities, making ant colony search independent of abstract weights; it reads personnel targets, protective equipment targets, work equipment targets, and high-altitude boundary targets from the current target record; for each personnel target, it takes the intersection area of the protective equipment target box and the personnel target box, and counts the number of pixels in the intersection area as the coverage area. If there are multiple protective equipment targets, they are accumulated separately for head protective equipment targets and torso protective equipment targets; it takes the intersection area of the personnel target box and the work equipment target box, and counts the number of pixels in the intersection area as the overlap area. If there is no intersection area, the overlap area is recorded as 0; it sets the personnel target box edges... Project the line onto the pixel region of the high-altitude boundary target box. Count the number of pixels whose edge falls into the high-altitude boundary target box region as the intersection length. If no pixels fall into the intersection, the intersection length is recorded as 0. Read the historical target records from the previous construction phase context record, calculate the Euclidean distance between the center point of the current target box and the center point of the same category of historical target boxes, sort them in ascending order of Euclidean distance, and use the historical target ranked first as the attachment target. If the attachment is successful, the continuation frame count is the previous continuation frame count plus 1. If no same category of historical target is found, the continuation frame count is recorded as 1, and a new target attachment relationship is created. Write the above calculation results into the phase relationship record for S2-3 to read. S2-3 is used to allocate stage relation quantities to different types of migration edges, enabling subsequent target feature migration chains to select feature flow directions according to the construction stage relationships; it reads the initial ant colony graph and stage relation quantity records, writes the included area into the pheromone field of the feature upsampling edge, so that the local inclusion relationship between protective equipment and personnel participates in the transmission of high-level semantics to low-level small target features; it writes the overlapping area into the pheromone field of the feature splicing edge, so that the co-occurrence relationship between personnel and work equipment participates in adjacent scale feature splicing; it writes the intersection edge length into the pheromone field of the feature backfeeding edge, so that the contact relationship between high-altitude boundaries and personnel is written back from the low-level spatial position to the high-level semantic features; it writes the number of consecutive frames into the pheromone field of the detection head access edge, so that the continuously appearing targets affect the feature source read by the detection head; after writing, a stage-aware ant colony graph is generated, which includes nest points, migration edges, pheromone fields, and target attachment relationships; if any stage relation quantity is 0, the corresponding value 0 is written into the pheromone field of the migration edge, and the corresponding migration edge is not deleted, so that S3 can continue to sort the candidate feature migration chains; In practical applications: After the edge computing terminal outputs the four-level feature maps P2, P3, P4, and P5 and the current target record in S1, it registers the four-level feature maps as nest points and establishes upsampling, stitching, and backfeeding relationships between adjacent nest points. For a worker in the image, the system calculates the number of pixels that the safety helmet frame and safety belt frame fall into the worker frame, the number of pixels that overlap between the worker frame and the elevator platform frame, and the number of pixels that the edge of the worker frame falls into the high-altitude boundary frame. The system then connects the worker frame with the nearest worker frame from the previous frame to obtain the number of consecutive frames. After the above values are written into the pheromone fields of different migration edges, the stage-aware ant colony graph can express the influence of protective equipment, working equipment, and high-altitude boundaries on feature migration in the current frame, providing data for S3 to search for target feature migration chains.
[0020] S3. In the stage-aware ant colony map, the ant colony searches for feature migration chains along the direction from P5 to P2. During each migration, the migration edge that can simultaneously increase the area of protective equipment, the overlapping area of working equipment, the intersection length of the high-altitude boundary, and the number of target continuation frames is selected first. The searched feature migration chains are written in reverse into the feature fusion layer and the detection head access layer of the YOLOv8 backbone network to generate the ant colony mutation YOLOv8 network. In this embodiment, S3 is used to determine the target feature transfer chain that can drive the feature fusion of the current frame in the stage-aware ant colony graph, and write the chain into the feature routing of the YOLOv8 backbone network. During processing, candidate feature transfer chains are first enumerated according to the nesting order from P5 to P2, then four types of pheromone fields are accumulated for each candidate feature transfer chain, and then the target feature transfer chain is determined by progressively sorting the fields. Finally, the target feature transfer chain is written into the feature fusion layer and the detection head access layer to form the ant colony mutation YOLOv8 network used in the current inference round. This writing process does not change the trained convolutional weights of the YOLOv8 backbone network, but only changes the feature routing of the current video frame. This implementation process includes the following steps: S3-1 is used to organize the discrete migration edges in the stage-aware ant colony graph into sortable candidate feature migration chains; it reads the nest points, migration edges, pheromone fields, and target attachment relationships in the stage-aware ant colony graph generated by S2, using P5 as the starting nest point and P2 as the ending nest point, and reads the feature upsampling edges, feature splicing edges, feature refeeding edges, and detection head access edges between adjacent nest points in the order of P5 to P4, P4 to P3, and P3 to P2; wherein, each candidate feature migration chain includes P5 to P4, P4 The migration relationships between three adjacent nest points, P3 and P2, are recorded, and the corresponding detection heads are connected to the edges. If any edge type is missing between adjacent nest points, the pheromone field of that edge type in the candidate feature migration chain is recorded as 0, and the candidate feature migration chain is not deleted. If any nest point among P5, P4, P3, and P2 is not registered in the stage-aware ant colony graph, then only registered nest points that can be connected in the order of adjacent nest points are generated as candidate feature migration chains. Thus, a set of candidate feature migration chains is obtained, which are used by S3-2 to calculate the chain value one by one. S3-2 is used to convert the edge fields in the candidate feature migration chain into chain-level values, so that different candidate feature migration chains can be compared under the same field. It reads the candidate feature migration chain set one by one, accumulates the pheromone fields of all feature upsampling edges in the candidate feature migration chain to obtain the included area chain value; accumulates the pheromone fields of all feature splicing edges in the candidate feature migration chain to obtain the overlapping area chain value; accumulates the pheromone fields of all feature backfeeding edges in the candidate feature migration chain to obtain the intersecting edge length chain value; accumulates the pheromone fields of all detection head access edges in the candidate feature migration chain to obtain the continuous frame count chain value; if there is no corresponding edge type, the chain value corresponding to the edge type is recorded as 0; if there are multiple target attachment relationships, the pheromone fields already written to each migration edge in the same candidate feature migration chain are directly accumulated without introducing additional weights; the candidate feature migration chain number, included area chain value, overlapping area chain value, intersecting edge length chain value, continuous frame count chain value, and corresponding target attachment relationship are written into the chain value record for sorting and reading in S3-3; S3-3 is used to determine the target feature migration chain without the participation of random parameters, so that the chain selection result is directly determined by the construction stage relation of the current frame. The chain value records are read and sorted first by the included area chain value from largest to smallest. If the included area chain values are the same, they are then sorted by the overlapping area chain value from largest to smallest. If the overlapping area chain values are still the same, they are then sorted by the intersecting side length chain value from largest to smallest. If the intersecting side length chain values are still the same, they are then sorted by the number of consecutive frames from largest to smallest. If all four chain values are the same, the candidate feature migration chain is selected according to the generation order in the candidate feature migration chain set. After sorting, the chain value record at the top is written into the target chain value record, and the candidate feature migration chain corresponding to the target chain value record is written into the target feature migration chain. If the chain value record is empty, the original feature fusion paths from P5 to P4, P4 to P3, and P3 to P2 of the YOLOv8 backbone network are used as the target feature migration chain, and this reuse result is written into the target chain value record. S3-4 is used to backfill the target feature migration chain into the current frame execution path of the YOLOv8 backbone network, enabling the relational variables in the construction phase to participate in feature fusion and detection head access; read the migration edge order in the target feature migration chain, write the feature upsampling edges into the upsampling input of the YOLOv8 backbone network, so that the high-level feature maps in the target feature migration chain are upsampled according to the size of the adjacent low-level feature maps; write the feature splicing edges into the channel splicing end of the feature fusion layer, so that the upsampled high-level feature maps are spliced with the corresponding low-level feature maps according to the channel dimension; and backfill the feature edges. The feedback input of the adjacent high-level feature map is written to the lower-level nest point so that the local feature region corresponding to the intersection edge length is reduced according to the scale of the adjacent high-level feature map and written into the corresponding index range of the high-level feature map; the detection head access edge is written to the detection head input so that the detection head reads the fusion feature specified by the target feature migration chain; thus generating the ant colony mutation YOLOv8 network; the network consists of the YOLOv8 backbone network, the target feature migration chain and the current frame feature route, and the mutation position is limited to the feature fusion layer and the detection head access layer, so that S4 can re-output the current target record; In practical applications: After the edge computing end perceives the ant colony map in the S2 generation stage, it first organizes candidate feature migration chains in the order of P5, P4, P3, and P2 as nest points, and then accumulates the inclusion area chain value, overlap area chain value, intersection edge length chain value, and continuous frame number chain value of each candidate feature migration chain. For example, if the inclusion area of the safety belt target of the same construction worker within the personnel target increases, and the personnel target overlaps with the elevator platform target, and the edge of the personnel target falls into the high-altitude boundary target area, then the corresponding candidate feature migration chain is written into the target feature migration chain in the sorting. Subsequently, the system writes the target feature migration chain into the upsampling input, channel splicing input, refeeding input, and detection head input of the YOLOv8 backbone network, so that the feature fusion path of the current video frame is rearranged around the stage relationship of protective equipment, working equipment, and high-altitude boundary, providing feature routes for S4 to re-identify personnel targets, protective equipment targets, working equipment targets, and high-altitude boundary targets.
[0021] S4. Input the current video frame into the ant colony mutation YOLOv8 network, re-output personnel targets, protective equipment targets, working equipment targets and high-altitude boundary targets, and generate the current construction stage record and candidate safety anomaly records based on the overlap relationship between personnel targets and working equipment targets, the intersection relationship between personnel targets and high-altitude boundary targets, and the inclusion relationship of protective equipment targets within personnel targets. In this embodiment, S4 is used to regenerate the target record for stage determination based on the ant colony mutation YOLOv8 network after the target feature migration chain has been written into the YOLOv8 backbone network, and to convert the pixel relationship between targets into the current construction stage record and candidate safety anomaly record; the current target record generated in S4 is used to overwrite the initial current target record in S1, and the subsequent S5 uses the current target record generated in S4 as the reading object; wherein, personnel targets, head protection equipment targets, torso protection equipment targets, working equipment targets and high-altitude boundary targets are all expressed using the pixel coordinate system of the current video frame; this implementation process includes the following steps: S4-1 is used to obtain the target detection result after feature routing rearrangement, so that subsequent stages no longer read the initial detection result of S1. The current video frame is input into the ant colony mutation YOLOv8 network generated by S3. The ant colony mutation YOLOv8 network performs current frame inference according to the upsampling input, channel splicing input, refeeding input, and detection head input determined by the target feature migration chain, and outputs personnel targets, head protection equipment targets, torso protection equipment targets, work equipment targets, and high-altitude boundary targets. Among them, the head protection equipment target corresponds to the safety helmet, and the torso protection equipment target corresponds to the safety belt or safety rope. Connect the regions; for each output target, read the target category, the coordinates of the top left corner of the target box, the coordinates of the bottom right corner of the target box, and the frame number, and calculate the coordinates of the center point of the target box and the area of the target box; the x-coordinate of the center point of the target box is half the sum of the x-coordinates of the top left corner and the bottom right corner, the y-coordinate of the center point of the target box is half the sum of the y-coordinates of the top left corner and the bottom right corner, and the area of the target box is the product of the width and height of the target box; write the above fields into the current target record; if the current video frame does not output a target of a certain category, then the target of that category is recorded as empty in the current target record and will not participate in subsequent pixel relationship calculations as an empty target category; S4-2 is used to convert the target frame relationships in the current target record into personnel phase quantity records, so that the construction phase judgment has a calculable data source; read the current target record, and take each personnel target frame as the calculation object; calculate the intersection area of the personnel target frame and the work equipment target frame, and count the number of pixels in the intersection area as the work equipment overlap area. If there is no intersection area, the work equipment overlap area is recorded as 0; project the edge of the personnel target frame to the pixel area of the high-altitude boundary target frame, and count the number of pixels that the edge of the personnel target frame falls into the high-altitude boundary target frame area as the high-altitude boundary intersection length; if there are no pixels that fall into the high-altitude boundary, the high-altitude boundary intersection length is recorded as 0; divide the personnel target frame vertically... The height is divided into a head area, a torso area, and a lower area. The head area is the one-third of the area closest to the top edge of the personnel target frame, and the torso area is the middle one-third of the area. The number of pixels intersecting the head protection equipment target frame with the head area is calculated as the area covered by the head protection equipment, and the number of pixels intersecting the torso protection equipment target frame with the torso area is calculated as the area covered by the torso protection equipment. If the same personnel target corresponds to multiple similar protection equipment targets, the number of corresponding intersection pixels is accumulated for each target. The coordinates of the personnel target frame, the overlapping area of the operating equipment, the intersection length of the high-altitude boundary, the area covered by the head protection equipment, the area covered by the torso protection equipment, and the frame number are written into the personnel stage quantity record for S4-3 and S4-4 to read. S4-3 is used to generate the current construction stage record based on the pixel relationship between personnel targets, work equipment targets, and high-altitude boundary targets; it reads the personnel stage quantity record and performs stage writing for each personnel target: if the overlapping area of work equipment is not 0 and the intersection length of the high-altitude boundary is 0, the personnel target is written into the climbing approach record; if the overlapping area of work equipment is not 0 and the intersection length of the high-altitude boundary is not 0, the personnel target is written into the high-altitude operation record; if the overlapping area of work equipment is 0 and the intersection length of the high-altitude boundary is not 0, and the same personnel target has been written into the high-altitude operation record in the previous round of construction stage context record, then the personnel target continues to be written into the high-altitude operation record to handle the stage break caused by the short-term non-output of the work equipment target in the current frame; if the personnel target does not meet any of the above writing relationships, then the personnel target is written into the non-entry into the high-altitude operation record; the above writing results constitute the current construction stage record, which includes at least the personnel target bounding box coordinates, frame number, construction stage name, work equipment overlapping area, and high-altitude boundary intersection length; S4-4 combines the results of high-altitude workers and protective equipment inclusion in the current construction phase record to form candidate safety anomaly records for S5 to read for rebuttal verification. It reads the current construction phase record and personnel phase quantity record, and writes the protection status of personnel targets written into the high-altitude work record: if the head protective equipment inclusion area is 0 or the torso protective equipment inclusion area is 0, the personnel target is written into the protection deficiency candidate anomaly, and the deficiency category is written simultaneously; where a head protective equipment inclusion area of 0 corresponds to head protection deficiency, and a torso protective equipment inclusion area of 0 corresponds to torso protection deficiency, and if both are 0, both deficiency categories are written simultaneously; if both the head and torso protective equipment inclusion areas are not 0, the personnel target is written into the protection established record; for personnel targets in the climbing approach record and those not in the high-altitude work record, no protection deficiency candidate anomaly is generated, only the corresponding phase name is written into the candidate safety anomaly record for S5 to judge the phase not established rebuttal item; the candidate safety anomaly record includes at least the personnel target frame coordinates, frame number, current construction phase name, head protective equipment inclusion area, torso protective equipment inclusion area, protection deficiency category, and candidate status name; In practical applications, when construction workers are near the aerial work platform, the YOLOv8 network with ant colony mutation outputs the targets: personnel, safety helmet, safety belt, aerial work platform, and high-altitude boundary. The system first calculates the number of overlapping pixels between the personnel target frame and the aerial work platform target frame, then calculates the number of pixels where the edge of the personnel target frame falls into the high-altitude boundary target frame area, and separately calculates the number of pixels where the safety helmet target frame falls into the head area and the safety belt target frame falls into the torso area. When the personnel target and the aerial work platform target overlap and the edge of the personnel target falls into the high-altitude boundary target area, the personnel target is written into the high-altitude operation record. If the safety belt target does not fall into the torso area at this time, the personnel target is written into the protection deficiency candidate anomaly, instead of being directly written into the valid safety anomaly status. Thus, S4 converts the image detection results into construction stage and candidate anomaly data, and S5 can continue to perform triage judgment based on occlusion, posture, historical wearing, and stage non-establishment counter-evidence.
[0022] S5. Based on the current construction phase record, candidate safety anomaly record, and the context record of the previous construction phase, write the occlusion counter-evidence item, posture counter-evidence item, historical wearing counter-evidence item, and phase not established counter-evidence item. Write the candidate safety anomaly record with counter-evidence item into the unexplained safety status. Write the candidate safety anomaly record with no counter-evidence item and the current construction phase record points to high-altitude operation into the valid safety anomaly status. Generate the context record of the next construction phase, local early warning data, remote prompt data, and central control display data. In this implementation, S5 is used to perform counter-evidence diversion on the protection deficiency candidate anomalies formed by S4, avoiding the direct writing of undetected results caused by occlusion, personnel posture changes, confirmed wearing in the previous frame, or failure of the construction phase into the valid safety anomaly status. During processing, a personnel frame to be verified is first established using the personnel target frame in the protection deficiency candidate anomalies, and then counter-evidence items for occlusion, posture, historical wearing, and failure of the phase are calculated respectively. Each counter-evidence item is written with the frame number of the personnel frame to be verified and the target frame coordinates as an index for reading during safety status diversion. This implementation process includes the following steps: In S5-1, the occlusion counter-evidence item is used to record situations where the protective equipment target may be occluded by the working equipment target or the high-altitude boundary target, allowing the protection deficiency candidate anomaly to enter the interpretation chain first; read the current target record, current construction stage record, and candidate safety anomaly record generated in S4, record the personnel target box corresponding to the protection deficiency candidate anomaly as the personnel box to be verified, and read the head area and torso area of the personnel box to be verified; the head area and torso area follow the vertical trisection result of the personnel target box in S4-2; calculate the intersection between the working equipment target box and the head area and torso area of the personnel box to be verified. The system calculates the number of pixels and the number of intersection pixels between the high-altitude boundary target bounding box and the head and torso regions of the personnel bounding box to be verified. Only pixels located within the head or torso region are included in the occlusion counter-evidence entry; pixels located in the lower part of the personnel bounding box are only included in the construction phase relationship and are not included in the occlusion counter-evidence entry. If the number of any covered pixels is not zero, the target category of the covered target, the region to which the covered area belongs, the number of covered pixels, the coordinates of the personnel bounding box to be verified, and the frame number of the personnel bounding box to be verified are written into the occlusion counter-evidence entry. If there are no covered pixels, no occlusion counter-evidence entry is generated. In S5-2, the posture reversal item is used to record the situation where the head protection equipment attachment area in the frame of the person to be verified is compressed, resulting in the head protection equipment not falling in. This is not interpreted as an independent human posture recognition result. The top edge, middle edge, bottom edge, and center point of the target frame of the person to be verified are read. The middle edge is used to mark the boundary between the upper and lower regions of the frame of the person to be verified. The center point of the target frame is the same as the center point calculated from the coordinates of the upper left corner and the lower right corner of the target frame in S4-1. The vertical pixel distance from the top edge to the center point of the target frame is calculated and recorded as the upper height. The vertical pixel distance from the center point of the target frame to the bottom edge is calculated and recorded as the lower height. The area of the head protection equipment in the personnel stage quantity record is read. If the upper height is less than the lower height and the area of the head protection equipment is 0, the frame number of the person to be verified, the coordinates of the person to be verified, the upper height, the lower height, and the area of the head protection equipment are written into the posture reversal item. If the upper height is not less than the lower height, or the area of the head protection equipment is not 0, no posture reversal item is generated. In S5-3, the historical wear disproving item is used to explain the short-term non-detection of the current frame using the previously confirmed protection establishment record, and restricts the disproving item to only apply to adjacent frames; read the historical personnel records from the previous construction phase context record, the historical personnel records include at least the historical personnel target frame coordinates, the historical personnel target frame center point, the historical frame number, the historical head protection equipment coverage area, the historical torso protection equipment coverage area, and the historical safety status; calculate the Euclidean distance between the center point of the personnel frame to be verified and the center points of each historical personnel target frame, sort them in ascending order of Euclidean distance, and take the historical personnel record with the highest Euclidean distance as the one to be verified. The historical personnel record is attached to the personnel frame; if no historical personnel record exists, no historical wearing counter-evidence item is generated; the first-ranked historical personnel record is read, and if the area contained in the historical head protective equipment and the area contained in the historical torso protective equipment are both not 0, and the frame number of the personnel to be verified is equal to the historical frame number plus 1, the historical frame number, the area contained in the historical head protective equipment, the area contained in the historical torso protective equipment, the coordinates of the personnel frame to be verified, and the frame number of the personnel frame to be verified are written into the historical wearing counter-evidence item; this historical wearing counter-evidence item only applies to the current personnel frame to be verified and will not repeatedly reference the same historical personnel record in the next frame to block effective security anomalies; In S5-4, safety status triage is used to classify protective deficiency candidate anomalies into unexplained safety statuses and valid safety anomaly statuses based on the existence of counter-evidence items and the validity of high-altitude work records. It reads the current construction stage record and candidate safety anomaly records. If the personnel frame to be verified is not written into the high-altitude work record, the coordinates, frame number, and current construction stage name of the personnel frame to be verified are written into the "stage not established counter-evidence item." The current construction stage name is taken from the approach record, high-altitude work record, or "not entered high-altitude work record." Subsequently, using the coordinates and frame number of the personnel frame to be verified as an index, it reads occlusion counter-evidence items, posture counter-evidence items, historical wearing counter-evidence items, and "stage not established counter-evidence item." If any counter-evidence item exists, the personnel frame to be verified is written into the unexplained safety status, and local early warning data is generated based on the unexplained safety status. The data includes the area number, frame number, coordinates of the personnel frame to be verified, type of counter-evidence, and local prompt text. If no counter-evidence is found and the data is already written into the high-altitude operation record, the personnel frame to be verified is written into a valid safety anomaly status. Based on the valid safety anomaly status, remote prompt data and central control display data are generated. The remote prompt data includes the area number, frame number, protection deficiency category, and coordinates of the personnel target frame. The central control display data includes a video frame overlaid with the personnel frame to be verified, protection deficiency category, current construction stage name, and valid safety anomaly status. Finally, the coordinates of the personnel frame to be verified, the center point of the target frame, the current construction stage name, the area covered by head protection equipment, the area covered by torso protection equipment, counter-evidence, safety status, and frame number are written into the context record of the next round of construction stage for the next round S1, S2, and S5 to read. In practical applications: When personnel are installing ductwork on the lifting platform, S4 first writes the personnel into the high-altitude operation record and generates a protection deficiency candidate anomaly because the safety belt target does not fall into the torso area; S5 reads the personnel frame to be verified corresponding to the personnel. If the lifting platform guardrail target covers the torso area of the personnel frame to be verified, an obstruction counter-evidence item is written, and the personnel is written into the unexplained safety status, with a prompt only output at the field end; if the safety belt target falls into the torso area again in the next frame, the context record of the next construction phase is updated to the protection established record; if the personnel frame to be verified does not have obstruction counter-evidence items, posture counter-evidence items, historical wearing counter-evidence items, or phase not established counter-evidence items, and the personnel is still in the high-altitude operation record, the system writes a valid safety anomaly status and outputs corresponding prompt data to the remote management end and the central control end; through this processing, the result of the protective equipment not being detected will not be directly converted into a remote alarm, but will first be diverted by the counter-evidence item before forming a safety status.
[0023] Furthermore, a safety status determination system based on the construction phase context includes: The acquisition and recognition module is used to acquire the current video frame and the context record of the previous construction phase in the construction area. The current video frame is input into the YOLOv8 backbone network to extract four-level feature maps of P2, P3, P4 and P5. The feature maps of each level are used to output personnel targets, protective equipment targets, working equipment targets and high-altitude boundary targets respectively, and generate the current target record. The ant colony mapping module is used to take the four-level feature maps P2, P3, P4, and P5 as nest points, and feature upsampling, feature splicing, feature refeedback, and detection head access as migration edges. It writes the area of personnel targets and protective equipment targets, the overlap area of personnel targets and operating equipment targets, the intersection edge length of personnel targets and high-altitude boundary targets, and the number of continuous frames of each target into the migration edge pheromones to generate a stage perception ant colony map. The migration mutation module is used to enable the ant colony to search for feature migration chains along the P5 to P2 direction in the stage perception ant colony map. During each migration, it prioritizes the migration edges that can simultaneously increase the area of protective equipment, the overlapping area of operating equipment, the intersection length of high-altitude boundaries, and the number of target continuation frames. The searched feature migration chains are written in reverse into the feature fusion layer and the detection head access layer of the YOLOv8 backbone network to generate the ant colony mutation YOLOv8 network. The phase determination module is used to input the current video frame into the ant colony mutation YOLOv8 network, re-output personnel targets, protective equipment targets, working equipment targets and high-altitude boundary targets, and generate the current construction phase record and candidate safety anomaly records based on the overlap relationship between personnel targets and working equipment targets, the intersection relationship between personnel targets and high-altitude boundary targets, and the inclusion relationship of protective equipment targets within personnel targets. The counter-evidence warning module is used to write counter-evidence items such as occlusion, posture, historical wearing, and stage not established based on the current construction stage record, candidate safety anomaly record, and the context record of the previous construction stage. It writes candidate safety anomaly records with counter-evidence items into the unexplained safety status, and writes candidate safety anomaly records with no counter-evidence items and whose current construction stage record points to high-altitude operations into the valid safety anomaly status. It also generates the context record of the next construction stage, local warning data, remote prompt data, and central control display data.
[0024] Working Principle: This solution first collects video frames of the construction area from the edge computing end, and uses the YOLOv8 backbone network to extract four-level feature maps from P2 to P5 to initially identify personnel, protective equipment, work equipment, and high-altitude boundaries. Then, the area of inclusion, overlapping area, intersection edge length, and number of continuous frames between these targets are written into the stage perception ant colony map. The feature migration chain suitable for the current construction stage is determined through ant colony search, and the migration chain is written into the feature fusion layer and detection head access layer of the YOLOv8 network to form an ant colony mutation YOLOv8 network. Subsequently, the targets in the current frame are re-identified, and the current construction stage record and candidate safety anomaly record are generated based on the pixel relationship between personnel and work equipment, high-altitude boundaries, and protective equipment. Finally, the candidate safety anomalies are analyzed for occlusion, posture, historical wearing, and stage non-establishment to distinguish between safety states to be explained and valid safety anomaly states, and local early warning, remote prompts, and central control display data are generated respectively. In the scenario of high-altitude duct installation, after the construction worker stands on the gantry platform, the system first identifies the personnel frame, gantry frame, high-altitude boundary frame, safety helmet frame, and safety belt frame. It then determines whether the worker has entered the high-altitude work phase based on whether the worker overlaps with the gantry and whether the worker is in contact with the high-altitude boundary. If the safety belt target does not fall into the worker's torso area, the system will not immediately identify it as a violation. Instead, it will continue to determine whether the area is obstructed by the gantry guardrail, whether the worker's posture makes the equipment temporarily invisible, whether the previous frame confirmed that the worker was wearing the safety belt, and whether the worker is indeed currently in the high-altitude work phase. Only when there is no counter-evidence and the worker is still in the high-altitude work phase will the system generate a valid safety anomaly and push it to the management and central control terminals. If there is obstruction or the previous frame confirmed that the worker was wearing the safety belt, the system will first issue a prompt at the field terminal and write it into the next round of context record, waiting for subsequent frames to continue the determination.
[0025] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for determining the safety status based on the construction phase context, characterized in that, include: S1. Collect the current video frame and the context record of the previous construction phase in the construction area. Input the current video frame into the YOLOv8 backbone network, extract the four-level feature maps P2, P3, P4, and P5, and output personnel targets, protective equipment targets, work equipment targets, and high-altitude boundary targets from each level of feature map to generate the current target record. S2. Using the four-level feature maps P2, P3, P4, and P5 as nest points, and feature upsampling, feature splicing, feature refeedback, and detection head access as migration edges, the inclusion area of personnel targets and protective equipment targets, the overlap area of personnel targets and operating equipment targets, the intersection length of personnel targets and high-altitude boundary targets, and the number of continuous frames of each target are written into the migration edge pheromones to generate a stage perception ant colony map. S3. In the stage-aware ant colony map, the ant colony searches for feature migration chains along the direction from P5 to P2. During each migration, the migration edge that can simultaneously increase the area of protective equipment, the overlapping area of working equipment, the intersection length of the high-altitude boundary, and the number of target continuation frames is selected first. The searched feature migration chains are written in reverse into the feature fusion layer and the detection head access layer of the YOLOv8 backbone network to generate the ant colony mutation YOLOv8 network. S4. Input the current video frame into the ant colony mutation YOLOv8 network, re-output personnel targets, protective equipment targets, working equipment targets and high-altitude boundary targets, and generate the current construction stage record and candidate safety anomaly records based on the overlap relationship between personnel targets and working equipment targets, the intersection relationship between personnel targets and high-altitude boundary targets, and the inclusion relationship of protective equipment targets within personnel targets. S5. Based on the current construction phase record, candidate safety anomaly record, and the context record of the previous construction phase, write the occlusion counter-evidence item, posture counter-evidence item, historical wearing counter-evidence item, and phase not established counter-evidence item. Write the candidate safety anomaly record with counter-evidence item into the unexplained safety status. Write the candidate safety anomaly record with no counter-evidence item and the current construction phase record points to high-altitude operation into the valid safety anomaly status. Generate the context record of the next construction phase, local early warning data, remote prompt data, and central control display data.
2. The safety status determination method based on the construction stage context according to claim 1, characterized in that: S1 includes: S1-1: Read the current video frame of the construction area and the context record of the previous construction phase, perform pixel normalization and frame number attachment on the current video frame, and generate a current frame record with area number, acquisition time and frame sequence number. S1-2. Input the current frame record into the YOLOv8 backbone network, extract the four-level feature maps P2, P3, P4 and P5 with different downsampling scales in sequence, and attach the personnel target position, operation equipment position and high-altitude boundary position in the context record of the previous construction stage to the feature map index of the corresponding scale to generate the context attachment feature map set. S1-3: Perform detection head mapping on the four level feature maps P2, P3, P4, and P5 in the context-attached feature map set respectively, output personnel targets, protective equipment targets, work equipment targets, and high-altitude boundary targets, and generate the current target record according to the target category, target box coordinates, corresponding feature map level, confidence value, and frame number.
3. The safety status determination method based on the construction stage context according to claim 2, characterized in that: S2 includes: S2-1. Read the four-level feature maps P2, P3, P4, and P5 and the current target record. Register P2, P3, P4, and P5 as nesting points. Establish feature upsampling edges and feature splicing edges between P5 and P4, P4 and P3, and P3 and P2. Establish feature recharge edges between P2 and P3, P3 and P4, and P4 and P5. Establish detection head access edges between P2, P3, P4, and P5 and the detection head respectively to generate the initial ant colony map. S2-2. Read the personnel target, protective equipment target, work equipment target and high-altitude boundary target in the current target record. Calculate the pixel area of the protective equipment target within the personnel target as the included area. Calculate the pixel area of the overlapping area between the personnel target and the work equipment target as the overlapping area. Calculate the pixel length of the overlapping edge of the personnel target and the edge of the high-altitude boundary target as the intersection edge length. Then, attach the current target record to the target of the same category in the context record of the previous construction stage that is ranked first in terms of distance from the center point of the target box. Generate the number of continuous frames according to the number of consecutive attachment frames. S2-3. Write the included area into the pheromone field of the feature upsampling edge, write the overlapping area into the pheromone field of the feature splicing edge, write the intersection edge length into the pheromone field of the feature backfeeding edge, and write the continuous frame number into the pheromone field of the detection head access edge to generate a stage-aware ant colony graph composed of nest points, migration edges, pheromone fields and target attachment relationships.
4. The safety status determination method based on the construction phase context according to claim 3, characterized in that: S3 includes: S3-1. In the reading phase, the nest points, migration edges, pheromone fields and target attachment relationships in the ant colony graph are perceived. Starting with P5 and ending with P2, the migration edges between adjacent nest points are arranged in the order of nest points from P5 to P4, P4 to P3, and P3 to P2 to generate a set of candidate feature migration chains. S3-2. Read the candidate feature migration chains in the candidate feature migration chain set one by one, accumulate the pheromone field of the feature upsampling edge contained in it to form the included area chain value, accumulate the pheromone field of the feature splicing edge contained in it to form the overlapping area chain value, accumulate the pheromone field of the feature backfeeding edge contained in it to form the intersecting edge length chain value, and accumulate the pheromone field of the detection head access edge contained in it to form the continuous frame number chain value, and generate chain value records.
5. The safety status determination method based on the construction stage context according to claim 4, characterized in that: S3 further includes: S3-3. Sort the chain value records in descending order of the included area chain value, overlapping area chain value, intersecting side length chain value, and continuous frame number chain value to obtain the target chain value record at the top, and write the candidate feature migration chain corresponding to the target chain value record into the target feature migration chain. S3-4. Following the migration edge order in the target feature migration chain, write the feature upsampling edge into the upsampling input of the YOLOv8 backbone network, write the feature splicing edge into the channel splicing end of the feature fusion layer, write the feature backfeeding edge into the backfeeding input of the adjacent high-level feature map, and write the detection head access edge into the detection head input to generate the ant colony mutation YOLOv8 network.
6. The safety status determination method based on the construction stage context according to claim 5, characterized in that: S4 includes: S4-1. Input the current video frame into the ant colony mutation YOLOv8 network, output personnel targets, head protection equipment targets, torso protection equipment targets, work equipment targets and high-altitude boundary targets, and generate the current target record according to target category, target box coordinates, target box center point, target box area and frame number; S4-2. Read the current target record, use the number of overlapping pixels between the personnel target frame and the working equipment target frame as the overlapping area of the working equipment, use the number of overlapping pixels between the edge of the personnel target frame and the edge of the high-altitude boundary target frame as the intersection length of the high-altitude boundary, and use the number of pixels of the head protection equipment target frame falling into the upper half of the personnel target frame and the number of pixels of the torso protection equipment target frame falling into the middle half of the personnel target frame as the coverage area of the protection equipment, and generate a personnel phase quantity record.
7. The safety status determination method based on the construction stage context according to claim 6, characterized in that: S4 further includes: S4-3. Read the personnel phase quantity record, write personnel targets with overlapping areas of working equipment not being 0 and intersection lengths of high-altitude boundaries not being 0 into the climbing approach record, write personnel targets with overlapping areas of working equipment not being 0 and intersection lengths of high-altitude boundaries not being 0 into the high-altitude operation record, and use the writing result as the current construction phase record. S4-4. Read the current construction phase record and personnel phase quantity record. Write personnel targets with a head protection equipment coverage area of 0 or a torso protection equipment coverage area of 0 in the high-altitude operation record into the protection missing candidate anomaly. Write personnel targets with a head protection equipment coverage area of not 0 and a torso protection equipment coverage area of not 0 in the high-altitude operation record into the protection established record, and generate candidate safety anomaly records.
8. The safety status determination method based on the construction phase context according to claim 7, characterized in that: S5 includes: S5-1. Read the current target record, the current construction stage record, and the candidate safety anomaly record. Take the personnel target box corresponding to the candidate anomaly of lack of protection as the personnel box to be verified. Calculate the number of pixels covered by the target box of the working equipment and the number of pixels covered by the target box of the high-altitude boundary. If the number of any covered pixels is not 0, write the target category, the number of covered pixels, and the frame number of the personnel box to be verified into the occlusion counter-proof item. S5-2. Read the top edge, middle edge, bottom edge and center point of the target frame of the personnel to be verified. Calculate the pixel height from the top edge to the center point of the target frame as the top height. Calculate the pixel height from the center point of the target frame to the bottom edge as the bottom height. Write the frame number, top height and bottom height of the personnel frame of the personnel to be verified with a top height less than the bottom height and a head protection equipment area of 0 into the attitude counter-proof item. S5-3. Read the historical personnel records in the context record of the previous construction phase that are of the same category as the personnel frame to be verified and are ranked first in terms of distance from the center point of the target frame. For historical personnel records where the area of head protective equipment and the area of torso protective equipment are both not 0 and the frame number of the historical personnel record is adjacent to the frame number of the personnel frame to be verified, write the frame number of the historical personnel record, the area of head protective equipment, and the area of torso protective equipment into the historical wearing counter-evidence item.
9. The safety status determination method based on the construction stage context according to claim 8, characterized in that: The S5 also includes: S5-4. Read the current construction stage record, write the target frame coordinates, frame number, and current construction stage name of the personnel frame to be verified that has not been written into the high-altitude operation record into the "Stage Not Established Counter-Evidence" item, write the personnel frame to be verified that has occlusion counter-evidence, posture counter-evidence, historical wearing counter-evidence, or "Stage Not Established Counter-Evidence" item into the "Unexplained Safety Status", write the personnel frame to be verified that does not have any counter-evidence item and is written into the high-altitude operation record into the "Valid Safety Anomaly Status", generate local early warning data based on the "Unexplained Safety Status", generate remote prompt data and central control display data based on the "Valid Safety Anomaly Status", and generate the next round of construction stage context record based on the personnel frame to be verified, counter-evidence items, and safety status.
10. A safety status determination system based on construction stage context, used to implement the safety status determination method based on construction stage context as described in any one of claims 1-9, characterized in that, include: The acquisition and recognition module is used to acquire the current video frame and the context record of the previous construction phase in the construction area. The current video frame is input into the YOLOv8 backbone network to extract four-level feature maps of P2, P3, P4 and P5. The feature maps of each level are used to output personnel targets, protective equipment targets, working equipment targets and high-altitude boundary targets respectively, and generate the current target record. The ant colony mapping module is used to take the four-level feature maps P2, P3, P4, and P5 as nest points, and feature upsampling, feature splicing, feature refeedback, and detection head access as migration edges. It writes the area of personnel targets and protective equipment targets, the overlap area of personnel targets and operating equipment targets, the intersection edge length of personnel targets and high-altitude boundary targets, and the number of continuous frames of each target into the migration edge pheromones to generate a stage perception ant colony map. The migration mutation module is used to enable the ant colony to search for feature migration chains along the P5 to P2 direction in the stage perception ant colony map. During each migration, it prioritizes the migration edges that can simultaneously increase the area of protective equipment, the overlapping area of operating equipment, the intersection length of high-altitude boundaries, and the number of target continuation frames. The searched feature migration chains are written in reverse into the feature fusion layer and the detection head access layer of the YOLOv8 backbone network to generate the ant colony mutation YOLOv8 network. The phase determination module is used to input the current video frame into the ant colony mutation YOLOv8 network, re-output personnel targets, protective equipment targets, working equipment targets and high-altitude boundary targets, and generate the current construction phase record and candidate safety anomaly records based on the overlap relationship between personnel targets and working equipment targets, the intersection relationship between personnel targets and high-altitude boundary targets, and the inclusion relationship of protective equipment targets within personnel targets. The counter-evidence warning module is used to write counter-evidence items such as occlusion, posture, historical wearing, and stage not established based on the current construction stage record, candidate safety anomaly record, and the context record of the previous construction stage. It writes candidate safety anomaly records with counter-evidence items into the unexplained safety status, and writes candidate safety anomaly records with no counter-evidence items and whose current construction stage record points to high-altitude operations into the valid safety anomaly status. It also generates the context record of the next construction stage, local warning data, remote prompt data, and central control display data.