Image recognition method, medium, apparatus, and computing device

By acquiring feature maps of images and training a target image recognition model, and combining this with a face detection model to perform preliminary predictions and further verification of feature maps, the problem of poor recognition of small areas in existing technologies is solved, and the accurate identification and prevention of the spread of harmful information in images is achieved.

CN114550230BActive Publication Date: 2025-12-16HANGZHOU NETEASE ZHIQI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111464229.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-02
Publication Date
2025-12-16
Estimated Expiration
2041-12-02

AI Technical Summary

Technical Problem

Existing image recognition models are ineffective at identifying small areas and struggle to accurately identify harmful information in images, thus increasing the risk of harmful information spreading.

Method used

By acquiring feature maps of the image to be identified and training a target image recognition model based on the feature maps of the target parts, the model can accurately determine whether the image contains the target parts. The model can then be combined with a face detection model to make preliminary predictions and further verify the feature maps, thereby improving the recognition accuracy.

Benefits of technology

It improves the accuracy of identifying small areas, reduces false detections and missed detections, effectively prevents the spread of harmful information, and safeguards network security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114550230B_ABST
    Figure CN114550230B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide an image recognition method, medium, device and computing device, obtaining an image to be recognized; extracting a feature map of the image to be recognized; inputting the feature map into a target image recognition model to obtain a first recognition result corresponding to the feature map. In the embodiments of the present disclosure, the feature map can more accurately express the feature information of the image, so that the model can accurately determine whether the target part is contained in the image to be recognized according to the feature information in the feature map, thereby timely limiting the spread of harmful information containing the target part and guaranteeing network security.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the technical field of image recognition, and more particularly, embodiments of the present disclosure relate to an image recognition method, medium, device and computing device. BACKGROUND

[0002] This section is intended to provide background information to facilitate a better understanding of embodiments of the disclosure recited in the claims. The description herein does not constitute admission that the information provided herein is prior art to the present disclosure.

[0003] With the continuous popularity of short video software and friend-making software, harmful information spreading in the mobile Internet has gradually increased. In the face of increasing user volume and the trend of younger users, how to accurately identify harmful information in images and timely limit the spread of harmful information is imminent.

[0004] In related technologies, image recognition models are usually used to identify harmful information in images. However, these image recognition models have better recognition effect on large area parts, and poorer recognition effect on small area parts. SUMMARY

[0005] In this context, embodiments of the present disclosure aim to provide an image recognition method, medium, device and computing device.

[0006] In a first aspect of the embodiments of the present disclosure, an image recognition method is provided, comprising: obtaining a to-be-recognized image; extracting a feature map of the to-be-recognized image; inputting the feature map into a target image recognition model to obtain a first recognition result corresponding to the feature map, the first recognition result being used to indicate whether the to-be-recognized image contains a target part, the target image recognition model being obtained based on a sample image, the sample image including a feature map of the target part.

[0007] In an embodiment of the present disclosure, the sample image further includes an image of a first face region, the first face region containing a region where the target part is located; the extracting of the feature map of the to-be-recognized image comprises: inputting the to-be-recognized image into the target image recognition model to obtain a prediction result corresponding to the to-be-recognized image, the prediction result being used to indicate whether the to-be-recognized image contains the target part; and in response to the prediction result indicating that the to-be-recognized image does not contain the target part, extracting the feature map of the to-be-recognized image.

[0008] In an embodiment of the present disclosure, the image to be identified is input into the target image recognition model to obtain a prediction result corresponding to the image to be identified, comprising: inputting the image to be identified into the face detection model to obtain a second recognition result corresponding to the image to be identified, the second recognition result being used to indicate whether the image to be identified contains a second face region, the second face region being larger than the first face region; in response to the second recognition result being that the image to be identified does not contain the second face region, inputting the image to be identified into the target image recognition model to obtain the prediction result corresponding to the image to be identified.

[0009] In an embodiment of the present disclosure, the sample image further comprises an image of a second face region, the second face region containing a region where the target part is located; the image recognition method further comprises: in response to the second recognition result being that the image to be identified contains the second face region, determining a target parameter of the second face region in the image to be identified; in response to the target parameter meeting a preset model processing requirement, inputting the second face region in the image to be identified into the target image recognition model to obtain a third recognition result corresponding to the image to be identified, the third recognition result being used to indicate whether the second face region of the image to be identified contains the target part.

[0010] In an embodiment of the present disclosure, the image recognition method further comprises: in response to the target parameter not meeting the preset model processing requirement, determining that the image to be identified does not contain the target part.

[0011] In a second aspect of the embodiments of the present disclosure, a training method of an image recognition model is provided, comprising: obtaining a sample image, the sample image comprising a feature map of a region where a target part is located; training the image recognition model through the sample image to obtain a loss function value; and in response to the loss function value meeting a preset requirement, determining that the current image recognition model is a target image recognition model.

[0012] In an embodiment of the present disclosure, the sample image is obtained by: obtaining an original sample image, the original sample image containing the target part; and extracting a feature map of a region where the target part is located based on a feature visualization technology, and determining the feature map as the sample image.

[0013] In an embodiment of the present disclosure, the sample image further comprises an image of a second face region; the loss function value is obtained by training the image recognition model through the sample image, comprising: obtaining an original sample image, the original sample image containing the target part; detecting a second face region in the original sample image through a face detection model to obtain a second image corresponding to the second face region of the original sample image; and training the image recognition model through the second image and the feature map to obtain the loss function value.

[0014] In an embodiment of the present disclosure, the sample image further includes an image of a first face region, the first face region being smaller than the second face region; the image recognition model is trained by using the second image, the feature map, to obtain a loss function value, including: obtaining a target key point in the second image; performing cutout processing and / or truncation processing on at least part of the second image according to the target key point, to obtain a first image of the first face region; and training the image recognition model by using the second image, the feature map, and the first image, to obtain the loss function value.

[0015] In an embodiment of the present disclosure, the training method further includes: obtaining a backflow image in the data backflow; identifying the backflow image by using the target image recognition model to obtain an identification result; determining a backflow image containing the target part and having an identification result of the target image recognition model as not containing the target part as a target backflow image; and training the target image recognition model by using the target backflow image.

[0016] In an embodiment of the present disclosure, the image recognition model includes a residual network, a pooling layer, and a full connection layer; the image feature of the feature map is obtained by using the residual network; the target feature in the image feature is obtained by using the pooling layer; and the loss function value is output according to the target feature by using the full connection layer.

[0017] In a third aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, and the computer readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the image recognition method of the first aspect and / or the training method of the image recognition model of the second aspect is implemented.

[0018] In a fourth aspect of the embodiments of the present disclosure, an image recognition device is provided, and includes:

[0019] The first obtaining module is configured to obtain a to-be-identified image; the extraction module is configured to extract a feature map of the to-be-identified image; and the processing module is configured to input the feature map into a target image recognition model to obtain a first identification result corresponding to the feature map, the first identification result being used to indicate whether the to-be-identified image contains a target part, the target image recognition model being trained based on a sample image, and the sample image including a feature map of the target part.

[0020] In an embodiment of the present disclosure, the sample image further includes an image of a first face region, the first face region containing a region where the target part is located; and the extraction module is specifically configured to: input the to-be-identified image into the target image recognition model to obtain a prediction result corresponding to the to-be-identified image, the prediction result being used to indicate whether the to-be-identified image contains the target part; and in response to the prediction result being that the to-be-identified image does not contain the target part, extract the feature map of the to-be-identified image.

[0021] In an embodiment of the present disclosure, the processing module is specifically configured to: input the to-be-identified image into a face detection model to obtain a second identification result corresponding to the to-be-identified image, the second identification result being used to indicate whether the to-be-identified image contains a second face region, the second face region being larger than the first face region; and in response to the second identification result being that the to-be-identified image does not contain the second face region, input the to-be-identified image into the target image identification model to obtain the prediction result corresponding to the to-be-identified image.

[0022] In an embodiment of the present disclosure, the sample image further includes an image of a second face region, the second face region containing a region where the target part is located; the processing module is specifically configured to: in response to the second identification result being that the to-be-identified image contains the second face region, determine a target parameter of the second face region in the to-be-identified image; and in response to the target parameter meeting a preset model processing requirement, input the second face region in the to-be-identified image into the target image identification model to obtain a third identification result corresponding to the to-be-identified image, the third identification result being used to indicate whether the second face region of the to-be-identified image contains the target part.

[0023] In an embodiment of the present disclosure, the processing module is further configured to: in response to the target parameter not meeting the preset model processing requirement, determine that the to-be-identified image does not contain the target part.

[0024] In a fifth aspect of the embodiments of the present disclosure, a training device of an image identification model is provided, including: a second acquisition module configured to acquire a sample image, the sample image including a feature map of a region where a target part is located; a training module configured to train the image identification model through the sample image to obtain a loss function value; and a determination module configured to determine, in response to the loss function value meeting a preset requirement, that a current image identification model is a target image identification model.

[0025] In an embodiment of the present disclosure, the second acquisition module is specifically configured to: acquire an original sample image, the original sample image containing the target part; and extract, based on a feature visualization technology, the feature map of the region where the target part is located to determine the feature map as the sample image.

[0026] In an embodiment of the present disclosure, the sample image further includes an image of a second face region; the training module is specifically configured to: acquire an original sample image, the original sample image containing the target part; detect, through a face detection model, a second face region in the original sample image to obtain a second image corresponding to the second face region of the original sample image; and train the image identification model through the second image and the feature map to obtain the loss function value.

[0027] In an embodiment of the present disclosure, the sample image further comprises an image of a first face region, the first face region being smaller than the second face region; the training module is specifically configured to: acquire a target key point in the second image; perform cutout processing and / or truncation processing on at least part of the second image according to the target key point, to obtain a first image of the first face region; and train the image recognition model by using the second image, the feature map and the first image, to obtain a loss function value.

[0028] In an embodiment of the present disclosure, the second acquisition module is further configured to: acquire a reflux image in the data reflux; identify the reflux image by using the target image recognition model to obtain an identification result; determine, as a target reflux image, a reflux image that contains the target part and for which the identification result of the target image recognition model is that the target part is not contained; and the training module is further configured to: train the target image recognition model by using the target reflux image.

[0029] In an embodiment of the present disclosure, the image recognition model comprises a residual network, a pooling layer and a fully connected layer; the residual network is configured to acquire an image feature of the feature map; the pooling layer is configured to acquire a target feature in the image feature; and the fully connected layer is configured to output the loss function value according to the target feature.

[0030] In a sixth aspect of the embodiments of the present disclosure, a computing device is provided, comprising: at least one processor and a memory; the memory stores computer-executable instructions; and the at least one processor stores the computer-executable instructions stored in the memory, so that the at least one processor executes the image recognition method of the first aspect and / or the training method of the image recognition model of the second aspect.

[0031] According to the embodiments of the present disclosure, the image to be recognized is acquired; a feature map of the image to be recognized is extracted; and the feature map is input into the target image recognition model to obtain a first identification result corresponding to the feature map. In the embodiments of the present disclosure, the feature map can more accurately express the feature information of the image, so that the model can accurately determine whether the image to be recognized contains the target part according to the feature information in the feature map, thereby timely limiting the spread of harmful information containing the target part and ensuring network security. BRIEF DESCRIPTION OF DRAWINGS

[0032] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:

[0033] Figure 1 An application scenario schematic diagram is provided for the embodiments of the present disclosure;

[0034] Figure 2Flowchart of the image recognition method provided by the embodiments of the present disclosure Figure 1 ;

[0035] Figure 3(a) is a flowchart of the image recognition method provided by the embodiments of the present disclosure Figure 2 ;

[0036] Figures 3(b) and 3(c) are example diagrams of the first face region

[0037] Figure 4(a) is a flowchart of the image recognition method provided by the embodiments of the present disclosure

[0038] Figure 4(b) is an example diagram of the second face region

[0039] Figure 5 Flowchart of the training method of the image recognition model provided by the embodiments of the present disclosure Figure 1 ;

[0040] Figure 6 Structural diagram of the image recognition model provided by the embodiments of the present disclosure

[0041] Figure 7 Flowchart of the training method of the image recognition model provided by the embodiments of the present disclosure Figure 2 ;

[0042] Figure 8 Flowchart of the training method of the image recognition model provided by the embodiments of the present disclosure

[0043] Figure 9 Structural diagram of the storage medium provided by the embodiments of the present disclosure

[0044] Figure 10 Structural diagram of the image recognition device provided by the embodiments of the present disclosure

[0045] Figure 11 Structural diagram of the training device of the image recognition model provided by the embodiments of the present disclosure

[0046] Figure 12 Structural diagram of the computing device provided by the embodiments of the present disclosure

[0047] In the drawings, the same or corresponding reference numbers represent the same or corresponding parts. DETAILED DESCRIPTION

[0048] The principles and spirits of the present disclosure will be described below with reference to a number of exemplary embodiments. It should be understood that the embodiments are given only so that those skilled in the art can better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, the embodiments are provided so that the present disclosure is more thorough and complete, and the scope of the present disclosure is fully conveyed to those skilled in the art.

[0049] Those skilled in the art will appreciate that the embodiments of the present disclosure can be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure can be embodied in the form of entire hardware, entire software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0050] According to embodiments of the present disclosure, a training method of an image recognition model, a medium, an apparatus and a computing device are provided.

[0051] In addition, the number of any elements in the drawings is used for illustration only and not limitation, and any naming is only for distinction and does not have any limiting meaning.

[0052] The principles and spirits of the present disclosure will be described below with reference to a number of exemplary embodiments. It should be understood that the embodiments are given only so that those skilled in the art can better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, the embodiments are provided so that the present disclosure is more thorough and complete, and the scope of the present disclosure is fully conveyed to those skilled in the art. SUMMARY

[0054] With the continuous popularity of short video software and friend-making software, harmful information spreading in mobile Internet is also gradually increasing. In the face of increasing user volume and the trend of younger users, how to accurately identify harmful information in images and timely limit the spread of harmful information is imminent.

[0055] In the related art, an image recognition model is usually used to identify harmful information in images. However, the present inventors have found that the image recognition model has good recognition effect on large area parts, but poor recognition effect on small area parts.

[0056] Therefore, in the embodiments of the present disclosure, an image recognition method, a medium, an apparatus and a computing device are provided. By obtaining a feature map of a to-be-identified image, a target image recognition model trained based on the feature map of a target part is used to identify the feature map, so as to accurately determine whether the feature map contains the target part, and further determine whether the to-be-identified image contains harmful information.

[0057] The method and the apparatus are based on the same application concept. Since the principles of the method and the apparatus for solving problems are similar, the implementation of the apparatus and the method can be referred to each other, and the repeated parts will not be described again.

[0058] After introducing the basic principles of the present disclosure, the various non-limiting embodiments of the present disclosure will be specifically introduced below.

[0059] OVERVIEW OF APPLICATION SCENARIOS

[0060] Firstly, refer to Figure 1 , Figure 1 application scenarios provided by the embodiments of the present disclosure. It schematically shows the application scenarios of the image recognition method and / or the training method of the image recognition model of the embodiments of the present disclosure, as shown in Figure 1 , the scene includes a server 101 and / or a terminal 102, and the image recognition process or the training process of the image recognition model is realized through the server 101 or the terminal 102.

[0061] Among them, the server 101 can be a single server, or a server cluster, can be a distributed server, or a centralized server, or a cloud server.

[0062] The terminal 102 can be a personal digital assistant (PDA) device, a handheld device with wireless communication function (such as a smart phone, a tablet computer), a computing device (such as a personal computer (PC)), a vehicle-mounted device, a wearable device (such as a smart watch, a smart bracelet), a smart home device (such as a smart display device), etc.

[0063] Exemplary Method

[0064] Next, combined with the application scenario shown in Figure 1 , the image recognition method and the training method of the image recognition model according to the exemplary embodiments of the present disclosure will be described with reference to Figures 2-8 , it should be noted that the above application scenario is only shown for the purpose of facilitating the understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.

[0065] Figure 2 The flowchart of the image recognition method provided by the embodiments of the present disclosure is shown in Figure 1 . As shown in Figure 2 , the image recognition method provided by the embodiments includes the following steps:

[0066] S201, obtaining an image to be recognized.

[0067] S202, extracting a feature map of the image to be recognized.

[0068] In the embodiments of the present disclosure, before the to-be-identified image is identified by the model, the feature information in the to-be-identified image can be further extracted to obtain a feature map of the to-be-identified image, so as to help the image recognition model to make a more accurate decision. For a to-be-identified image with less feature information of the target part, for example, the to-be-identified image only contains a partial face region, or if the to-be-identified image is blurred, the present solution can also accurately determine whether the to-be-identified image contains the target part, thereby preventing false detection and avoiding the spread of harmful information.

[0069] In some embodiments, the feature map is, for example, a class activation heat map corresponding to the to-be-identified image, in which the similarity of each position in the to-be-identified image to the target part can be indicated in the form of a heat map. For example, taking the tongue as the target part, in the embodiments of the present disclosure, the feature map of the to-be-identified image can be extracted by a feature visualization technology (Class Activation Mapping, CAM), and the feature map indicates the similarity of each position in the to-be-identified image to the tongue in the form of a heat map.

[0070] In some embodiments, the feature map is, for example, a class activation heat map corresponding to the to-be-identified image, in which the similarity of each position in the to-be-identified image to the target part can be indicated in the form of a heat map. For example, taking the tongue as the target part, in the embodiments of the present disclosure, the feature map of the to-be-identified image can be extracted by a feature visualization technology (Class Activation Mapping, CAM), and the feature map indicates the similarity of each position in the to-be-identified image to the tongue in the form of a heat map.

[0071] In some embodiments, the feature map is, for example, a class activation heat map corresponding to the to-be-identified image, in which the similarity of each position in the to-be-identified image to the target part can be indicated in the form of a heat map. For example, taking the tongue as the target part, in the embodiments of the present disclosure, the feature map of the to-be-identified image can be extracted by a feature visualization technology (Class Activation Mapping, CAM), and the feature map indicates the similarity of each position in the to-be-identified image to the tongue in the form of a heat map.

[0072] In some embodiments, the feature map is, for example, a class activation heat map corresponding to the to-be-identified image, in which the similarity of each position in the to-be-identified image to the target part can be indicated in the form of a heat map. For example, taking the tongue as the target part, in the embodiments of the present disclosure, the feature map of the to-be-identified image can be extracted by a feature visualization technology (Class Activation Mapping, CAM), and the feature map indicates the similarity of each position in the to-be-identified image to the tongue in the form of a heat map.

[0073] In some embodiments, the feature map is, for example, a class activation heat map corresponding to the to-be-identified image, in which the similarity of each position in the to-be-identified image to the target part can be indicated in the form of a heat map. For example, taking the tongue as the target part, in the embodiments of the present disclosure, the feature map of the to-be-identified image can be extracted by a feature visualization technology (Class Activation Mapping, CAM), and the feature map indicates the similarity of each position in the to-be-identified image to the tongue in the form of a heat map.

[0074] In some embodiments, the feature map is, for example, a class activation heat map corresponding to the to-be-identified image, in which the similarity of each position in the to-be-identified image to the target part can be indicated in the form of a heat map. For example, taking the tongue as the target part, in the embodiments of the present disclosure, the feature map of the to-be-identified image can be extracted by a feature visualization technology (Class Activation Mapping, CAM), and the feature map indicates the similarity of each position in the to-be-identified image to the tongue in the form of a heat map.

[0075] FIG. 3(a) is a flowchart of an image recognition method provided by the embodiments of the present disclosure Figure 2As shown in FIG. 3(a), the image recognition method provided in this embodiment includes the following steps.

[0076] S301, obtaining an image to be recognized.

[0077] S302, inputting the image to be recognized into a target image recognition model to obtain a prediction result corresponding to the image to be recognized.

[0078] In some embodiments, the sample image used for training the image recognition model further includes an image of a first facial region, and the first facial region contains a region where the target part is located. For example, still taking the tongue as the target part, the first facial region can be a partial facial region containing the region where the tongue is located, and missing at least one other facial feature region.

[0079] The facial feature region includes a mouth region (i.e., the region where the tongue is located), a nose region, an eye region, a brow region, and an ear region.

[0080] For ease of understanding, please refer to FIG. 3(b) and FIG. 3(c), which are example diagrams of the first facial region. As shown in FIG. 3(b), the facial region includes a mouth region 1 (i.e., the region where the tongue is located) and a nose region 2, and as shown in FIG. 3(c), the facial region includes a mouth region 1 (i.e., the region where the tongue is located), a nose region 2, and an eye region 3, which are all facial regions containing the region where the tongue is located and missing other facial feature regions.

[0081] In the embodiments of the present disclosure, since the target part can also be included in the non-complete facial image, training the image recognition model by using the first facial region containing the target part can make the image recognition model have the recognition function for the partial facial region, so that when the image to be recognized is a non-complete facial image, the non-complete facial image can also be accurately determined whether it contains the target part. The specific training process is shown in subsequent embodiments.

[0082] The prediction result is used to indicate whether the target part is included in the image to be recognized.

[0083] S303, determining whether the target part is included in the image to be recognized based on the prediction result.

[0084] S304, in response to the prediction result indicating that the target part is included in the image to be recognized, determining that the prediction result is the final recognition result.

[0085] That is, in the embodiment of the present disclosure, the local facial region is first preliminarily predicted by the target image recognition model, and when the prediction result is that the target part is contained in the to-be-recognized image, the recognition result of the target part contained in the to-be-recognized image is output. Then, this process does not need to extract the feature map of the to-be-recognized image, and further recognition is performed on the feature map, which can simplify the recognition process and improve the image recognition efficiency.

[0086] S305, in response to the prediction result that the target part is not contained in the to-be-recognized image, extracting a feature map of the to-be-recognized image.

[0087] In the embodiment of the present disclosure, since the feature information in the local facial image is still relatively small, there is still a risk of false detection when the target image recognition model is used for recognition, that is, when the actual target part is contained, the recognition result may be that the target part is not contained, thereby causing the spread of harmful information. Therefore, when the prediction result is that the target part is not contained in the to-be-recognized image, the feature map of the to-be-recognized image is extracted and further recognized, thereby avoiding the spread of harmful information.

[0088] S306, inputting the feature map into the target image recognition model to obtain a first recognition result corresponding to the feature map.

[0089] Specifically, the extracted feature map is input into the target image recognition model for further recognition to obtain a first recognition result.

[0090] The first recognition result is used to indicate whether the target part is contained in the to-be-recognized image. If the first recognition result is that the target part is contained in the to-be-recognized image, it means that the to-be-recognized image is a harmful image. Correspondingly, if the first recognition result is that the target part is not contained in the to-be-recognized image, it means that the to-be-recognized image is not a harmful image.

[0091] It should be noted that the scheme and principle of obtaining the feature map of the to-be-recognized image and recognizing the feature map in steps S305 and S306 are similar to steps S202 and S203 in the embodiment shown in Figure 2 This will not be repeated here.

[0092] In the embodiments of the present disclosure, since the feature information in the local face image is still relatively small, there is still a risk of false detection when identifying through the target image recognition model, resulting in inaccurate prediction results of the image actually containing the target part, and further causing the spread of harmful information. In the embodiments of the present disclosure, the target image recognition model is first used to preliminarily predict the to-be-identified image, and when the prediction result is that the to-be-identified image does not contain the target part, the feature map is further used for verification, so as to ensure the accuracy of the identification result and prevent the spread of harmful information. In addition, by preliminarily predicting the to-be-identified image through the target image recognition model, if the model can identify it, there is no need to further obtain the feature map of the to-be-identified image and perform the next step of identification, and the image recognition efficiency can be improved.

[0093] FIG. 4(a) is a flowchart of an image recognition method provided by the embodiments of the present disclosure. As shown in FIG. 4, the image recognition method provided by the present embodiment includes the following steps:

[0094] S401, obtaining a to-be-identified image.

[0095] S402, inputting the to-be-identified image into a face detection model to obtain a second identification result corresponding to the to-be-identified image.

[0096] The face detection model is used to detect whether the to-be-identified image contains a second face region. The second face region is a complete face region larger than the first face region, and the second face region contains a region where the target part is located.

[0097] In some embodiments, the face detection model is obtained by training a face image containing a complete facial feature region. Through the face detection model, it can be determined whether the to-be-identified image contains a complete facial feature region, so as to determine whether the to-be-processed image contains the second face region.

[0098] Specifically, when the second identification result is that the to-be-identified image does not contain a complete facial feature region, it is determined that the to-be-identified image does not contain the second face region. When the second identification result is that the to-be-identified image contains a complete facial feature region, it is determined that the to-be-identified image contains the second face region.

[0099] Still taking the tongue as an example of the target part, the second face region can be a face region containing complete facial features, wherein the facial feature region includes a mouth region (i.e., a region where the tongue is located), a nose region, an eye region, a brow region, and an ear region.

[0100] For ease of understanding, please refer to FIG. 4(b), which is an example of the second face region. As shown in FIG. 4(b), the face region includes a mouth region 1 (i.e., a region where the tongue is located), a nose region 2, an eye region 3, a brow region 4, and an ear region 5 (one side is taken as an example in the figure).

[0101] S403, judging whether the second face region is contained in the to-be-identified image based on the second recognition result.

[0102] S404, in response to the second recognition result indicating that the second face region is contained in the to-be-identified image, determining a target parameter of the second face region in the to-be-identified image.

[0103] The target parameter can be an area of the second face region, a resolution of the second face region, and the like.

[0104] S405, judging whether the target parameter meets a preset model processing requirement.

[0105] It should be noted that the preset model processing requirement is a parameter threshold of each target parameter. Taking the target parameters of the area and the resolution as examples, when the area of the second face region is less than an area threshold, or the resolution of the second face region is less than a resolution threshold, it is considered that the target parameter does not meet the preset model processing requirement. The similar preset model processing requirements and threshold parameters of each type can be set according to experience values, and the embodiments of the present disclosure are not limited specifically.

[0106] S406, in response to the target parameter not meeting the preset model processing requirement, determining that the to-be-identified image does not contain the target part.

[0107] In the embodiments of the present disclosure, when the target parameter of the to-be-identified image does not meet the preset model processing requirement, it indicates that the area of the face region in the to-be-identified image is small or the resolution is low, even if the to-be-identified image contains the target part, the harmful degree is also small, which can be considered as not containing the target part, so as not to further identify it, so as to simplify the image recognition process and improve the image recognition efficiency.

[0108] S407, in response to the target parameter meeting the preset model processing requirement, inputting the second face region in the to-be-identified image into a target image recognition model to obtain a third recognition result corresponding to the to-be-identified image.

[0109] It should be understood that when the target parameter of the to-be-identified image meets the preset model processing requirement, it indicates that the area of the face region in the to-be-identified image is large or the resolution is high, and if the target part exists, it will cause great harm, and therefore the target part identification is needed.

[0110] In some embodiments, the sample image used to train the image recognition model also includes an image of the second facial region (i.e., the entire facial region). By training the image recognition model through the entire facial region, the target image recognition model can be enabled to recognize the target part in the entire facial region, so that when the image to be recognized is a complete facial image, an accurate recognition result can be obtained. The specific training process is shown in subsequent embodiments.

[0111] In the embodiments of the present disclosure, when it is determined that the image to be recognized contains the second facial region, the second facial region is directly recognized by the target image recognition model, so that whether the image to be recognized contains the target part can be accurately recognized. Through the present solution, the subsequent recognition process can be avoided, the image recognition process can be simplified, and the image recognition efficiency can be greatly improved.

[0112] S408, in response to the second recognition result that the image to be recognized does not contain the second facial region, inputting the image to be recognized into the target image recognition model to obtain a prediction result corresponding to the image to be recognized.

[0113] In some embodiments, the sample image used to train the image recognition model also includes an image of the first facial region (i.e., the local facial region). By training the image recognition model through the local facial region, the target image recognition model can be enabled to recognize the target part in the local facial region, so that when the image to be recognized is a local facial image, an accurate recognition result can also be obtained. The specific training process is shown in subsequent embodiments.

[0114] The inventors have found that when the image to be recognized does not contain the second facial region (i.e., the complete facial region), the image to be recognized can be a local facial region, and the local facial region can still contain the target part. In the embodiments of the present disclosure, the image recognition model is further used to recognize the image that does not contain the second facial region, which can prevent missing detection of the local facial image containing the target part, thereby improving the accuracy of the detection result and preventing the spread of harmful information.

[0115] S409, determining whether the image to be recognized contains the target part based on the prediction result.

[0116] S410, in response to the prediction result that the image to be recognized contains the target part, determining that the prediction result is the final recognition result.

[0117] The prediction result is used to indicate whether the image to be recognized contains the target part.

[0118] That is, in this step, the local face region is first predicted by the target image recognition model, and when the prediction result is that the target part is contained in the to-be-identified image, the recognition result of the target part contained in the to-be-identified image is output, and further recognition is not performed.

[0119] S411, in response to the prediction result that the target part is not contained in the to-be-identified image, extracting a feature map of the to-be-identified image.

[0120] On the other hand, since the feature information in the local face image is still relatively small, there is still a risk of false detection when identifying by the target image recognition model, resulting in inaccurate prediction results of images actually containing target parts, and further causing the spread of harmful information. In the embodiment of the present disclosure, when the prediction result is that the target part is not contained in the to-be-identified image, the feature map of the to-be-identified image is extracted again, and further identification is performed on the feature map, which can prevent missed detection.

[0121] S412, inputting the feature map into the target image recognition model to obtain a first recognition result corresponding to the feature map.

[0122] Specifically, the extracted feature map is input into the target image recognition model for further identification to obtain a first recognition result.

[0123] The first recognition result is used to indicate whether the target part is contained in the to-be-identified image. If the first recognition result is that the target part is contained in the to-be-identified image, it means that the to-be-identified image is a harmful image. Correspondingly, if the first recognition result is that the target part is not contained in the to-be-identified image, it means that the to-be-identified image is not a harmful image.

[0124] It should be noted that the scheme and principle of obtaining the feature map of the to-be-identified image and identifying the feature map in steps S411 and S412 are similar to those of steps S202 and S203 in the embodiment shown in Figure 5 , which will not be described here.

[0125] Figure 1 The flowchart of the training method of the image recognition model provided by the embodiment of the present disclosure is shown in Figure 5 . As shown in Figure 6 , the training method provided by the embodiment includes the following steps:

[0126] S501, obtaining a sample image.

[0127] The sample image includes a feature map of a region where the target part is located. In some embodiments, the feature map is, for example, a class activation heat map corresponding to the to-be-identified image, and in the feature map, the similarity between each position in the to-be-identified image and the target part can be indicated in the form of a heat map. For example, taking the tongue as the target part, in the embodiments of the present disclosure, the feature map of the to-be-identified image can be extracted by a feature visualization technology, and the feature map indicates the similarity between each position in the to-be-identified image and the tongue in the form of a heat map.

[0128] S502, training the image recognition model by using the sample image to obtain a loss function value.

[0129] For ease of understanding, the scheme of the embodiments of the present disclosure is described in detail in combination with the structure of the image recognition model. Figure 6 The structure of the image recognition model provided by the embodiments of the present disclosure is shown in FIG. 1. Figure 7 As shown in FIG. 1, the image recognition model provided by the embodiments of the present disclosure includes a residual network, a pooling layer, and a fully connected layer.

[0130] In the embodiments of the present disclosure, after the sample image is obtained, the sample image is input into the residual network of the image recognition model, and the image features of the sample image are obtained by the residual network.

[0131] Further, the image features obtained by the residual network are input into the pooling layer, the target features in the sample image are obtained by the pooling layer for feature extraction, and then the target features are classified by the fully connected layer to obtain the probability value of each position in the feature map being the target part, so as to obtain the loss function value according to the probability value.

[0132] It should be noted that the specific type of the loss function corresponding to the loss function value is not limited in the embodiments of the present disclosure. For example, the loss function corresponding to the loss function value can be a BCELoss function. Taking the loss function corresponding to the loss function value as the BCELoss function as an example, the loss function value output by the classification module in each training process can be obtained by the following formula:

[0133]

[0134] pred is the probability value of the sample image output by the image recognition model, and label is the label (0, 1) of the sample image, wherein 1 is used to identify that the sample image includes the target part (i.e. positive sample), and 0 is used to identify that the sample image does not include the target part (i.e. negative sample).

[0135] S503, in response to the loss function value meeting the preset requirement, determining that the current image recognition model is a target image recognition model.

[0136] Further, when the loss function value does not converge, the model parameters corresponding to the residual network can be adjusted according to the loss function value. Correspondingly, when the loss function value converges, it indicates that the residual network training is completed, and the current model corresponding to the residual network is determined as the target image recognition model.

[0137] It should be noted that the model parameter types of each module in the image recognition model and the adjustment method of the model parameters are not specifically limited here.

[0138] In the embodiments of the present disclosure, since the feature map can more accurately express the feature information of the image, the image recognition model is trained based on the feature map of the target part, so that the model can accurately determine whether the target part is contained in the to-be-identified image, thereby timely limiting the spread of harmful information containing the target part and ensuring network security.

[0139] Figure 2 The flowchart of the training method of the image recognition model provided in the embodiments of the present disclosure Figure 7 As shown in Figure 8 , the training method of the image recognition model provided in the embodiments includes the following steps:

[0140] S701, obtaining an original sample image.

[0141] The original sample image contains a target part.

[0142] S702, based on a feature visualization technology, extracting a feature map of a region where the target part is located, and determining the feature map as a sample image.

[0143] The feature map is, for example, a class activation heat map corresponding to the to-be-identified image. In the feature map, the similarity between each position in the to-be-identified image and the target part can be indicated in the form of a heat map. For example, taking the tongue as the target part, in the embodiments of the present disclosure, the feature map of the original sample image can be extracted by the feature visualization technology, and the feature map indicates the similarity between each position in the original sample image and the tongue in the form of a heat map.

[0144] S703, detecting a second face region in the original sample image by a face detection model, and obtaining a second image corresponding to the second face region of the original sample image.

[0145] The second face region is the entire face region of a person, and the second image is a face image.

[0146] The inventors find that the original sample image can contain other body parts of the person or other background information, which can cause certain interference to the training process, and make the accuracy of the model worse. In the embodiment of the disclosure, the face detection model is used to detect the face in the original sample image, the entire face region in the original sample image can be checked, and the image recognition model is trained by the image of the face region, so that the target image recognition model has the ability to recognize the target part in the complete face image, and the accuracy of the target image recognition model is improved.

[0147] S704, training the image recognition model by the second image and the feature map to obtain a loss function value.

[0148] In addition, in the process of image recognition by the target image recognition model, the source of the image to be recognized is wide, and the face region can be incomplete, so that the recognition result is inaccurate, for example, the face region is truncated or the face region is partially blocked.

[0149] However, the public data set or the artificially collected samples are limited, and the target image recognition model obtained by training the image recognition model by the limited sample images has poor recognition effect on the above several types of images to be recognized.

[0150] Therefore, in another embodiment, the image of the complete face region can also be preprocessed in this step to obtain the image of the incomplete face region, and the image recognition model is trained by the image of the incomplete face region, so that the target recognition model can accurately recognize whether the target part is contained in the incomplete face image when recognizing the incomplete face image.

[0151] The sample image of the first face region can be obtained by cutting or cutout processing of the second image, and the step S704 specifically includes the following steps:

[0152] (1) Obtain the target key point in the second image.

[0153] It should be understood that the target key point is not limited in the embodiment of the disclosure, and the target part is taken as the tongue for example, the target key point can be the mouth, eyes, nose, ears and other parts, and can also be more face key points, which will not be described one by one here.

[0154] (2) According to the target key point, at least part of the second image is cutout processed and / or truncated processed to obtain the first image of the first face region.

[0155] In example one, when the second image is truncated, for each image, a region where the target part is located in the second image is determined according to the target key point, the region where the target part is located is truncated from the second image to obtain the first image of the first facial region, and the first image containing the target part is the positive sample image, and the first image not containing the target part is the negative sample image.

[0156] In example two, when the second image is cut out, for each image, at least one position in the second image is randomly cut out, for example, at least one of an eye region, a nose region, and a mouth region is cut out to obtain the first image. The first image containing the target part is the positive sample image, and the first image not containing the target part is the negative sample image.

[0157] (3) The image recognition model is trained by using the second image, the feature map, and the first image to obtain a loss function value.

[0158] It should be noted that the way of training the image recognition model by using different images is similar to the above embodiments, and details are not repeated here.

[0159] In this embodiment, the truncation processing and the cut-out processing can simulate the situation that the facial region in the real image is not complete (for example, an image containing only a tongue region, or an image in which the eyes, nose, and other parts are blocked), thereby improving the recognition effect of the target image recognition model on the non-complete facial image. At the same time, the target key point can accurately determine the truncation region and the cut-out region, and further improve the recognition effect of the image to be recognized.

[0160] In addition, it should be noted that for the same second image, the truncation processing and the cut-out processing can be performed at the same time to ensure the diversification of the sample image and further improve the training effect of the target image recognition model.

[0161] Figure 8 A flowchart of the training method of the image recognition model provided in the embodiments of the present disclosure is shown in FIG. 3. Exemplary Medium As shown in FIG. 3, the training method provided in the embodiments of the present disclosure includes the following steps:

[0162] S801, obtaining a backflow image in a data backflow.

[0163] In some embodiments, a large amount of data backflow can be obtained through the Internet, and to obtain a more accurate image recognition model, the target image recognition model can be further trained by using the backflow image in the data backflow, thereby improving the accuracy of the target image recognition model.

[0164] S802, identifying the backflow image by using the target image recognition model to obtain an identification result.

[0165] The recognition results include the following types:

[0166] (1) The reflowed image contains the target area, but the recognition result is that it does not contain the target area;

[0167] (2) The reflowed image contains the target area, and the recognition result indicates that the target area is contained;

[0168] (3) The reflowed image does not contain the target area, but the recognition result indicates that the target area is contained;

[0169] (4) The reflow image does not contain the target area, and the recognition result is that the target area is not contained.

[0170] Among them, the recognition results corresponding to types (1) and (3) indicate that the target image recognition model has failed to recognize the target image. The target image recognition model can be further trained by the two corresponding return images, thereby optimizing the target image recognition model.

[0171] S803. Determine that the reflow image containing the target region and whose recognition result from the target image recognition model is that it does not contain the target region is the target reflow image.

[0172] S804. Train the target image recognition model using the target reflow image.

[0173] It should be noted that the principle of training the target image recognition model using the target reflow image is similar to the principle of training the image recognition model using sample images in the above embodiment, and will not be repeated here.

[0174] In this embodiment of the disclosure, by re-training the target image recognition model with the reflowed image, the target image recognition model can be continuously optimized, thereby improving the accuracy of the target image recognition model and further improving the accuracy of its recognition results.

[0175] Figure 9

[0176] After introducing the methods of exemplary embodiments of this disclosure, the following references are made. Figure 9 The storage medium of the exemplary embodiments of this disclosure will be described.

[0177] Figure 9 A schematic diagram of a storage medium provided in an embodiment of this disclosure. (See reference) Exemplary Apparatus As shown, the storage medium 900 stores a program product for implementing the above-described audio processing method according to embodiments of the present disclosure. This program product may be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto.

[0178] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0179] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium.

[0180] Program code for performing the operations disclosed herein can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN).

[0181] Figure 10

[0182] Having introduced the medium of exemplary embodiments of this disclosure, the following references are made to... Figure 11 , Figure 10 The image recognition apparatus and the image recognition model training apparatus of the exemplary embodiments of this disclosure will be described respectively, which are used to implement the methods in any of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.

[0183] Figure 10 This is a schematic diagram of the structure of an image recognition device provided in an embodiment of this disclosure. Figure 11 As shown, the image recognition device 1000 provided in this embodiment includes: a first acquisition module 1001, an extraction module 1002, and a processing module 1003.

[0184] The first obtaining module 1001 is configured to obtain a to-be-identified image.

[0185] The extraction module 1002 is configured to extract a feature map of the to-be-identified image.

[0186] The processing module 1003 is configured to input the feature map into a target image recognition model to obtain a first identification result corresponding to the feature map, where the first identification result is used to indicate whether the target part is contained in the to-be-identified image, and the target image recognition model is obtained based on a sample image including a feature map of the target part.

[0187] In an embodiment of the present disclosure, the sample image further includes an image of a first face region, and the first face region contains a region where the target part is located; the extraction module 1002 is specifically configured to: input the to-be-identified image into the target image recognition model to obtain a prediction result corresponding to the to-be-identified image, where the prediction result is used to indicate whether the target part is contained in the to-be-identified image; and in response to the prediction result indicating that the target part is not contained in the to-be-identified image, extract the feature map of the to-be-identified image.

[0188] In an embodiment of the present disclosure, the processing module 1003 is specifically configured to: input the to-be-identified image into a face detection model to obtain a second identification result corresponding to the to-be-identified image, where the second identification result is used to indicate whether a second face region is contained in the to-be-identified image, and the second face region is larger than the first face region; and in response to the second identification result indicating that the second face region is not contained in the to-be-identified image, input the to-be-identified image into the target image recognition model to obtain a prediction result corresponding to the to-be-identified image.

[0189] In an embodiment of the present disclosure, the sample image further includes an image of a second face region, and the second face region contains a region where the target part is located; the processing module 1003 is specifically configured to: in response to the second identification result indicating that the second face region is contained in the to-be-identified image, determine a target parameter of the second face region in the to-be-identified image; and in response to the target parameter satisfying a preset model processing requirement, input the second face region in the to-be-identified image into the target image recognition model to obtain a third identification result corresponding to the to-be-identified image, where the third identification result is used to indicate whether the second face region of the to-be-identified image contains the target part.

[0190] In an embodiment of the present disclosure, the processing module 1003 is further configured to: in response to the target parameter not satisfying the preset model processing requirement, determine that the to-be-identified image does not contain the target part.

[0191] The image recognition device provided in the embodiments of the present disclosure can implement the processes in the embodiments of the image recognition method, and achieve the same functions and effects, which will not be described here.

[0192] Figure 11A structural schematic diagram of a training device of an image recognition model is provided for an embodiment of the present disclosure. As shown in the structural schematic diagram of the training device 1100, the training device 1100 includes a second acquisition module 1101, a training module 1102, and a determination module 1103. Exemplary Computing Device

[0193] The second acquisition module 1101 is configured to acquire a sample image, the sample image including a feature map of a region where a target part is located. The training module 1102 is configured to train the image recognition model by using the sample image to obtain a loss function value. The determination module 1103 is configured to determine that a current image recognition model is a target image recognition model in response to the loss function value meeting a preset requirement.

[0194] In an embodiment of the present disclosure, the second acquisition module 1101 is specifically configured to acquire an original sample image, the original sample image containing a target part; and extract a feature map of a region where the target part is located based on a feature visualization technology, and determine the feature map as the sample image.

[0195] In an embodiment of the present disclosure, the sample image further includes an image of a second face region.

[0196] The training module 1102 is specifically configured to acquire an original sample image, the original sample image containing a target part; detect a second face region in the original sample image by using a face detection model to obtain a second image corresponding to the second face region of the original sample image; and train the image recognition model by using the second image and the feature map to obtain a loss function value.

[0197] In an embodiment of the present disclosure, the sample image further includes an image of a first face region, the first face region being smaller than the second face region.

[0198] The training module 1102 is specifically configured to acquire a target key point in the second image; perform cutout processing and / or truncation processing on at least part of the second image according to the target key point to obtain a first image of a first face region; and train the image recognition model by using the second image, the feature map, and the first image to obtain a loss function value.

[0199] In an embodiment of the present disclosure, the second acquisition module 1101 is further configured to acquire a backflow image in a data backflow; identify the backflow image by using the target image recognition model to obtain an identification result; determine a backflow image containing the target part and having an identification result of the target image recognition model as not containing the target part as a target backflow image; and the training module 1102 is further configured to train the target image recognition model by using the target backflow image.

[0200] ​In one embodiment of the present disclosure, the image recognition model comprises a residual network, a pooling layer and a fully connected layer; through the residual network, image features of a feature map are obtained; through the pooling layer, target features in the image features are obtained; through the fully connected layer, a loss function value is output according to the target features.

[0201] The training device provided in the foregoing embodiment of the present disclosure can implement each process in the embodiment of the training method of the image recognition model and achieve the same functions and effects, and details are not described herein.

[0202] Figure 12

[0203] After introducing the method, medium and device of the exemplary embodiments of the present disclosure, next, with reference to Figure 12 The computing device of the exemplary embodiments of the present disclosure is described.

[0204] It should be understood that Figure 12 The displayed computing device 1200 is only an example and should not bring any limitation to the functions and use range of the embodiments of the present disclosure.

[0205] Figure 12 The structural schematic diagram of the computing device provided in the embodiments of the present disclosure is shown. As Figure 12 The computing device 1200 is shown in the form of a general computing device. The components of the computing device 1200 can include but are not limited to the above-mentioned at least one processing unit 1201, the above-mentioned at least one storage unit 1202, a bus 1203 connecting different system components including the processing unit 1201 and the storage unit 1202.

[0206] The bus 1203 includes a data bus, a control bus and an address bus. The storage unit 1202 can include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1212 and / or a cache memory 1222, and can further include a readable medium in the form of a non-volatile memory, such as a read-only memory (ROM) 1232.

[0207] The storage unit 1202 can also include programs / utilities 1252 having a set of (at least one) program modules 1242, such as an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which can include the implementation of a network environment.

[0208] The computing device 1200 can also communicate with one or more external devices 1204 such as a keyboard or pointing device, through Input / Output (I / O) interfaces 1205. And, the computing device 1200 can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the Internet, through a network adapter 1206. As ​ illustrated, the network adapter 1206 communicates with the other modules of the computing device 1200 through the bus 1203. It should be appreciated that, although not shown, other hardware and / or software modules could be used in conjunction with the computing device 1200. Examples, include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.

[0209] It should be noted that, although several units / modules or sub-units / modules of the training apparatus and the image recognition apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, according to embodiments of the present disclosure, features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, features and functions of one unit / module described above can be further divided into embodied by multiple units / modules.

[0210] Moreover, while operations of the methods of the present disclosure are described in a particular order in the drawings, this is not required or implied, and the desired results can be achieved without performing all of the operations shown, or performing the operations in the particular order shown. Additionally or alternatively, certain steps can be omitted, combined into a single step, and / or split into multiple steps.

[0211] While the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it is to be understood that the present disclosure is not limited to the specific embodiments disclosed and that the division of aspects is not meant to imply that features from one aspect cannot be combined with features from another aspect to advantage, but is merely for convenience of description. The present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the claims appended hereto.

Claims

1. An image recognition method, comprising: Acquire the image to be recognized; The image to be identified is input into a face detection model to obtain a second recognition result corresponding to the image to be identified. The second recognition result is used to indicate whether the image to be identified contains a second facial region. The second facial region is a complete facial region that is larger than the first facial region and includes the region where the target part is located. In response to the second recognition result that the image to be recognized does not contain the second facial region, the image to be recognized is input into the target image recognition model to obtain the prediction result corresponding to the image to be recognized. The prediction result is used to indicate whether the image to be recognized contains the target part. In response to the prediction result that the target region is not contained in the image to be identified, the feature map of the image to be identified is extracted; The feature map is input into the target image recognition model. Based on the similarity between each position in the feature map and the target part, it is determined whether each position in the feature map is the target part. Then, based on the determination result of each position, a first recognition result corresponding to the feature map is obtained. The first recognition result is used to indicate whether the image to be recognized contains the target part. The target image recognition model is trained based on sample images. The sample images include feature maps of the target part. The sample images also include images of a first facial region. The first facial region is an incomplete facial region that includes the area where the target part is located and is missing at least one other facial feature area.

2. The image recognition method according to claim 1, wherein the sample image further includes an image of a second facial region, the second facial region containing the region where the target part is located; The image recognition method further includes: In response to the second recognition result that the image to be recognized contains a second facial region, the target parameters of the second facial region in the image to be recognized are determined; In response to the target parameters meeting the preset model processing requirements, the second facial region in the image to be identified is input into the target image recognition model to obtain the third recognition result corresponding to the image to be identified. The third recognition result is used to indicate whether the second facial region of the image to be identified contains the target part.

3. The image recognition method according to claim 2 further includes: In response to the fact that the target parameters do not meet the preset model processing requirements, it is determined that the target part is not contained in the image to be identified.

4. A method for training an image recognition model, comprising: Acquire a sample image, the sample image including a feature map of the region where the target part is located; The image recognition model is trained using the sample images to obtain the loss function value; In response to the loss function value satisfying the preset requirements, the current image recognition model is determined to be the target image recognition model; the target image recognition model is the target image recognition model of any one of claims 1-3.

5. The training method according to claim 4, wherein acquiring the sample image includes: Obtain an original sample image, wherein the original sample image contains the target region; Based on feature visualization technology, feature maps of the region where the target part is located are extracted, and the feature maps are determined to be the sample image.

6. The training method according to claim 4, wherein the sample image further includes an image of a second facial region; The image recognition model is trained using the sample images to obtain the loss function value, including: Obtain an original sample image, wherein the original sample image contains the target region; Using a face detection model, the second face region in the original sample image is detected, and the second image corresponding to the second face region in the original sample image is obtained. The image recognition model is trained using the second image and the feature map to obtain the loss function value.

7. The training method according to claim 6, wherein the sample image further includes an image of a first facial region, the first facial region being smaller than the second facial region; The step of training the image recognition model using the second image and the feature map to obtain a loss function value includes: Obtain the target key points in the second image; Based on the target key points, at least a portion of the second image is subjected to image cutout and / or truncation processing to obtain a first image of the first facial region; The image recognition model is trained using the second image, the feature map, and the first image to obtain a loss function value.

8. The training method according to any one of claims 4-7, further comprising: Acquire the reflow image during data reflow; The reflowed image is identified using the target image recognition model to obtain the recognition result; The reflow image is defined as the one that contains the target region and whose recognition result of the target image recognition model is that it does not contain the target region. The target image recognition model is trained using the target reflow image.

9. The training method according to any one of claims 4-7, wherein the image recognition model comprises a residual network, a pooling layer, and a fully connected layer; The image features of the feature map are obtained through the residual network; The target features in the image features are obtained through the pooling layer; The loss function value is output through the fully connected layer based on the target features.

10. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the image recognition method as described in any one of claims 1 to 3, and / or, the training method for the image recognition model as described in any one of claims 4 to 9.

11. An image recognition device, comprising: The first acquisition module acquires the image to be recognized; An extraction module is configured to input the image to be identified into a face detection model to obtain a second recognition result corresponding to the image to be identified. The second recognition result indicates whether the image to be identified contains a second facial region. The second facial region is a complete facial region larger than a first facial region, and the second facial region contains the region where the target part is located. In response to the second recognition result indicating that the image to be identified does not contain a second facial region, the image to be identified is input into a target image recognition model to obtain a prediction result corresponding to the image to be identified. The prediction result indicates whether the image to be identified contains the target part. In response to the prediction result indicating that the image to be identified does not contain the target part, features of the image to be identified are extracted. The processing module is used to input the feature map into the target image recognition model, determine whether each position in the feature map is the target part based on the similarity between each position in the feature map and the target part, and then obtain a first recognition result corresponding to the feature map based on the judgment result of each position. The first recognition result is used to indicate whether the image to be recognized contains the target part. The target image recognition model is trained based on sample images, and the sample images include feature maps of the target part. The sample images also include an image of a first facial region, which is an incomplete facial region that includes the area where the target part is located and is missing at least one other facial feature area.

12. The image recognition device according to claim 11, wherein the sample image further includes an image of a second facial region, the second facial region containing the region where the target part is located; The processing module is specifically used to determine the target parameters of the second facial region in the image to be identified in response to the second recognition result indicating that the image to be identified contains a second facial region. In response to the target parameters meeting the preset model processing requirements, the second facial region in the image to be identified is input into the target image recognition model to obtain the third recognition result corresponding to the image to be identified. The third recognition result is used to indicate whether the second facial region of the image to be identified contains the target part.

13. The image recognition device according to claim 12, wherein the processing module is further configured to: determine that the target part is not contained in the image to be recognized in response to the target parameter not meeting the preset model processing requirements.

14. A training device for an image recognition model, comprising: The second acquisition module is used to acquire a sample image, the sample image including a feature map of the region where the target part is located; The training module is used to train the image recognition model using the sample images and obtain the loss function value. The determination module is used to determine the current image recognition model as the target image recognition model in response to the loss function value meeting the preset requirements; the target image recognition model is the target image recognition model of any one of claims 11-13.

15. The training apparatus according to claim 14, wherein the second acquisition module is specifically used for: Obtain an original sample image, wherein the original sample image contains the target region; Based on feature visualization technology, feature maps of the region where the target part is located are extracted, and the feature maps are determined to be the sample image.

16. The training apparatus of claim 14, wherein the sample image further comprises an image of a second facial region; The training module is specifically used for: Obtain an original sample image, wherein the original sample image contains the target region; Using a face detection model, the second face region in the original sample image is detected, and the second image corresponding to the second face region in the original sample image is obtained. The image recognition model is trained using the second image and the feature map to obtain the loss function value.

17. The training apparatus according to claim 16, wherein the sample image further includes an image of a first facial region, the first facial region being smaller than the second facial region; The training module is specifically used for: Obtain the target key points in the second image; Based on the target key points, at least a portion of the second image is subjected to image cutout and / or truncation processing to obtain a first image of the first facial region; The image recognition model is trained using the second image, the feature map, and the first image to obtain a loss function value.

18. The training apparatus according to any one of claims 14-17, wherein the second acquisition module is further configured to: Acquire reflow images from the data reflow; identify the reflow images using the target image recognition model to obtain recognition results; determine the reflow images that contain the target part and whose recognition result from the target image recognition model is that they do not contain the target part as target reflow images; The training module is also used to train the target image recognition model using the target reflow image.

19. The training apparatus according to any one of claims 14-17, wherein the image recognition model comprises a residual network, a pooling layer, and a fully connected layer; The residual network is used to obtain image features from the feature map; the pooling layer is used to obtain target features from the image features; and the fully connected layer is used to output loss function values ​​based on the target features.

20. A computing device, comprising: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor stores computer execution instructions in the memory, causing the at least one processor to execute the image recognition method as described in any one of claims 1 to 3, and / or the image recognition model training method as described in any one of claims 4 to 9.

Citation Information

Patent Citations

  • Face recognition method and device, electronic equipment and storage medium

    CN110363047A

  • Image detection method and device, electronic equipment and medium

    CN111797754A

  • Face recognition method and device, computer equipment and storage medium

    CN112364827A

  • Cascading type face shielding expression recognition method based on multiple tasks

    CN112766158A

  • Expression recognition method and device and electronic equipment

    CN112818838A