# US 2023/0410468 A1 · Method and device for detecting standardization of wearing mask

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0410468 A1
- Document ID: US20230410468A1
- Status: Published application
- Kind: A1
- Application number: 18/242,015
- Filed: 2023-09-05
- Published: 2023-12-21
- Earliest claimed: 2021-06-25
- Assignees: Zhejiang Dahua Technology Co., Ltd.
- Applicants: Zhejiang Dahua Technology Co., Ltd.
- Inventors: Xingming ZHANG; Jingsong HAO; Shulei ZHU
- Web page: https://patentgrep.com/patent/US20230410468A1

## CPC

- G06V 10/751: {Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching}
- G06V 10/82: using neural networks
- G06N 3/0895: Weakly supervised learning, e.g. semi-supervised or self-supervised learning
- G06V 10/759: {Region-based matching}
- G06V 10/774: Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
- G06V 10/776: Validation; Performance evaluation
- G06V 10/95: {structured as a network, e.g. client-server architectures}
- G06V 20/52: Surveillance or monitoring of activities, e.g. for recognising suspicious objects (recognising microscopic objects G06V20/69)
- G06V 40/165: {using facial parts and geometric relationships}
- G06V 40/168: {Feature extraction; Face representation}
- G06V 40/171: {Local features and components; Facial parts (eye characteristics G06V40/18); Occluding parts, e.g. glasses; Geometrical relationships}
- G06V 40/172: {Classification, e.g. identification}
- G06V 10/945: {User interactive design; Environments; Toolboxes}
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

The method includes: receiving an image to be detected, wherein the image to be detected includes an object to be detected; detecting the image to be detected based on a trained multi-task network model to obtain a region where the object wears a mask; comparing an area of the region where the object wears the mask to a predetermined threshold to determine a first detection result; in response to the object being determined as wearing the mask, determining comparison information of a mask area to be compared, and determining a target region in the image to be detected corresponding to the comparison information based on a face feature point template; and obtaining a second detection result based on an overlapping degree between the target region and the region where the object wears the mask.

## Claims

### Claim 1

A method for detecting standardization of mask wearing, comprising:
receiving an image to be detected, wherein the image to be detected comprises an object to be detected;
detecting the image to be detected based on a trained multi-task network model to obtain a region where the object wears a mask;
comparing an area of the region where the object wears the mask to a predetermined threshold to determine a first detection result, wherein the first detection result is that the object is wearing the mask or that the object is not wearing the mask;
in response to the object being determined as wearing the mask, determining comparison information of a mask area to be compared, and determining a target region in the image to be detected corresponding to the comparison information based on a face feature point template, wherein the comparison information represents information of a comparison portion to be detected when standardization of mask wearing is detected, and the face feature point template is determined based on a face region of the object to be detected; and
obtaining a second detection result based on an overlapping degree between the target region and the region where the object wears the mask, wherein the second detection result includes the mask being worn standardly and the mask being worn non-standardly.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the determining comparison information of a mask area to be compared, and the determining a target region in the image to be detected corresponding to the comparison information based on a face feature point template, comprise:
receiving input customized comparison criteria, generating the comparison information of the mask area to be compared based on the customized comparison criteria; and
determining first feature point information corresponding to the comparison information; screening, from the face feature point template, feature points identical to the first feature point information; and
forming the corresponding target region in the image to be detected based on the feature points.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the obtaining a second detection result based on an overlapping degree between the target region and the region where the object wears the mask, comprises:
determining an overlapping region between the target region and the region where the object wears the mask, determining a ratio of the overlapping region to the target region;
determining the second detection result as the mask being worn standardly in response to the ratio being not less than a predetermined threshold; and
determining the second detection result as the mask being worn non-standardly in response to the ratio being less than the predetermined threshold.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the multi-task management model is trained by following operations:
determining a sample image to be trained, wherein the sample image correspondingly comprises a detection frame of a marked face, marked face feature points, a region where a marked object wears the mask or information of whether the marked object wears the mask;
detecting the sample image based on a predetermined multi-task management model to obtain a predicted face detection frame, comparing the predicted face detection frame to the detection frame of the marked face to obtain a first loss value, wherein the first loss value represents a deviation between the predicted face detection frame and the detection frame of the marked face;
detecting the sample image based on the predetermined multi-task management model to obtain predictive detection information, comparing the predictive detection information to the information of whether the marked object is wearing the mask to obtain a second loss value, wherein the second loss value represents a deviation between the predictive detection information and the information of whether the marked object is wearing the mask;
detecting the sample image based on the predetermined multi-task management model to obtain predicted face feature point information, comparing the predicted face feature points to the marked face feature points to obtain a third loss value; wherein the third loss value represents a deviation between the predicted face feature points and the marked face feature points;
detecting the sample image based on the predetermined multi-task management model to obtain a predicted region where the mask is worn, comparing the predicted region where the mask is worn to the region where the marked object wears the mask to obtain a fourth loss value, wherein the fourth loss value represents a deviation between the predicted region where the mask is worn and the region where the marked object wears the mask;
determining an overall loss value based on the first loss value and a weight corresponding to the first loss value, the second loss value and a weight corresponding to the second loss value, the third loss value and a weight corresponding to the third loss value, and the fourth loss value and a weight corresponding to the fourth loss value, adjusting the predetermined multi-task management model based on the overall loss value to obtain an adjusted multi-task management model; and
taking the adjusted multi-task management model as the trained multi-task management model in response to the overall loss value determined by the adjusted multi-task management model being determined as in a predetermined range.

### Claim 5

A computer device, comprises a memory, a processor and computer programs stored in the memory and able to be run by the processor, wherein the computer programs, when being executed by the processor, are configured to implement the operations of:
receiving an image to be detected, wherein the image to be detected comprises an object to be detected;
detecting the image to be detected based on a trained multi-task network model to obtain a region where the object wears a mask;
comparing an area of the region where the object wears the mask to a predetermined threshold to determine a first detection result, wherein the first detection result is that the object is wearing the mask or that the object is not wearing the mask;
in response to the object being determined as wearing the mask, determining comparison information of a mask area to be compared, and determining a target region in the image to be detected corresponding to the comparison information based on a face feature point template, wherein the comparison information represents information of a comparison portion to be detected when standardization of mask wearing is detected, and the face feature point template is determined based on a face region of the object to be detected; and
obtaining a second detection result based on an overlapping degree between the target region and the region where the object wears the mask, wherein the second detection result includes the mask being worn standardly and the mask being worn non-standardly.

### Claim 6 (depends on 5)

The computer device according to claim 5, wherein, while determining comparison information of the mask area to be compared, and determining the target region in the image to be detected corresponding to the comparison information based on the face feature point template, the computer programs are further configured to implement the operations of:
receiving input customized comparison criteria, generating the comparison information of the mask area to be compared based on the customized comparison criteria; and
determining first feature point information corresponding to the comparison information; screening, from the face feature point template, feature points identical to the first feature point information; and
forming the corresponding target region in the image to be detected based on the feature points.

### Claim 7 (depends on 5)

The computer device according to claim 5, wherein, while obtaining the second detection result based on the overlapping degree between the target region and the region where the object wears the mask, the computer programs are further configured to implement the operations of:
determining an overlapping region between the target region and the region where the object wears the mask, determining a ratio of the overlapping region to the target region;
determining the second detection result as the mask being worn standardly in response to the ratio being not less than a predetermined threshold; and
determining the second detection result as the mask being worn non-standardly in response to the ratio being less than the predetermined threshold.

### Claim 8 (depends on 5)

The computer device according to claim 5, wherein the multi-task management model is trained by following operations:
determining a sample image to be trained, wherein the sample image correspondingly comprises a detection frame of a marked face, marked face feature points, a region where a marked object wears the mask or information of whether the marked object wears the mask;
detecting the sample image based on a predetermined multi-task management model to obtain a predicted face detection frame, comparing the predicted face detection frame to the detection frame of the marked face to obtain a first loss value, wherein the first loss value represents a deviation between the predicted face detection frame and the detection frame of the marked face;
detecting the sample image based on the predetermined multi-task management model to obtain predictive detection information, comparing the predictive detection information to the information of whether the marked object is wearing the mask to obtain a second loss value, wherein the second loss value represents a deviation between the predictive detection information and the information of whether the marked object is wearing the mask;
detecting the sample image based on the predetermined multi-task management model to obtain predicted face feature point information, comparing the predicted face feature points to the marked face feature points to obtain a third loss value; wherein the third loss value represents a deviation between the predicted face feature points and the marked face feature points;
detecting the sample image based on the predetermined multi-task management model to obtain a predicted region where the mask is worn, comparing the predicted region where the mask is worn to the region where the marked object wears the mask to obtain a fourth loss value, wherein the fourth loss value represents a deviation between the predicted region where the mask is worn and the region where the marked object wears the mask;
determining an overall loss value based on the first loss value and a weight corresponding to the first loss value, the second loss value and a weight corresponding to the second loss value, the third loss value and a weight corresponding to the third loss value, and the fourth loss value and a weight corresponding to the fourth loss value, adjusting the predetermined multi-task management model based on the overall loss value to obtain an adjusted multi-task management model; and
taking the adjusted multi-task management model as the trained multi-task management model in response to the overall loss value determined by the adjusted multi-task management model being determined as in a predetermined range.

### Claim 9

A non-transitory computer-readable storage medium, having computer programs stored therein, wherein the computer programs, when being executed by the processor, are configured to implement the operations of:
receiving an image to be detected, wherein the image to be detected comprises an object to be detected;
detecting the image to be detected based on a trained multi-task network model to obtain a region where the object wears a mask;
comparing an area of the region where the object wears the mask to a predetermined threshold to determine a first detection result, wherein the first detection result is that the object is wearing the mask or that the object is not wearing the mask;
in response to the object being determined as wearing the mask, determining comparison information of a mask area to be compared, and determining a target region in the image to be detected corresponding to the comparison information based on a face feature point template, wherein the comparison information represents information of a comparison portion to be detected when standardization of mask wearing is detected, and the face feature point template is determined based on a face region of the object to be detected; and
obtaining a second detection result based on an overlapping degree between the target region and the region where the object wears the mask, wherein the second detection result includes the mask being worn standardly and the mask being worn non-standardly.

### Claim 10 (depends on 9)

The non-transitory computer-readable storage medium according to claim 9, wherein, while determining comparison information of the mask area to be compared, and the determining the target region in the image to be detected corresponding to the comparison information based on the face feature point template, the computer programs are configured to implement the operations of:
receiving input customized comparison criteria, generating the comparison information of the mask area to be compared based on the customized comparison criteria; and
determining first feature point information corresponding to the comparison information; screening, from the face feature point template, feature points identical to the first feature point information; and
forming the corresponding target region in the image to be detected based on the feature points.

### Claim 11 (depends on 9)

The non-transitory computer-readable storage medium according to claim 9, wherein, while obtaining the second detection result based on the overlapping degree between the target region and the region where the object wears the mask, the computer programs are configured to implement the operations of:
determining an overlapping region between the target region and the region where the object wears the mask, determining a ratio of the overlapping region to the target region;
determining the second detection result as the mask being worn standardly in response to the ratio being not less than a predetermined threshold; and
determining the second detection result as the mask being worn non-standardly in response to the ratio being less than the predetermined threshold.

### Claim 12 (depends on 9)

The non-transitory computer-readable storage medium according to claim 9, wherein the multi-task management model is trained by following operations:
determining a sample image to be trained, wherein the sample image correspondingly comprises a detection frame of a marked face, marked face feature points, a region where a marked object wears the mask or information of whether the marked object wears the mask;
detecting the sample image based on a predetermined multi-task management model to obtain a predicted face detection frame, comparing the predicted face detection frame to the detection frame of the marked face to obtain a first loss value, wherein the first loss value represents a deviation between the predicted face detection frame and the detection frame of the marked face;
detecting the sample image based on the predetermined multi-task management model to obtain predictive detection information, comparing the predictive detection information to the information of whether the marked object is wearing the mask to obtain a second loss value, wherein the second loss value represents a deviation between the predictive detection information and the information of whether the marked object is wearing the mask;
detecting the sample image based on the predetermined multi-task management model to obtain predicted face feature point information, comparing the predicted face feature points to the marked face feature points to obtain a third loss value; wherein the third loss value represents a deviation between the predicted face feature points and the marked face feature points;
detecting the sample image based on the predetermined multi-task management model to obtain a predicted region where the mask is worn, comparing the predicted region where the mask is worn to the region where the marked object wears the mask to obtain a fourth loss value, wherein the fourth loss value represents a deviation between the predicted region where the mask is worn and the region where the marked object wears the mask;
determining an overall loss value based on the first loss value and a weight corresponding to the first loss value, the second loss value and a weight corresponding to the second loss value, the third loss value and a weight corresponding to the third loss value, and the fourth loss value and a weight corresponding to the fourth loss value, adjusting the predetermined multi-task management model based on the overall loss value to obtain an adjusted multi-task management model; and
taking the adjusted multi-task management model as the trained multi-task management model in response to the overall loss value determined by the adjusted multi-task management model being determined as in a predetermined range.
