Recognition method for judging whether safety helmet is worn or not based on artificial intelligence

By applying artificial intelligence-based safety helmet wear recognition method at the construction site, and using deep learning and support vector machine models for automated detection, the problems of inefficiency and missed detection of traditional manual detection methods are solved, and efficient and accurate safety management is achieved.

CN120014547APending Publication Date: 2025-05-16曲思凝
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510088249.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

When checking the wearing of safety helmets at the construction site, traditional manual inspection methods have problems such as inefficiency, fatigue, poor real-time performance and slow response, resulting in frequent mis-checking and missed inspections, affecting the progress and quality of the construction project.

Method used

Using an identification method based on artificial intelligence, head position recognition is performed through deep learning object detection model, and safety helmet wear recognition is used using support vector machine model to achieve automated detection. The method includes obtaining worker activity images, performing preprocessing and feature extraction, using deep learning models for head position recognition, and performing hard hat wearing recognition based on the support vector machine model.

Benefits of technology

Efficient and accurate safety helmet wear inspection has been achieved, which significantly improves safety at the construction site and in the industrial environment, reduces labor costs, avoids false and missed inspections of manual inspections, and improves the efficiency of safety management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014547A_ABST
    Figure CN120014547A_ABST
Patent Text Reader

Abstract

The invention discloses a recognition method for judging whether a safety helmet is worn or not based on artificial intelligence, and relates to the technical field of safety helmet wearing recognition, and the method comprises the following steps: obtaining a worker activity image, carrying out the unified adjustment of the size of the worker activity image, obtaining a standardized image, and carrying out the preprocessing of the standardized image, and obtaining a to-be-detected image; according to the to-be-detected image, performing head position identification by using a deep learning target detection model to obtain a head detection area, and obtaining a head image based on the head detection area; and based on the head image, carrying out safety helmet wearing identification by using a support vector machine model to obtain a safety helmet wearing result, and carrying out safety early warning on a result that the safety helmet is not worn. According to the invention, head position identification is carried out through the deep learning target detection model, and safety helmet wearing identification is carried out by using the support vector machine model, so that the wearing condition of the safety helmet can be accurately identified, and efficient and accurate safety management is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of helmet wearing recognition, and in particular to a recognition method for judging whether a helmet is worn based on artificial intelligence. Background Art

[0002] In the construction environment, hard hats play a vital role in protecting the heads of workers. In order to ensure the safety of workers at the construction site, wearing hard hats is a basic requirement. Therefore, the inspection of the wearing of hard hats is a top priority in construction safety management. However, the traditional method of manually checking whether workers are wearing hard hats by watching surveillance videos has many shortcomings and limitations. These problems not only affect the effectiveness and accuracy of the inspection, but also have an adverse impact on the progress and quality of the entire construction project to a certain extent. Since the traditional manual inspection method requires a lot of human resources, it means that the company must allocate special personnel to do this work, which not only increases labor costs, but may also occupy the manpower required for other more critical tasks. As the scale of construction expands and the complexity increases, the manpower required also increases accordingly, which is not conducive to the company's resource management.

[0003] In addition, long-term monitoring and observation can easily lead to fatigue of monitoring personnel, thereby reducing their attention and judgment, making false detections and missed detections more frequent; more importantly, the process of manual review of video materials is usually not instant, and there is often a certain lag. There may be a long time interval between discovering violations and taking corrective measures; this delay means that if a helmet is not worn, it cannot be dealt with immediately, making it difficult to achieve real-time monitoring and rapid response, which in turn affects the overall construction plan; in summary, although traditional manual inspection methods can play a supervisory role to a certain extent, their low efficiency, fatigue, poor real-time performance, slow response and other problems have obviously restricted their application in modern efficient construction environments.

[0004] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention

[0005] In view of the problems in the related art, the present invention proposes an identification method based on artificial intelligence to determine whether a helmet is worn, so as to overcome the above-mentioned technical problems existing in the existing related art.

[0006] To this end, the specific technical solution adopted by the present invention is as follows: A recognition method for judging whether a helmet is worn based on artificial intelligence, the method comprising the following steps: S1, obtaining worker activity images, uniformly adjusting the sizes of the worker activity images to obtain normalized images, and preprocessing the normalized images to obtain images to be detected; S2. According to the image to be detected, the deep learning target detection model is used to identify the head position, obtain the head detection area, and obtain the head image based on the head detection area; S3. Based on the head image, the support vector machine model is used to identify the helmet wearing, obtain the helmet wearing result, and issue a safety warning for the result of not wearing the helmet.

[0007] Further, obtaining worker activity images, uniformly adjusting the sizes of the worker activity images to obtain normalized images, and preprocessing the normalized images to obtain the images to be detected include the following steps: S11, obtaining worker activity images, and uniformly adjusting the sizes of the worker activity images through interpolation processing to obtain normalized images; S12, performing denoising and correction processing on the normalized image by using Gaussian blur and gamma correction, and adjusting the contrast of the processed image by logarithmic transformation to obtain an optimized image; S13. Perform global normalization on the optimized image through the image network mean and standard deviation to obtain the image to be detected.

[0008] Further, the normalized image is subjected to denoising and correction processing by using Gaussian blur and gamma correction, and the contrast of the processed image is adjusted by logarithmic transformation to obtain an optimized image, which includes the following steps: S121, by setting the convolution kernel and standard deviation of Gaussian blur, weighted averaging the pixel values ​​of each pixel point and its neighborhood in the normalized image to obtain a denoised image; S122, assigning a gamma value to the gamma correction, generating a mapping table according to the gamma value, and replacing each pixel value of the denoised image with a corresponding lookup table value based on the mapping table to obtain a corrected image; S123, inputting the corrected image into a logarithmic transformation formula to adjust the contrast, and normalizing the adjustment result to obtain an optimized image.

[0009] Further, according to the image to be detected, the head position is recognized by using a deep learning target detection model to obtain a head detection area, and based on the head detection area, obtaining a head image includes the following steps: S21. Using the image to be detected, train the deep learning target detection model to obtain an initial head detection model; S22, optimizing the initial head detection model by using the intersection-over-union ratio and the complete intersection-over-union ratio loss function to obtain a head detection model; S23. Based on the head detection model, the head position is recognized for the pre-acquired image to be detected to obtain a head detection area, and based on the head detection area, a head image is obtained.

[0010] Furthermore, the initial head detection model is optimized using the intersection-over-union (IoU) and complete IoU loss functions, including: performing weighted product of the IoU and complete IoU loss functions to obtain a total loss function, and optimizing the initial head detection model based on the total loss function.

[0011] Furthermore, based on the head detection area, obtaining the head image includes: expanding and cropping the image to be detected at a preset ratio according to the head detection area to obtain the head image.

[0012] Furthermore, based on the head image, a support vector machine model is used to identify the wearing of a helmet, obtain the result of wearing a helmet, and issue a safety warning for the result of not wearing a helmet, including the following steps: S31, extracting the color and contour of the head image to obtain color feature data and contour feature data; S32, combining the color feature data and the contour feature data, and using the combined comprehensive feature vector to train a support vector machine model to obtain an initial helmet wearing recognition model; S33, using the hinge loss function, optimizing the initial helmet wearing recognition model to obtain a helmet wearing recognition model; S34, based on the helmet wearing recognition model, perform helmet wearing recognition on the pre-acquired head image to obtain the helmet wearing result, and issue a safety warning for the result of not wearing a helmet.

[0013] Furthermore, extracting the color and contour of the head image to obtain color feature data and contour feature data includes the following steps: S311, by setting different color channels and bin numbers, the color value of each pixel in the head image is counted, and the distribution frequency on each color channel is calculated to obtain a color histogram; S312, according to the color value of each color channel of the color histogram, calculate the mean value, variance and skewness of each color channel to obtain color feature data; S313. Based on the Canny edge detection algorithm, detect the intensity change area in the head image to obtain edge data of the head image, and extract contour features from the edge data to obtain contour feature data.

[0014] Further, based on the Canny edge detection algorithm, the intensity change area in the head image is detected to obtain edge data of the head image, and contour features are extracted from the edge data to obtain contour feature data, including the following steps: S3131, using the Sobel operator in the Canny edge detection algorithm, calculating the gradient amplitude and direction of each pixel of the head image, and obtaining the direction and intensity of the image grayscale change; S3132, performing non-maximum suppression on the gradient amplitude of the head image according to the direction and intensity of the image grayscale change to obtain edge data; S3133. Perform dual threshold detection on edge data by setting two thresholds, and perform edge tracking and linking based on the detection results to obtain contour feature data.

[0015] Further, the color feature data and the contour feature data are combined, and the combined comprehensive feature vector is used to train the support vector machine model to obtain the initial helmet wearing recognition model, which includes the following steps: S321, using a standardization method, standardizing the color feature data and the outline feature data to obtain color feature standardized data and outline feature standardized data; S322, performing weighted summation on the color feature standardized data and the contour feature standardized data to obtain a comprehensive feature vector; S323. According to the comprehensive feature vector, the support vector machine model is trained to obtain an initial helmet wearing recognition model.

[0016] The beneficial effects of the present invention are: 1. The present invention uses a deep learning target detection model to perform head position recognition, and uses a support vector machine model to perform helmet wearing recognition. It can accurately identify the wearing status of the helmet and achieve efficient and accurate safety management. It can not only significantly improve the safety at construction sites and industrial environments, but also greatly improve the efficiency of helmet wearing detection, greatly reducing labor costs. At the same time, it also improves the accuracy of helmet wearing detection, avoids false detection and missed detection in manual detection, and greatly improves the efficiency of safety management.

[0017] 2. The present invention ensures the consistency and high quality of image data through Gaussian blur, gamma correction and logarithmic transformation, thereby improving the accuracy and stability of subsequent detection; at the same time, color feature data and contour feature data are extracted from the head image to ensure more accurate recognition of helmet wearing, wherein Gaussian blur effectively removes image noise, gamma correction adjusts the image brightness distribution, and logarithmic transformation enhances the contrast, making the features more obvious; in addition, by extracting color feature data and contour feature data from the head image, the input information of the support vector machine model is further enriched, and the recognition accuracy of the helmet wearing status is further enhanced, so that the recognition efficiency and reliability can be maintained in various complex environments, further ensuring the accuracy and reliability of helmet wearing recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 It is a flow chart of a recognition method for judging whether a helmet is worn based on artificial intelligence according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] To further illustrate each embodiment, the present invention provides drawings, which are part of the disclosure of the present invention and are mainly used to illustrate the embodiments. They can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, ordinary technicians in this field should be able to understand other possible implementation methods and advantages of the present invention.

[0021] According to an embodiment of the present invention, a recognition method for judging whether a helmet is worn based on artificial intelligence is provided.

[0022] The present invention will now be further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to the recognition method for judging whether a helmet is worn based on artificial intelligence according to an embodiment of the present invention, the method comprises the following steps: S1. Acquire worker activity images, uniformly adjust the sizes of the worker activity images to obtain normalized images, and preprocess the normalized images to obtain images to be detected.

[0023] Specifically, obtaining worker activity images, uniformly adjusting the sizes of the worker activity images to obtain normalized images, and preprocessing the normalized images to obtain images to be detected include the following steps: S11, obtaining worker activity images, and uniformly adjusting the sizes of the worker activity images through interpolation processing to obtain normalized images; S12. Using Gaussian blur and gamma correction, the normalized image is subjected to denoising and correction processing, and the contrast of the processed image is adjusted by logarithmic transformation to obtain an optimized image.

[0024] Specifically, using Gaussian blur and gamma correction to perform denoising and correction processing on the normalized image, and adjusting the contrast of the processed image by logarithmic transformation, to obtain the optimized image includes the following steps: S121, by setting the convolution kernel and standard deviation of Gaussian blur, weighted averaging the pixel values ​​of each pixel point and its neighborhood in the normalized image to obtain a denoised image; S122, assigning a gamma value to the gamma correction, generating a mapping table according to the gamma value, and replacing each pixel value of the denoised image with a corresponding lookup table value based on the mapping table to obtain a corrected image; S123, inputting the corrected image into a logarithmic transformation formula to adjust the contrast, and normalizing the adjustment result to obtain an optimized image.

[0025] S13. Perform global normalization on the optimized image through the image network mean and standard deviation to obtain the image to be detected.

[0026] S2. According to the image to be detected, use the deep learning target detection model to identify the head position, obtain the head detection area, and obtain the head image based on the head detection area.

[0027] Specifically, according to the image to be detected, the deep learning target detection model is used to identify the head position, obtain the head detection area, and based on the head detection area, obtain the head image, including the following steps: S21. Use the image to be detected to train the deep learning target detection model to obtain an initial head detection model.

[0028] It should be noted that data enhancement techniques are applied to the images to be detected, such as rotating, flipping, cropping, color jittering, etc., to increase data diversity and improve the robustness of the initial head detection model.

[0029] It should be noted that the deep learning target detection model collects and annotates a large number of images to be detected, accurately annotates the head area in each image, usually uses a bounding box to mark the position of each head, and performs data cleaning and enhancement to ensure the consistency and high quality of the input data; the YOLO (You Only LookOnce) v3 model is selected as the deep learning target detection model, and the network parameters are initialized with pre-trained weights, the optimizer and hyperparameters are configured, and the data set is divided into training set, validation set and test set on the basis of appropriate hardware and software environment.

[0030] S22. Optimize the initial head detection model using the intersection-over-union ratio and complete intersection-over-union ratio loss functions to obtain a head detection model.

[0031] It should be noted that the initial head detection model is optimized using the intersection-over-union (IoU) and complete intersection-over-union (IoU) loss functions. Specifically, the loss values ​​and performance indicators are monitored, the model performance is regularly evaluated on the validation set, and necessary adjustments and optimizations are made. Finally, a comprehensive evaluation is performed on an independent test set to obtain the head detection model, which improves the accuracy and stability of the head detection model and ensures its robustness in various complex environments.

[0032] Specifically, optimizing the initial head detection model using the intersection-over-union (IoU) and complete IoU loss functions includes: performing weighted product of the IoU and complete IoU loss functions to obtain a total loss function, and optimizing the initial head detection model based on the total loss function.

[0033] S23. Based on the head detection model, the head position is recognized for the pre-acquired image to be detected to obtain a head detection area, and based on the head detection area, a head image is obtained.

[0034] Specifically, based on the head detection area, obtaining the head image includes: expanding and cropping the image to be detected at a preset ratio according to the head detection area to obtain the head image.

[0035] S3. Based on the head image, the support vector machine model is used to identify the helmet wearing, obtain the helmet wearing result, and issue a safety warning for the result of not wearing the helmet.

[0036] Specifically, based on the head image, the support vector machine model is used to identify the helmet wearing, obtain the helmet wearing result, and issue a safety warning for the result of not wearing the helmet, including the following steps: S31. Extract the color and contour of the head image to obtain color feature data and contour feature data.

[0037] Specifically, extracting the color and contour of the head image to obtain color feature data and contour feature data includes the following steps: S311, by setting different color channels and bin numbers, the color value of each pixel in the head image is counted, and the distribution frequency on each color channel is calculated to obtain a color histogram; S312, according to the color value of each color channel of the color histogram, calculate the mean value, variance and skewness of each color channel to obtain color feature data; S313. Based on the Canny edge detection algorithm, detect the intensity change area in the head image to obtain edge data of the head image, and extract contour features from the edge data to obtain contour feature data.

[0038] Specifically, based on the Canny edge detection algorithm, the intensity change area in the head image is detected to obtain edge data of the head image, and contour features are extracted from the edge data to obtain contour feature data, including the following steps: S3131, using the Sobel operator in the Canny edge detection algorithm, calculating the gradient amplitude and direction of each pixel of the head image, and obtaining the direction and intensity of the image grayscale change; S3132, performing non-maximum suppression on the gradient amplitude of the head image according to the direction and intensity of the image grayscale change to obtain edge data; S3133. Perform dual threshold detection on edge data by setting two thresholds, and perform edge tracking and linking based on the detection results to obtain contour feature data.

[0039] S32, combining the color feature data and the contour feature data, and using the combined comprehensive feature vector to train a support vector machine model to obtain an initial helmet wearing recognition model.

[0040] Specifically, combining the color feature data and the contour feature data, and using the combined comprehensive feature vector to train the support vector machine model, to obtain the initial helmet wearing recognition model includes the following steps: S321, using a standardization method, standardizing the color feature data and the outline feature data to obtain color feature standardized data and outline feature standardized data; S322, performing weighted summation on the color feature standardized data and the contour feature standardized data to obtain a comprehensive feature vector; S323. According to the comprehensive feature vector, the support vector machine model is trained to obtain an initial helmet wearing recognition model.

[0041] It should be noted that the support vector machine (SVM) model is trained based on the comprehensive feature vector as input, and appropriate kernel functions (such as linear kernel) and hyperparameters (such as regularization parameter C and kernel parameter γ) are selected to improve the classification performance; during the training process, the cross-validation method is used to evaluate the model performance to ensure its generalization ability; it not only enhances the robustness of the initial helmet wearing recognition model to different lighting conditions and background changes, but also significantly improves the accuracy and reliability of helmet wearing recognition.

[0042] S33. Utilize the hinge loss function to optimize the initial helmet wearing recognition model to obtain a helmet wearing recognition model.

[0043] S34, based on the helmet wearing recognition model, perform helmet wearing recognition on the pre-acquired head image to obtain the helmet wearing result, and issue a safety warning for the result of not wearing a helmet.

[0044] It should be noted that the hard hat wearing recognition model can accurately distinguish between workers wearing hard hats and those not wearing hard hats, and issue safety warnings for those not wearing hard hats; it outputs warning information for those not wearing hard hats, and promptly reminds relevant personnel to take corrective measures, thereby effectively improving the safety of the work site.

[0045] In summary, with the help of the above technical scheme of the present invention, the present invention uses a deep learning target detection model to perform head position recognition, and uses a support vector machine model to perform helmet wearing recognition, which can accurately identify the wearing status of the helmet and realize efficient and accurate safety management; it can not only significantly improve the safety at construction sites and industrial environments, but also greatly improve the efficiency of helmet wearing detection, greatly reducing labor costs; at the same time, it also improves the accuracy of helmet wearing detection, avoids false detection and missed detection of manual detection, and greatly improves the efficiency of safety management; through Gaussian blur, gamma correction and logarithmic transformation, it ensures that the image data is consistent and High quality improves the accuracy and stability of subsequent detection; at the same time, color feature data and contour feature data are extracted from the head image to ensure more accurate recognition of helmet wearing. Among them, Gaussian blur effectively removes image noise, gamma correction adjusts the image brightness distribution, and logarithmic transformation enhances the contrast, making the features more obvious; in addition, by extracting color feature data and contour feature data from the head image, the input information of the support vector machine model is further enriched, and the recognition accuracy of the helmet wearing status is further enhanced, so that the recognition efficiency and reliability can be maintained in various complex environments, and the accuracy and reliability of helmet wearing recognition is further ensured.

[0046] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for determining whether a helmet is worn based on artificial intelligence, characterized in that: The method comprises the following steps: S1, obtaining worker activity images, uniformly adjusting the sizes of the worker activity images to obtain normalized images, and preprocessing the normalized images to obtain images to be detected; S2. According to the image to be detected, the deep learning target detection model is used to identify the head position, obtain the head detection area, and obtain the head image based on the head detection area; S3. Based on the head image, the support vector machine model is used to identify the helmet wearing, obtain the helmet wearing result, and issue a safety warning for the result of not wearing the helmet.

2. The method for determining whether a helmet is worn based on artificial intelligence according to claim 1, characterized in that: The steps of obtaining worker activity images, uniformly adjusting the sizes of the worker activity images to obtain normalized images, and preprocessing the normalized images to obtain images to be detected include the following steps: S11, obtaining worker activity images, and uniformly adjusting the sizes of the worker activity images through interpolation processing to obtain normalized images; S12, performing denoising and correction processing on the normalized image by using Gaussian blur and gamma correction, and adjusting the contrast of the processed image by logarithmic transformation to obtain an optimized image; S13. Perform global normalization on the optimized image through the image network mean and standard deviation to obtain the image to be detected.

3. The method for determining whether a helmet is worn based on artificial intelligence according to claim 2, characterized in that: The process of denoising and correcting the normalized image by using Gaussian blur and gamma correction, and adjusting the contrast of the processed image by logarithmic transformation to obtain an optimized image comprises the following steps: S121, by setting the convolution kernel and standard deviation of Gaussian blur, weighted averaging the pixel values ​​of each pixel point and its neighborhood in the normalized image to obtain a denoised image; S122, assigning a gamma value to the gamma correction, generating a mapping table according to the gamma value, and replacing each pixel value of the denoised image with a corresponding lookup table value based on the mapping table to obtain a corrected image; S123, inputting the corrected image into a logarithmic transformation formula to adjust the contrast, and normalizing the adjustment result to obtain an optimized image.

4. The method for determining whether a helmet is worn based on artificial intelligence according to claim 1, characterized in that: The method of identifying the head position by using a deep learning target detection model according to the image to be detected, obtaining a head detection area, and acquiring a head image based on the head detection area includes the following steps: S21. Using the image to be detected, train the deep learning target detection model to obtain an initial head detection model; S22, optimizing the initial head detection model by using the intersection-over-union ratio and the complete intersection-over-union ratio loss function to obtain a head detection model; S23. Based on the head detection model, the head position is recognized for the pre-acquired image to be detected to obtain a head detection area, and based on the head detection area, a head image is obtained.

5. The method for determining whether a helmet is worn based on artificial intelligence according to claim 4 is characterized in that: The method of optimizing the initial head detection model by using the intersection-over-union ratio and the complete intersection-over-union ratio loss function includes: performing weighted product of the intersection-over-union ratio and the complete intersection-over-union ratio loss function to obtain a total loss function, and optimizing the initial head detection model based on the total loss function.

6. The method for determining whether a helmet is worn based on artificial intelligence according to claim 4, characterized in that: The acquiring of the head image based on the head detection area includes: expanding and cropping the image to be detected at a preset ratio according to the head detection area to acquire the head image.

7. The method for determining whether a helmet is worn based on artificial intelligence according to claim 1, characterized in that: The method of using a support vector machine model to perform helmet wearing recognition based on a head image, obtaining a helmet wearing result, and issuing a safety warning for a helmet not being worn result comprises the following steps: S31, extracting the color and contour of the head image to obtain color feature data and contour feature data; S32, combining the color feature data and the contour feature data, and using the combined comprehensive feature vector to train a support vector machine model to obtain an initial helmet wearing recognition model; S33, using the hinge loss function, optimizing the initial helmet wearing recognition model to obtain a helmet wearing recognition model; S34, based on the helmet wearing recognition model, perform helmet wearing recognition on the pre-acquired head image to obtain the helmet wearing result, and issue a safety warning for the result of not wearing a helmet.

8. The method for determining whether a helmet is worn based on artificial intelligence according to claim 7, characterized in that: The extraction of the color and contour of the head image to obtain color feature data and contour feature data comprises the following steps: S311, by setting different color channels and bin numbers, the color value of each pixel in the head image is counted, and the distribution frequency on each color channel is calculated to obtain a color histogram; S312, according to the color value of each color channel of the color histogram, calculate the mean value, variance and skewness of each color channel to obtain color feature data; S313. Based on the Canny edge detection algorithm, detect the intensity change area in the head image to obtain edge data of the head image, and extract contour features from the edge data to obtain contour feature data.

9. The method for determining whether a helmet is worn based on artificial intelligence according to claim 8, characterized in that: The method of detecting the intensity change area in the head image based on the Canny edge detection algorithm to obtain edge data of the head image, and extracting contour features from the edge data to obtain contour feature data includes the following steps: S3131, using the Sobel operator in the Canny edge detection algorithm, calculating the gradient amplitude and direction of each pixel of the head image, and obtaining the direction and intensity of the image grayscale change; S3132, performing non-maximum suppression on the gradient amplitude of the head image according to the direction and intensity of the image grayscale change to obtain edge data; S3133. Perform dual threshold detection on edge data by setting two thresholds, and perform edge tracking and linking based on the detection results to obtain contour feature data.

10. The method for determining whether a helmet is worn based on artificial intelligence according to claim 7, characterized in that: The method of combining the color feature data and the contour feature data and using the combined comprehensive feature vector to train the support vector machine model to obtain the initial helmet wearing recognition model comprises the following steps: S321, using a standardization method, standardizing the color feature data and the outline feature data to obtain color feature standardized data and outline feature standardized data; S322, performing weighted summation on the color feature standardized data and the contour feature standardized data to obtain a comprehensive feature vector; S323. According to the comprehensive feature vector, the support vector machine model is trained to obtain an initial helmet wearing recognition model.