A safety helmet wearing early warning method and device based on image recognition and a medium

By generating structured monitoring data, detecting the head and shoulder area, constructing a semantic contradiction matrix for helmet wearing, and performing temporal prediction modeling, this method solves the problem of insufficient temporal semantic reasoning in existing technologies for helmet wearing detection. It enables risk prediction and early warning of helmet wearing behavior, improving the practicality and foresight of safety management.

CN122223640APending Publication Date: 2026-06-16JIANGSU HANDUN SECURITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU HANDUN SECURITY TECH CO LTD
Filing Date
2026-02-28
Publication Date
2026-06-16

Smart Images

  • Figure CN122223640A_ABST
    Figure CN122223640A_ABST
Patent Text Reader

Abstract

The application discloses a safety helmet wearing early warning method and device based on image recognition, and a medium, and relates to the technical field of image recognition.The method comprises the following steps: constructing a wearing semantic contradiction matrix according to wearing semantic features, performing conflict resolution and reasoning decision on the wearing semantic contradiction matrix, outputting a frame-level wearing state sequence, utilizing a multi-target tracking algorithm to perform cross-frame association on a head image sequence, and generating a personnel tracking trajectory; performing time sequence semantic connection processing on the personnel tracking trajectory and the frame-level wearing state sequence, generating a time sequence wearing state trajectory, performing trend analysis and abnormal fluctuation detection on the time sequence wearing state trajectory, and generating a behavior risk index sequence; and performing time sequence prediction modeling and behavior semantic aggregation processing on the behavior risk index sequence, and outputting an early warning level plan and a corresponding early warning event report.The application improves the foresight and practicality of safety management through wearing semantic analysis based on image recognition and time sequence prediction modeling based on behavior risk evolution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to a method, device and medium for providing early warning of helmet wearing based on image recognition. Background Technology

[0002] In high-risk work scenarios such as mining, construction, and smart factories, safety helmets, as a crucial component of head protection equipment, directly impact the probability of accidents due to their compliance with wearing regulations. Early safety helmet wearing detection technologies relied primarily on manual inspections, spot checks, and video playback, which suffered from low efficiency, significant delays, and insufficient coverage, failing to meet the real-time monitoring needs of high-density, complex, and dynamic work environments. With the development of image recognition and target detection methods, traditional machine vision-based color detection, shape detection, and background segmentation methods have gradually been applied to safety helmet detection. However, limitations imposed by factors such as lighting variations, complex occlusions, workwear color interference, and camera angle changes have led to the recent development of deep learning-based image recognition, target detection, instance segmentation, keypoint detection, multi-target tracking, behavior recognition, and multimodal fusion technologies. These technologies are gradually being implemented in industrial settings, providing higher-precision detection capabilities for safety helmet wearing identification.

[0003] However, existing technologies still have some shortcomings. Existing methods focus on static frame-level detection output, and their recognition logic is usually based on single-frame image classification or detection, lacking semantic reasoning capabilities oriented towards the time dimension. This makes it impossible to identify dangerous behavior patterns such as "short-term removal and wearing - repeated removal and wearing - continuous non-wearing," and also impossible to classify risk levels based on the dynamic evolution trend of behavior. This results in the lag and lack of continuity in the early warning logic. Existing methods usually take the detection result as the endpoint, without having mechanisms for semantic conflict resolution, temporal alignment, multi-target tracking and association, and behavioral risk modeling of the detection result. Therefore, they lack stable response capabilities to problems such as occlusion, personnel crossing, and camera perspective switching in complex construction scenarios. At the same time, existing solutions lack the semantic explanation path of "wearing behavior - temporal evolution - risk output," and cannot form a behavioral semantic chain that can be used for post-event traceability, making it difficult for intelligent safety supervision to achieve closed-loop management from identifying violations to predicting risks. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides an image recognition-based helmet wearing early warning method to solve the problem of being unable to perform temporal semantic reasoning and risk evolution prediction on helmet wearing behavior.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a safety helmet wearing early warning method based on image recognition, comprising: acquiring monitoring image data and corresponding scene parameters, and performing image quality assessment to generate structured monitoring data; detecting workers in the structured monitoring data and locating the head and shoulder areas, outputting a head image sequence, and extracting wearing semantic features from the head image sequence; constructing a wearing semantic contradiction matrix based on the wearing semantic features, and performing conflict resolution and reasoning adjudication on the wearing semantic contradiction matrix to output a frame-level wearing state sequence; using a multi-target tracking algorithm to perform cross-frame association on the head image sequence to generate a personnel tracking trajectory; performing temporal semantic connection processing on the personnel tracking trajectory and the frame-level wearing state sequence to generate a temporal wearing state trajectory; performing trend analysis and abnormal fluctuation detection on the temporal wearing state trajectory to generate a behavioral risk index sequence; performing temporal prediction modeling and behavioral semantic convergence processing on the behavioral risk index sequence to output an early warning level plan and a corresponding early warning event report.

[0007] As a preferred embodiment of the image recognition-based helmet wearing warning method of the present invention, the specific steps for generating structured monitoring data are as follows: Extract the light intensity, occlusion ratio and camera terminal posture information from the scene parameters, and encapsulate them together with the monitoring image data to form a time-series related data pair; Analyze the pixel brightness, local contrast, edge sharpness, and foreground occlusion of time-series correlated data pairs and perform quality annotation to generate structured monitoring data.

[0008] As a preferred embodiment of the image recognition-based helmet wearing warning method of the present invention, the specific steps for extracting the wearing semantic features of the head image sequence are as follows: By statistically analyzing the pixel-level texture gradient, human contour boundary, and pose key point distribution of structured monitoring data, target region segmentation is performed on the structured monitoring data, and head image sequence is output. By analyzing the geometric proportions and spatial gradient distribution of the head and shoulder regions in the head image sequence, the head image sequence is divided into the cap region and the lower region. The existence characteristics of the hat body are obtained by statistically analyzing the proportion of hue intervals, edge gradient distribution, and contour closure of the hat body region. Perform texture consistency detection, occlusion boundary recognition, and foreground region annotation on the lower region to obtain tether state features; The existence features of the hat body and the status features of the ties are structurally integrated to generate wearing semantic features.

[0009] As a preferred embodiment of the image recognition-based helmet wearing warning method of the present invention, the specific steps for outputting the frame-level wearing state sequence are as follows: By calculating the feature collaboration index of wearing semantic features, the co-occurrence relationship and mutual exclusion relationship between wearing semantic features are determined, and a set of semantic constraints is generated. Using the semantic features of wearing as semantic nodes, and the statistics of co-occurrence and mutual exclusion relationships in the set of semantic constraints as edge weights, a semantic contradiction matrix of wearing is constructed. The types and locations of conflicts in the semantic contradiction matrix are statistically analyzed to form a semantic conflict set. Calculate the semantic confidence of the wearing semantic features, and perform conflict resolution processing in combination with the semantic conflict set to output a frame-level wearing state sequence.

[0010] As a preferred embodiment of the image recognition-based helmet wearing warning method of the present invention, the step of using a multi-target tracking algorithm to perform cross-frame correlation on the head image sequence to generate a personnel tracking trajectory includes the following specific steps. The sequence of header images is traversed frame by frame to obtain the spatial boundary position and regional pixel color distribution of the header image in each frame, and then encapsulated to form the corresponding frame-level header instance. The boundary gradient distribution, spatial overlap, and position offset of frame-level header instances in adjacent frames are statistically analyzed to form candidate matching information; Perform appearance consistency comparison and motion continuity comparison on the candidate matching information to form a matching confidence set; Based on the matching confidence set, cross-frame association decisions and temporal splicing are performed on frame-level header instances to form personnel tracking trajectories.

[0011] As a preferred embodiment of the image recognition-based helmet wearing warning method of the present invention, the specific steps for generating the time-series helmet wearing state trajectory are as follows: Record the spatial location and corresponding time number of the personnel's tracking trajectory in each time frame, and retrieve the wearing status of the corresponding time number in the frame-level wearing status sequence, and mark the time frame that fails to be retrieved as a blank state to form a wearing association sequence; By performing temporal consistency analysis on the length of the wearing-related sequence, the number of state changes, and the time distribution of the blank state, a temporal wearing state trajectory is generated.

[0012] As a preferred embodiment of the image recognition-based helmet wearing warning method of the present invention, the specific steps for generating the behavioral risk index sequence are as follows: Based on the state type and duration of the time-series wearing state trajectory, the time-series wearing state trajectory is divided into a stable and continuous segment and a short-term fluctuating segment; Anomaly offset analysis is performed on the duration and frequency of short-term fluctuation segments and the time interval between them and adjacent stable and persistent segments to identify anomalous fluctuation segments. Analyze the density, duration, and percentage of blank states of abnormal fluctuation segments to generate a behavioral risk index sequence.

[0013] As a preferred embodiment of the image recognition-based helmet wearing warning method of the present invention, the specific steps for outputting the warning level plan and the corresponding warning event report are as follows: Extract the risk upward trend, risk fluctuation amplitude, and risk duration of the behavioral risk index sequence in chronological order to form risk evolution characteristics; The risk evolution characteristics are compared using short-term and long-term time series analysis to identify risk escalation points, risk peak positions, and risk decay intervals, thereby forming a risk prediction sequence. By statistically analyzing the changes in risk intensity in the risk prediction sequence, the risk prediction sequence is divided into high-risk, medium-risk, and low-risk stages. Stage attributes are then assigned to form an early warning level plan and corresponding early warning event reports.

[0014] In a second aspect, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the image recognition-based helmet wearing warning method described in the first aspect of the present invention.

[0015] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the image recognition-based helmet wearing warning method described in the first aspect of the present invention.

[0016] The beneficial effects of this invention are as follows: By using image recognition-based semantic parsing of helmet wearing status, logical consistency reasoning of helmet wearing status is achieved, enabling the device to output reliable frame-level wearing status in complex environments with occlusion, changing viewpoints, and lighting interference; Simultaneously, based on temporal prediction modeling of behavioral risk evolution, image recognition results are mapped to behavioral risk indices and warning levels are output, achieving predictive identification of behavioral patterns and improving the foresight and practicality of safety management. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart for an image recognition-based helmet wearing warning method.

[0019] Figure 2 A flowchart for generating structured monitoring data.

[0020] Figure 3 This is a flowchart for extracting the wearing semantic features of head image sequences.

[0021] Figure 4 A flowchart for generating a behavioral risk index sequence and corresponding early warning event reports. Detailed Implementation

[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0024] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0025] Reference Figures 1-4 This is one embodiment of the present invention, which provides a helmet-wearing warning method based on image recognition, including the following steps: S1. Collect monitoring image data and corresponding scene parameters, perform image quality assessment, and generate structured monitoring data.

[0026] S1.1 Extract the light intensity, occlusion ratio and camera terminal posture information from the scene parameters, and encapsulate them together with the monitoring image data to form a time-series related data pair.

[0027] It should be noted that the monitoring image data consists of continuous video image frames captured in real time by camera terminals deployed in the work area to be monitored. These frames include pixel array information representing the scene content and corresponding shooting time information. The camera terminals are fixedly deployed high-definition network cameras, PTZ cameras, or embedded edge devices with video capture capabilities. Scene parameters include illumination intensity parameters, occlusion ratio parameters, and camera terminal attitude parameters. Illumination intensity parameters represent the brightness distribution of the incident light field in the work area, occlusion ratio parameters represent the occlusion of foreground objects within the visible range of the scene, and camera terminal attitude parameters represent the spatial attitude changes of the camera terminal. Illumination intensity parameters can be measured using the photosensitive element of the camera terminal, occlusion ratio parameters can be extracted from the foreground region of the video image, and camera terminal attitude parameters can be measured using an inertial measurement unit.

[0028] The illumination intensity parameter, occlusion ratio parameter, and camera terminal posture parameter are extracted from the scene parameters and encapsulated together with the monitoring image data according to the principle of time consistency. This establishes a one-to-one correspondence between the monitoring image data and the scene parameters at the corresponding acquisition time, forming a time-series associated data pair containing image content parameters and acquisition condition parameters.

[0029] It should also be noted that the foreground area refers to the pixel area in the scene that is close to the camera terminal or obscures the subject, while the background area refers to the pixel area in the scene that is far away from the camera terminal and is not obscured.

[0030] S1.2 Analyze the pixel brightness, local contrast, edge sharpness and foreground occlusion of time-series correlated data pairs and perform quality annotation to generate structured monitoring data.

[0031] It should be noted that pixel brightness features representing the overall brightness level are generated by measuring the distribution of pixel brightness in the image space of the monitoring image data; local contrast features representing the level of detail are generated by measuring the grayscale variation range in the monitoring image data; edge sharpness features representing the sharpness of contours are generated by measuring the grayscale transition amplitude near the contour positions in the monitoring image data; and foreground occupancy features representing the field of view occupancy are generated by measuring the proportion of foreground and background areas in the monitoring image data. The pixel brightness features, local contrast features, edge sharpness features, and foreground occupancy features are combined to form an image quality feature set. The availability level of the monitoring image data is determined by comparing the correspondence between the image quality feature set and the illumination intensity parameter, the occupancy ratio parameter, and the camera terminal posture parameter. A quality level identifier is generated for each time-series associated data pair based on the availability level. The monitoring image data, illumination intensity parameter, occupancy ratio parameter, camera terminal posture parameter, and quality level identifier are encapsulated in a unified data format to generate structured monitoring data.

[0032] It should also be noted that the availability level is used to indicate the strength of the recognition reliability of the surveillance image data, including high availability level, medium availability level and low availability level. The high availability level is used to indicate that the surveillance image data has image features and scene conditions suitable for head area localization and wearing semantic recognition. The medium availability level is used to indicate that the surveillance image data has some recognition conditions but there are slight adverse factors in image quality or acquisition conditions. The low availability level is used to indicate that the surveillance image data does not have the conditions to be used to perform wearing semantic recognition.

[0033] Image quality feature set is used to describe the image content quality of surveillance image data. Illumination intensity parameter, occlusion ratio parameter, and camera terminal posture parameter are used to describe the acquisition condition quality of surveillance image data. By comparing the matching of image content quality and acquisition condition quality in performing head region localization and wearable semantic recognition tasks, a level determination criterion is generated. When both image content quality and acquisition condition quality meet the matching conditions suitable for performing head region localization and wearable semantic recognition tasks, a high availability level is generated from the level determination criterion. When either image content quality or acquisition condition quality deviates slightly from the matching conditions for performing head region localization and wearable semantic recognition tasks, a medium availability level is generated from the level determination criterion. When both image content quality and acquisition condition quality deviate significantly from the matching conditions for performing head region localization and wearable semantic recognition tasks, a low availability level is generated from the level determination criterion. Slight deviation corresponds to interference that only causes a decrease in the visibility of local features but does not affect the extraction of wearable semantic features. Significant deviation corresponds to interference that results in missing features or the inability to form effective wearable semantic features.

[0034] S2. Detect workers in structured monitoring data and locate the head and shoulder area, output head image sequence, and extract the wearing semantic features of the head image sequence.

[0035] S2.1 By statistically analyzing the pixel-level texture gradient, human contour boundary, and pose key point distribution of the structured monitoring data, target region segmentation is performed on the structured monitoring data, and head image sequence is output.

[0036] It should be noted that by measuring the variation of pixel grayscale in the spatial direction of the monitoring image data in the structured monitoring data, pixel-level texture gradients are obtained. The contour lines with grayscale transitions in the monitoring image data are used as contour boundary information to describe the range of human body contours. The geometric features of the shoulder, neck and top of the head are identified in the monitoring image data as the distribution of posture key points. The spatial envelope region formed by the contour boundary information and the distribution of posture key points is used as the basis for target region extraction. The target region image containing the human head and shoulder regions is cropped from the monitoring image data through image recognition and combined in chronological order to form a head image sequence.

[0037] S2.2 By analyzing the geometric proportions and spatial gradient distribution of the head and shoulder regions in the head image sequence, the head image sequence is divided into the cap region and the lower region.

[0038] It should be noted that, within each frame of the head image sequence, pixel intensity changes are sampled along the horizontal direction to obtain the pixel difference between adjacent horizontal sampling points, generating a horizontal pixel gradient; simultaneously, within each frame of the head image sequence, pixel intensity changes are sampled along the vertical direction to obtain the pixel difference between adjacent vertical sampling points, generating a vertical pixel gradient; the horizontal and vertical pixel gradients are fused according to their positional correspondence to generate a spatial gradient distribution representing the spatial distribution of the head contour; based on the pattern that the spatial gradient distribution exhibits intensity convergence in the upper region and intensity expansion in the lower region, the position of the width change of the spatial gradient distribution is detected, thereby locating the vertical boundary position representing the hat area and the lower region, and the head image sequence is divided into the upper hat area and the lower region based on the vertical boundary position.

[0039] S2.3. Statistically analyze the proportion of hue intervals, edge gradient distribution, and contour closure of the hat body area to obtain the existence characteristics of the hat body.

[0040] It should be noted that color sampling is performed along the horizontal and vertical directions within the hat body area at fixed pixel intervals (e.g., 4 to 8 pixels). Hue values ​​representing color information are read, and the frequency of occurrence of hue values ​​in different hue intervals is counted. The ratio of the frequency of occurrence to the total number of sampling points is used as the hue interval proportion. By detecting the pixel intensity differences representing edge changes along the hat body boundary direction within the hat body area, the continuous pixel intensity differences are accumulated into an edge gradient distribution representing the edge sharpness. By following the edge gradient distribution, closed or nearly closed boundary curves are identified, and the continuity and closure of the curves are measured to generate the contour closure. The hue interval proportion, edge gradient distribution, and contour closure are collectively encapsulated as the hat body existence feature.

[0041] It should also be noted that hue is the angular attribute of a color on the color wheel, used to distinguish categories such as red, yellow, green, and blue. Hue range is a range of color categories divided in the color space, used to statistically analyze color bias trends.

[0042] S2.4 Perform texture consistency detection, occlusion boundary recognition and foreground region annotation on the lower region to obtain tether state features.

[0043] It should be noted that a grayscale image representing brightness distribution is generated by performing grayscale transformation on pixel values ​​representing pixel color in the lower region. Pixel neighborhoods representing local neighborhood relationships are selected in the grayscale image, and the difference between grayscale values ​​within the neighborhood and the grayscale value at the neighborhood center is statistically analyzed to generate a local grayscale difference set. By statistically analyzing the amplitude of local grayscale differences in the local grayscale difference set, a texture consistency index describing the smoothness of local textures is generated. Simultaneously, the locations of intensity abrupt changes in the grayscale image are detected and the corresponding continuous distributions are recorded to generate an occlusion boundary set describing the contour of occluded objects. Pixels representing the foreground region are marked within the neighborhood of the occlusion boundary set, and the area ratio of the foreground region in the lower region is used as the foreground coverage ratio. The texture consistency index, the occlusion boundary set, and the foreground coverage ratio are combined as the criterion to determine whether a tethered structure with continuous banded texture and partial visibility exists in the lower region. The combination relationship between the existence of the banded structure and the foreground coverage ratio is encapsulated as a tethered state feature.

[0044] S2.5. The existence features of the hat body and the status features of the ties are structurally integrated to generate wearing semantic features.

[0045] It should be noted that the existence characteristics of the hat body and the state characteristics of the ties are labeled as hat body semantic attributes and ties semantic attributes respectively according to the semantic attribute categories. The hat body semantic attributes and ties semantic attributes are combined to form a unified key-value structure of wearing semantic features.

[0046] It should also be noted that semantic attribute categories are used to represent the semantic dimensions that can be distinguished in visual analysis of the target object. For example, the semantic dimension used to represent the presence of the protective component above the head and the semantic dimension used to represent the presence and visibility of the connecting structure below the head; different semantic attribute categories are used to distinguish different semantic description objects and description content.

[0047] S3. Construct a semantic contradiction matrix based on the semantic features of wearing, and perform conflict resolution and reasoning adjudication on the semantic contradiction matrix of wearing, output a frame-level wearing state sequence, and use a multi-target tracking algorithm to perform cross-frame association on the head image sequence to generate a person tracking trajectory.

[0048] S3.1 By calculating the feature collaboration index of wearing semantic features, the co-occurrence relationship and mutual exclusion relationship between wearing semantic features are determined, and a semantic constraint set is generated.

[0049] The expression for calculating the feature synergy index is: ; in, Indicates semantic features of wearing and wearing semantic features The feature coordination index between them represents the total number of time dimensions. Indicates semantic features of wearing In the The values ​​for each time dimension, Indicates semantic features of wearing In the The values ​​for each time dimension, This represents a numerically stable term, used to avoid positive biases with a denominator of zero (such as 0.0000001).

[0050] It should be noted that after obtaining the feature synergy index, the distribution pattern of the synergy index of different combinations of wearing semantic features is measured in the time dimension to identify the concentrated and sparse regions in the distribution of synergy index. The wearing semantic feature combinations in the concentrated region are labeled as co-occurrence relationships, and the wearing semantic feature combinations in the sparse region are labeled as mutual exclusion relationships. The concentrated region represents attribute combinations that show a stable joint occurrence trend in the time dimension, and the sparse region represents attribute combinations that show a low-frequency joint occurrence trend in the time dimension. The concentrated region and the sparse region are labeled with relationships and integrated to form a semantic constraint set.

[0051] S3.2. Using the semantic features of wearing as semantic nodes, and the statistical values ​​of co-occurrence and mutual exclusion relationships in the semantic constraint set as edge weights, construct the semantic contradiction matrix of wearing.

[0052] It should be noted that the co-occurrence and mutual exclusion counts among all wearing semantic features in the statistical semantic constraint set, forming co-occurrence and mutual exclusion statistics, are obtained by registering each wearing semantic feature as a semantic node and establishing co-occurrence edges to represent the degree of semantic cooperation and mutual exclusion edges to represent the degree of semantic conflict between semantic nodes. By attaching co-occurrence statistics to the co-occurrence edges and mutual exclusion statistics to the mutual exclusion edges, a weighted semantic relation structure is formed. Each semantic node in the weighted semantic relation structure has a unique co-occurrence and mutual exclusion statistics. By arranging the co-occurrence and mutual exclusion statistics among all semantic nodes in the weighted semantic relation structure in a fixed node order, a wearing semantic conflict matrix is ​​formed.

[0053] S3.3. Statistically analyze the conflict types and locations in the semantic contradiction matrix to form a semantic conflict set.

[0054] It should be noted that by traversing the co-occurrence statistics and mutual exclusion statistics recorded in the semantic conflict matrix, matrix grids with mutual exclusion statistics greater than zero and co-occurrence statistics equal to zero are identified and labeled as mutual exclusion conflict types, matrix grids with co-occurrence statistics greater than zero and mutual exclusion statistics equal to zero are identified and labeled as co-occurrence conflict types, the matrix row index and matrix column index positions corresponding to mutual exclusion conflict types and co-occurrence conflict types are recorded, and encapsulated into a semantic conflict set containing conflict type information and conflict position index.

[0055] S3.4 Calculate the semantic confidence of the wearing semantic features, and perform conflict resolution processing in combination with the semantic conflict set to output the frame-level wearing state sequence.

[0056] The expression for calculating the semantic confidence of wearing semantic features is as follows: ; in, Indicates semantic features of wearing semantic confidence, This represents the total amount of semantic features associated with wearing the garment. This represents the semantic contradiction matrix related to the semantic feature number of wearing. and wearing semantic feature number The corresponding co-occurrence statistic, This represents the semantic contradiction matrix related to the semantic feature number of wearing. and wearing semantic feature number The corresponding mutual exclusion statistics.

[0057] It should be noted that after obtaining the semantic confidence of the wearing semantic features, the wearing semantic feature combination corresponding to each conflict type and conflict position index is read from the semantic conflict set, and the semantic confidence of the wearing semantic features in the wearing semantic feature combination is compared. The wearing semantic features with larger semantic confidence values ​​are retained, and the wearing semantic features with smaller semantic confidence values ​​are marked as invalid, forming a semantically valid set. The wearing semantic feature combination in the semantically valid set is mapped to a status identifier used to represent the helmet wearing status. The status identifier includes normal wearing status, non-standard wearing status, and no wearing status. The frame-level wearing status sequence is formed by arranging the status identifiers of all time records in chronological order.

[0058] S3.5. Traverse the header image sequence frame by frame, obtain the spatial boundary position and regional pixel color distribution of the header image in each frame, and encapsulate them to form the corresponding frame-level header instance.

[0059] It should be noted that each frame of the head image sequence is traversed in chronological order. The spatial boundary position parameters representing the spatial occupancy of the head image are determined by reading the row and column index range of the head image in the pixel coordinate plane. Within the pixel range defined by the spatial boundary position parameters, the pixel distribution of each color channel is statistically analyzed according to the color channel to generate the regional pixel color distribution representing the color composition characteristics of the head region. The spatial boundary position parameters and the regional pixel color distribution are encapsulated in a unified data format to form a frame-level head instance.

[0060] S3.6. Calculate the boundary gradient distribution, spatial overlap relationship and position offset of the frame-level header instances of adjacent frames respectively to form candidate matching information.

[0061] It should be noted that by performing pixel-by-pixel row and column difference processing on the spatial boundary position parameters of each pair of frame-level head instances in adjacent frames, the boundary gradient distribution used to represent the edge change trend is extracted. By measuring the two-dimensional overlap area measure of the spatial boundary position parameters of each frame-level head instance in adjacent frames, the spatial overlap relationship is obtained. By performing center point coordinate offset measurement processing on the spatial boundary position parameters of each frame-level head instance in adjacent frames, the displacement offset used to represent the head region movement trend is extracted. The boundary gradient distribution, spatial overlap relationship and position offset are encapsulated into candidate matching information in chronological order and the correspondence with adjacent time frames is maintained.

[0062] S3.7 Perform appearance consistency comparison and motion continuity comparison on the candidate matching information to form a matching confidence set.

[0063] It should be noted that, according to the color channel, the regional pixel color distribution in the frame-level header instance of adjacent frames is extracted as an appearance consistency index. The position offset in the candidate matching information is continuously differentially processed in chronological order, and the smoothness of the offset change is analyzed. The motion continuity index is extracted, and the appearance consistency index and motion continuity index are weighted and fused to form a matching confidence score while maintaining the correspondence with the adjacent frames of the candidate matching information. All matching confidence scores are combined in chronological order to form a matching confidence score set.

[0064] S3.8. Based on the matching confidence set, perform cross-frame association decision and temporal splicing on the frame-level header instance to form the personnel tracking trajectory.

[0065] It should be noted that, according to the matching confidence values ​​in the matching confidence set, the frame-level header instances of the current time frame are sorted by matching priority. In the sorting results, frame-level header instances are selected in descending order of matching confidence values ​​to obtain a sequence of frame-level header instances arranged in chronological order. The spatial boundary position parameters of the frame-level header instance sequence are combined in chronological order to form the personnel tracking trajectory.

[0066] S4. Perform temporal semantic connection processing on the personnel tracking trajectory and the frame-level wearing status sequence to generate a temporal wearing status trajectory. Perform trend analysis and abnormal fluctuation detection on the temporal wearing status trajectory to generate a behavioral risk index sequence.

[0067] S4.1 Record the spatial location and corresponding time number of the personnel tracking trajectory in each time frame, and retrieve the wearing status of the corresponding time number in the frame-level wearing status sequence, and mark the time frame that fails to be retrieved as a blank state, thus forming a wearing association sequence.

[0068] It should be noted that the spatial location parameters and time sequence number corresponding to each time frame are extracted from the personnel tracking trajectory, and data pairs containing spatial location parameters and time sequence numbers are generated. The corresponding wearing status identifier is retrieved in the frame-level wearing status sequence using the time sequence number as the retrieval key. If the corresponding wearing status identifier is not found, the data pair with the corresponding time sequence number is assigned a blank status identifier. All data pairs and the corresponding wearing status identifiers or blank status identifiers are encapsulated into a wearing association sequence in chronological order.

[0069] S4.2. Perform temporal consistency analysis by statistically analyzing the length of the wearing association sequence, the number of state changes, and the time distribution of the blank state, and generate a temporal wearing state trajectory.

[0070] It should be noted that the number of wearing status identifiers and blank status identifiers in the wearing association sequence is counted to obtain the wearing status duration. By comparing the changes of wearing status identifiers or blank status identifiers between adjacent time numbers, the number of status changes used to represent the frequency of wearing status changes is obtained. At the same time, by counting the occurrence positions and occurrence intervals of blank status identifiers in consecutive time numbers, the statistical results of blank time distribution are obtained. The wearing status duration, the number of status changes, and the statistical results of blank time distribution are repackaged according to the time number into a time-series wearing status trajectory containing the time number, wearing status identifiers, and corresponding behavioral statistical parameters.

[0071] S4.3 Based on the state type and duration of the time-series wearing state trajectory, the time-series wearing state trajectory is divided into a stable and continuous segment and a short-term fluctuation segment.

[0072] It should be noted that the time-series wearing status trajectory is traversed in an orderly manner according to the time sequence number. By comparing the wearing status identifiers at adjacent time sequences, continuous state segments representing the occurrence interval of the same wearing status in consecutive time sequences are extracted. The difference between the start time sequence number and the end time sequence number of the continuous state segment is used as the state duration parameter. After sorting the state duration parameters according to their numerical values, the median position is taken as the reference point. The continuous state segments corresponding to the state duration parameters greater than the reference point are marked as stable and continuous segments, and the continuous state segments corresponding to the state duration parameters less than or equal to the reference point are marked as short-term fluctuation segments.

[0073] S4.4 Perform anomaly offset analysis on the duration and frequency of short-term fluctuation segments and the time interval between them and adjacent stable and continuous segments to identify anomalous fluctuation segments.

[0074] It should be noted that the start and end time numbers of the short-term fluctuation segment are read and differential processing is performed to extract the short-term duration parameter. By statistically analyzing the number of occurrences of the short-term fluctuation segment in the timing wear state trajectory and the total time span of the timing wear state trajectory, the short-term occurrence frequency parameter is obtained. The difference between the end time number of the short-term fluctuation segment and the start time number of the adjacent stable and continuous segment is used as the cross-interval time interval parameter. Reference values ​​are extracted from the short-term duration parameter, short-term occurrence frequency parameter, and cross-interval time interval parameter of the short-term fluctuation segment. The reference values ​​are obtained by statistically analyzing the median of the short-term duration parameter set, the short-term occurrence frequency parameter set, and the cross-interval time interval parameter set. The differences between the short-term duration parameter, short-term occurrence frequency parameter, and cross-interval time interval parameter and the corresponding reference values ​​are obtained to generate duration deviation, occurrence frequency deviation, and cross-interval deviation. By detecting cases where at least two of the duration deviation, occurrence frequency deviation, and cross-interval deviation are higher than the corresponding reference values ​​in each short-term fluctuation segment, the corresponding short-term fluctuation segment is marked as an abnormal fluctuation segment.

[0075] S4.5 Analyze the density, duration and proportion of blank states of abnormal fluctuation segments to generate a behavioral risk index sequence.

[0076] It should be noted that the time intervals between abnormal fluctuation segments are extracted in chronological order, and the time intervals and the number of abnormal fluctuation segments are combined to form a density value. The time span parameter of the abnormal fluctuation segments is subjected to span accumulation processing to obtain the duration value used to represent the abnormal persistence characteristics. At the same time, the ratio of the duration of the blank state to the duration of the normal state in the time-series wearing state trajectory is used as the blank proportion value. The density value, duration value and blank proportion value are encapsulated into a behavioral risk index sequence in chronological order.

[0077] S5. Perform time-series prediction modeling and behavioral semantic aggregation processing on the behavioral risk index sequence, and output the early warning level plan and corresponding early warning event report.

[0078] S5.1 Extract the risk upward trend, risk fluctuation range and risk duration of the behavioral risk index sequence in chronological order to form risk evolution characteristics.

[0079] It should be noted that the behavioral risk index sequence is traversed in chronological order. The difference between the risk index values ​​at adjacent time positions in the behavioral risk index sequence is used as the trend change. The magnitude of the difference between the risk index values ​​at adjacent time positions is extracted to form the volatility. By performing time span accumulation processing on the time positions where the risk index values ​​are continuously maintained within the same risk level range, the duration of the risk is extracted to represent the persistence characteristics of the risk. The trend change, volatility, and duration are encapsulated in chronological order as risk evolution characteristics.

[0080] S5.2 Perform time series comparison processing of short-cycle and long-cycle risk evolution characteristics to identify risk rise nodes, risk peak positions and risk decay intervals, and form a risk prediction sequence.

[0081] It should be noted that the time point when the trend change changes from a non-positive value to a positive value within a short-term time window is identified as the risk rise node. The time point when the volatility reaches its maximum value within a long-term time range is identified as the risk peak position. The continuous time segment where the trend change changes from a positive value to a non-positive value and persists after the risk peak position is identified as the risk decay interval. The risk rise node, risk peak position, and risk decay interval are encapsulated into a risk prediction sequence in chronological order.

[0082] It should also be noted that the behavioral risk index sequence is composed of continuous time positions. The time interval between different time positions has a fixed collection period, which is determined by the collection period of the monitoring image data. Therefore, the minimum time span composed of multiple continuous time positions is used to represent the local change range of risk evolution. The set of time positions corresponding to the minimum time span constitutes a short-cycle time window.

[0083] The behavioral risk index sequence covers the entire time range from the starting time of the risk index generation to the current latest time. The entire range is used to characterize the overall trend of risk evolution and constitutes a long-term time range.

[0084] S5.3. By statistically analyzing the changes in risk intensity of the risk prediction sequence, the risk prediction sequence is divided into high-risk, medium-risk, and low-risk stages, and stage attribute values ​​are assigned to form an early warning level plan and corresponding early warning event reports.

[0085] It should be noted that the risk intensity parameters at each time point in the statistical risk prediction sequence are used. Based on the median, quartile, and extreme value intervals of the risk intensity parameters, the risk prediction sequence is segmented. Time points where the risk intensity parameters fall within the upper quartile of the statistical distribution are classified as high-risk stages, those within the middle quartile are classified as medium-risk stages, and those within the lower quartile are classified as low-risk stages. Stage attribute assignment is performed for each stage, including assigning values ​​to risk duration, risk change trend, and risk-related behavioral event attributes. This ensures that high-risk, medium-risk, and low-risk stages have time and risk attributes that can be used for behavioral semantic interpretation. Based on the stage attribute assignment results, each stage is chronologically organized and packaged into a warning level plan. Simultaneously, the risk-related behavioral event information recorded in the high-risk, medium-risk, and low-risk stages is aggregated and packaged to form a warning event report for behavioral tracing and warning output.

[0086] It should also be noted that the risk intensity parameter is derived from the risk evolution characteristics corresponding to each time position in the risk prediction sequence. In the process of forming the risk prediction sequence, the risk evolution characteristics retain quantitative values ​​that reflect the degree of risk increase, the degree of risk peak, and the magnitude of risk decay. These quantitative values ​​are the risk intensity parameter.

[0087] After the risk prediction sequence is divided into risk stages, the start time and end time of each risk stage are extracted, and the difference is used as the stage duration attribute. The direction of risk intensity change within the corresponding time segment in the risk prediction sequence is extracted as the risk trend attribute. Behavioral event attributes used to describe risk-related behaviors are extracted from the set of risk-related behavioral events recorded by the time-series wearing state trajectory within the corresponding time segment. The stage duration attribute, risk trend attribute, and behavioral event attribute are bound to the corresponding risk stage, forming a risk stage attribute set containing time attributes and risk attributes. This allows the high-risk stage, medium-risk stage, and low-risk stage to have time attributes and risk attributes that can be used for behavioral semantic interpretation.

[0088] This embodiment also provides a computer device applicable to the helmet wearing warning method based on image recognition, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the helmet wearing warning method based on image recognition as proposed in the above embodiment. The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0089] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the image recognition-based helmet wearing warning method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0090] In summary, this invention achieves logical consistency reasoning of helmet wearing status through image recognition-based semantic parsing, enabling the device to output reliable frame-level wearing status in complex environments with occlusion, changing viewpoints, and lighting interference; simultaneously, it maps image recognition results to behavioral risk indices and outputs warning levels based on temporal prediction modeling of behavioral risk evolution, thereby achieving predictive identification of behavioral patterns and improving the foresight and practicality of safety management.

[0091] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A helmet-wearing warning method based on image recognition, characterized in that: include, Collect monitoring image data and corresponding scene parameters, perform image quality assessment, and generate structured monitoring data; Detect workers in structured monitoring data and locate the head and shoulder area, output head image sequence, and extract the wearing semantic features of the head image sequence; Based on the semantic features of wearing, a semantic contradiction matrix of wearing is constructed, and conflict resolution and reasoning adjudication are performed on the semantic contradiction matrix of wearing, and a frame-level wearing state sequence is output. A multi-target tracking algorithm is used to perform cross-frame correlation on the head image sequence to generate a person tracking trajectory. The personnel tracking trajectory is linked with the frame-level wearing status sequence through temporal semantic processing to generate a temporal wearing status trajectory. Trend analysis and abnormal fluctuation detection are performed on the temporal wearing status trajectory to generate a behavioral risk index sequence. The behavioral risk index sequence is subjected to time series prediction modeling and behavioral semantic aggregation processing to output early warning level plans and corresponding early warning event reports.

2. The helmet wearing warning method based on image recognition as described in claim 1, characterized in that: The specific steps for generating structured monitoring data are as follows: Extract the light intensity, occlusion ratio and camera terminal posture information from the scene parameters, and encapsulate them together with the monitoring image data to form a time-series related data pair; Analyze the pixel brightness, local contrast, edge sharpness, and foreground occlusion of time-series correlated data pairs and perform quality annotation to generate structured monitoring data.

3. The helmet wearing warning method based on image recognition as described in claim 1, characterized in that: The specific steps for extracting the wearing semantic features from the head image sequence are as follows: By statistically analyzing the pixel-level texture gradient, human contour boundary, and pose key point distribution of structured monitoring data, target region segmentation is performed on the structured monitoring data, and head image sequence is output. By analyzing the geometric proportions and spatial gradient distribution of the head and shoulder regions in the head image sequence, the head image sequence is divided into the cap region and the lower region. The existence characteristics of the hat body are obtained by statistically analyzing the proportion of hue intervals, edge gradient distribution, and contour closure of the hat body region. Perform texture consistency detection, occlusion boundary recognition, and foreground region annotation on the lower region to obtain tether state features; The existence features of the hat body and the status features of the ties are structurally integrated to generate wearing semantic features.

4. The helmet wearing warning method based on image recognition as described in claim 1, characterized in that: The specific steps for generating the output frame-level wearing state sequence are as follows: By calculating the feature collaboration index of wearing semantic features, the co-occurrence relationship and mutual exclusion relationship between wearing semantic features are determined, and a set of semantic constraints is generated. Using the semantic features of wearing as semantic nodes, and the statistics of co-occurrence and mutual exclusion relationships in the set of semantic constraints as edge weights, a semantic contradiction matrix of wearing is constructed. The types and locations of conflicts in the semantic contradiction matrix are statistically analyzed to form a semantic conflict set. Calculate the semantic confidence of the wearing semantic features, and perform conflict resolution processing in combination with the semantic conflict set to output a frame-level wearing state sequence.

5. The helmet wearing warning method based on image recognition as described in claim 1, characterized in that: The method of using a multi-target tracking algorithm to perform cross-frame correlation on head image sequences and generate personnel tracking trajectories involves the following specific steps. The sequence of header images is traversed frame by frame to obtain the spatial boundary position and regional pixel color distribution of the header image in each frame, and then encapsulated to form the corresponding frame-level header instance. The boundary gradient distribution, spatial overlap, and position offset of frame-level header instances in adjacent frames are statistically analyzed to form candidate matching information; Perform appearance consistency comparison and motion continuity comparison on the candidate matching information to form a matching confidence set; Based on the matching confidence set, cross-frame association decisions and temporal splicing are performed on frame-level header instances to form personnel tracking trajectories.

6. The helmet wearing warning method based on image recognition as described in claim 1, characterized in that: The specific steps for generating the timing-based wearing state trajectory are as follows: Record the spatial location and corresponding time number of the personnel's tracking trajectory in each time frame, and retrieve the wearing status of the corresponding time number in the frame-level wearing status sequence, and mark the time frame that fails to be retrieved as a blank state to form a wearing association sequence; By performing temporal consistency analysis on the length of the wearing-related sequence, the number of state changes, and the time distribution of the blank state, a temporal wearing state trajectory is generated.

7. The helmet wearing warning method based on image recognition as described in claim 1, characterized in that: The specific steps for generating the behavioral risk index sequence are as follows: Based on the state type and duration of the time-series wearing state trajectory, the time-series wearing state trajectory is divided into a stable and continuous segment and a short-term fluctuating segment; Anomaly offset analysis is performed on the duration and frequency of short-term fluctuation segments and the time interval between them and adjacent stable and persistent segments to identify anomalous fluctuation segments. Analyze the density, duration, and percentage of blank states of abnormal fluctuation segments to generate a behavioral risk index sequence.

8. The helmet wearing warning method based on image recognition as described in claim 1, characterized in that: The specific steps for outputting the early warning level plan and the corresponding early warning event report are as follows. Extract the risk upward trend, risk fluctuation amplitude, and risk duration of the behavioral risk index sequence in chronological order to form risk evolution characteristics; The risk evolution characteristics are compared with short-term and long-term time series processing to identify risk escalation nodes, risk peak positions and risk decay intervals, forming a risk prediction sequence; By statistically analyzing the changes in risk intensity in the risk prediction sequence, the risk prediction sequence is divided into high-risk, medium-risk, and low-risk stages. Stage attributes are then assigned to form an early warning level plan and corresponding early warning event reports.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the image recognition-based helmet wearing warning method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the image recognition-based helmet wearing warning method according to any one of claims 1 to 8.