A security discrimination method based on image recognition

By installing high-definition cameras in chemical plants, and using Gaussian mixture models and an improved YOLOv7 algorithm to automatically detect whether safety helmets are being worn and to identify their colors, the problem of detecting the absence of safety helmets and foreign object intrusion in chemical plants has been solved, achieving efficient and accurate automatic early warning.

CN116597346BActive Publication Date: 2025-11-11HEYUAN JINSHENG ELECTRIC POWER ENG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310445003.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-24
Publication Date
2025-11-11
Estimated Expiration
2043-04-24

AI Technical Summary

Technical Problem

Existing video surveillance systems are ineffective in detecting cases of people not wearing safety helmets or foreign objects entering chemical plants, resulting in high costs and a high risk of oversights in manual monitoring.

Method used

Using a high-definition camera combined with a Gaussian mixture model and an improved YOLOv7 algorithm, the system automatically detects whether workers are wearing safety helmets and identifies the color of the helmets. It then determines whether there is any foreign object intrusion based on a safety level threshold and triggers an alarm.

Benefits of technology

It achieves fully automated helmet wearing detection and foreign object intrusion identification, reducing labor costs, improving detection accuracy and timeliness, and adapting to changes in lighting conditions and small target identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116597346B_ABST
    Figure CN116597346B_ABST
Patent Text Reader

Abstract

A security discrimination method based on image recognition employs a high-definition camera to acquire real-time video streams of the target area. The real-time video stream is processed frame-by-frame into images to be detected. For each image, a Gaussian mixture model is used for background modeling and foreground detection, filtering out background interference and extracting the foreground target. The foreground target is then passed to a continuous frame detection module. If the detection result indicates no helmet is being worn, the next N consecutive frames of the image are detected. If all N frames show no helmet being worn and N is greater than or equal to a first preset value n, an alert is issued. The next M consecutive frames after the Nth frame are then detected. If all M frames show helmet being worn and M is greater than or equal to a second preset value m, the alert is terminated. Compared to traditional manual supervision, this invention significantly saves manpower and financial resources for real-time monitoring and also solves the problem of insufficient timely warnings from manual monitoring.
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 more specifically to a security discrimination method based on image recognition. Background Technology

[0002] In the normal production process of a chemical plant, safety areas are typically divided into different levels based on potential hazards. These are generally categorized into Level 1, Level 2, Level 3, and Level 4 areas according to the degree of hazard. Specifically: Level 1: Also known as a non-hazardous area, where fire, explosion, or leakage is unlikely; Level 2: Also known as a slightly hazardous area, where small amounts of hazardous substances may be present or generated during production, but are unlikely to cause major hazards such as fire, explosion, or leakage; Level 3: Also known as a moderately hazardous area, where a relatively large amount of hazardous substances may be present or generated during production, potentially leading to fire, explosion, or leakage; Level 4: Also known as a heavily hazardous area, where a large amount of hazardous substances are present or easily generated during production.

[0003] Each level of safety zone has its specific safety requirements and measures, including restrictions on the safety level requirements for safety officers entering and exiting each safety zone. For example, ordinary workers and visitors are strictly restricted from entering areas above level two. If employees in higher-level areas do not meet the requirements of that area, this situation can generally be considered a foreign object intrusion. This situation poses many risks. Regardless of the personal safety of the workers or the normal production of the chemical plant, foreign object intrusion should be warned in advance to reduce the occurrence of such dangerous accidents.

[0004] There are many technologies for preventing foreign object intrusion, including dual-grid systems, laser systems, radar, and video surveillance. Video surveillance is increasingly used in foreign object intrusion detection due to its advantages such as simple installation, low cost, and intuitive results. However, most current video surveillance systems rely on dedicated personnel to periodically check key areas for foreign object intrusion. This heavy workload for monitoring operators can easily lead to oversights, resulting in intrusions not being handled promptly and accurately. Summary of the Invention

[0005] To address the aforementioned technical problems, this technical solution provides a security discrimination method based on image recognition. This method can detect whether workers are wearing safety helmets. If someone is not wearing a helmet, an alarm will be automatically triggered, and the alarm will be automatically deactivated once the worker is wearing a helmet. Furthermore, when all personnel in the area are properly wearing helmets, the color of the helmets in the detection area can be categorized to obtain the helmet color of each person in the current video stream, thereby determining the employee's job security level. Based on preset values, the method can determine whether the current employee is experiencing a foreign object intrusion. In the event of a foreign object intrusion, the device will trigger an alarm, reducing the error rate and effectively solving the aforementioned problems.

[0006] This invention is achieved through the following technical solution:

[0007] A security discrimination method based on image recognition involves acquiring real-time video streams of a target area using a high-definition camera within a designated area. The real-time video stream is processed frame-by-frame into images to be detected. For each image, a Gaussian mixture model is used for background modeling and foreground detection, filtering out background interference and extracting the foreground target. The foreground target is then passed to a continuous frame detection module. If the detection result indicates no helmet is being worn, the next N consecutive frames of the image are detected. If all N frames show no helmet being worn and N is greater than or equal to a first preset value n, an alarm is issued. Simultaneously, an improved YOLOv7 algorithm model identifies the color of helmets worn by personnel in the video stream using a preset security level threshold parameter within the system. The system automatically determines the security level of personnel in the area based on helmet color. An alarm is issued for situations where the security level does not meet the area's requirements, achieving a warning effect and thus enabling the determination of foreign object intrusion based on the security level of personnel in the area. The specific steps are as follows:

[0008] Step 1: Install high-definition cameras in the designated area, initialize the equipment, set the corresponding security zone parameters, and manually set the personnel security level threshold for the current designated area;

[0009] Step 2: Extract the video stream of a specific area acquired by the high-definition camera frame by frame to obtain the corresponding image stream. Apply the Gaussian mixture background modeling method to the acquired image stream to separate the background and foreground.

[0010] After separating the background and foreground, continuous frame detection is performed. When the detection result of a certain frame in the video is that someone is not wearing a helmet, the next N consecutive frames of the image to be detected are detected. If the detection result is that someone is not wearing a helmet and N is greater than or equal to the first preset value n, it can be determined that there are people not wearing helmets in the video at this time.

[0011] Step 3: In cases where a safety helmet is not being worn, a command is sent directly through the embedded terminal to trigger the matching alarm device to issue an alarm, thus achieving the effect of early warning;

[0012] Step 4: Then, the next M consecutive frames after the Nth frame are detected. If the detection results show that all people are wearing safety helmets and M is greater than or equal to the second preset value m, it can be determined that all people in the video are wearing safety helmets.

[0013] Step 5: For cases where safety helmets are worn in the image stream, the YOLO anchor mechanism is used to identify the target area. The YOLO head of the YOLO v7 algorithm is used to classify the safety helmets worn in the target area according to their colors. The color of the safety helmet worn by each person in the current video stream is obtained to determine the job security level of the employee. The set threshold is used to determine whether the current employee is in a foreign object intrusion situation.

[0014] Step 6: If no foreign object intrusion is found, the current detection ends and the process returns to Step 2 for repeated detection. If foreign object intrusion is found, a command is sent directly through the embedded terminal to trigger the corresponding alarm device to issue an alarm, thus achieving the effect of early warning.

[0015] Step 7: Then, inspect the subsequent images to see if the foreign object intrusion has been eliminated; if it has not been eliminated, continue to issue an alarm; if it has been eliminated, then the current inspection is considered complete, and return to Step 2 for repeated inspection.

[0016] Furthermore, in step 1, the corresponding security zone parameters are set. These parameters include: the current area's security level restriction requirements and the security personnel's foreign object intrusion monitoring threshold. The current area's security level restriction requirements refer to the security level of the area where the camera is located. Security levels, from highest to lowest, are level 4, level 3, level 2, and level 1. The safety helmet level and color correspond as follows:

[0017] Level -> Blue hard hat -> Ordinary worker;

[0018] Leve2 -> Yellow safety helmet -> Technician;

[0019] Level 3 -> Red Safety Helmet -> Senior Technicians and Middle / Lower Management Personnel;

[0020] Leve4 -> White safety helmet -> Supervisor or client;

[0021] If the target area only allows access to administrators and above, the threshold for that target area can be set to Level 3. After setting the area threshold, load the data model trained with a large amount of test data into the system.

[0022] Furthermore, the data model trained with a large amount of test data is obtained by training a large number of pre-acquired image streams. The training steps of the data model include:

[0023] Step S1: Install cameras in each area of ​​the chemical plant with safety requirements to obtain video stream files of the chemical plant workers. Extract the video stream files frame by frame in the form of one image per second to obtain images of each area, for a total of 5000 images.

[0024] Step S2: Divide the 5000 images into a ratio of 8:1:1, and use 4000 images as the training set to train the model; use 500 images as the validation set to evaluate and adjust the algorithm model; and use 500 images as the test set to test the generalization ability of the algorithm model.

[0025] Step S3: Use the open-source Labelimg dataset annotation tool to annotate 4500 images. The annotation content is the color of the safety helmet in the image stream, namely yellow, blue, red, orange and white. After annotating the target area of ​​each image, a corresponding XML tag file will be generated. The XML tag file mainly stores information such as the file name of the corresponding image, the image name, the location of the image, the overall length, width, number of channels of the image, and the location of the marked object.

[0026] Step S4: The improved YOLO7 algorithm model is trained. The backbone network of the overall algorithm model adopts CSPDarknet53, and the network layers in the network framework are connected through CSP. Then, the YOLO7 Head network adopts an improved multi-scale feature aggregation module. This module mainly integrates the features of each layer from large to small size. Then, through the cross-feature refinement module, the features of different sizes are obtained by mapping convolution to obtain the final effective information, thereby improving the robustness of the trained algorithm model. Finally, after at least 50 algorithm iterations, the weights with the lowest loss values ​​on both the training set and the validation set are obtained. After obtaining the model algorithm weights that can accurately identify the color of the safety helmets of workers in the target area, the weights are loaded into the improved YOLO7 algorithm model to obtain the corresponding chemical plant safety helmet color detection algorithm model.

[0027] Furthermore, the specific operation method for separating the background and foreground in step 2 is as follows: before performing foreground detection, the background is trained first. A Gaussian mixture model is used to simulate each background in each frame of the image. The pixel is checked to see if it matches the Gaussian model of the background. If it matches, it is the background; if it does not match, it is the foreground.

[0028] Furthermore, the continuous frame detection described in step 2 mainly involves processing consecutive video frames to obtain dynamic change information in the video, thereby enabling various analyses and processing of the video.

[0029] Furthermore, in step 2, the video stream is extracted frame by frame, and the acquired image stream is processed using a Gaussian mixture model. The Gaussian mixture model is a model composed of K single Gaussian models, and its probability distribution is as follows:

[0030]

[0031] Where χ represents the observed data, α k α is the probability that the observed data belongs to the Kth sub-model. k ≥0, φ(x|θ k ) is the Gaussian distribution density function of the Kth sub-model, and P(X|θ) represents the distribution of sample X in the θ sub-models.

[0032] Furthermore, the specific mathematical expression of the Kth sub-model in the Gaussian mixture model is as follows:

[0033]

[0034] Wherein, φ(y|θ) k ) represents a Gaussian distribution for a single model; μ K Let σ be the expected value of the data, and σ be the standard deviation of the data. Let y be the variance of the Gaussian distribution, and y be the input variable value.

[0035] Furthermore, in step 5, the Yolo v7 uses the CIou loss function, and the mathematical formula for the CIou loss function is as follows:

[0036]

[0037] Where β is the weight parameter, v is used to measure the similarity of aspect ratio, Iou is the intersection-union ratio of the two regions, and b,b gt ρ represents the center point of the predicted bounding box and the ground truth, respectively. 2 This indicates the calculation of the Euclidean distance between two center points.

[0038] Beneficial effects

[0039] The security discrimination method based on image recognition proposed in this invention has the following advantages compared with existing technologies:

[0040] (1) This invention adopts a fully automatic approach to solve the complexity of detecting non-wearing safety helmets and foreign object intrusion in chemical plants. It mainly involves installing high-definition cameras in the target area, combined with pre-set target area safety level parameters, trained models, and embedded terminals to achieve automatic early warning. Compared with traditional manual supervision, it greatly saves manpower and financial resources for real-time monitoring. At the same time, it also solves the problem of foreign object intrusion caused by lack of concentration during real-time monitoring, which prevents timely warnings.

[0041] (2) This method employs a novel foreign object intrusion detection approach. By directly using target recognition to identify the color of a chemical plant worker's safety helmet, it determines the worker's safety level and thus whether any personnel inconsistent with the area's safety level have entered the target area. This achieves foreign object intrusion discrimination based on image recognition of chemical plant safety officer levels. Compared to traditional foreign object intrusion detection methods, this method can quickly and effectively identify foreign object intrusion situations involving safety officers of non-designated safety levels.

[0042] (3) After obtaining the video stream at the front end, this method uses a Gaussian mixture model to separate the foreground and background in the video stream. The improved YOLOv7 algorithm model is used to determine whether there is foreign object intrusion in the moving target area. An alarm can be issued in time based on the judgment. In the case of large changes in light in the chemical plant 24 hours a day, it has a better recognition effect on small targets in the target area and stronger system robustness. Attached Figure Description

[0043] Figure 1 This is a detailed flowchart of the overall method in this invention.

[0044] Figure 2 This is a schematic diagram of the basic process of image recognition in this invention.

[0045] Figure 3 This is a monitoring plan of different areas of the chemical plant in this invention.

[0046] Figure 4 This is a diagram illustrating the effect of regional foreign object intrusion detection based on security levels in this invention. The labels in the attached diagram are: 1-camera, 2-alarm device, 3-target area. Detailed Implementation

[0047] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. The described embodiments are merely some embodiments of the present invention, and not all embodiments. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the design concept of the present invention should fall within the protection scope of the present invention.

[0048] Example 1:

[0049] like Figure 1 As shown, a security discrimination method based on image recognition is proposed. A high-definition camera is used to acquire real-time video streams of a target area within a specified region. The real-time video stream is processed frame by frame into images to be detected. For each image, a Gaussian mixture model is used for background modeling and foreground detection, filtering out background interference and extracting the foreground target. The foreground target is then passed to a continuous frame detection module for processing. When the detection result indicates that no safety helmet is being worn, the next N consecutive frames of the image to be detected are continued for detection. If the detection result is that no safety helmet is being worn and N is greater than or equal to a first preset value n, an alarm is issued. Simultaneously, using a preset security level threshold parameter within the system, an improved YOLOv7 algorithm model identifies the color of the safety helmets worn by personnel in the video surveillance stream. The system automatically obtains the security level of personnel in this area based on the helmet color. An alarm is issued for situations where the security level does not meet the area's requirements, achieving a warning effect and thus enabling the determination of whether foreign object intrusion exists based on the security level of personnel in the area. The specific steps are as follows:

[0050] Step 1: Install high-definition cameras in the designated area, initialize the system, set the corresponding security zone parameters, and manually set the personnel security level threshold for the current designated area.

[0051] The corresponding security zone parameters include: the current area's security level limit requirements and the security personnel's foreign object intrusion monitoring threshold. The current area's security level limit requirements refer to the security level of the area where the camera is located. Security levels are categorized from highest to lowest as level 4, level 3, level 2, and level 1. The safety helmet levels and colors correspond as follows:

[0052] Level -> Blue hard hat -> Ordinary worker;

[0053] Leve2 -> Yellow safety helmet -> Technician;

[0054] Level 3 -> Red Safety Helmet -> Senior Technicians and Middle / Lower Management Personnel;

[0055] Leve4 -> White safety helmet -> Supervisor or client.

[0056] If the target area only allows access to administrators and above, the threshold for that target area can be set to Level 3. After setting the area threshold, load the data model trained with a large amount of test data into the system.

[0057] The data model trained on a large amount of test data is obtained by training on a large stream of pre-acquired images. The training steps of the data model are as follows: Figure 2 As shown, it includes:

[0058] Step S1: Install a high-definition camera (model DS-2CD3T86FWDV2-I3S) in each area of ​​the chemical plant with high safety requirements to obtain video stream files of chemical plant workers. Extract the video stream files frame by frame at the rate of one image per second to obtain images of each area, for a total of 5000 images.

[0059] Step S2: Divide the 5000 images into a ratio of 8:1:1, using 4000 images as the training set to train the model; use 500 images as the validation set to evaluate and adjust the algorithm model; and use 500 images as the test set to test the generalization ability of the algorithm model.

[0060] Step S3: Use the open-source Labelimg dataset annotation tool to annotate 4500 images. The annotation content is the color of the safety helmet in the image stream, namely yellow, blue, red, orange and white. After annotating the target area of ​​each image, a corresponding XML tag file will be generated. The tag file XML mainly stores information such as the file name of the corresponding image, the image name, the location of the image, the overall length, width and number of channels of the image, and the location of the marked object.

[0061] Step S4: The improved YOLO7 algorithm model is trained. The backbone network of the overall algorithm model adopts CSPDarknet53, and the network layers in the network framework are connected through CSP. Then, the YOLO7 Head network adopts an improved multi-scale feature aggregation module. This module mainly integrates the features of each layer from large to small size. Then, through the cross-feature refinement module, the features of different sizes are obtained by mapping convolution to obtain the final effective information, thereby improving the robustness of the trained algorithm model. Finally, after at least 50 algorithm iterations, the weights with the lowest loss values ​​on both the training set and the validation set are obtained. After obtaining the model algorithm weights that can accurately identify the color of the safety helmets of workers in the target area, the weights are loaded into the improved YOLO7 algorithm model to obtain the corresponding chemical plant safety helmet color detection algorithm model.

[0062] After completing the above preparations, proceed with the actual use. Before use, based on the area where the camera is located, set the corresponding safety level threshold for the area. Safety helmet levels are divided into level 4, level 3, level 2, and level 4 from high to low.

[0063] Once set up, the camera installed in the target area will capture video of the area in real time, and the video stream from the target area will be transmitted to the embedded terminal in real time.

[0064] Step 2: Extract the video stream of a specific area acquired by the high-definition camera frame by frame to obtain the corresponding image stream. Apply the Gaussian mixture background modeling method to the acquired image stream to separate the background and foreground.

[0065] The specific operation method for separating the background and foreground is as follows: before performing foreground detection, the background is trained first. For each background in each frame of the image, a Gaussian mixture model is used to simulate it. The pixel is checked to see if it matches the Gaussian model of the background. If it matches, it is the background; if it does not match, it is the foreground.

[0066] After separating the background from the foreground, continuous frame detection is performed. Continuous frame detection mainly involves processing consecutive video frames to obtain dynamic change information in the video, so as to realize various analyses and processing of the video.

[0067] The video stream is extracted frame by frame, and the acquired image stream is processed using a Gaussian mixture model (Gaussian Mixture Model). A Gaussian mixture model is a combination of K single Gaussian models, and its probability distribution is as follows:

[0068]

[0069] Where χ represents the observed data, α k α is the probability that the observed data belongs to the Kth sub-model. k ≥0, φ(x|θ k ) is the Gaussian distribution density function of the Kth sub-model, and P(X|θ) represents the distribution of sample X in the θ sub-models.

[0070] The specific mathematical expression of the Kth sub-model in the Gaussian mixture model is:

[0071]

[0072] Wherein, φ(y|θ) k ) represents a Gaussian distribution for a single model; μ K Let σ be the expected value of the data, and σ be the standard deviation of the data. Let y be the variance of the Gaussian distribution, and y be the input variable value.

[0073] When the detection result of a certain frame in the video shows that someone is not wearing a safety helmet, the detection continues for the next N consecutive frames of the image to be detected. If the detection result is that someone is not wearing a safety helmet, and N is greater than or equal to the first preset value n, then it can be determined that there are people not wearing safety helmets in the video at this time.

[0074] By employing a Gaussian mixture modeling approach, the background is trained before foreground detection. For each frame of the image, a Gaussian mixture model is used to simulate the background, and the pixels are checked to see if they match the background's Gaussian model. If they match, it's considered background; otherwise, it's considered foreground. Therefore, the overall algorithm is highly adaptable to changing backgrounds, and can detect moving targets even in situations with significant changes in scene lighting or minor vibrations, thus improving the overall robustness of the method.

[0075] Step 3: In cases where a safety helmet is not being worn, a command is sent directly through the embedded terminal to trigger the matching alarm device to issue an alarm, thus achieving the effect of early warning.

[0076] Step 4: Then, the next M consecutive frames after the Nth frame are detected. If the detection results show that all people are wearing safety helmets and M is greater than or equal to the second preset value m, then it can be determined that all people in the video are wearing safety helmets.

[0077] Step 5: For cases where safety helmets are worn in the image stream, the YOLO anchor mechanism is used to identify the target area. The YOLO head of the YOLO v7 algorithm is used to classify the safety helmets worn in the target area according to their colors. The color of the safety helmet worn by each person in the current video stream is obtained to determine the safety level of the employee's position. A set threshold is used to determine whether the current employee is involved in a foreign object intrusion.

[0078] Yolo v7 uses the CIou loss function, and the mathematical formula for the CIou loss function is shown below:

[0079]

[0080] Where β is the weight parameter, v is used to measure the similarity of aspect ratio, Iou is the intersection-union ratio of the two regions, and b,b gt ρ represents the center point of the predicted bounding box and the ground truth, respectively. 2 This indicates the calculation of the Euclidean distance between two center points.

[0081] Step 6: If no foreign object intrusion is found, the current detection ends, and the process returns to Step 2 for repeated detection. If foreign object intrusion is found, a command is sent directly through the embedded terminal to trigger the corresponding alarm device to issue an alarm, thus achieving the effect of early warning.

[0082] The classification and prediction results are obtained through YOLOv7. The safety officer level of the target area is obtained by the color of the safety helmet worn. At the same time, the safety officer level of the target area is compared with the pre-set safety officer level parameters. If the level of the safety officer in a specified area is lower than the safety officer level threshold, an early warning signal is sent to the hardware through the foreign object intrusion detection system for special areas of chemical plants based on safety level, thereby achieving the effect of foreign object intrusion detection.

[0083] The safety level of the security officer is obtained through target detection using the improved Yolov7 algorithm, with the following effect: Figure 4 As shown.

[0084] Step 7: Then, inspect the subsequent images to see if the foreign object intrusion has been eliminated; if it has not been eliminated, continue to issue an alarm; if it has been eliminated, then the current inspection is considered complete, and return to Step 2 for repeated inspection.

[0085] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes, substitutions and improvements within the technical scope disclosed in the present invention are within the scope of protection of the present invention.

Claims

1. A security discrimination method based on image recognition, which involves acquiring real-time video streams of a target area using a high-definition camera in a designated area, processing the real-time video stream frame by frame into images to be detected; performing background modeling and foreground detection using a Gaussian mixture model to filter out background interference and extract the foreground target; then passing the foreground target to a continuous frame detection module for processing; if the detection result is "not wearing a safety helmet," continuing to detect the next N consecutive frames of the image to be detected; if the detection result is "not wearing a safety helmet" and N is greater than or equal to a first preset value n, an alarm is issued; simultaneously, using a preset security level threshold parameter in the system, an improved YOLOv7 algorithm model identifies the color of the safety helmets of workers in the video surveillance stream, thereby automatically determining the security level of workers in this area based on the safety helmet color; and issuing an alarm for cases where the security level does not meet the area requirements, thus achieving an early warning effect and enabling the determination of whether there is foreign object intrusion based on the security level of personnel in the area; the specific steps are as follows: Step 1: Install high-definition cameras in the designated area, initialize the equipment, set the corresponding security zone parameters, and manually set the personnel security level threshold for the current designated area; Step 2: Extract the video stream of a specific area acquired by the high-definition camera frame by frame to obtain the corresponding image stream. Apply the Gaussian mixture background modeling method to the acquired image stream to separate the background and foreground. After separating the background and foreground, continuous frame detection is performed. When the detection result of a certain frame in the video is that someone is not wearing a helmet, the next N consecutive frames of the image to be detected are detected. If the detection result is that someone is not wearing a helmet and N is greater than or equal to the first preset value n, it can be determined that there are people not wearing helmets in the video at this time. Step 3: In cases where a safety helmet is not being worn, a command is sent directly through the embedded terminal to trigger the matching alarm device to issue an alarm, thus achieving the effect of early warning; Step 4: Then, the next M consecutive frames after the Nth frame are detected. If the detection results show that all people are wearing safety helmets and M is greater than or equal to the second preset value m, it can be determined that all people in the video are wearing safety helmets. Step 5: For cases where safety helmets are already worn in the image stream, the YOLO anchor mechanism is used to identify the target area. The YOLO head of the YOLO v7 algorithm is used to classify the safety helmets worn in the target area according to their colors. The color of the safety helmet worn by each person in the current video stream is obtained to determine the job security level of the person. The set threshold is used to determine whether the current person is in a situation of foreign object intrusion. Step 6: If no foreign object intrusion is found, the current detection ends and the process returns to Step 2 for repeated detection. If foreign object intrusion is found, a command is sent directly through the embedded terminal to trigger the corresponding alarm device to issue an alarm, thus achieving the effect of early warning. Step 7: Then, inspect the subsequent images to see if the foreign object intrusion has been eliminated; if it has not been eliminated, continue to issue an alarm; if it has been eliminated, then the current inspection is considered complete, and return to Step 2 for repeated inspection.

2. The security discrimination method based on image recognition according to claim 1, characterized in that: Step 1 involves setting the corresponding security zone parameters, including: the current area's security level restriction requirements and the security personnel's foreign object intrusion monitoring threshold. The current area's security level restriction requirements refer to the security level of the area where the camera is located. Security levels are categorized from high to low as level 4, level 3, level 2, and level 1. The safety helmet level and color correspond as follows: Level -> Blue hard hat -> Ordinary worker; Leve2 -> Yellow safety helmet -> Technician; Level 3 -> Red Safety Helmet -> Senior Technicians and Middle / Lower Management Personnel; Leve4 -> White safety helmet -> Supervisor or client; If the target area only allows access to personnel with administrator or higher privileges, the threshold for that target area can be set to Level 3. After setting the area threshold, load the data model trained with a large amount of test data into the system.

3. The security discrimination method based on image recognition according to claim 2, characterized in that: The data model trained on a large amount of test data is obtained by training on a large number of pre-acquired image streams. The training steps of the data model include: Step S1: Install cameras in each area of ​​the chemical plant with safety requirements to obtain video stream files of the chemical plant workers. Extract the video stream files frame by frame in the form of one image per second to obtain images of each area, for a total of 5000 images. Step S2: Divide the 5000 images into a ratio of 8:1:1, and use 4000 images as the training set to train the model; use 500 images as the validation set to evaluate and adjust the algorithm model; and use 500 images as the test set to test the generalization ability of the algorithm model. Step S3: Use the open-source Labelimg dataset annotation tool to annotate 4500 images. The annotation content is the color of the safety helmet in the image stream, namely yellow, blue, red, orange and white. After annotating the target area of ​​each image, a corresponding XML tag file will be generated. The XML tag file mainly stores information such as the file name of the corresponding image, the image name, the location of the image, the overall length, width, number of channels of the image, and the location of the marked object. Step S4: The improved YOLO7 algorithm model is trained. The backbone network of the overall algorithm model adopts CSPDarknet53, and the network layers in the network framework are connected through CSP. Then, the YOLO7 Head network adopts an improved multi-scale feature aggregation module. This module mainly integrates the features of each layer from large to small size. Then, through the cross-feature refinement module, the features of different sizes are obtained by mapping convolution to obtain the final effective information, thereby improving the robustness of the trained algorithm model. Finally, after at least 50 algorithm iterations, the weights with the lowest loss values ​​on both the training set and the validation set are obtained. After obtaining the model algorithm weights that can accurately identify the color of the safety helmets of workers in the target area, the weights are loaded into the improved YOLO7 algorithm model to obtain the corresponding chemical plant safety helmet color detection algorithm model.

4. The security discrimination method based on image recognition according to claim 1, characterized in that: The specific operation method for separating the background and foreground in step 2 is as follows: before performing foreground detection, the background is trained first. A Gaussian mixture model is used to simulate each background in each frame of the image. The pixel is checked to see if it matches the Gaussian model of the background. If it matches, it is the background; if it does not match, it is the foreground.

5. The security discrimination method based on image recognition according to claim 1, characterized in that: The continuous frame detection described in step 2 mainly involves processing consecutive video frames to obtain dynamic change information in the video, so as to realize various analyses and processing of the video.

6. A security discrimination method based on image recognition according to claim 1 or 5, characterized in that: Step 2 describes the frame-by-frame extraction of the video stream. The acquired image stream is then processed using a Gaussian mixture model (Gaussian Mixture Model). A Gaussian mixture model is a combination of K single Gaussian models, and its probability distribution is as follows: Where χ represents the observed data, α k α is the probability that the observed data belongs to the Kth sub-model. k ≥0, φ(x|θ k ) is the Gaussian distribution density function of the Kth sub-model, and P(X|θ) represents the distribution of sample X in the θ sub-models.

7. The security discrimination method based on image recognition according to claim 6, characterized in that: The specific mathematical expression of the Kth sub-model in the Gaussian mixture model is as follows: Wherein, φ(y|θ) k ) represents a Gaussian distribution for a single model; μ K Let σ be the expected value of the data, and σ be the standard deviation of the data. Let y be the variance of the Gaussian distribution, and y be the input variable value.

8. The security discrimination method based on image recognition according to claim 1, characterized in that: The YOLO v7 mentioned in step 5 uses the CIou loss function, and the mathematical formula for the CIou loss function is shown below: Where β is the weight parameter, v is used to measure the similarity of aspect ratio, Iou is the intersection-union ratio of the two regions, and b,b gt ρ represents the center point of the predicted bounding box and the ground truth, respectively. 2 This indicates the calculation of the Euclidean distance between two center points.

Citation Information

Patent Citations

  • Substation perimeter video intelligent detection system

    CN110691224A

  • Quantum, biological, computer vision, and neural network systems for industrial internet of things

    WO2022236064A2