A construction site safety hidden danger identification and description verification method and system
By combining a lightweight target detection model with a multimodal large model, the construction entities and their spatial relationships at the construction site are identified, and a safety hazard description report with consistency verification is generated. This solves the problem of accuracy in entity relationship identification and description in construction site safety monitoring, and improves the efficiency and reliability of construction site safety management.
Patent Information
- Application Number
- CN202611620988.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-20
- Publication Date
- 2026-11-27
AI Technical Summary
Existing construction site safety monitoring technologies are unable to effectively identify the spatial relationships between construction entities and their potential hazards. Furthermore, visual language models generate hazard descriptions in complex scenarios that suffer from unclear entity references, incorrect spatial relationship descriptions, and high computational resource requirements.
A lightweight target detection model is used to identify construction entities in construction images, generate structured detection results, and combine them with a multimodal large model to describe potential hazards. Detection guidance prompts are used to improve the accuracy and consistency of the descriptions. Semantic quality assessment and risk level determination are used to generate a safety hazard detection and description report.
It improves the traceability and reliability of safety hazard identification at construction sites, reduces ambiguity in entity references and errors in spatial relationship descriptions, lowers computational resource requirements, and provides convenient suggestions for hazard rectification.
Smart Images

Figure CN123182129A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent monitoring of construction safety and multimodal artificial intelligence technology, specifically to a method and system for identifying, describing and verifying safety hazards at construction sites. Background Technology
[0002] Construction sites involve a large number of personnel, construction machinery, and temporary work facilities. Workers and equipment move concurrently within the same work area, resulting in a wide variety of safety hazards that are complexly distributed and dynamically changing. Hazard identification at construction sites is a crucial aspect of construction safety management. This primarily involves analyzing on-site images or videos to identify hazards such as inadequate personnel protection, falls from edges, machinery entrapment, and abnormal working environments. Based on the identification results, safety inspections and rectifications are then carried out. Currently, construction site safety monitoring is increasingly employing artificial intelligence technologies such as target detection and visual language models to improve hazard identification efficiency and assist in generating hazard descriptions.
[0003] Existing object detection-based construction safety monitoring methods can identify targets such as construction workers and machinery, and output target category and location information. However, the detection results mainly reflect the existence of targets and their distribution in the image, making it difficult to directly determine the spatial relationships between different targets and their potential hazards. While visual language models can identify safety hazards and generate natural language descriptions based on image content, they are prone to problems such as unclear entity references, incorrect spatial relationship descriptions, omission of hazards, and inconsistencies between generated content and the actual image in scenarios with dense construction entities, severe occlusion, or multiple hazards coexisting. Furthermore, large-scale visual language models require significant computational resources, limiting their application on edge computing devices at construction sites.
[0004] Furthermore, even when using target detection results to assist visual language models in hazard identification in existing technologies, the generated hazard descriptions may still have discrepancies with the detected entities or unclear risk assessment criteria. Without consistency verification between the generated text and the detection results, safety managers struggle to determine the specific construction entities involved in the hazard description and their spatial locations, and also find it difficult to effectively identify descriptions lacking sufficient evidence. Therefore, how to combine construction entity detection and spatial positioning results with the hazard description process of a multimodal large model, and how to perform consistency verification and risk level determination on the generated results to improve the traceability and reliability of hazard identification results at construction sites, is a pressing technical problem that needs to be solved. Summary of the Invention
[0005] To address the above technical problems, this invention provides a method for identifying, describing, and verifying safety hazards at construction sites, comprising the following steps: S100. Acquire construction site images, preprocess the construction site images to obtain preprocessed construction images; S200. Input the preprocessed construction image into the lightweight target detection model, identify the construction entities in the construction image, obtain the category label, bounding box parameters and detection confidence of each construction entity, and filter the detection results according to the detection confidence. Perform spatial sorting and label assignment on the filtered construction entities to obtain a structured detection result containing entity label, category label and normalized spatial location. S300. Construct a list of construction entities based on the structured detection results, and combine the list of construction entities with preset role task instructions, safety hazard category definitions and output format constraints to generate detection guidance prompts. S400. Input the preprocessed construction image and the detection guidance prompt into the multimodal large model. The multimodal large model performs multimodal reasoning based on the visual features in the construction image and the construction entity information in the detection guidance prompt to generate a safety hazard description text that includes the hazard category, the spatial relationship of the involved entities, the risk cause, and rectification suggestions. S500. Based on the structured detection results, perform consistency verification on the safety hazard description text and semantic quality assessment on the safety hazard description text. Combine the hazard category, the spatial relationship of the involved entities, and the preset risk judgment rules to determine the risk level. Generate a safety hazard detection and description report based on the consistency verification results, risk level, and safety hazard description text. Associate the safety hazard detection and description report with the corresponding construction entity spatial location and output it.
[0006] As a further improvement of the present invention, S100 includes the following steps: S101. Obtain images of the construction site by means of fixed cameras, inspection cameras or drones set up at the construction site, wherein the images of the construction site include construction personnel, construction machinery and corresponding working environment; S102. Denoise the construction site image and restore the motion blur of the construction site image with motion blur to obtain the denoised and restored construction image. S103. Using the limited contrast adaptive histogram equalization method, the brightness and contrast of the denoised and restored construction image are enhanced to obtain the enhanced construction image. S104. Scale the enhanced construction image to a preset resolution while maintaining the RGB three-channel color space to obtain a preprocessed construction image that corresponds to the input requirements of the lightweight target detection model.
[0007] As a further improvement of the present invention, S200 includes the following steps: S201. Input the preprocessed construction image into the lightweight target detection model to detect workers and construction machinery in the construction image, and obtain a set of construction entity detection results: in, This represents the set of test results for the construction entity. This indicates the number of construction entities detected. Indicates the first Boundary box parameters of each construction entity Indicates the first Category labels for each construction entity, Indicates the first The confidence level of the inspection of each construction entity; S202, The bounding box parameters are expressed as follows: in, and They represent the first The normalized coordinates of the center point of the bounding box of each construction entity relative to the width and height of the image. and These represent the normalized width and normalized height of the corresponding bounding box, respectively; S203. Based on a preset confidence threshold, the set of construction entity detection results is filtered, and detection results with a confidence level lower than the confidence threshold are removed to obtain the filtered construction entity detection results. S204. According to the order of the horizontal coordinates of the center of the bounding box corresponding to the screened construction entity detection results from small to large, the construction entities are spatially sorted, and deterministic entity identifiers are assigned according to the sorting results; among them, workers are represented by worker identifiers and sequence indexes, and construction machinery is represented by corresponding machinery category abbreviations and sequence indexes; S205. Associate the deterministic entity identifiers of each construction entity with the corresponding category labels, bounding box parameters, and detection confidence levels to form the structured detection results.
[0008] As a further improvement of the present invention, S300 includes the following steps: S301. Extract the deterministic entity identifier, category label and normalized bounding box center coordinates of each construction entity from the structured detection results, generate the corresponding entity description text according to the preset entity description format, and combine them into a construction entity list according to the sorting result of the deterministic entity identifier. S302. Obtain a preset prompt template, the prompt template including a role and task instruction segment, a construction entity list segment, a safety hazard category definition segment and an output format constraint segment, fill the construction entity list into the construction entity list segment, and generate detection guidance prompt words containing construction entity category and spatial location information; S303. Set four safety hazard categories in the safety hazard category definition section: non-compliance of personal protective equipment, fall hazard, entanglement and squeezing hazard, and unsafe environment; and specify the hazard category field and hazard description field of the safety hazard description text in the output format constraint section. S304. Set a task instruction in the role and task instruction section to identify safety hazards based on the construction site image and the list of construction entities, and constrain the multimodal large model to output the hazard category and hazard description according to the preset fields through the output format constraint section, and output a preset empty hazard identifier when no safety hazard is identified.
[0009] As a further improvement of the present invention, S400 includes the following steps: S401. Input the preprocessed construction image and the detection guidance prompt into the multimodal large model, use the visual encoder of the multimodal large model to extract the visual features of the construction image, and encode the detection guidance prompt to obtain the corresponding text features; S402. Perform cross-modal alignment and fusion on the visual features and text features to obtain multimodal features that include visual information of the construction site and spatial location information of construction entities. S403. Based on the multimodal features and the safety hazard category definition in the detection guidance prompts, identify the safety hazards existing at the construction site, and determine the construction entities involved in the corresponding hazards and the spatial relationships between the entities; S404. Based on the safety hazard category, the spatial relationship of the involved entities, and the work environment information in the construction site image, the multimodal large model is used to perform autoregressive decoding to output a safety hazard description text containing the hazard category, involved entities, spatial relationship, risk cause, and rectification suggestions. The safety hazard categories include non-compliant personal protective equipment, fall hazards, entanglement and squeezing hazards, and unsafe environments. The safety hazard description text generated by the multimodal large model uses the deterministic entity identifier to represent the corresponding construction entity.
[0010] As a further improvement of the present invention, determining the risk level in S500 includes the following steps: S511. Extract the hazard category, the construction entities involved and their spatial relationships from the safety hazard description text, and obtain the category label and normalized spatial location of the corresponding construction entity from the structured detection results based on the deterministic entity identifier of the construction entity. S512. Based on the normalized spatial location of the construction entities involved, determine the normalized spatial distance between the relevant construction entities, and obtain the number of construction entities involved in the safety hazard. S513. Based on the work area information in the construction images, determine whether the safety hazard is located within the worker's work area, and use the hazard category, normalized spatial distance, number of entities involved, and whether it is located within the worker's work area as the basis for risk level determination. S514. According to the preset risk assessment rules, the safety hazards are classified into risk levels, resulting in low risk, medium risk or high risk levels, and the risk levels are associated with the corresponding safety hazard description text.
[0011] As a further improvement of the present invention, the consistency verification of the safety hazard description text in S500 includes the following steps: S521. Obtain the construction entity category labels from the structured inspection results, and determine the corresponding candidate hazard category set based on the construction entity category labels and the preset candidate hazard category association relationship. ; S522. Parse the safety hazard description text generated by the multimodal large model, extract the hazard categories, and form a set of hazard categories output by the large model. ; S523, in the set of candidate hazard categories When the set of candidate hazard categories is not empty, the overlap between the candidate hazard category set and the output hazard category set of the large model is determined, and the calculation relationship is as follows: in, Indicates the degree of category overlap. This represents the number of categories contained in the intersection of the large model's output hazard category set and the candidate hazard category set. This indicates the number of categories in the candidate hazard category set; S524. Compare the category overlap with a preset consistency threshold. When the category overlap is lower than the consistency threshold, mark the corresponding security risk description text as a low confidence description and generate a consistency warning label. S525. Associate the consistency warning identifier with the corresponding security hazard description text and structured detection results as the consistency verification result in the security hazard detection and description report.
[0012] As a further improvement of the present invention, the semantic quality assessment and generation of a security risk detection and description report in step S500 includes the following steps: S531. Obtain the safety hazard description text and its corresponding reference description text. Use the BERTScore semantic similarity evaluation index based on a pre-trained language model to determine the semantic precision and semantic recall between the safety hazard description text and the reference description text. Calculate the semantic precision and semantic recall based on the semantic precision and semantic recall. Fractions, their calculation relationship is as follows: in, Indicates semantic precision. Indicates semantic recall. Semantics Fraction; S532. Based on the safety hazard description text, risk level, semantic quality assessment results and consistency verification results, generate a safety hazard detection and description report. The report includes the hazard category, the definite entity identifier of the involved entity, the hazard description, the risk level, rectification suggestions and consistency warning identifier. S533. Based on the deterministic entity identifier, obtain the bounding box parameters of the corresponding construction entity, and associate the relevant hazard information in the safety hazard detection and description report with the corresponding spatial location in the construction image. S534. Display the construction image, construction entity detection box, hidden danger description text, risk level and rectification suggestions on the user interface, and display the corresponding consistency warning mark according to the consistency verification result.
[0013] Based on this, the present invention also provides a construction site safety hazard identification, description and verification system, including: The image acquisition and preprocessing module is used to acquire images of the construction site, preprocess the images of the construction site, and obtain preprocessed construction images. An entity detection module is connected to the image acquisition and preprocessing module. The entity detection module includes a lightweight target detection model, which is used to identify construction entities in the construction image, obtain the category label, bounding box parameters and detection confidence of each construction entity, and obtain structured detection results through confidence filtering, spatial sorting and label allocation. The prompt construction module, connected to the entity detection module, is used to generate a list of construction entities based on the structured detection results, and combine the list of construction entities with preset role task instructions, safety hazard category definitions and output format constraints to generate detection guidance prompts; The hazard description module is connected to the image acquisition and preprocessing module and the prompt construction module respectively. The hazard description module includes a multimodal large model, which is used to perform multimodal reasoning based on the preprocessed construction image and the detection guidance prompt words to generate a safety hazard description text that includes the hazard category, the spatial relationship of the entities involved, the risk cause and the rectification suggestions. The assessment and verification module is connected to the entity detection module and the hazard description module respectively. It is used to perform consistency verification on the safety hazard description text based on the structured detection results, and to perform semantic quality assessment on the safety hazard description text. It determines the risk level by combining the hazard category, the spatial relationship of the entities involved and the preset risk judgment rules, and generates a safety hazard detection and description report containing the hazard category, risk level, rectification suggestions and consistency verification results. The visualization output module, connected to the evaluation and verification module, is used to associate the safety hazard detection and description report with the spatial location of the corresponding construction entity in the construction image, and to display the safety hazard detection and description report and the corresponding construction entity detection results in the user interface.
[0014] Based on this, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned method for identifying, describing, and verifying safety hazards at construction sites.
[0015] Compared with existing technologies, this invention acquires construction site images and performs denoising, motion blur restoration, brightness and contrast enhancement, and resolution normalization processing to reduce interference from complex lighting, dust, and image blurring on construction entity recognition, providing an image data foundation for subsequent target detection. A lightweight target detection model is used to identify construction workers and machinery, obtaining category labels, bounding box parameters, and detection confidence scores for construction entities. Based on confidence score filtering, spatial sorting, and label allocation, structured detection results are generated, ensuring that construction entities in the same image have deterministic identifiers and corresponding normalized spatial locations. Furthermore, the identifiers, categories, and location information of the construction entities are encoded into a construction entity list, and combined with role task instructions, safety hazard category definitions, and output format constraints to form detection guidance prompts. This enables the multimodal large model to combine visual information from construction images and entity spatial information from detection results for hazard identification and description, reducing unclear entity referencing and incorrect spatial relationship descriptions in unconstrained scene understanding. In cases where the content of a hazard lacks corresponding evidence, after generating a safety hazard description text, the corresponding risk level is determined based on the hazard category, the normalized spatial distance between involved entities, the number of entities, and the work area information. The generated description is then checked for consistency with the structured detection results. Warning signs are output for descriptions that do not meet the preset consistency requirements, enabling safety management personnel to identify hazard descriptions that require further review. Simultaneously, with reference description text available, the generated description is evaluated using semantic quality assessment indicators. The hazard category, involved entities, spatial relationships, risk causes, risk levels, rectification suggestions, and consistency verification results are linked to form a safety hazard detection and description report. The user interface visualizes the hazard information and the spatial location of the corresponding construction entity, allowing the hazard identification results to be traced back to the corresponding construction entity and detection location. This improves the standardization, traceability, and convenience of result review in describing safety hazards at the construction site, and provides technical support for construction safety inspections and hazard rectification. Attached Figure Description
[0016] The embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0017] Figure 1 This is a schematic diagram of the overall framework of the construction site safety hazard identification, description and verification method according to an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the overall flow and methodology of the method in this embodiment of the invention; Figure 3 This is a flowchart illustrating the generation and verification process for security hazard labeling in an embodiment of the present invention. Figure 4 This is an example diagram of the construction entity detection results of the lightweight target detection model according to an embodiment of the present invention; Figure 5This is an example diagram illustrating the description and assessment results of safety hazards in an embodiment of the present invention; Figure 6 This is a comparison chart of the performance of the baseline configuration and the detection guidance configuration for hazard classification in an embodiment of the present invention; Figure 7 This is a flowchart illustrating the construction site safety hazard identification, description, and verification method according to an embodiment of the present invention. Figure 8 This is a flowchart illustrating the construction of the construction safety hazard dataset and model training in an embodiment of the present invention. Figure 9 This is a schematic diagram of the user interface of the safety hazard detection and description system according to an embodiment of the present invention. Detailed Implementation
[0018] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0019] Please see Figures 1 to 9 This invention addresses the complex safety monitoring scenarios comprised of construction site personnel, machinery, and the surrounding environment. It employs a combination of a lightweight target detection model and a multimodal large-scale model to detect and spatially locate construction entities in construction site images. The detected entity categories, bounding box positions, and entity identifiers are converted into detection guidance prompts, enabling the multimodal large-scale model to identify and describe safety hazards by incorporating clear entity information when analyzing construction site images. Based on this, a consistency check is performed between the generated safety hazard description text and the corresponding entity detection results. The risk level is determined by combining the hazard category and the spatial relationship between entities. The safety hazard description, rectification suggestions, risk level, and consistency check results are then linked to the spatial location of the corresponding construction entity, generating a safety hazard detection and description report that can be viewed by construction site safety management personnel.
[0020] The lightweight target detection model is primarily used to identify actual workers and construction machinery in construction images, providing corresponding entity categories and location information. The multimodal large model is mainly used to identify potential safety hazards based on image content and detection guidance prompts, generating descriptive text containing hazard categories, spatial relationships, risk causes, and rectification suggestions. By having these two types of models respectively undertake entity detection and hazard semantic analysis tasks, a correspondence can be established between the spatial positioning results of construction entities and the hazard description results, providing a foundation for subsequent risk level determination and description consistency verification.
[0021] Example 1 Please see Figure 1 and Figure 7 This embodiment provides a method for identifying, describing, and verifying safety hazards at construction sites. Figure 1 This demonstrates the overall framework for detection-guided identification and description of safety hazards at construction sites. Figure 7 The processing flow of the method of the present invention is shown.
[0022] This embodiment first acquires and preprocesses images of the construction site. Then, a lightweight target detection model is used to detect workers and construction machinery, resulting in structured detection results containing category labels, normalized spatial locations, and deterministic entity identifiers. Subsequently, the structured detection results are encoded into detection guidance prompts according to a preset prompt template, and these prompts, along with the construction images, are input into a multimodal large model to generate safety hazard description text. Finally, the safety hazard description text is further processed through risk level determination, semantic quality evaluation, and consistency verification. The processing results are then correlated with the spatial locations of the construction entities to form a safety hazard detection and description report.
[0023] Specifically, it includes the following steps.
[0024] S100. Acquire construction site images, preprocess the construction site images to obtain preprocessed construction images.
[0025] Construction site environments typically involve various types of construction machinery and personnel, and are affected by factors such as changes in lighting, dust, moisture, equipment vibration, and obstruction by construction materials. The raw images acquired may suffer from localized insufficient brightness, low contrast, image noise, and motion blur. These factors can affect the accuracy of lightweight target detection models in identifying workers and construction machinery, and further impact subsequent multimodal large-scale models' judgment of spatial relationships within the construction site.
[0026] Therefore, in this embodiment, construction site images are first acquired, and corresponding denoising, motion blur restoration, image enhancement, and resolution normalization processes are performed according to the characteristics of the acquired images, so that the subsequent target detection model can obtain image data corresponding to its input requirements.
[0027] S100 includes the following sub-steps.
[0028] S101. Obtain images of the construction site by means of fixed cameras, inspection cameras or drones set up at the construction site, wherein the images of the construction site include construction personnel, construction machinery and corresponding working environment.
[0029] In this embodiment, images of the construction site can be obtained by visible light cameras fixedly installed on tower cranes, scaffolding, perimeter fencing, or high on the work surface, or by cameras carried by inspection personnel or drones.
[0030] For fixed cameras, the installation location can be selected based on the spatial range of the construction area and monitoring needs, ensuring that the captured images cover areas where construction workers are active, areas where machinery is operating, or corresponding hazardous work surfaces. For inspection cameras or drones, images of different work areas can be acquired during site inspections to supplement construction scenes that are difficult to cover with fixed cameras.
[0031] As an optional implementation, the camera's image resolution is not less than 1920×1080 pixels, and the image acquisition frequency is set to 5 to 15 frames per second.
[0032] When acquiring video streams, construction site images are extracted from the video streams according to a preset frame extraction frequency, and the extracted image frames are used as objects for subsequent processing.
[0033] The construction site images may include workers, construction machinery, scaffolding, foundation pits, edge areas, construction materials, and other site environmental information. The subsequent target detection model primarily detects pre-defined worker and construction machinery categories, while the multimodal large model combines relevant environmental information contained in the images to determine safety hazards.
[0034] S102. Denoise the construction site image and restore the motion blur of the construction site image with motion blur to obtain the denoised and restored construction image.
[0035] After obtaining the original construction site images, the images are first denoised to reduce image noise caused by dust, water vapor and other interference factors at the construction site.
[0036] As an optional implementation method, a nonlocal mean denoising method is used to process the construction site image. By comparing regions with similar local features in the image, the influence of image noise on the edges and local textures of the construction entity is reduced.
[0037] When images are blurred due to camera shake or equipment vibration, Wiener filtering or deep learning-based deblurring networks are used to restore the images, thereby reducing the impact of motion blur on the edge information of workers and construction machinery.
[0038] After the above processing, the denoised and restored construction image is obtained and used for subsequent brightness and contrast enhancement.
[0039] S103. Using the limited contrast adaptive histogram equalization method, the brightness and contrast of the denoised and restored construction image are enhanced to obtain the enhanced construction image.
[0040] Due to factors such as strong outdoor light, building shadows, localized backlighting, and dust obstruction at construction sites, there may be significant brightness differences between different image areas. When the brightness of a certain area is too low or the contrast is insufficient, the local features of workers and construction machinery in that area may not be clearly visible.
[0041] Therefore, this embodiment employs the Contrast Limited Adaptive Histogram Equalization (CLAHE) method to enhance the local brightness and contrast of the image.
[0042] During processing, the image is divided into multiple local regions, and histogram equalization is performed on each region accordingly. At the same time, the local contrast enhancement is limited to reduce the excessive amplification of noise.
[0043] As an optional implementation, the local area is divided into 8×8 blocks, and the contrast limiting factor is set to 2.0.
[0044] The above processing makes the local visual differences between personnel, machinery and equipment and the surrounding environment in the construction images more obvious, and the enhanced construction images are then passed to the subsequent resolution normalization process.
[0045] S104. Scale the enhanced construction image to a preset resolution while maintaining the RGB three-channel color space to obtain a preprocessed construction image that corresponds to the input requirements of the lightweight target detection model.
[0046] After image enhancement is completed, the enhanced construction images are uniformly scaled to a preset resolution according to the input requirements of the lightweight target detection model.
[0047] As an optional implementation, the construction image is scaled to 640×640×3 pixels, where 640×640 represents the spatial resolution of the image and 3 represents the three color channels corresponding to the RGB color image.
[0048] After resolution normalization, the preprocessed construction image is obtained and used as input for the subsequent lightweight target detection model.
[0049] Through the above steps S101 to S104, the processing from the original construction site image to the target detection model input image is completed, enabling construction images obtained by different acquisition devices to be converted into corresponding input representations, while reducing the impact of image noise, motion blur, and local brightness differences on the subsequent detection process.
[0050] S200. Input the preprocessed construction image into the lightweight target detection model to identify construction entities in the construction image, obtain the category label, bounding box parameters and detection confidence of each construction entity, and filter the detection results according to the detection confidence. Perform spatial sorting and label assignment on the filtered construction entities to obtain structured detection results containing entity labels, category labels and normalized spatial positions.
[0051] After obtaining the preprocessed construction images in the S100, a lightweight target detection model is further used to identify workers and construction machinery in the images.
[0052] The lightweight target detection model is used to locate pre-defined construction entities that actually exist in the construction site image and outputs the corresponding category label, spatial location, and detection confidence score. Unlike directly inputting the image into a multimodal large model for free description, this embodiment first converts the detection results into structured data with deterministic entity identifiers, so that subsequent descriptive text can refer to the specific construction objects in the image based on the corresponding entity identifiers.
[0053] S200 includes the following sub-steps.
[0054] S201. Input the preprocessed construction image into the lightweight target detection model to detect workers and construction machinery in the construction image, and obtain a set of construction entity detection results.
[0055] In this embodiment, the lightweight target detection model adopts a single-stage YOLO series target detection model.
[0056] As an optional implementation, the YOLOv11n model is used as a lightweight target detection model, with approximately 2.6M parameters.
[0057] The lightweight target detection model performs target detection based on the preprocessed construction image and outputs the corresponding construction entity's category label, bounding box parameters, and detection confidence.
[0058] Let the input construction image be: in, This represents the pre-processed construction image. Indicates the image height. 3 represents the image width, and 3 represents the number of RGB color channels.
[0059] The set of construction entity detection results output by the lightweight target detection model Represented as: in, This indicates the number of construction entities detected in the image. Indicates the first Boundary box parameters of each construction entity Indicates the corresponding category label, This indicates the corresponding detection confidence level.
[0060] In this embodiment, the construction entity category includes workers and the following construction machinery: Cement mixer trucks, road rollers, bulldozers, dump trucks, excavators, graders, mobile cranes, tower cranes, wheel loaders, and backhoe loaders.
[0061] The aforementioned workers and ten types of construction machinery together constitute eleven types of construction entities.
[0062] Please see Figure 4 , Figure 4 This document demonstrates the detection output of a lightweight target detection model on construction site images, including scenarios such as mixed operations of personnel and construction machinery, operations near the edge of deep foundation pits, stacking of construction materials, and simultaneous operation of multiple machines. The images use bounding boxes, category labels, and corresponding confidence scores to represent the recognition results, illustrating the model's ability to classify and locate construction entities in construction images.
[0063] S202. The bounding box parameters are expressed as normalized bounding box center coordinates, width, and height.
[0064] After obtaining the inspection results of the construction entities, the bounding boxes of each construction entity are represented as follows: in, Indicates the first The normalized x-coordinate of the center point of the bounding box of each construction entity relative to the image width. This represents the normalized ordinate of the bounding box center point relative to the image height. This represents the normalized value of the bounding box width relative to the image width. This represents the normalized value of the bounding box height relative to the image height.
[0065] By using normalized bounding box parameters, the spatial location of different construction entities can be represented in a unified coordinate form, avoiding the need for the location description in subsequent prompts to directly depend on the original image pixel size.
[0066] The above-mentioned normalized bounding box parameters are correlated with the corresponding entity category labels and confidence levels, serving as the basis for subsequent detection result screening and entity ranking.
[0067] S203. Based on a preset confidence threshold, the set of construction entity detection results is filtered, and detection results with a confidence level lower than the confidence threshold are removed to obtain the filtered construction entity detection results.
[0068] After completing the physical inspection of the construction site, the results are first filtered based on the confidence level of the inspection.
[0069] Let the preset confidence threshold be... If the confidence level of a test result for a construction entity is lower than the confidence level threshold, the test result is discarded; test results that meet the confidence level requirements are retained.
[0070] As an optional implementation, the confidence threshold Set it to 0.25.
[0071] Through the above processing, the filtered construction entity test results are obtained, reducing the possibility of low-confidence test results entering the subsequent prompt word construction process.
[0072] Let the number of construction entities retained after confidence level screening be . The No more than the number of initial test results .
[0073] S204. According to the order of the horizontal coordinates of the center of the bounding box corresponding to the detected results of the screened construction entities, the construction entities are spatially sorted in ascending order, and deterministic entity identifiers are assigned according to the sorting results.
[0074] After obtaining the test results of the screened construction entities, spatial sorting is performed based on the abscissa of the center of the normalized bounding box corresponding to each construction entity.
[0075] Arrange them in ascending order of their central horizontal coordinates so that different construction entities in the construction image can form a corresponding sequential relationship based on their horizontal spatial position.
[0076] Let the x-coordinates of the centers of each construction entity after sorting be respectively , … Then the following condition is met: in, This represents the number of construction entities retained after confidence level screening.
[0077] After sorting, assign deterministic entity identifiers to different construction entities according to the sorting results.
[0078] For worker entities, a combination of worker category identifier and sequential index is used for representation, such as w1, w2, w3.
[0079] For construction machinery entities, the abbreviation of the corresponding machinery category and the sequential index are used for representation. For example, excavator corresponds to ex1 and dump truck corresponds to dt1.
[0080] When there are multiple construction entities in the same category, the index is allocated incrementally according to the corresponding sorting order.
[0081] Using the above method, corresponding deterministic text labels are established for each construction entity in the same construction site image, and a reproducible correspondence is formed between the labels and the actual detection results.
[0082] S205. Associate the deterministic entity identifiers of each construction entity with the corresponding category labels, bounding box parameters, and detection confidence levels to form the structured detection results.
[0083] After completing confidence level screening, spatial sorting, and entity identifier allocation, the deterministic entity identifiers, category labels, normalized bounding box parameters, and detection confidence levels of each construction entity are correlated to form structured detection results.
[0084] Let the set of structured detection results after filtering be: in, Indicates the first Normalized bounding box parameters for each retained construction entity. Indicates its category label, This indicates its detection confidence level. This represents the corresponding deterministic entity identifier.
[0085] The structured detection results are used, on the one hand, to construct subsequent detection guidance prompts, and on the other hand, to verify the correlation between the safety hazard description text and the detection results of the construction entity and to visualize the results.
[0086] Through the above processing in S200, the workers and construction machinery in the construction site images are transformed from raw visual objects into structured data with category labels, normalized spatial locations, and deterministic entity identifiers, providing clear entity references for subsequent hazard descriptions in multimodal large models.
[0087] S300. Construct a list of construction entities based on the structured detection results, and combine the list of construction entities with preset role task instructions, safety hazard category definitions and output format constraints to generate detection guidance prompts.
[0088] After obtaining the structural detection results of the construction entity in S200, the entity category, deterministic entity identifier and spatial location information are further converted into text prompt information that can be received by the multimodal large model.
[0089] In this embodiment, the detection guidance prompts do not merely provide general safety inspection tasks to the multimodal large model, but rather use the detected construction entities and their locations in the image as prompts, enabling the multimodal large model to understand the construction site by combining the corresponding entity information when identifying safety hazards.
[0090] S300 includes the following sub-steps.
[0091] S301. Extract the deterministic entity identifier, category label, and normalized bounding box center coordinates of each construction entity from the structured detection results, generate the corresponding entity description text according to the preset entity description format, and combine them into a construction entity list based on the sorting result of the deterministic entity identifier.
[0092] After obtaining the structured inspection results, extract the deterministic entity identifiers, category labels, and normalized bounding box center coordinates of each retained construction entity.
[0093] For each construction entity, it is converted into the following entity description form: "Identifier: Category, Location Center = (cx, cy)".
[0094] Here, the identifier represents the deterministic entity identifier of the corresponding construction entity, the category represents the preset category to which the construction entity belongs, and cx and cy represent the normalized coordinates of the center point of the corresponding bounding box.
[0095] As an optional implementation, the construction entity list can be represented as follows: Construction entity list: w1: worker, location center = (0.558, 0.518); w2: worker, location center = (0.590, 0.514); w3: worker, location center = (0.817, 0.555); ex1: excavator, location center = (0.474, 0.463).
[0096] Through the above processing, the bounding box data originally output by the object detection model is converted into structured text containing entity categories and spatial locations.
[0097] Each deterministic entity identifier in the entity list can be associated with the corresponding structured detection result in S200, so that the subsequent safety hazard description text can reference the specific construction entity through the corresponding identifier.
[0098] S302. Obtain a preset prompt template, which includes a role and task instruction segment, a construction entity list segment, a safety hazard category definition segment, and an output format constraint segment. Fill the construction entity list into the construction entity list segment to generate detection guidance prompts containing construction entity category and spatial location information.
[0099] After obtaining the list of construction entities, combine it with a pre-set prompt template.
[0100] In this embodiment, the prompt template includes a role and task instruction section, a construction entity list section, a safety hazard category definition section, and an output format constraint section.
[0101] The role and task instruction section specifies the construction safety inspection tasks performed by the multimodal large model; the construction entity list section provides the multimodal large model with information on workers and construction machinery that have been detected in the images; the safety hazard category definition section limits the types of safety hazards that need to be identified; and the output format constraint section specifies the fields and expression format used in the generated text.
[0102] The list of construction entities is generated by S301 and filled into the prompt template according to the order of the corresponding entity identifiers.
[0103] Therefore, the detection guidance prompts not only include the safety inspection tasks to be performed, but also the construction entities corresponding to the current construction image and their spatial location information.
[0104] S303. In the definition section of the safety hazard category, four categories of safety hazards are set: non-compliance of personal protective equipment, fall hazards, entanglement and squeezing hazards, and unsafe environment. In the output format constraint section, the hazard category field and hazard description field of the safety hazard description text are specified.
[0105] In this embodiment, the safety hazard categories include non-compliant personal protective equipment, fall hazards, entanglement and crush hazards, and unsafe environments.
[0106] Among them, non-compliance with personal protective equipment mainly refers to situations where workers do not wear safety helmets or high-visibility reflective safety vests.
[0107] Fall hazards mainly refer to situations where workers are located at heights, in foundation pits, or near edges, and lack appropriate fall protection measures.
[0108] The risk of being caught in a crush or trapping incident mainly refers to situations where workers are near machinery, mobile equipment, structures, trenches, or confined spaces and are at risk of being hit, squeezed, or trapped.
[0109] Unsafe environments mainly refer to environmental conditions at construction sites such as exposed steel bars, uneven terrain, debris, exposed electrical wires, or insufficient lighting.
[0110] By setting the above four categories of safety hazards, the multimodal large model can perform analysis based on the preset hazard definitions, avoiding the direct assumption that all construction entities appearing in the image are safety hazards.
[0111] Meanwhile, a hazard category field and a hazard description field are set in the output format constraint section, so that the hazard category and description content in the generated text can be extracted and used for risk level determination, consistency verification and report generation.
[0112] S304. Set a task instruction in the role and task instruction section to identify safety hazards based on the construction site image and the list of construction entities, and constrain the multimodal large model to output the hazard category and hazard description according to the preset fields through the output format constraint section, and output a preset empty hazard identifier when no safety hazard is identified.
[0113] After completing the list of construction entities and the definition of hazard categories, these are further embedded into the role task instructions and output format constraints to form complete detection guidance prompts.
[0114] As an optional implementation, the prompt template can be represented as follows: You are a construction site safety inspector. Each worker is identified by their ID and location, and the machinery is also listed. Please identify safety hazards in the construction images using only the following categories: 1. Non-compliant personal protective equipment (PPE): Only check hard hats and high-visibility reflective safety vests; 2. Fall hazards: Working at heights, in pits, or near edges without fall protection; 3. Entanglement / pinch hazards: Workers are near machinery, moving equipment, structures, trenches, or confined spaces; 4. Unsafe environments: Exposed rebar, uneven terrain, debris, exposed wiring, or insufficient lighting. If no hazard exists, please label it "none". Answer in the following format: Hazard: -<Hazard Category>; Description: -<Hazard Category>: <Brief Description>.
[0115] In actual use, the list of construction entities generated by S301 is filled into the above prompt template so that the prompt text contains the specific entity information corresponding to the current construction image.
[0116] The “Hazard” field is used to output the category of the identified safety hazard, and the “Description” field is used to output the corresponding description of the hazard. The description may include the entity involved, spatial relationship, risk cause and corresponding rectification suggestions.
[0117] When the multimodal large model does not identify the defined safety hazard, it outputs a preset empty hazard flag none to indicate that the corresponding hazard category does not exist in the current output.
[0118] Through the above processing, the construction entity inspection results are incorporated into the multimodal large model's hazard identification process in the form of structured text, and the large model output can be parsed according to the corresponding fields.
[0119] Please see Figure 1 , Figure 1 The detection guidance framework includes a target detection component and a multimodal large model component for detection guidance. The former extracts the construction entity category, spatial location, and identification information from the construction image, while the latter uses the detection results to generate prompt words, which are then used together with the construction image for hazard identification and description.
[0120] The S300 system enables the conversion from structured inspection results to inspection guidance prompts, allowing subsequent multimodal large models to generate safety hazard description texts by combining specific construction entities and their spatial locations.
[0121] S400. Input the preprocessed construction image and the detection guidance prompt into the multimodal large model. The multimodal large model performs multimodal reasoning based on the visual features in the construction image and the construction entity information in the detection guidance prompt to generate a safety hazard description text that includes the hazard category, the spatial relationship of the involved entities, the cause of the risk, and rectification suggestions.
[0122] After obtaining the detection guidance prompt in S300, it is input into the multimodal large model along with the preprocessed construction image obtained in S100.
[0123] In this embodiment, the multimodal large model mainly judges safety hazards based on visual features in construction images and entity categories and spatial location information in prompt words, and generates corresponding descriptive text.
[0124] S400 includes the following sub-steps.
[0125] S401. Input the preprocessed construction image and the detection guidance prompt into the multimodal large model, use the visual encoder of the multimodal large model to extract the visual features of the construction image, and encode the detection guidance prompt to obtain the corresponding text features.
[0126] In this embodiment, the multimodal large model adopts a visual language model with the ability to jointly process vision and text.
[0127] As an optional implementation, the multimodal large model is a small multimodal large model with no more than 4B parameters, such as Gemma-3 4B, Qwen-3-VL 2B, Qwen-3-VL 4B, InternVL-3 1B, InternVL-3 2B, or SmolVLM-2B.
[0128] The above model can be used for inference with zero or low samples, and can also be fine-tuned according to the labeled construction safety hazard dataset.
[0129] When performing multimodal reasoning, the preprocessed construction images are first extracted using a visual encoder to obtain visual feature representations corresponding to the personnel, construction machinery, and environmental information at the construction site.
[0130] Meanwhile, the detection guidance prompts generated by S300 are text-encoded so that the role task instructions, construction entity list, safety hazard category definition and output format constraints can participate in subsequent multimodal reasoning.
[0131] Thus, feature representations of the corresponding construction images and detection guidance prompts are obtained respectively.
[0132] S402. Perform cross-modal alignment and fusion on the visual features and text features to obtain multimodal features that include visual information of the construction site and spatial location information of the construction entity.
[0133] After obtaining the visual features of the image and the text features of the prompt words, the above features are jointly processed using the cross-modal alignment and fusion structure in the multimodal large model.
[0134] In this embodiment, the multimodal large model may include a visual encoder, a cross-modal alignment projector, and an autoregressive language decoder. The visual encoder is used to extract image features, the cross-modal alignment projector is used to map the visual features to text representations that the language model can process, and the autoregressive language decoder is used to generate output text based on the fused features.
[0135] By associating visual information in construction images with construction entity information in detection guidance prompts, the model can analyze image content by combining the category and normalized spatial location of specific construction entities.
[0136] For example, when the detection results include worker w1 and excavator ex1, the multimodal large model can combine the two entity identifiers and their positions during the analysis of construction site images to describe the relative spatial relationship between the worker and the excavator.
[0137] It should be noted that normalized image coordinates primarily represent the position of an entity in a two-dimensional image. For physical spatial information such as the turning radius of machinery and the actual working distance, it is still necessary to combine the construction site images and available operational status information for judgment. The two-dimensional normalized distance cannot be directly equated with the actual spatial distance.
[0138] S403. Based on the multimodal features and the safety hazard category definition in the detection guidance prompts, identify the safety hazards existing at the construction site and determine the construction entities involved in the corresponding hazards and the spatial relationships between the entities.
[0139] After completing the fusion of visual and textual features, the multimodal big data model analyzes the construction images based on the four types of safety hazards defined in the prompt words.
[0140] For potential hazards related to non-compliance with personal protective equipment, analyze whether the worker in the image is wearing a safety helmet or a highly visible reflective safety vest, and combine this with the corresponding worker identification to form a hazard assessment result.
[0141] Regarding the risk of falls, we analyze whether there is a corresponding risk of falls by combining the worker's location with the environmental characteristics of the high-altitude work surface, foundation pit and edge area in the construction images.
[0142] To address potential crushing hazards, analyze whether personnel are in a work environment where impact, compression, or crushing may occur, taking into account the relative positions of workers, construction machinery, and surrounding structures.
[0143] For unsafe environments, combine environmental information such as exposed rebar, uneven terrain, debris, exposed wires, and lighting conditions in construction images to determine whether there are corresponding safety hazards.
[0144] During the process of identifying potential hazards, the model uses entity identifiers in the prompts to reference the workers and construction machinery involved, enabling the corresponding hazard descriptions to be associated with the structured inspection results in S200.
[0145] S404. Based on the safety hazard category, the spatial relationship of the involved entities, and the work environment information in the construction site image, the multimodal large model is used to perform autoregressive decoding to output a safety hazard description text containing the hazard category, involved entities, spatial relationship, risk cause, and rectification suggestions.
[0146] After determining the hazard category and related construction entities, the multimodal large model generates corresponding safety hazard description text based on the fused visual and textual features.
[0147] The description of the safety hazard can be expressed as follows: in, This represents the security hazard description text output by the multimodal large model; VLM stands for Visual Language Model. This indicates that the input is a construction image. This indicates a detection prompt.
[0148] In this embodiment, the generated safety hazard description text includes the following: safety hazard category, spatial relationship description of the entities involved, explanation of the risk causes, and rectification suggestions.
[0149] Among them, the safety hazard category is determined according to the preset hazard category definition in S300; the spatial relationship description of the entities involved uses corresponding deterministic entity identifiers to refer to workers or construction machinery; the risk cause description combines the entity location and operation status in the image to describe the possible safety risks; and the rectification suggestions provide corresponding on-site handling suggestions based on the identified safety hazards.
[0150] As an optional implementation, a low-temperature decoding setting with a temperature parameter not exceeding 0.2 is used to reduce random variations in the output text. The preferred temperature parameter is 0.1.
[0151] Meanwhile, the maximum output length of a single text generation is limited to no more than 200 tokens. As an optional implementation, the maximum output length is set to 180 tokens.
[0152] For example, when a construction image contains workers w1 and w2 and an excavator ex1, and the multimodal large model determines from the image that the workers are near the excavator's relevant working area and are at risk of being hit by the machinery, the following safety hazard description can be output: Hazard: Entanglement / pinching hazard; Explanation: Entanglement / pinching hazard: Workers W1 and W2 are standing near the moving parts of the excavator EX1, within the working range of the robotic arm, and are at risk of being struck by the machine. It is recommended to suspend machine operation, evacuate personnel outside the turning radius, and establish a warning zone.
[0153] The above text uses deterministic entity identifiers to reference the corresponding workers and excavators, enabling the description to establish a correspondence with the inspection results of the construction entities.
[0154] Please see Figure 5 , Figure 5 This example demonstrates the correspondence between the detection results in construction images and the safety hazard descriptions generated by the multimodal large model. In the construction images, workers and machinery are marked with bounding boxes, while the text generated by the multimodal large model describes the corresponding safety hazards through hazard categories and descriptive fields.
[0155] Please refer to further information. Figure 2 , Figure 2 The overall technical process and corresponding data processing relationships of the method of the present invention are demonstrated, including the fine-tuning and testing of the target detection model, the preparation of the visual language model dataset, and the evaluation process of the detection-guided hazard identification framework.
[0156] The S400 system converts construction images and inspection guidance prompts into safety hazard description text, enabling the relevant construction entities in the generated text to be linked to the aforementioned inspection results and providing input data for subsequent risk level determination and consistency verification.
[0157] S500. Based on the structured detection results, perform consistency verification on the safety hazard description text and semantic quality assessment on the safety hazard description text. Combine the hazard category, the spatial relationship of the involved entities, and the preset risk judgment rules to determine the risk level. Generate a safety hazard detection and description report based on the consistency verification results, risk level, and safety hazard description text. Associate the safety hazard detection and description report with the corresponding construction entity spatial location and output it.
[0158] After the S400 generates a description text of security risks, it further determines the risk level and verifies the consistency, and conducts a semantic quality evaluation when a reference description text is available.
[0159] Among them, the risk level is used to indicate the corresponding risk level of the identified safety hazards; the consistency check is used to check whether the generated hazard category and the candidate hazard category determined based on the construction entity inspection results meet the preset correspondence requirements; and the semantic quality evaluation is used to compare the semantic consistency between the generated description text and the reference description text.
[0160] After completing the above processing, the corresponding results are linked with the safety hazard description text to form a safety hazard detection and description report that includes hazard category, spatial relationship, risk cause, risk level and rectification suggestions.
[0161] S511. Extract the hazard category, the construction entities involved and their spatial relationships from the safety hazard description text, and obtain the category label and normalized spatial location of the corresponding construction entity from the structured detection results based on the deterministic entity identifier of the construction entity.
[0162] After obtaining the safety hazard description text, the hazard category, hazard description and related entities in the text are parsed according to the output format specified in S300.
[0163] Among them, the safety hazard category is used to represent the type of hazard identified by the model, the entity identifier is used to represent the workers or construction machinery involved in the corresponding hazard, and the spatial relationship is used to describe the relative position of the relevant entities in the construction image.
[0164] When deterministic entity identifiers such as worker w1 or excavator ex1 appear in the description text, the corresponding entity's category label and normalized bounding box parameters are obtained from the structured detection results generated by S200 based on the corresponding identifier.
[0165] Through the above processing, a correspondence is established between the entity information involved in the hazard description text and the detection entities in the corresponding construction images, providing spatial location data for subsequent risk level determination.
[0166] S512. Based on the normalized spatial location of the construction entities involved, determine the normalized spatial distance between the relevant construction entities, and obtain the number of construction entities involved in the safety hazard.
[0167] After obtaining the normalized spatial location of the relevant construction entities, the corresponding normalized spatial distance is further determined based on their positional relationship in the construction images.
[0168] For example, when analyzing the potential for entanglement and squeezing between workers and construction machinery, distance information reflecting the positional relationship between the two in the images can be obtained based on the normalized spatial positions of the workers and construction machinery.
[0169] At the same time, based on the entity identifiers associated with the safety hazard description, the number of workers and construction machinery involved in the corresponding hazard is determined.
[0170] In this embodiment, the normalized spatial distance is used to represent the relative positional relationship of entities in a two-dimensional construction image, and is one of the factors considered in risk level determination.
[0171] S513. Based on the work area information in the construction images, determine whether the safety hazard is located within the worker's work area, and use the hazard category, normalized spatial distance, number of entities involved, and whether it is located within the worker's work area as the basis for risk level determination.
[0172] After obtaining the hazard category, the spatial distance of related entities, and the number of entities, we further analyze whether the corresponding hazard occurs in the work area where the worker is working by combining the work area information in the construction site images.
[0173] The sources of risk differ across different categories of safety hazards. Non-compliance with personal protective equipment is mainly related to the personnel's protective status; fall hazards are mainly related to the personnel's work location and fall protection conditions; entanglement and crush hazards are mainly related to the spatial relationship between construction workers and machinery; and unsafe environments are mainly related to the hazardous environmental conditions at the construction site.
[0174] Therefore, this embodiment uses the hazard category, the normalized spatial distance between the involved entities, the number of involved entities, and whether the hazard is located within the worker's work area as the basis for determining the risk level, so as to determine the corresponding risk level according to the preset risk determination rules.
[0175] S514. According to the preset risk assessment rules, the safety hazards are classified into risk levels, resulting in low risk, medium risk or high risk levels, and the risk levels are associated with the corresponding safety hazard description text.
[0176] After obtaining all the information required for risk assessment, the corresponding safety hazards are classified according to the preset risk assessment rules.
[0177] This embodiment divides the risk level into three levels: low risk, medium risk, and high risk.
[0178] The risk assessment rules are determined based on the type of hazard, the normalized spatial distance of related entities, the number of entities involved, and information about the work area.
[0179] Through the above processing, the safety hazard description text not only includes a textual explanation of the hazard category and risk causes, but also establishes a correlation with the corresponding risk level, so that the corresponding risk level can be displayed in the subsequent safety hazard detection and description report.
[0180] After the risk level is determined, a consistency check is performed on the generated hazard description text to check its correlation with the target detection results.
[0181] S521. Obtain the construction entity category labels from the structured inspection results, and determine the corresponding candidate hazard category set based on the construction entity category labels and the preset candidate hazard category association relationship. .
[0182] When performing consistency verification, first read the structured detection results output by S200 to obtain the categories of workers and construction machinery that have been detected in the current construction image.
[0183] Based on this, and according to the pre-defined association between construction entity categories and candidate hazard categories, the corresponding set of candidate hazard categories is determined. .
[0184] The candidate hazard category set is used to represent the corresponding hazard category that participates in the consistency comparison based on the detection results.
[0185] It should be noted that the target detection model directly outputs construction entity categories such as workers, excavators, and dump trucks, while safety hazard categories include non-compliant personal protective equipment, fall hazards, entanglement and squeezing hazards, and unsafe environments. These belong to different classification systems. Therefore, when calculating category overlap, the set of candidate hazard categories determined through corresponding relationships should be used, and the set of construction entity categories should not be directly regarded as the set of hazard categories.
[0186] S522. Parse the safety hazard description text generated by the multimodal large model, extract the hazard categories, and form a set of hazard categories output by the large model. .
[0187] After obtaining the set of candidate hazard categories, the safety hazard description text generated by S400 is parsed to extract the hazard category field.
[0188] The hazard category field is generated according to the output format constraints in S300, and corresponds to preset hazard types such as non-compliant personal protective equipment, fall hazards, entanglement and squeezing hazards, and unsafe environments.
[0189] The identified hazard categories are aggregated to form a large model output set of hazard categories. .
[0190] Subsequently, the set of hazard categories output by the large model is compared with the set of candidate hazard categories obtained in S521 to determine the degree of consistency between the two categories.
[0191] S523, in the set of candidate hazard categories When the set of candidate hazard categories is not empty, determine the degree of category overlap between the set of candidate hazard categories and the set of hazard categories output by the large model.
[0192] In this embodiment, category overlap is used. This indicates the degree of overlap between the set of hazard categories output by the large model and the set of candidate hazard categories. The calculation relationship is as follows: in, This represents the set of hazard categories output by the multimodal large model. This represents the set of candidate hazard categories determined based on the results of on-site construction inspections. This represents the number of hazard categories contained in the intersection of two sets. This indicates the number of categories in the candidate hazard category set.
[0193] In the calculation process, first obtain and Then determine the number of common hazard categories between the two, and calculate the category overlap based on the number of categories in the candidate hazard category set.
[0194] When the candidate hazard category set is empty, the above calculation relationship with the number of elements in the set as the denominator is not directly applied. Instead, subsequent checks need to be performed according to the actual processing rules of the corresponding system.
[0195] S524. Compare the category overlap with a preset consistency threshold. When the category overlap is lower than the consistency threshold, mark the corresponding security risk description text as a low confidence description and generate a consistency warning label.
[0196] After obtaining the category overlap, it is compared with a preset consistency threshold.
[0197] As an optional implementation, the consistency threshold is set to 0.5.
[0198] When the category overlap is lower than the consistency threshold, it indicates that the set of hidden danger categories output by the multimodal large model and the set of candidate hidden danger categories determined based on the construction entity detection results do not meet the preset overlap requirements. Therefore, the corresponding safety hazard description text is marked as a low confidence description, and a consistency warning label is generated.
[0199] For cases where the multimodal large model outputs an empty hazard marker (none), but the target detection model still detects workers or machinery, such results can be associated with the original image for safety management personnel to review; it is not permissible to conclude that there are necessarily safety hazards at the construction site simply because workers or construction machinery are present.
[0200] Through the above processing, the consistency check can mark the description results that do not meet the requirements of the preset category, providing prompts for subsequent manual review.
[0201] S525. Associate the consistency warning identifier with the corresponding security hazard description text and structured detection results as the consistency verification result in the security hazard detection and description report.
[0202] After completing the consistency comparison, the category overlap, low confidence description markers, and consistency warning markers are associated with the corresponding security hazard description text.
[0203] At the same time, the construction entity identifiers referenced in the corresponding safety hazard description text are retained, so that safety management personnel can view the corresponding detection boxes and their spatial locations based on the entity identifiers.
[0204] When the system outputs a consistency warning, a corresponding prompt can be displayed in subsequent reports or the user interface, indicating that the current description result needs to be further verified in conjunction with the original construction images.
[0205] After completing the above consistency verification, a semantic quality evaluation is further carried out based on the corresponding reference description text, and a final security vulnerability detection and description report is generated.
[0206] S531. Obtain the safety hazard description text and its corresponding reference description text. Use the BERTScore semantic similarity evaluation index based on a pre-trained language model to determine the semantic precision and semantic recall between the safety hazard description text and the reference description text, and calculate the semantic similarity. Fraction.
[0207] In this embodiment, BERTScore is used as the semantic quality evaluation index for security hazard description text.
[0208] The reference descriptive text can be derived from a manually reviewed dataset of construction safety hazards, and is used for semantic comparison with the descriptive text generated by the multimodal large model.
[0209] BERTScore obtains contextual feature representations of corresponding words in the generated and reference texts through a pre-trained language model, and calculates semantic precision, semantic recall, and semantic accuracy based on the semantic similarity between the corresponding word representations. Fraction.
[0210] As an optional implementation, a Roberta-large pre-trained model is used to generate contextual embedding representations of lexical units, and the semantic consistency between the generated descriptive text and the reference descriptive text is evaluated based on the cosine similarity between the lexical embeddings.
[0211] Semantics Fractions are calculated using the following relationship: in, Semantics Fraction, Indicates semantic precision. This represents semantic recall.
[0212] The semantic precision rate is used to evaluate the degree of semantic matching between the words in the generated text and the reference text, and the semantic recall rate is used to evaluate the degree of semantic matching between the words in the reference text and the generated text.
[0213] In the specific calculation, the semantic precision and semantic recall are obtained based on the context embedding of the generated description text and the reference description text, respectively, and then the semantic precision and semantic recall are calculated according to the above relationship. Fraction.
[0214] It should be noted that BERTScore calculation relies on reference description text. Therefore, in the evaluation stage of datasets with corresponding human reference descriptions, the above semantic quality evaluation can be performed directly. For on-site images without reference description text, the actual operating conditions of online hazard identification and offline semantic evaluation should be distinguished, and it should not be assumed that every frame of construction site image has corresponding human reference text.
[0215] S532. Generate a safety hazard detection and description report based on the safety hazard description text, risk level, semantic quality assessment results, and consistency verification results.
[0216] After completing the risk level determination, description consistency verification, and corresponding semantic quality evaluation, the above processing results are correlated to form a safety hazard detection and description report.
[0217] In this embodiment, the report includes the hazard category, the definitive entity identifier of the involved entity, the hazard description, the spatial relationship, the risk level, the rectification suggestions, and the consistency verification results.
[0218] In evaluation scenarios with reference descriptive text, the report can also include corresponding semantics. Fraction.
[0219] Among them, the hazard category is used to indicate the type of safety hazard identified, the entity identifier is used to locate the corresponding construction object, the spatial relationship and risk cause are used to explain the relevant conditions for the formation of the hazard, the risk level is used to indicate the corresponding risk level, the rectification suggestion is used to provide corresponding on-site handling reference, and the consistency verification result is used to indicate whether the description content meets the preset category corresponding requirements.
[0220] In addition, statistics can be compiled on different safety hazard categories and risk levels according to the work area or monitoring time period to form corresponding information on the number of hazards, risk level distribution, and rectification priority.
[0221] S533. Based on the deterministic entity identifier, obtain the bounding box parameters of the corresponding construction entity, and associate the relevant hazard information in the safety hazard detection and description report with the corresponding spatial location in the construction image.
[0222] After obtaining the safety hazard detection and description report, the boundary box parameters of the corresponding construction entities are obtained from the structured detection results generated by S200 based on the construction entity identifiers involved in the report.
[0223] For example, when worker w1 and excavator ex1 appear in the safety hazard description text, the corresponding bounding box position, category label and detection confidence are obtained according to w1 and ex1 respectively.
[0224] Subsequently, the safety hazard category, risk level, and descriptive text are associated with the bounding box position of the corresponding construction entity, so that the user interface can simultaneously display the relevant entities in the construction image and their hazard descriptions.
[0225] For potential hazards involving multiple construction entities, multiple corresponding detection results can be associated with the entity identifiers referenced in the description text.
[0226] Through the above processing, a correspondence can be established between the textual description of safety hazards and the specific detection locations in the construction images.
[0227] S534. Display the construction image, construction entity detection box, hidden danger description text, risk level and rectification suggestions on the user interface, and display the corresponding consistency warning mark according to the consistency verification result.
[0228] After associating the hazard report with the spatial location of the construction entity, the report and corresponding test results are output to the user interface.
[0229] Please see Figure 9 , Figure 9 A schematic diagram of the user interface of the safety hazard detection and description system of the present invention is shown.
[0230] In this embodiment, the user interface may include a construction image and inspection box display area, a hazard description text display area, a hazard category and risk level statistics area, a hazard area distribution area, and an interactive control area.
[0231] The construction image and detection box display area is used to display the original construction image and overlay the detection boundary box, category label, detection confidence level and deterministic entity identifier of the construction entity.
[0232] The hazard description text display area is used to display the safety hazard category, the spatial relationship of the entities involved, the cause of the risk, and rectification suggestions according to the corresponding fields.
[0233] The Hazard Category and Risk Level Statistics Area is used to statistically analyze the hazard categories and corresponding risk levels identified in the current construction site images.
[0234] The hazard distribution area is used to display the distribution of different safety hazards according to the work area or camera position, and supports viewing according to hazard category and risk level.
[0235] The interactive control area can be set with interactive controls such as "detection results" and "hazard descriptions" to respond to user operations and display the corresponding target detection results or safety hazard descriptions and rectification suggestions generated by the multimodal large model.
[0236] When the consistency verification result contains a warning indicator, a consistency warning will be displayed in the corresponding hazard description location, enabling safety management personnel to review the relevant description.
[0237] Thus, the S500 completes the risk level determination, consistency verification, semantic quality evaluation, report generation, and spatial location association of the safety hazard description text, enabling the hazard description generated by the multimodal large model to establish a correspondence with the entity detection results in the construction images.
[0238] In the above embodiments, the lightweight target detection model and the multimodal large model can be pre-trained models. To illustrate how the relevant models are obtained and their application in construction site scenarios, this embodiment further combines... Figure 2 , Figure 3 and Figure 8 The process of model training and dataset construction is explained.
[0239] Please see Figure 2, Figure 2 The first part shows the fine-tuning and testing process of the target detection model, the second part shows the preparation process of the visual language model dataset, and the third part shows the evaluation process of the detection-guided hazard identification framework.
[0240] During the training process of the lightweight target detection model, construction images containing workers and construction machinery are first acquired, and the images are labeled according to eleven pre-determined construction entities.
[0241] The construction images can be sourced from publicly available construction safety datasets and engineering machinery image datasets.
[0242] As an optional implementation, the target detection model training data includes no less than 10,000 labeled construction images, and uses eleven types of construction entities corresponding to S200 for category labeling.
[0243] The number of labeled instances for the eleven types of construction entities in the dataset are as follows: 3,527 workers, 655 cement mixers, 877 road rollers, 775 bulldozers, 948 dump trucks, 922 excavators, 940 graders, 898 mobile cranes, 363 tower cranes, 949 wheel loaders, and 978 backhoe loaders, totaling 11,832 labeled instances. The number of labeled instances is not the same as the number of different images.
[0244] After completing the annotation of the construction entities, the dataset was divided into training set, validation set and test set according to the proportions of 70%, 20% and 10%, and the images were uniformly scaled to 640×640×3 pixels.
[0245] In this embodiment, a pre-trained YOLOv11n model is used for transfer learning, and fine-tuning is performed based on the aforementioned construction entity category data.
[0246] As an optional implementation, the model training rounds are set to 50 rounds, the batch size is set to 16, the optimizer uses the stochastic gradient descent method, the initial learning rate is set to 0.01, the final learning rate coefficient is set to 0.01, the momentum is set to 0.937, the weight decay is set to 0.0005, and a 3-round warm-up phase is set.
[0247] During training, the weights of the bounding box loss, classification loss, and distribution focus loss were set to 7.5, 0.5, and 1.5, respectively, and the intersection-union threshold was set to 0.7.
[0248] To enhance the model's adaptability to different construction scenarios, data augmentation was further employed during training.
[0249] The mosaic enhancement probability is set to 1.0, the horizontal flip probability is set to 50%, the translation range is set to ±10%, and the scaling range is set to 0.5. The color enhancement uses an HSV perturbation with a hue of 0.015, a saturation of 0.7, and a brightness of 0.4, and the random erasure probability is set to 0.4 to simulate situations such as target occlusion at the construction site.
[0250] During training, the model performance is evaluated round by round on the validation set according to the preset training configuration, and an early stopping strategy is adopted, with the patience value set to 15 rounds.
[0251] After the model training is completed, the lightweight object detection model is evaluated using a test set.
[0252] The test results are shown in Table 1.
[0253] Table 1. Detection performance of the lightweight target detection model on the test set. As shown in Table 1, the lightweight target detection model can output corresponding detection results for workers and different types of construction machinery. The overall precision is 89.0%, the recall is 88.4%, the mAP@0.5 is 93.3%, and the mAP@0.5:0.95 is 77.4%.
[0254] The above detection results are used to construct a list of construction entities, enabling the multimodal large model to obtain reference information on the categories and locations of relevant workers and machinery in the images.
[0255] For the construction safety hazard dataset required for the multimodal large model, this embodiment further adopts a combination of large-scale multimodal model-assisted annotation and manual verification for construction.
[0256] Please see Figure 3 , Figure 3 The process of generating and verifying construction safety hazard labels was demonstrated.
[0257] First, construction images are collected from historical safety inspection records at the construction site and publicly available construction safety datasets. These images are then cropped and cleaned to remove blurry, overexposed, severely obscured, or unusable work areas. The remaining images cover different construction stages, lighting conditions, and combinations of potential hazards.
[0258] Subsequently, the cleaned construction images are input into a large-scale multimodal model, and structured prompts containing hazard category definitions and output format constraints are provided, enabling the large-scale multimodal model to automatically generate initial hazard category labels and corresponding explanatory text.
[0259] As an optional implementation, the temperature parameter of the large-scale multimodal model is set to 0.1, and the maximum output length is set to 180 words.
[0260] After obtaining the initial annotations and explanatory texts, trained annotators will check them according to unified evaluation criteria, focusing on verifying whether the hazard category is correct, whether the explanatory content is specific, and whether the explanatory text is consistent with the actual scene in the image.
[0261] When the initial labeling contains errors such as incorrect categories, inaccurate descriptions, or incomplete content, the labeling personnel will verify and correct it to form a verified dataset of construction safety hazards.
[0262] As an optional implementation, the construction safety hazard dataset contains 1,833 construction images, each with a corresponding hazard category label and reference explanatory text.
[0263] Please see Figure 8 , Figure 8 This demonstrates the correspondence between the construction of the construction safety hazard dataset and the model training.
[0264] The construction images, after being collected, cropped, and cleaned, are automatically initially labeled and manually verified to form a construction safety hazard dataset containing hazard categories and reference explanatory text, which is used for fine-tuning and evaluation of the multimodal large model; the lightweight target detection model is trained and validated using the aforementioned eleven types of construction entity labeled data.
[0265] After obtaining the model evaluation results, corresponding construction images and labeled data can be added based on construction scenarios that are prone to false detection or missed detection, for subsequent model training and evaluation.
[0266] Through the above model training and dataset construction process, the lightweight target detection model can acquire detection capabilities suitable for identifying workers and machinery at construction sites, and the multimodal large model has an evaluation or fine-tuning data foundation related to the categories of construction safety hazards and corresponding explanatory texts.
[0267] To illustrate the impact of detection guidance prompts on the process of identifying and describing safety hazards at construction sites, this embodiment further compares a baseline configuration without detection guidance information with the configuration of the present invention that includes detection guidance information.
[0268] The baseline configuration inputs the preprocessed construction images and prompts containing only hazard category definitions and output format constraints into the multimodal large model, without providing it with target detection results.
[0269] The configuration of this invention first detects construction entities through a lightweight target detection model, encodes the corresponding entity identifier, category label, and normalized spatial location into detection guidance prompts, and inputs them together with the construction image into the same multimodal large model.
[0270] Both configurations are evaluated for the corresponding construction safety hazard datasets.
[0271] This embodiment uses precision, recall, Score, mAP, BERTScore semantics The system performance is evaluated using metrics such as score and frames per second (FPS).
[0272] Among them, accuracy This represents the proportion of correctly detected potential hazards among all samples identified as potential hazards. The calculation relationship is as follows: Recall rate The proportion of correctly detected potential hazards in the total number of actual potential hazard samples is calculated as follows: The score represents the harmonic mean of precision and recall, and its calculation relationship is as follows: in, This indicates the number of correctly detected potential hazards. This indicates the number of potential hazard samples that were falsely detected. This indicates the number of potential hazard samples that were missed during testing.
[0273] For the inspection of construction entities, cross-comparison ratio can also be used. The degree of overlap between the predicted bounding box and the ground truth bounding box is evaluated, and the calculation relationship is as follows: in, Indicates the predicted bounding box. Represents the true bounding box. This indicates the area of the corresponding region.
[0274] Based on this, the mean accuracy (mAP) can be used to evaluate the positioning and classification effects corresponding to different construction entity categories, including mAP@0.5 and mAP@0.5:0.95.
[0275] For text describing security risks, the aforementioned BERTScore semantics are used. The degree of semantic consistency between the generated description and the reference description for score evaluation.
[0276] The system processing efficiency is evaluated using frames per second (FPS).
[0277] In this embodiment, six multimodal models, namely Gemma-3 4B, Qwen-3-VL 4B, Qwen-3-VL 2B, InternVL-3 2B, InternVL-3 1B and SmolVLM 2B, were selected for comparative experiments.
[0278] Hazard identification under different model configurations and the configuration of this invention The scores are shown in Table 2.
[0279] Table 2. Potential hazards detected in the configuration of this invention compared to the baseline configuration. Score Comparison As shown in Table 2, after introducing detection guidance prompts, the six multimodal models improved hazard detection. All scores improved.
[0280] Among them, Gemma-3 4B The score improved from 34.5% to 50.6%, an increase of 16.1 percentage points; InternVL-31B The score increased from 19.4% to 34.2%, a rise of 14.8 percentage points.
[0281] Please see Figure 6 , Figure 6 The performance comparison between the baseline configuration and the configuration of this invention in the hazard classification task is shown. Figure 6 (a) Precision, recall, and [other parameters] of different small multimodal large models under baseline configuration. Fraction, Figure 6 (b) is the evaluation result under the configuration of the present invention.
[0282] Under the test conditions, the precision of Gemma-3 4B improved from 24.5% to 60.1%, and the recall rate changed from 57.0% to 43.7%.
[0283] The above results indicate that detecting guiding prompts can improve the precision of the corresponding model output, but the recall of some models may decrease accordingly. Therefore, a combination of precision, recall, and... The scores are used to jointly evaluate the actual effectiveness of the guidance strategy.
[0284] Furthermore, in this embodiment, BERTScore is used to evaluate the semantic quality of the generated security hazard description text, and the results are shown in Table 3.
[0285] Table 3. Comparison of semantic quality of potential problems described in the present invention configuration and the baseline configuration. As shown in Table 3, under the test conditions adopted, the semantic consistency between the hazard description text and the reference description text generated by different multimodal models was improved after introducing detection guidance prompts.
[0286] For example, according to the values in Table 3, the BERTScore of Gemma-3 4B The value of Qwen-3-VL 4B increased from 0.56 to 0.80, and the value of InternVL-3 1B increased from 0.46 to 0.62.
[0287] Based on the above results, we can analyze the impact of detection guidance prompts on the hazard classification results and the semantic quality of the generated explanatory text under different model conditions.
[0288] The inference efficiency of different models was further evaluated. Under the test conditions, the lightweight target detection model introduced an additional processing delay of approximately 2.5 milliseconds in the detection process of a single frame image, and the overall processing throughput of the multimodal model was in the range of approximately 0.40 to 0.48 frames per second.
[0289] Therefore, the lightweight target detection step adds less processing time compared to the overall inference process of the multimodal large model, and can be used as an entity detection and spatial information extraction step in the construction site image processing system.
[0290] It should be noted that the above 0.40 to 0.48 frames per second represents the actual processing throughput under the corresponding test conditions and cannot be directly equated to the original acquisition frame rate of the construction camera.
[0291] By comparing the detection performance, hazard classification performance, semantic description quality, and inference efficiency of the above models, the technical effectiveness of the detection guidance and prompting strategy can be evaluated from different dimensions, and a basis can be provided for model selection and deployment in subsequent construction site applications.
[0292] In practical construction site applications, lightweight target detection models and multimodal large models can be deployed on edge computing devices at the construction site, enabling on-site acquired images to complete entity detection, prompt word construction, hazard description, and report generation on the corresponding computing devices.
[0293] As an alternative implementation, to reduce the computational resources required for multimodal large model inference, at least one of the following acceleration methods can be used: low bit quantization, key-value cache reuse, or operator fusion.
[0294] Low-bit quantization is used to reduce the storage and computational resource requirements of model parameters, key-value cache reuse is used to reduce redundant calculations in the corresponding autoregressive inference process, and operator fusion is used to optimize computational operations in the model inference process.
[0295] For lightweight object detection models, as an optional implementation, the detection latency of a single frame image is controlled to within 5 milliseconds.
[0296] In scenarios where video stream input is used, the construction site video can be processed frame by frame according to a preset frame extraction frequency, and S100 to S500 can be executed for each image frame.
[0297] For the construction entity detection results, safety hazard description text, risk level and consistency verification results generated in each frame, the corresponding timestamp and work area information are further associated to form a spatiotemporal archive of construction site hazards.
[0298] In this embodiment, hazard records at different times can be organized according to the work area or camera position, and the changes in hazard categories, quantities and risk levels at different times in the same work area can be compared to form corresponding hazard change trend judgment and early warning information.
[0299] The deterministic entity identifier is mainly used to associate the detected entity with the descriptive text in the current image frame; for construction images at different times, the corresponding hidden danger records can be organized by combining the timestamp and work area information.
[0300] Through the above methods, this embodiment can not only identify and describe potential hazards in a single construction site image, but also generate continuous monitoring records in the video stream scene according to the corresponding processing frequency, and carry out spatiotemporal information management of potential hazards based on the records.
[0301] In summary, this embodiment links image preprocessing, construction entity detection, detection guidance prompt word construction, multimodal large model hazard description, risk level determination, and consistency verification through S100 to S500, so that the safety hazard description can reference specific construction entities and establish a corresponding relationship with the corresponding spatial location.
[0302] Based on this, model training and semantic evaluation can be carried out by combining the manually reviewed construction safety hazard dataset. According to the computing resource conditions of the construction site, the appropriate edge deployment method can be adopted to finally generate a safety hazard detection and description report that includes hazard category, spatial relationship, risk cause, risk level, rectification suggestions and consistency verification results, providing technical basis for construction site safety inspection and hazard rectification.
[0303] Example 2 This embodiment provides a construction site safety hazard identification, description and verification system, used to execute the construction site safety hazard identification, description and verification method described in Embodiment 1.
[0304] The system includes an image acquisition and preprocessing module, an entity detection module, a prompt construction module, a hazard description module, an assessment and verification module, and a visualization output module.
[0305] The image acquisition and preprocessing module is used to acquire images of the construction site, preprocess the images, and output the preprocessed construction images.
[0306] In this embodiment, the image acquisition and preprocessing module may include a fixed camera, an inspection camera, or a drone acquisition interface, as well as a denoising and deblurring unit, an adaptive enhancement unit, and a resolution normalization unit corresponding to image preprocessing.
[0307] The denoising and deblurring unit is used to process noise and restore motion blur in the original construction image; the adaptive enhancement unit is used to enhance brightness and contrast using a contrast-limited adaptive histogram equalization method; and the resolution normalization unit is used to adjust the processed construction image to the input resolution required by the lightweight target detection model.
[0308] After completing the above processing, the image acquisition and preprocessing module sends the preprocessed construction images to the entity detection module and the hazard description module.
[0309] The entity detection module is connected to the image acquisition and preprocessing module, and has a built-in lightweight target detection model for detecting and locating workers and construction machinery in construction images.
[0310] In this embodiment, the entity detection module outputs the category label, bounding box parameters, and detection confidence of the corresponding construction entity based on the construction image, and filters the detection results according to a preset confidence threshold.
[0311] Subsequently, the retained construction entities are sorted in ascending order of the abscissa of the center of the normalized bounding box, and deterministic entity identifiers are assigned according to the sorting results.
[0312] After completing the above processing, the entity detection module outputs structured detection results, which include the deterministic entity identifier, category label, normalized bounding box parameters, and detection confidence of each construction entity.
[0313] The prompt construction module is connected to the entity detection module and is used to generate a list of construction entities based on the structured detection results, and to construct detection guidance prompts in combination with preset prompt templates.
[0314] In this embodiment, the prompting construction module first extracts the entity identifier, category label, and normalized bounding box center coordinates from the structured detection results, generates the text representation of each construction entity according to the preset entity description format, and then combines the corresponding entity descriptions to form a construction entity list.
[0315] Subsequently, the list of construction entities is combined with role task instructions, safety hazard category definitions, and output format constraints to form detection guidance prompts.
[0316] The safety hazard categories are defined as including non-compliant personal protective equipment, fall hazards, entanglement and crush hazards, and unsafe environments; the output format constraints are used to specify the output results of the multimodal large model according to the corresponding hazard category and hazard description field.
[0317] After the prompt word is constructed, the prompt construction module sends the detection guidance prompt word to the hazard description module.
[0318] The hazard description module is connected to the image acquisition and preprocessing module and the prompt construction module, respectively. It has a built-in multimodal large model, which is used to perform multimodal reasoning based on the preprocessed construction images and detection guidance prompts.
[0319] In this embodiment, the multimodal large model obtains the visual feature representation of the construction image through a visual encoder, and performs text encoding on the detection guidance prompts. Through cross-modal alignment and fusion processing, the visual information in the construction image is associated with the construction entity information in the prompts, and then the safety hazard description text is generated through autoregressive decoding.
[0320] The safety hazard description text includes the hazard category, the spatial relationship of the entities involved, the cause of the risk and rectification suggestions, and references the relevant construction entities through deterministic entity identifiers.
[0321] After completing the above processing, the hazard description module will send the generated safety hazard description text to the assessment and verification module.
[0322] The assessment and verification module is connected to the entity detection module and the hazard description module, respectively. It is used to determine the risk level and verify consistency based on the structured detection results and the safety hazard description text, and to perform semantic quality evaluation when reference description text is available.
[0323] In this embodiment, the evaluation and verification module first extracts the hazard category and related entities from the safety hazard description text, and obtains the corresponding category and normalized spatial location from the structured detection results based on the entity identifier.
[0324] Then, based on the type of hazard, the normalized spatial distance between the entities involved, the number of entities involved, and the corresponding work area information, the risk level of low risk, medium risk, or high risk is determined according to the preset risk assessment rules.
[0325] Furthermore, the evaluation and verification module determines the set of candidate hazard categories based on the structured detection results and the preset candidate hazard category association relationship, and extracts the hazard category set from the text generated by the multimodal large model, and calculates the category overlap degree and judges the corresponding consistency threshold between the two sets.
[0326] When the category overlap is lower than the preset consistency threshold, the corresponding description result is marked as a low confidence description and a consistency warning is generated.
[0327] For evaluation samples with reference description text, the evaluation and verification module can also use BERTScore to calculate the semantic relationship between the generated description text and the reference description text. Scores are used to evaluate the semantic quality of the text.
[0328] After completing the corresponding processing, the assessment and verification module associates the hazard category, involved entities, spatial relationships, risk level, rectification suggestions, and consistency verification results to form a safety hazard detection and description report, which is then sent to the visualization output module.
[0329] The visualization output module is connected to the evaluation and verification module to associate the safety hazard detection and description report with the corresponding spatial location of the construction entity in the construction image, and to display the detection results and hazard description information in the user interface.
[0330] Please see Figure 9 The user interface may include a construction image and inspection box display area, a hazard description text display area, a hazard category and risk level statistics area, a hazard area distribution area, and an interactive control area.
[0331] The construction image and inspection box display area shows the bounding box, category label, confidence level, and deterministic entity identifier corresponding to the construction image and construction entity.
[0332] The hazard description text display area shows the corresponding hazard category, spatial relationship, risk cause, and rectification suggestions.
[0333] The statistics area for hazard categories and risk levels displays the quantity and distribution of different hazard categories and risk levels.
[0334] Within the hazard distribution area, relevant hazard information is displayed based on the construction area or camera position.
[0335] In the interactive control area, the results of the construction entity inspection or the description of potential hazards and rectification suggestions generated by the multimodal large model are displayed according to the user's operation.
[0336] When the assessment and verification module outputs a consistency warning, the visualization output module can also display the corresponding warning information at the location of the hazard description for safety management personnel to review.
[0337] As an optional implementation, the system may also include a data annotation subsystem for generating initial hazard annotations and explanatory text based on construction site images, and providing a manual verification and correction interface to form a construction safety hazard dataset for model training or fine-tuning.
[0338] The data annotation subsystem can generate initial annotations using a large-scale multimodal model, which are then manually verified and corrected according to unified evaluation criteria. The verified construction images, hazard categories, and reference description texts are then associated and saved.
[0339] Furthermore, the system may also include a field monitoring module, which is used to receive video streams from the construction site and acquire image frames according to a preset frame extraction frequency, and perform corresponding safety hazard detection and description processing on different image frames.
[0340] After obtaining the processing results of each image frame, the safety hazard category, related construction entity, risk level and corresponding timestamp are associated and saved to form a spatiotemporal archive of hazards. Hazard records at different times in the same construction area are compared and the corresponding hazard change information is output.
[0341] In actual deployment, the entity detection module, prompt construction module, hidden danger description module, and assessment and verification module can be deployed on the edge computing device at the construction site. Based on the computing resource conditions, the multimodal large model can be processed by low bit quantization, key-value cache reuse, or operator fusion to reduce the resource requirements of model inference.
[0342] Therefore, the system acquires construction site images through the image acquisition and preprocessing module, forms structured detection results through the entity detection module, encodes construction entity information into detection guidance prompts through the prompt construction module, generates safety hazard description text through the hazard description module, completes risk level determination and consistency verification through the assessment and verification module, and finally displays the corresponding hazard report with the construction entity detection location through the visualization output module, thus realizing the construction site safety hazard identification and description verification method described in Embodiment 1.
[0343] Example 3 This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the construction site safety hazard identification, description, and verification method described in Embodiment 1.
[0344] Specifically, when the computer program is executed by the processor, it first acquires a construction site image, and then performs noise reduction, motion blur restoration, brightness and contrast enhancement, and resolution normalization on the construction site image to obtain a preprocessed construction image.
[0345] Subsequently, the preprocessed construction image is input into the lightweight target detection model to detect workers and construction machinery in the construction image, obtain the category label, bounding box parameters and detection confidence of the construction entity, and form a structured detection result through confidence filtering, spatial sorting and label allocation.
[0346] After obtaining the structured detection results, the deterministic entity identifiers, category labels, and normalized spatial locations of the construction entities are further extracted to construct a list of construction entities. The list of construction entities is then combined with role task instructions, safety hazard category definitions, and output format constraints to form detection guidance prompts.
[0347] Subsequently, the detection guidance prompts and the preprocessed construction images are input into a multimodal large model. The multimodal large model is then used to jointly process the image visual features and the detection guidance prompts to generate a safety hazard description text that includes the hazard category, the spatial relationship of the entities involved, the cause of the risk, and rectification suggestions.
[0348] After obtaining the safety hazard description text, the risk level is determined according to the corresponding hazard category, the spatial relationship of the entities involved, and the preset risk judgment rules. Consistency verification is carried out based on the correlation between the structured detection results and the generated hazard category to form corresponding verification results and warning labels.
[0349] With reference descriptive text available, the BERTScore is further used to evaluate the semantic quality of the security hazard description text.
[0350] Finally, the safety hazard category, involved entities, spatial relationships, risk level, rectification suggestions, and consistency verification results are associated to form a safety hazard detection and description report. The corresponding bounding box parameters are obtained based on the construction entity identifier, so that the report can be linked to the spatial location of the relevant construction entities in the construction image. The safety hazard detection and description report is then displayed in the user interface.
[0351] When the computer program is executed by the processor, it completes the preprocessing of construction site images, structured entity detection, construction of detection guidance prompts, description of multimodal hazards, determination of risk level, consistency verification and result output according to the steps S100 to S500 in Embodiment 1, thereby realizing the identification and description verification of safety hazards at the construction site.
[0352] The above description is merely a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Without departing from the technical concept of the present invention, those skilled in the art can adapt the corresponding model parameters, prompt templates, and system deployment methods according to different construction site operating environments, types of construction machinery, image acquisition conditions, and computing resource configurations. The scope of protection of the present invention should be determined by the scope defined in the claims.
Claims
1. A method for identifying, describing, and verifying safety hazards at construction sites, characterized in that, Includes the following steps: S100. Acquire construction site images, preprocess the construction site images to obtain preprocessed construction images; S200. Input the preprocessed construction image into the lightweight target detection model, identify the construction entities in the construction image, obtain the category label, bounding box parameters and detection confidence of each construction entity, and filter the detection results according to the detection confidence. Perform spatial sorting and label assignment on the filtered construction entities to obtain a structured detection result containing entity label, category label and normalized spatial location. S300. Construct a list of construction entities based on the structured detection results, and combine the list of construction entities with preset role task instructions, safety hazard category definitions and output format constraints to generate detection guidance prompts. S400. Input the preprocessed construction image and the detection guidance prompt into the multimodal large model. The multimodal large model performs multimodal reasoning based on the visual features in the construction image and the construction entity information in the detection guidance prompt to generate a safety hazard description text that includes the hazard category, the spatial relationship of the involved entities, the risk cause, and rectification suggestions. S500. Based on the structured detection results, perform consistency verification on the safety hazard description text and semantic quality assessment on the safety hazard description text. Combine the hazard category, the spatial relationship of the involved entities, and the preset risk judgment rules to determine the risk level. Generate a safety hazard detection and description report based on the consistency verification results, risk level, and safety hazard description text. Associate the safety hazard detection and description report with the corresponding construction entity spatial location and output it.
2. The method for identifying, describing, and verifying safety hazards at construction sites according to claim 1, characterized in that, S100 includes the following steps: S101. Obtain images of the construction site by means of fixed cameras, inspection cameras or drones set up at the construction site, wherein the images of the construction site include construction personnel, construction machinery and corresponding working environment; S102. Denoise the construction site image and restore the motion blur of the construction site image with motion blur to obtain the denoised and restored construction image. S103. Using the limited contrast adaptive histogram equalization method, the brightness and contrast of the denoised and restored construction image are enhanced to obtain the enhanced construction image. S104. Scale the enhanced construction image to a preset resolution while maintaining the RGB three-channel color space to obtain a preprocessed construction image that corresponds to the input requirements of the lightweight target detection model.
3. The method for identifying, describing, and verifying safety hazards at construction sites according to claim 1, characterized in that, S200 includes the following steps: S201. Input the preprocessed construction image into the lightweight target detection model to detect workers and construction machinery in the construction image, and obtain a set of construction entity detection results: in, This represents the set of test results for the construction entity. This indicates the number of construction entities detected. Indicates the first Boundary box parameters of each construction entity Indicates the first Category labels for each construction entity, Indicates the first The confidence level of the inspection of each construction entity; S202, The bounding box parameters are expressed as follows: in, and They represent the first The normalized coordinates of the center point of the bounding box of each construction entity relative to the width and height of the image. and These represent the normalized width and normalized height of the corresponding bounding box, respectively; S203. Based on a preset confidence threshold, the set of construction entity detection results is filtered, and detection results with a confidence level lower than the confidence threshold are removed to obtain the filtered construction entity detection results. S204. According to the order of the horizontal coordinates of the center of the bounding box corresponding to the screened construction entity detection results from small to large, the construction entities are spatially sorted, and deterministic entity identifiers are assigned according to the sorting results; among them, workers are represented by worker identifiers and sequence indexes, and construction machinery is represented by corresponding machinery category abbreviations and sequence indexes; S205. Associate the deterministic entity identifiers of each construction entity with the corresponding category labels, bounding box parameters, and detection confidence levels to form the structured detection results.
4. The method for identifying, describing, and verifying safety hazards at construction sites according to claim 3, characterized in that, S300 includes the following steps: S301. Extract the deterministic entity identifier, category label and normalized bounding box center coordinates of each construction entity from the structured detection results, generate the corresponding entity description text according to the preset entity description format, and combine them into a construction entity list according to the sorting result of the deterministic entity identifier. S302. Obtain a preset prompt template, the prompt template including a role and task instruction segment, a construction entity list segment, a safety hazard category definition segment and an output format constraint segment, fill the construction entity list into the construction entity list segment, and generate detection guidance prompt words containing construction entity category and spatial location information; S303. Set four safety hazard categories in the safety hazard category definition section: non-compliance of personal protective equipment, fall hazard, entanglement and squeezing hazard, and unsafe environment; and specify the hazard category field and hazard description field of the safety hazard description text in the output format constraint section. S304. Set a task instruction in the role and task instruction section to identify safety hazards based on the construction site image and the list of construction entities, and constrain the multimodal large model to output the hazard category and hazard description according to the preset fields through the output format constraint section, and output a preset empty hazard identifier when no safety hazard is identified.
5. The method for identifying, describing, and verifying safety hazards at construction sites according to claim 4, characterized in that, The S400 includes the following steps: S401. Input the preprocessed construction image and the detection guidance prompt into the multimodal large model, use the visual encoder of the multimodal large model to extract the visual features of the construction image, and encode the detection guidance prompt to obtain the corresponding text features; S402. Perform cross-modal alignment and fusion on the visual features and text features to obtain multimodal features that include visual information of the construction site and spatial location information of construction entities. S403. Based on the multimodal features and the safety hazard category definition in the detection guidance prompts, identify the safety hazards existing at the construction site, and determine the construction entities involved in the corresponding hazards and the spatial relationships between the entities; S404. Based on the safety hazard category, the spatial relationship of the involved entities, and the work environment information in the construction site image, the multimodal large model is used to perform autoregressive decoding to output a safety hazard description text containing the hazard category, involved entities, spatial relationship, risk cause, and rectification suggestions. The safety hazard categories include non-compliant personal protective equipment, fall hazards, entanglement and squeezing hazards, and unsafe environments. The safety hazard description text generated by the multimodal large model uses the deterministic entity identifier to represent the corresponding construction entity.
6. The method for identifying, describing, and verifying safety hazards at construction sites according to claim 5, characterized in that, Determining the risk level in S500 includes the following steps: S511. Extract the hazard category, the construction entities involved and their spatial relationships from the safety hazard description text, and obtain the category label and normalized spatial location of the corresponding construction entity from the structured detection results based on the deterministic entity identifier of the construction entity. S512. Based on the normalized spatial location of the construction entities involved, determine the normalized spatial distance between the relevant construction entities, and obtain the number of construction entities involved in the safety hazard. S513. Based on the work area information in the construction images, determine whether the safety hazard is located within the worker's work area, and use the hazard category, normalized spatial distance, number of entities involved, and whether it is located within the worker's work area as the basis for risk level determination. S514. According to the preset risk assessment rules, the safety hazards are classified into risk levels, resulting in low risk, medium risk or high risk levels, and the risk levels are associated with the corresponding safety hazard description text.
7. The method for identifying, describing, and verifying safety hazards at construction sites according to claim 1, characterized in that, The consistency verification of the safety hazard description text in S500 includes the following steps: S521. Obtain the construction entity category labels from the structured inspection results, and determine the corresponding candidate hazard category set based on the construction entity category labels and the preset candidate hazard category association relationship. ; S522. Parse the safety hazard description text generated by the multimodal large model, extract the hazard categories, and form a set of hazard categories output by the large model. ; As an optional implementation, the category overlap is calculated using the intersection-union ratio (IUGR) method, which is the ratio of the number of categories contained in the intersection of the large model output hazard category set and the candidate hazard category set to the number of categories contained in their union. The calculation relationship is as follows: The above calculation method can reflect the situation where the large model misses the corresponding hidden danger category in the candidate hidden danger category set, and can also penalize the large model for outputting redundant hidden danger categories outside the candidate hidden danger category set; when the hidden danger category set output by the large model is completely consistent with the candidate hidden danger category set, the category overlap value is 1. In another alternative implementation, the category overlap can also be calculated using the number of categories in the candidate hazard category set as the denominator: S523, in the set of candidate hazard categories When the set of candidate hazard categories is not empty, the overlap between the candidate hazard category set and the output hazard category set of the large model is determined, and the calculation relationship is as follows: in, Indicates the degree of category overlap. This represents the number of categories contained in the intersection of the large model's output hazard category set and the candidate hazard category set. This indicates the number of categories in the candidate hazard category set; S524. Compare the category overlap with a preset consistency threshold. When the category overlap is lower than the consistency threshold, mark the corresponding security risk description text as a low confidence description and generate a consistency warning label. S525. Associate the consistency warning identifier with the corresponding security hazard description text and structured detection results as the consistency verification result in the security hazard detection and description report.
8. The method for identifying, describing, and verifying safety hazards at construction sites according to claim 7, characterized in that, The S500 performs semantic quality assessment and generates a security vulnerability detection and description report, including the following steps: S531. Obtain the safety hazard description text and its corresponding reference description text. Use the BERTScore semantic similarity evaluation index based on a pre-trained language model to determine the semantic precision and semantic recall between the safety hazard description text and the reference description text. Calculate the semantic precision and semantic recall based on the semantic precision and semantic recall. Fractions, their calculation relationship is as follows: in, Indicates semantic precision. Indicates semantic recall. Semantics Fraction; S532. Based on the safety hazard description text, risk level, semantic quality assessment results and consistency verification results, generate a safety hazard detection and description report. The report includes the hazard category, the definite entity identifier of the involved entity, the hazard description, the risk level, rectification suggestions and consistency warning identifier. S533. Based on the deterministic entity identifier, obtain the bounding box parameters of the corresponding construction entity, and associate the relevant hazard information in the safety hazard detection and description report with the corresponding spatial location in the construction image; S534. Display the construction image, construction entity detection box, hidden danger description text, risk level and rectification suggestions on the user interface, and display the corresponding consistency warning mark according to the consistency verification result.
9. A system for identifying, describing, and verifying safety hazards at construction sites, characterized in that, include: The image acquisition and preprocessing module is used to acquire images of the construction site, preprocess the images of the construction site, and obtain preprocessed construction images. An entity detection module is connected to the image acquisition and preprocessing module. The entity detection module includes a lightweight target detection model, which is used to identify construction entities in the construction image, obtain the category label, bounding box parameters and detection confidence of each construction entity, and obtain structured detection results through confidence filtering, spatial sorting and label allocation. The prompt construction module, connected to the entity detection module, is used to generate a list of construction entities based on the structured detection results, and combine the list of construction entities with preset role task instructions, safety hazard category definitions and output format constraints to generate detection guidance prompts; The hazard description module is connected to the image acquisition and preprocessing module and the prompt construction module respectively. The hazard description module includes a multimodal large model, which is used to perform multimodal reasoning based on the preprocessed construction image and the detection guidance prompt words to generate a safety hazard description text that includes the hazard category, the spatial relationship of the entities involved, the risk cause and the rectification suggestions. The assessment and verification module is connected to the entity detection module and the hazard description module respectively. It is used to perform consistency verification on the safety hazard description text based on the structured detection results, and to perform semantic quality assessment on the safety hazard description text. It determines the risk level by combining the hazard category, the spatial relationship of the entities involved and the preset risk judgment rules, and generates a safety hazard detection and description report containing the hazard category, risk level, rectification suggestions and consistency verification results. The visualization output module, connected to the evaluation and verification module, is used to associate the safety hazard detection and description report with the spatial location of the corresponding construction entity in the construction image, and to display the safety hazard detection and description report and the corresponding construction entity detection results in the user interface.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the construction site safety hazard identification, description, and verification method according to any one of claims 1 to 8.
