High-precision mask detection method based on scene classification self-adaption

Through a high-precision mask detection method based on scene classification adaptive, combined with mask training technology and multi-label classification structure, dynamically adjusting image processing technology and detection scale, the problem of decreasing mask detection accuracy in complex environments is solved, and the mask detection effect with high accuracy and robustness is achieved.

CN119649107AActive Publication Date: 2025-03-18E SURFING VISION TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411700670.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-18
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

In the complex and changeable environment, such as changes in lighting conditions, dense people or large scene differences, the detection accuracy is often limited, resulting in a significant decrease in detection accuracy.

Method used

A high-precision mask detection method based on scene classification adaptation is proposed. By collecting mask images under various scene categories, a scene classification model is generated, and combining mask training technology and multi-label classification structure, the image processing technology and detection scale are dynamically adjusted, and exclusive detection models are selected for mask detection according to different scenarios.

Benefits of technology

It significantly improves the accuracy and robustness of mask detection, can operate stably and effectively in different environments, reduces dependence on large-scale and fully labeled data sets, and improves the training efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119649107A_ABST
    Figure CN119649107A_ABST
Patent Text Reader

Abstract

The invention relates to a high-precision mask detection method based on scene classification self-adaption, and belongs to the field of computer vision, and the method comprises the steps: collecting mask images under various scene types, and carrying out the model training, so as to generate a corresponding scene classification model; inputting the image into a scene classification model, and identifying a scene category to which the image belongs by the scene classification model; and selecting the corresponding exclusive detection model to perform mask detection according to the scene category to which the image belongs, and outputting a mask detection result corresponding to each scene category. According to the method provided by the invention, the accuracy and robustness of mask detection can be remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of computer vision, deep learning and intelligent monitoring, and in particular relates to a high-precision mask detection method based on scene classification and adaptation. Background Art

[0002] Mask detection technology has been widely used in public safety, medical and social management. However, in complex scenes, the accuracy of mask detection is often limited due to factors such as lighting conditions, crowd density, and background interference. Traditional mask detection algorithms usually work in a single mode and cannot be adaptively optimized according to the characteristics of different scenes, resulting in unstable detection accuracy. In complex and changeable environments, such as changing lighting conditions, dense crowds, or large scene differences, the accuracy of mask detection is often limited due to factors such as lighting conditions, crowd density, and background interference, and the detection accuracy often drops significantly. Summary of the invention

[0003] In view of the above deficiencies in the prior art, the object of the present invention is to provide a high-precision mask detection method based on scene classification and adaptation, which can significantly improve the accuracy and robustness of mask detection.

[0004] The present invention proposes a high-precision mask detection method based on scene classification and adaptation, comprising:

[0005] S1, collect mask images under various scene categories and perform model training to generate corresponding scene classification models;

[0006] During the model training process, a training set mask system is established, and the mask training technology is used to modify the training head of the model. The back-propagated gradient is multiplied by a mask. The mask is 0 for unlabeled categories and 1 for labeled categories, so that the model ignores the GroundTruth value of missing categories during training. The data description of the training set mask system is as follows:

[0007]

[0008] Where Mi is the mask value;

[0009] Loss function modification: During the training process, the loss function L is adjusted to:

[0010] L′=L·M

[0011] Among them, L′ is the loss function after mask adjustment, L is the original loss function, M is the mask vector, and the loss contribution of the unlabeled category is set to zero;

[0012] Backpropagating gradients: Gradients During back propagation it is calculated as:

[0013]

[0014] Gradients of unlabeled categories are ignored and do not participate in model parameter updates. is the original loss function gradient;

[0015] S2, inputting the image into a scene classification model, and the scene classification model identifies the scene category to which the image belongs; wherein the scene categories include: outdoor, indoor, night, high exposure, crowded, and special environments where masks need to be worn;

[0016] S3: According to the scene category to which the image belongs, select the corresponding exclusive detection model for mask detection, and output the mask detection results corresponding to each scene category.

[0017] Furthermore, in S1, the scene classification model adopts the BEiT-3 image classification model.

[0018] Furthermore, in S1, a multi-label classification structure is used to classify and label the scene, including: setting one or more scene labels for the scene, and using a binary cross entropy loss function to simultaneously identify multiple scene labels in complex scenes.

[0019] Furthermore, when the scene category is outdoor, a pre-trained mask detection model for outdoor scenes is used to analyze the image lighting conditions, and adaptive histogram equalization technology is used to improve the local contrast of the image; the image is divided into multiple small blocks, and histogram equalization is applied to each small block to enhance the details of the face area; a multi-scale detection method is used to put the original image, the image compressed twice, and the image enlarged twice into the mask detection model for outdoor scenes for identification, so as to obtain the outdoor mask detection result.

[0020] Furthermore, when the scene category is indoor, low-light image enhancement technology is applied to the low-brightness image to improve the brightness and contrast of the image; the processed image is placed in the mask detection model for indoor scenes for recognition to obtain the indoor mask detection result.

[0021] Furthermore, when the scene category is night, low-light image enhancement technology is applied to images with low brightness to improve the brightness and contrast of the image; adaptive threshold segmentation technology is used to extract clear local mask features, and the processed image is placed in the mask detection model for night scenes for identification to obtain the night mask detection results.

[0022] Furthermore, when the scene category is high exposure, low-light image enhancement technology is applied to the low-brightness image to improve the brightness and contrast of the image; the processed image is placed in the mask detection model for high-exposure scenes for recognition to obtain the high-exposure mask detection result.

[0023] Furthermore, when the scene category is crowded, the number and distribution of people in the image are analyzed, including: pre-training a YOLO V10 high-precision face detection model to detect faces in the picture. When the number of faces in a certain area of ​​the picture reaches a threshold, the area is regarded as a densely populated image area, and then the area is cropped and enlarged, and the image is placed in a mask detection model for crowded scenes for identification to obtain a densely populated mask detection result.

[0024] Furthermore, when the scene category is a special environment where a mask needs to be worn, a pre-trained mask detection model for special environments where a mask needs to be worn is used, and then the image is placed into the mask detection model for special environments where a mask needs to be worn for recognition, wherein the mask detection model for special environments where a mask needs to be worn adds training for easily misidentified targets and special masks during the training process to obtain special environment mask detection results.

[0025] Furthermore, the low-light image enhancement technology uses a gamma correction technology to adjust the brightness of the image.

[0026] The beneficial effects of the present invention are as follows:

[0027] 1. Improve the accuracy of mask detection in complex environments

[0028] By combining target detection technology with scene classification, specific detection strategies are automatically applied to different scenarios, thereby significantly improving the accuracy and robustness of mask detection.

[0029] Specifically, in the process of scene classification and mask detection, adaptive seamless connection is achieved. First, the BEiT-3 image classification model is used to accurately identify the scene, and then specific mask detection strategies are adaptively applied according to different scenes. This cross-module dynamic optimization mechanism significantly improves the detection accuracy in various scenes. For example, in outdoor, night, indoor and other environments, the optimal image processing and detection strategy will be selected according to the specific scene.

[0030] By deeply integrating scene classification with mask detection, the present invention can automatically switch the optimal detection strategy in different scenarios. Whether it is outdoors, at night, in high exposure, indoors or crowded environments, the system can perform image preprocessing and model selection according to the specific characteristics of the scene to ensure the accuracy of detection.

[0031] 2. Enhance the robustness and adaptability of the system

[0032] By adaptively analyzing the lighting, personnel density, and other conditions of the input image, the image processing technology (such as adaptive histogram equalization, gamma correction, etc.) and detection scale are dynamically adjusted to ensure that the system can adapt to different distances, lighting, and environmental noise changes, thereby improving the ability to detect mask wearing in specific scenarios.

[0033] 3. Optimize the utilization efficiency of limited annotation resources

[0034] Through innovative mask training technology, the present invention solves the model interference problem when some categories of data are missing. The system can effectively learn in the case of incomplete annotation, improve the accuracy of mask detection in specific scenes, thereby reducing the dependence on large-scale, fully annotated data sets and improving the training efficiency of the model.

[0035] 4. Multi-label classification structure and mask training

[0036] This paper optimizes the traditional single-label classification model and introduces a multi-label classification structure, so that the system can efficiently identify multiple scene labels in complex scenes. The mask training system is innovatively used. When the labeled data is incomplete, the gradient calculation of the unlabeled category is ignored to ensure that the model can still learn effectively in the case of scarce data or incomplete labeling, avoiding interference and maintaining high detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.

[0038] Figure 1 This is a flow chart of a high-precision mask detection method based on scene classification and adaptation according to an embodiment of the present invention;

[0039] Figure 2 It is a schematic diagram of a high-precision mask detection method based on scene classification and adaptation according to an embodiment of the present invention;

[0040] Figure 3 Schematic diagram of mask training according to an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.

[0042] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.

[0043] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0044] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.

[0045] The technical terms involved in the present invention are explained below:

[0046] Beit-3: BEiT-3 is an advanced multimodal infrastructure model proposed by Microsoft that can effectively extract image features and combine the latest technologies to achieve efficient scene classification.

[0047] Binary Cross Entropy (BCE): Binary cross entropy is a type of loss function used for binary or multi-label classification problems, measuring the difference between the predicted probability output by the model and the true label.

[0048] Adaptive Histogram Equalization: An image enhancement technique that improves image details by locally adjusting the contrast of an image, especially in the case of uneven lighting. It is based on the histogram calculation of the local area of ​​the image and is used to improve the local contrast of the image.

[0049] Gamma Correction: A nonlinear image processing technique used to adjust the brightness of an image. It can enhance or weaken the dark or bright details of the image.

[0050] The present invention proposes a high-precision mask detection method based on scene classification and adaptation, which can achieve more accurate mask detection in diverse and complex scenes, ensure that the system can operate stably and effectively in different environments, and meet the current social demand for high-precision mask detection systems.

[0051] The method provided by the present invention first passes the input image through a scene classification model to identify which category the image belongs to, and then selects different dedicated models for different categories, as well as special strategy optimization, to perform mask detection. The present invention formulates a series of strategies for different scenarios to improve the accuracy of mask detection.

[0052] like Figure 1 As shown, the high-precision mask detection method based on scene classification and adaptation in an embodiment of the present invention includes the following steps:

[0053] S1, collect mask images under various scene categories and perform model training to generate corresponding scene classification models.

[0054] The scene classification models include: mask detection models for outdoor scenes, mask detection models for indoor scenes, mask detection models for night scenes, mask detection models for high-exposure scenes, mask detection models for crowded scenes, and mask detection models for special environments where masks need to be worn. It should be noted that the scene classification models are not limited to the above examples, and can also include other types, which can be set as needed.

[0055] Specifically, a multi-label classification structure is used to classify and label the scene, including: setting one or more scene labels for the scene, and using a binary cross entropy loss function to simultaneously identify multiple scene labels in complex scenes. The scene classification model uses the BEiT-3 image classification model.

[0056] Specifically, for the scene classification model, the advanced BEiT-3 image classification model is used. Based on BEit-3, the present invention optimizes the network structure, introduces a multi-label classification structure, modifies the single-label classification head into a multi-label classification head, and uses a binary cross entropy loss function, so that multiple scenes (such as "indoor" and "kitchen") can be recognized simultaneously in complex scenes, ensuring the comprehensiveness and accuracy of the detection.

[0057] In addition, in order to further optimize the model performance and make full use of limited manual annotation resources, the present invention also innovatively implements mask training. Specifically, for a certain training set, there are only N categories of manual annotation, and the model can recognize M categories, where M>N. According to the previous traditional training method, in this case, the missing MN categories must be converted into negative samples (GroundTruth is set to 0) for training. In this case, because the categories with missing annotations may be positive samples in some training samples, the training is greatly disturbed and the training effect is greatly reduced.

[0058] The present invention innovatively uses mask training technology, establishes a training set mask system, modifies the training head of the model, and multiplies the loss function (or the gradient of back propagation) by a mask. The mask is 0 for unlabeled categories and 1 for labeled categories. Therefore, during the training process, the model will ignore the GroundTruth value of the missing category, and the gradient of the missing category will not participate in back propagation, so it will not interfere with normal training, so that the model can still effectively learn when facing images with only some categories labeled. This training method, with the help of the principle of self-supervised learning, significantly enhances the adaptability of the model in data-scarce conditions and improves the recognition accuracy of specific objects.

[0059] The specific definition of the mask training system is explained below.

[0060] Let the training set be D, which contains N manually labeled categories and M model-recognizable categories, and M>N. In traditional training methods, the missing MN categories are regarded as negative samples, that is, their ground truth is set to 0, which greatly reduces the training effect.

[0061] To solve the above problems, the present invention innovatively proposes a mask training technology which can be described by the following mathematical formula.

[0062] The mask is defined as follows:

[0063]

[0064] Among them, M i is the mask value.

[0065] Loss function modification: During the training process, the loss function L is adjusted to:

[0066] L′=L·M

[0067] Among them, L′ is the loss function after mask adjustment, L is the original loss function, M is the mask vector, and the loss contribution of unlabeled categories is set to zero.

[0068] Backpropagating gradients: Gradients During back propagation it is calculated as:

[0069]

[0070] In this way, the gradients of unlabeled categories will be ignored and will not participate in the model parameter update. is the original loss function gradient.

[0071] Figure 3 This is a schematic diagram of mask training. Figure 3 As shown, the model prediction value is (1,1,0, 0 , 0 , 1), GroundTruth value is (1, 0 ,0, 1 , 1 ,1), and get the back propagation gradient (0, 0.5 ,0, 0.5 , 0.5 ,0). Add a mask (1, 0 ,1,1,1,1), and get the masked back-propagation gradient (0, 0 ,0,0.5,0.5,0), and then the model is trained using the masked back-propagated gradients.

[0072] Among them, the second bit "1", the fourth bit "0" and the fifth bit "0" in the model prediction value (1,1,0,0,0,1) are the focus objects. Among them, the "focus object" refers to the parameters in the figure that the user needs to pay attention to.

[0073] The Ground Truth value is (1, 0 ,0, 1 , 1 ,1) The second bit “0”, the fourth bit “1” and the fifth bit “1” in are the objects of attention.

[0074] Backpropagation gradient (0, 0.5 ,0, 0.5 , 0.5 ,0) in the second digit “0.5”, the fourth digit “0.5” and the fifth digit “0.5” are the objects of attention.

[0075] Mask(1, 0 ,1,1,1,1) in which the second bit “0” is the object of attention.

[0076] The back propagation gradient after masking (0, 0 ,0,0.5,0.5,0) in which the second digit “0” is the object of attention.

[0077] In summary, in scene classification, by using the Beit3 model, multi-label classification structure, and mask training system, the present invention not only improves the accuracy of scene classification, but also shows excellent robustness when dealing with diverse and complex environments.

[0078] S2, input the image into the scene classification model, and the scene classification model identifies the scene category to which the image belongs. The scene categories include: outdoor, indoor, night, high exposure, crowded, and special environments where masks need to be worn. It should be noted that the scene categories are not limited to the above examples, and may also include other categories, which can be set as needed.

[0079] S3: According to the scene category to which the image belongs, select the corresponding exclusive detection model for mask detection, and output the mask detection results corresponding to each scene category.

[0080] Specifically, the image is classified by a scene classification model to identify whether it belongs to six specific scenarios, including outdoor, indoor, night, high exposure, crowded, kitchen, hospital, and other environments where masks need to be worn.

[0081] For these six specific scenarios, we use dedicated data sets for training and develop high-precision mask detection models for each scenario to further improve the accuracy and robustness of detection. According to experimental results, the accuracy of dedicated scenario models is generally 10%-20% higher than that of general-purpose models. For these six scenarios, in addition to dedicated models, each will also go through specific strategies to achieve high-precision mask detection effects.

[0082] Combine the following Figure 2 The recognition process of each scene is explained respectively.

[0083] (1) Outdoor

[0084] When the scene category is outdoor, a pre-trained mask detection model for outdoor scenes is used.

[0085] Specifically, for outdoor scenes, the system will use a pre-trained mask detection model for outdoor scenes. Analyze the lighting conditions of the image and use the adaptive histogram equalization (CLAHE) technology, which improves the local contrast of the image, especially in uneven lighting conditions. By dividing the image into multiple small blocks and applying histogram equalization to each small block, the details of the face area can be effectively enhanced to ensure that the face area of ​​the image is clearly visible. Using a multi-scale detection method, the original image, the image compressed twice, and the image enlarged twice are all put into the mask detection model for outdoor scenes to ensure that the mask wearing situation can be accurately identified regardless of the distance of the person, and finally the outdoor mask detection result is obtained.

[0086] (2) Indoor

[0087] When the scene category is indoor, a pre-trained mask detection model for indoor scenes is used.

[0088] Specifically, for indoor scenes, there may be insufficient light indoors. If the overall brightness level of the image is detected to be low, low-light image enhancement technology will be applied to the low-brightness image to increase the brightness and contrast of the image to ensure that facial features are clearly visible. The processed image is put into the mask detection model for indoor scenes for recognition to obtain the indoor mask detection result.

[0089] Among them, low-light image enhancement technology uses gamma correction technology to adjust the brightness of the image and enhance the details of dark areas.

[0090] (3) Nighttime

[0091] When the scene category is night, a pre-trained mask detection model for night scenes is used. This model has been trained with a large amount of mask data from night scenes and has strong robustness in night scenes.

[0092] Specifically, low-light image enhancement technology is applied to images with low brightness in night scenes to improve the brightness and contrast of the image. Among them, low-light image enhancement technology uses gamma correction technology to adjust the brightness of the image, implements low-light image enhancement strategy, and improves the brightness and contrast of the image to facilitate clear recognition of facial features. Adaptive Threshold segmentation technology is used to extract clear local mask features to ensure that masks can still be accurately detected under low light conditions. Finally, the processed image is placed in the mask detection model for night scenes for recognition to obtain the night mask detection result.

[0093] (4) High exposure

[0094] When the scene category is high exposure, a pre-trained mask detection model for high exposure scenes is used. This model is trained using a large number of high exposure light-colored masks, which can effectively improve the accuracy of mask recognition in this scene.

[0095] Specifically, in high-exposure scenes, low-light image enhancement technology is applied to low-brightness images to improve the brightness and contrast of the image. Among them, low-light image enhancement technology uses gamma correction technology to adjust the brightness of the image. Gamma correction is used to adjust the brightness of the image so that the brightness reaches a normal level. The processed image is then placed in the mask detection model for high-exposure scenes for recognition to obtain a high-exposure mask detection result.

[0096] (5) Crowded

[0097] When the scene category is crowded, such as streets and classrooms, a pre-trained mask detection model for crowded scenes is used.

[0098] Specifically, the number and distribution of people in the image are analyzed, including: pre-training a yolo v10 high-precision face detection model to detect faces in the image. When the number of faces in a certain area of ​​the image reaches a threshold, it is considered to be a densely populated image area. Then, the area is cropped and enlarged, and the image is put into the mask detection model for densely populated scenes for recognition, and the densely populated mask detection result is obtained to ensure that the wearing of masks can be accurately identified regardless of whether the people are densely populated or not.

[0099] (6) Special environments where masks are required

[0100] When the scene category is a special environment where masks need to be worn, such as kitchens and hospitals, a pre-trained mask detection model for special environments where masks need to be worn is used. During the training process, a large number of miscellaneous objects in kitchens and hospitals are added to the model, which are easy to be misidentified. In addition, during the training process, the mask detection model for special environments where masks need to be worn is trained with easy-to-misidentify targets and special masks. For example, a large amount of training has been conducted on special masks such as medical masks, N95 masks, and transparent masks, which improves the model recognition accuracy of such scenes.

[0101] Specifically, the image is placed into a mask detection model for special environments where a mask needs to be worn for recognition, and a special environment mask detection result is obtained.

[0102] In summary, through this series of scene classification-based adaptive mask detection systems, the present invention significantly improves the accuracy and robustness of mask detection, ensuring that the system can operate effectively in a variety of complex environments and meet high-precision detection requirements.

[0103] The scene classification-based adaptive high-precision mask detection method of the present invention provides a high-precision mask detection technology, which can be widely used in public safety, medical treatment and social management.

[0104] Specifically, the present invention can be applied to situations where mask wearing needs to be monitored, such as public transportation, indoor and outdoor public places, hospitals, schools, factories, etc. Through adaptive scene classification technology, the system can optimize mask detection in different environments (such as complex lighting, crowded people, etc.), improve detection accuracy and robustness, and is suitable for real-time monitoring needs in a variety of complex scenes.

[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.

Claims

1. A high-precision mask detection method based on scene classification and adaptation, characterized in that: include: S1, collects mask images under various scene categories and performs model training to generate corresponding scene classification models; During the model training process, a training set mask system is established, and the mask training technology is used to modify the training head of the model. The back-propagated gradient is multiplied by a mask. The mask is 0 for unlabeled categories and 1 for labeled categories, so that the model ignores the GroundTruth value of missing categories during training. The data description of the training set mask system is as follows: Where Mi is the mask value; Loss function modification: During the training process, the loss function L is adjusted to: L′=L·M Among them, L′ is the loss function after mask adjustment, L is the original loss function, M is the mask vector, and the loss contribution of the unlabeled category is set to zero; Backpropagating gradients: Gradients During back propagation it is calculated as: Gradients of unlabeled categories are ignored and do not participate in model parameter updates. is the original loss function gradient; S2, inputting the image into a scene classification model, and the scene classification model identifies the scene category to which the image belongs; wherein the scene categories include: outdoor, indoor, night, high exposure, crowded, and special environments where masks need to be worn; S3: According to the scene category to which the image belongs, select the corresponding exclusive detection model for mask detection, and output the mask detection results corresponding to each scene category.

2. According to the high-precision mask detection method based on scene classification and adaptation according to claim 1, it is characterized in that: In S1, the scene classification model adopts the BEiT-3 image classification model.

3. A high-precision mask detection method based on scene classification and adaptation according to claim 1, characterized in that: In S1, a multi-label classification structure is used to classify and label the scenes, including: setting one or more scene labels for the scenes, and using a binary cross entropy loss function to simultaneously identify multiple scene labels in complex scenes.

4. The high-precision mask detection method based on scene classification and adaptation according to claim 1 is characterized in that: When the scene category is outdoor, a pre-trained mask detection model for outdoor scenes is used to analyze the image lighting conditions, and adaptive histogram equalization technology is used to improve the local contrast of the image; the image is divided into multiple small blocks, and histogram equalization is applied to each small block to enhance the details of the face area; a multi-scale detection method is used to put the original image, the image compressed twice, and the image enlarged twice into the mask detection model for outdoor scenes for recognition, so as to obtain the outdoor mask detection result.

5. The high-precision mask detection method based on scene classification and adaptation according to claim 1 is characterized in that: When the scene category is indoor, low-light image enhancement technology is applied to low-brightness images to improve the brightness and contrast of the image; the processed image is put into the mask detection model for indoor scenes for recognition to obtain the indoor mask detection result.

6. A high-precision mask detection method based on scene classification and adaptation according to claim 1, characterized in that: When the scene category is night, low-light image enhancement technology is applied to low-brightness images to improve the brightness and contrast of the image; adaptive threshold segmentation technology is used to extract clear local mask features, and the processed image is placed in the mask detection model for night scenes for identification to obtain the night mask detection results.

7. The high-precision mask detection method based on scene classification and adaptation according to claim 1 is characterized in that: When the scene category is high exposure, low-light image enhancement technology is applied to low-brightness images to improve the brightness and contrast of the image; the processed image is put into the mask detection model for high-exposure scenes for recognition to obtain the high-exposure mask detection result.

8. The high-precision mask detection method based on scene classification and adaptation according to claim 1 is characterized in that: When the scene category is crowded, the number and distribution of people in the image are analyzed, including: pre-training a yolov10 high-precision face detection model to detect faces in the picture. When the number of faces in a certain area of ​​the picture reaches a threshold, the area is regarded as a crowded image area, and then the area is cropped and enlarged. The image is then put into a mask detection model for crowded scenes for identification, and the crowded mask detection result is obtained.

9. The high-precision mask detection method based on scene classification and adaptation according to claim 1 is characterized in that: When the scene category is a special environment where a mask needs to be worn, a pre-trained mask detection model for special environments where a mask needs to be worn is used, and then the image is placed into the mask detection model for special environments where a mask needs to be worn for recognition. The mask detection model for special environments where a mask needs to be worn adds training for easily misidentified targets and special masks during the training process to obtain special environment mask detection results.

10. A high-precision mask detection method based on scene classification and adaptation according to any one of claims 5-7, characterized in that: The low-light image enhancement technology uses a gamma correction technology to adjust the brightness of the image.

Citation Information

Patent Citations

  • Image contrast enhancement method and device, storage medium and electronic equipment

    CN112102175A

  • Mask recognition model training method and device, computer equipment and readable storage medium

    CN112347988A

  • Cross-domain remote sensing scene classification method adaptive to mask image modeling guide domain

    CN116580243A