Rolo-v8-based mask identification method

Through the mask recognition method based on yolo-v8, combined with the SE module and Gelu activation function, the problems of low efficiency and high cost of traditional mask detection methods are solved, and fast and accurate mask wearing recognition is achieved, which improves personal safety and detection accuracy.

CN120108020AInactive Publication Date: 2025-06-06GUILIN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510268886.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-06-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional mask testing methods are inefficient and costly, making it difficult to quickly and accurately identify the wearing of masks.

Method used

Using the mask recognition method based on yolo-v8, the SE module is introduced and the Sigmoid activation function is replaced as the Gelu activation function to improve the target detection accuracy.

Benefits of technology

It realizes the rapid and accurate identification of whether medical personnel, patients, and pedestrians are wearing masks correctly, improves personal safety, and improves detection accuracy without increasing the calculation complexity and parameter volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120108020A_ABST
    Figure CN120108020A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, in particular to a respirator recognition method based on yo-v8. The method comprises the following steps of S1, collecting facial images of medical personnel, patients and pedestrians wearing masks to form a data set, and performing preprocessing; s2, the preprocessed picture is imported into a yo-v8n model; s3, an SE module is introduced, and a second-layer activation function Sigmoid in the SE module is improved; and S4, outputting the improved experiment result, the detection precision and the parameter quantity. According to the invention, whether medical personnel, patients and pedestrians correctly wear masks can be rapidly and accurately identified, so that the personal safety of the medical personnel and the patients is greatly improved, image data can be automatically analyzed through a backbone network, and the accuracy of the identification result is improved. And medical personnel, patients and pedestrians who do not wear the masks or the condition that the masks are not worn normatively can be quickly identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a mask recognition method based on YOLO-V8. Background Art

[0002] Traditional testing technology generally involves visually checking whether the appearance, size, color, etc. of the mask meet the standard requirements or measuring the performance indicators of the mask through some physical methods such as ventilation resistance test and mechanical property test. However, these methods have low detection efficiency and high cost;

[0003] To this end, a mask recognition method based on yolo-v8 is designed to provide another technical solution to the above technical problems. Summary of the invention

[0004] Based on this, it is necessary to provide a mask recognition method based on yolo-v8 to solve the technical problems raised in the above background technology.

[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0006] A mask recognition method based on yolo-v8, the steps are as follows:

[0007] S1: Collect facial images of medical staff, patients, and pedestrians wearing masks to form a data set and perform preprocessing;

[0008] S2: Import the preprocessed image into the yolo-v8n model;

[0009] S3: Introduce the SE module and improve the second layer activation function Sigmoid in the SE module;

[0010] S4: Output the improved experimental results, detection accuracy, and parameter quantity.

[0011] As a preferred implementation of the mask recognition method based on yolo-v8 provided by the present invention, in the step S1, the images in the data set are 2641 mask images.

[0012] As a preferred implementation of the mask recognition method based on yolo-v8 provided by the present invention, in the step S1, the collected data set is cut and the data set size is adjusted to complete the preprocessing.

[0013] As a preferred implementation of the mask recognition method based on yolo-v8 provided by the present invention, in the step S1, the images in the preprocessed data set are classified into medical masks, N95 masks and ordinary masks.

[0014] As a preferred implementation of the mask recognition method based on yolo-v8 provided by the present invention, in the S3 step, the SE module is introduced, and the second layer activation function Sigmoid in the SE module is improved, and the steps are as follows:

[0015] The SE module displays the dependencies between channels through modeling, filters out useful information and suppresses useless information;

[0016] Perform numerical normalization on the Sigmoid activation function; replace the original Sigmoid activation function with the Gelu activation function.

[0017] As a preferred implementation of the mask recognition method based on yolo-v8 provided by the present invention, the Gelu activation function expression is:

[0018] GELU(x)=x*P(X≤x)=x*Φ(x)

[0019] Where Φ(x) represents the cumulative distribution function of the normal distribution;

[0020] The cumulative distribution function expression of the normal distribution is:

[0021]

[0022] Here, erf represents the Gaussian error function.

[0023] It can be seen without a doubt that the above-mentioned technical solution of the present application can definitely solve the technical problem to be solved by the present application.

[0024] At the same time, through the above technical solutions, the present invention has at least the following beneficial effects:

[0025] The present invention provides a mask recognition method based on yolo-v8, which can quickly and accurately identify whether medical staff, patients, and pedestrians are wearing masks correctly, thereby greatly improving the personal safety of medical staff and patients, and can automatically analyze image data through the backbone network to quickly identify medical staff, patients, pedestrians who are not wearing masks or who are wearing masks improperly;

[0026] The present invention introduces the SE module into the backbone network of the yolo-v8 framework and replaces the original activation function Sigmoid with Gelu, so as to improve the target detection accuracy while keeping the computational complexity and the number of parameters unchanged, increase the model's attention to the useful information of the image, effectively suppress the useless information of the image, and improve the model training accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are 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.

[0028] Figure 1 It is a flowchart of the procedure of mask recognition detection of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0030] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings.

[0031] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features and technical solutions in the embodiments may be combined with each other.

[0032] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0033] Embodiment 1

[0034] Reference Figure 1 , a mask recognition method based on yolo-v8, the steps are as follows:

[0035] Facial images of medical staff, patients, and pedestrians wearing masks were collected. A total of 2,641 mask images were collected, and the images were labeled and classified into: medical masks, N95 masks, and ordinary masks.

[0036] Perform operations such as cutting the labeled images and adjusting the size of the dataset.

[0037] Import the processed images into the yolo-v8n model. The SE module is introduced into the yolo-v8n model to obtain the importance of channels through training and learning, and to weight the extracted features to highlight the important features.

[0038] Embodiment 2

[0039] Based on the above embodiment 1, a mask recognition method based on yolo-v8 is disclosed, and the steps are as follows:

[0040] Introduce the SE module into the backbone network of the yolo-v8n model.

[0041] The SE module uses modeling to display the dependencies between channels, filter out useful information and suppress useless information, which can effectively avoid such confusion and allow the model to focus on learning model features. This mechanism allows the model to pay more attention to important models and significantly improve the model calculation accuracy.

[0042] The SE module is used to increase the model's attention to useful information in the image, effectively suppress useless information in the image, and improve the model training accuracy.

[0043] The Sigmoid activation function is used for the output of hidden layer neurons, and its value is between (0,1). The values ​​are normalized, but the convergence of the Sigmoid function slows down when it approaches 0 and 1, which makes the neuron weights stop updating at these positions where the gradient approaches zero;

[0044] In order to eliminate the problem of slow convergence when the Sigmoid function approaches 0 and 1, the second layer activation function Sigmoi in the SE module is improved, and the Sigmoid activation function is numerically normalized. The Gelu function is introduced to replace the original Sigmoid activation function, making the function converge more smoothly and reducing the problem of neuron death. This greatly improves the efficiency of model detection and reduces overhead;

[0045] The Gelu activation function introduces random regularization and focuses on the effective information of the model output. The Gelu function is a continuous 'S' curve, and the calculation convergence is smoother than the Relu function, which can slow down the problem of neuron death. It converges faster than Sigmoid when calculating values ​​near zero, and also improves the model operation efficiency;

[0046] The activation function Sigmoid introduces nonlinearity into the neural network, making the network closer to complex functions, thereby handling pattern recognition and classification problems of complex functions. Therefore, the Sigmoid activation function formula can be expressed as:

[0047] σ(x)=1 / (1+e -x ),

[0048] Here, x is the input of the function and σ(x) is the output of the function.

[0049] The Gelu activation function can be expressed as: GELU(x)=x*P(X≤x)=x*Φ(x)

[0050] Where Φ(x) represents the cumulative distribution function of the normal distribution.

[0051] The cumulative distribution function of the normal distribution can be expressed as:

[0052] Here, erf represents the Gaussian error function.

[0053] Embodiment 3

[0054] The present invention is disclosed on the basis of the above-mentioned Embodiment 1 and Embodiment 2.

[0055] Table 1: Improved results

[0056]

[0057] Compare the results of introducing SE module into the backbone network of yolo-v8 to the results before and after the introduction of SE module.

[0058] The results of introducing the SE module in yolo-v8 and using the Sigmoid activation function are compared with the improvement of the model by replacing the Sigmoid activation function with the Gelu function.

[0059] Finally, the present invention uses two evaluation indicators: precision (p) and average precision (mAP).

[0060] The improved results are shown using these two evaluation metrics.

[0061] The calculation formulas for precision (P) and average precision mAP are:

[0062] Precision(P):

[0063] The precision P represents the correct image data. FP represents the number of correctly predicted images. FN represents the number of incorrectly predicted images.

[0064] Average precision mAP:

[0065] The average precision mAP represents the average number of correctly predicted images, P i Represents the average precision value of the i-th category, where i represents the number of categories predicted by the image.

[0066] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the present invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A mask recognition method based on yolo-v8, characterized in that: Here are the steps: S1: Collect facial images of medical staff, patients, and pedestrians wearing masks to form a data set and perform preprocessing; S2: Import the preprocessed image into the yolo-v8n model; S3: Introduce the SE module and improve the second layer activation function Sigmoid in the SE module; S4: Output the improved experimental results, detection accuracy, and parameter quantity.

2. A mask recognition method based on yolo-v8 according to claim 1, characterized in that, In the step S1, the images in the data set are 2641 mask images.

3. A mask recognition method based on yolo-v8 according to claim 1, characterized in that, In the step S1, the collected data set is cut and the size of the data set is adjusted to complete the preprocessing.

4. A mask recognition method based on yolo-v8 according to claim 1, characterized in that, In the step S1, the images in the preprocessed data set are classified into medical masks, N95 masks and ordinary masks.

5. A mask recognition method based on yolo-v8 according to claim 1, characterized in that, In the S3 step, the SE module is introduced, and the second layer activation function Sigmoid in the SE module is improved. The steps are as follows: The SE module displays the dependencies between channels through modeling, filters out useful information and suppresses useless information; Perform numerical normalization on the Sigmoid activation function; replace the original Sigmoid activation function with the Gelu activation function.

6. A mask recognition method based on yolo-v8 according to claim 5, characterized in that, The Gelu activation function expression is: GELU(x)=x*P(X≤x)=x*Φ(x) Where Φ(x) represents the cumulative distribution function of the normal distribution; The cumulative distribution function expression of the normal distribution is: Here, erf represents the Gaussian error function.