Image recognition method and device

By determining the portrait area and judging its content in image recognition, and combining the classification model to identify vulgar content, the problem of misjudgment in image recognition in the existing technology is solved, and the recognition precision and accuracy are improved.

CN112016345BActive Publication Date: 2024-09-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910451827.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-05-28
Publication Date
2024-09-06
Estimated Expiration
2039-05-28

AI Technical Summary

Technical Problem

Among the existing image recognition methods, the binary classification model is not very accurate in identifying vulgar content and is prone to misjudgment. It cannot effectively filter out images that do not include human portraits and images that do not have specific human portrait parts.

Method used

By determining whether the image to be recognized includes a portrait area, and determining whether the portrait area only includes non-vulgar objects, if not, use a classification model to identify whether the portrait area includes vulgar content, and then determine whether the image is a vulgar image.

Benefits of technology

It effectively reduces the classification model's misjudgment of images that do not include portraits and do not have specific portrait parts, improves the recognition accuracy and accuracy, and reduces the interference of background information on recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112016345B
    Figure CN112016345B
Patent Text Reader

Abstract

The embodiment of the present application discloses an image recognition method and device. For an image to be recognized, it is determined whether the image includes a portrait area. If the image includes a portrait area, it is determined whether the portrait area includes only non-vulgar objects. If it does not include only non-vulgar objects, it is determined whether the portrait area of ​​the image to be recognized includes vulgar content according to a classification model, and whether the image to be recognized is a vulgar image according to the recognition result. Since vulgar images are often characterized by including exposed portrait parts, that is, they all have portrait areas, by identifying whether the image includes a portrait area, images to be recognized that do not include any portraits at all are effectively screened out, thereby avoiding the classification model from misjudging such images. Moreover, the exposed portrait parts in vulgar images are relatively specific, so by judging the non-vulgar objects in the portrait area, images to be recognized that do not have the aforementioned specific portrait parts are effectively screened out, thereby avoiding the classification model from misjudging such images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to an image recognition method and device. Background Art

[0002] With the development of the Internet, images can be easily spread on the Internet. Users can easily browse other users' shared and published images on the Internet, or be pushed various advertisements including images.

[0003] However, some users with ulterior motives may use this to spread images containing vulgar content on the Internet. The spread of such images on the Internet will have a negative impact or mislead users who browse such images. Therefore, in order to purify the network environment, it is necessary to accurately identify and filter such images.

[0004] At present, the traditional image filtering method mainly uses a binary classification model, which directly inputs the image obtained from the network into the classifier, and then the binary classification model predicts whether the image contains vulgar content. However, this method is not very accurate and is prone to misjudgment. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides an image recognition method and device, which can reduce the misjudgment of images by classification models.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] In a first aspect, an embodiment of the present application provides an image recognition method, the method comprising:

[0008] Determine whether the image to be recognized includes a portrait area;

[0009] If so, determining whether the portrait region includes only non-vulgar objects;

[0010] If not, identifying whether the portrait area of ​​the image to be identified includes vulgar content according to the classification model;

[0011] Determine whether the image to be identified is a vulgar image according to the identification result.

[0012] In a second aspect, an embodiment of the present application provides an image recognition device, the device comprising a first determination unit, a judgment unit, a recognition unit, and a second determination unit:

[0013] The first determination unit is used to determine whether the image to be identified includes a portrait area;

[0014] The judging unit is configured to judge whether the portrait area includes only non-vulgar objects;

[0015] The recognition unit is used to identify whether the portrait area of ​​the image to be recognized includes vulgar content according to the classification model;

[0016] The second determination unit is used to determine whether the image to be identified is a vulgar image according to the identification result.

[0017] In a third aspect, an embodiment of the present application provides a device for image recognition, the device comprising a processor and a memory:

[0018] The memory is used to store program code and transmit the program code to the processor;

[0019] The processor is used to execute the image recognition method described in the first aspect according to the instructions in the program code.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the image recognition method described in the first aspect.

[0021] It can be seen from the above technical solution that for the image to be identified, it is determined whether the image to be identified includes a portrait area. If it includes a portrait area, it is determined whether the portrait area only includes non-vulgar objects. If it does not only include non-vulgar objects, it is determined whether the portrait area of ​​the image to be identified includes vulgar content according to the classification model, and whether the image to be identified is a vulgar image according to the recognition result. Since the characteristics of vulgar images are mostly including exposed portrait parts, that is, all have portrait areas, by identifying whether the image includes a portrait area, the images to be identified that do not include portraits at all are effectively screened out, avoiding the classification model from misjudging such images. Moreover, the exposed portrait parts in vulgar images are relatively specific, so by judging the non-vulgar objects in the portrait area, the images to be identified that do not have the aforementioned specific portrait parts are effectively screened out, avoiding the classification model from misjudging such images. In addition, the classification model mainly performs vulgar recognition based on the portrait area in the image to be identified, further filtering out the interference caused by other background information in the image to be identified, and improving the recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0023] Figure 1A schematic diagram of a method for recognizing images through a binary classification model;

[0024] Figure 2 This is an example image that is misclassified as a vulgar image by the binary classification model;

[0025] Figure 3 A schematic diagram of an application scenario of an image recognition method provided in an embodiment of the present application;

[0026] Figure 4 A flowchart of an image recognition method provided in an embodiment of the present application;

[0027] Figure 5 A schematic diagram of a method for detecting a portrait area provided in an embodiment of the present application;

[0028] Figure 6 A schematic diagram of a method for identifying non-vulgar objects in a portrait area provided in an embodiment of the present application;

[0029] Figure 7 A schematic diagram of a method for identifying non-vulgar objects in a portrait area provided in an embodiment of the present application;

[0030] Figure 8 A schematic diagram of a prompt message sent to a reviewer indicating that an image to be identified is a vulgar image provided in an embodiment of the present application;

[0031] Fig. 9 A flowchart of a summary information matching method provided in an embodiment of the present application;

[0032] Fig.10 A flow chart of an image recognition method provided in an embodiment of the present application;

[0033] Fig.11 A comparison chart of recognition results of three different image recognition models provided in an embodiment of the present application;

[0034] Fig.12 A structural diagram of an image recognition device provided in an embodiment of the present application;

[0035] Fig.13 A structural diagram of a device for image recognition provided in an embodiment of the present application;

[0036] Fig.14 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0038] Currently, binary classification models are mainly used to predict whether an image contains vulgar content. Figure 1 , which shows a schematic diagram of a method for recognizing images through a binary classification model. Figure 1 As shown in the figure, the method of identifying whether an image is a vulgar image by a binary classification model is as follows: the image is input into the binary classification model, the binary classification model identifies the image, and outputs the identification result. When the identification result is that the image is a vulgar image, the reviewer can be prompted; when the identification result is that the image is a non-vulgar image (normal image), it can be allowed to pass normally. However, this method is not very accurate and is prone to misjudgment. For example, when using a binary classification model to identify some images that do not contain vulgar content, these images may be predicted as vulgar images. See Figure 2 , which shows an example image that is misclassified as vulgar by a binary classification model.

[0039] To this end, the embodiment of the present application provides an image recognition method, which mainly uses a multi-level filtering method to filter out images that do not contain vulgar content at each level, thereby avoiding the classification model from misjudging these types of images. In addition, for the images to be identified that have not been filtered out, when the classification model is used to perform vulgarity identification for the images to be identified, the classification model can mainly perform vulgarity identification based on the portrait area in the images to be identified, thereby further filtering out the interference caused by other background information in the images to be identified, and improving the recognition accuracy.

[0040] First, the application scenario of the embodiment of the present application is introduced. The image recognition method provided in the embodiment of the present application can be applied to a server, which can be a dedicated server used only for image recognition or a public server that also includes other data processing functions, which is not limited in the embodiment of the present application.

[0041] In order to facilitate understanding of the technical solution of the present application, the image recognition method provided in the embodiment of the present application is introduced below in combination with actual application scenarios.

[0042] See also Figure 3 , which shows a schematic diagram of an application scenario of an image recognition method provided by an embodiment of the present application. The application scenario includes a server 301. Since the characteristics of vulgar images are mostly including exposed portrait parts. In other words, vulgar images should include a portrait area. Among them, the portrait area can be an image area including a complete portrait or a partial portrait (including one or more portrait parts).

[0043] Based on this, first, the server 301 can determine whether the image to be identified includes a portrait area. If the image to be identified includes a portrait area, it indicates that the image to be identified is likely to be a vulgar image, and the next step of vulgarity identification of the image is performed for it. If the image to be identified does not include a portrait area, it can be indicated that the image to be identified is unlikely to be a vulgar image, and the image to be identified is determined as a non-vulgar image and filtered. In this way, by only performing vulgarity identification on the images to be identified that include a portrait area, and filtering those images to be identified that do not include a portrait at all, it is possible to avoid the classification model from misjudging the images to be identified that do not include a portrait.

[0044] For example: for Figure 2 As the image shown does not include the portrait area, this step can be used to Figure 2 The image shown is filtered, thereby avoiding the classification model from misjudging the image to be identified that does not include a portrait.

[0045] Next, since the exposed parts of the portrait in the vulgar image are relatively specific, for the image to be identified that includes the portrait area, it can be determined whether the portrait area in the image to be identified only includes non-vulgar objects. The non-vulgar objects mentioned here may include objects that do not belong to vulgar content, such as the head, etc.

[0046] If it is determined that the portrait area of ​​the image to be identified only includes such non-vulgar objects, it can be indicated that the portrait area of ​​the image to be identified has no possibility of having the aforementioned specific portrait part, so the image to be identified can be determined to be a non-vulgar image (normal image) and filtered. If it is determined that the portrait area of ​​the image to be identified does not only include non-vulgar objects, that is, the portrait area of ​​the image to be identified includes other portrait parts in addition to non-vulgar objects, it can be indicated that the image to be identified may include the aforementioned specific portrait part, and the next step of vulgarity identification of the image is performed.

[0047] In this way, if the portrait area of ​​the image to be identified only includes such non-vulgar objects, it can be determined that the portrait area of ​​the image to be identified does not have the aforementioned specific portrait part at all. Therefore, the image to be identified that only includes non-vulgar objects in the portrait area can be effectively filtered, thereby avoiding the classification model from misjudging such image to be identified.

[0048] Finally, for the unfiltered image to be identified after the aforementioned filtering step, the classification model can be used to identify the vulgarity of the image to be identified, and whether the image to be identified is a vulgar image can be determined based on the identification result. When the image to be identified is identified by the classification model, since the vulgarity identification is mainly based on the portrait area in the image to be identified, the interference caused by other background information in the image to be identified can be further filtered out, thereby improving the recognition accuracy.

[0049] Next, the image recognition method provided in the embodiment of the present application will be introduced with reference to the accompanying drawings.

[0050] See also Figure 4 , which shows a flow chart of an image recognition method, the method comprising:

[0051] S401: Determine whether the image to be recognized includes a portrait area, if so, execute S402.

[0052] In the embodiment of the present application, for the image to be identified, it can be determined whether it includes a portrait area. If it is determined that it includes a portrait area, S302 is executed. If it is determined that it does not include a portrait area, it can be determined to be a normal image and allowed to pass normally.

[0053] In a specific implementation, a neural network model for person detection can be constructed based on a convolutional neural network image detection model and a Single Shot MultiBox Detection (SSD) algorithm, so that it can detect the portrait area from the input image. The constructed neural network model for person detection is used as a person detection module.

[0054] Among them, see Figure 5 , which shows a schematic diagram of a method for detecting a portrait area provided by an embodiment of the present application. Figure 5 As shown, the image to be identified can be input into the person detection module. If the person detection module detects a portrait region in the image to be identified, the portrait region can be framed and the next step S402 can be performed. If no portrait region is detected in the image to be identified, it can be determined that there is no person in the image to be identified, and the image is determined to be a non-vulgar image (normal image) and automatically passed.

[0055] By filtering out those images to be identified that do not include any human portraits at all, it is possible to avoid misjudging such images by the classification model.

[0056] S402: Determine whether the portrait area includes only non-vulgar objects, if not, execute S403.

[0057] Among them, the non-vulgar objects may include objects that do not belong to vulgar content. In actual scenes, for example, the head, hands, and feet of the human body can all belong to non-vulgar objects. In addition, although the aforementioned specific portrait parts may be exposed in the two portraits of pregnant women and babies, such as the abdomen of pregnant women, these two portraits do not belong to vulgar content. Based on this, in a possible implementation, the non-vulgar objects may include any one or more combinations of pregnant women, babies, human heads, hands, or feet.

[0058] Since the exposed parts of the portrait in the vulgar image are relatively specific, after determining that the image to be identified includes a portrait area, it can be determined whether the portrait area only includes non-vulgar objects. If it is determined that the portrait area of ​​the image to be identified includes only non-vulgar objects, it can be determined that the image to be identified is a non-vulgar image and it is allowed to pass normally. If it is determined that the portrait area of ​​the image to be identified does not only include non-vulgar objects, the next S403 process is performed for it.

[0059] In a specific implementation, for the two special persons, pregnant women or infants, a special person classification model can be constructed accordingly, so that it can realize the function of identifying pregnant women or infants from the portrait area. In addition, a human body part classification model can also be constructed, so that it can realize the function of identifying various parts of the human body from the portrait area. Among them, for the special person classification model and the human body part classification model, they can all be trained in the picture classification model based on the 50-layer convolutional neural network.

[0060] Based on this, see Figure 6 , which shows a schematic diagram of a method for identifying non-vulgar objects in a portrait area provided by an embodiment of the present application. Figure 6 As shown, the image to be identified can be input into the special person classification model and the human body part classification model respectively. After the special person classification model identifies the image to be identified, if it is determined that the portrait area of ​​the image to be identified includes an infant or a pregnant woman, the infant or the pregnant woman can be determined as a non-vulgar object. After the human body part classification model identifies the image to be identified, if it is determined that the portrait area of ​​the image to be identified includes a human head, hands, feet, legs, etc., the human head, hands, feet, legs, etc. can be determined as non-vulgar objects.

[0061] In this way, the recognition results of the portrait area in the image to be recognized can be respectively analyzed according to the special person classification model and the human body part classification model, and a decision can be made on the image to be recognized to determine whether the image to be recognized includes only non-vulgar objects. If so, that is, the portrait area of ​​the image to be recognized includes only non-vulgar objects, then the image to be recognized is determined to be a non-vulgar image and is automatically passed to proceed to the subsequent steps.

[0062] If it is determined according to the special person recognition model and the human body part recognition model that the portrait region of the image to be recognized does not only include non-vulgar objects, the next processing of S403 is performed for the image to be recognized.

[0063] By effectively filtering the images to be identified that only include non-vulgar objects in such portrait areas, the classification model is prevented from misjudging such images to be identified.

[0064] S403: Identify whether the portrait area of ​​the image to be identified includes vulgar content according to the classification model.

[0065] If the image to be identified is not filtered after S401-S402, the image to be identified can be identified by the classification model and an identification result can be obtained. The identification result can be whether the portrait area of ​​the image to be identified includes vulgar content, for example, the identification result can be: the image to be identified includes vulgar content, or the image to be identified does not include vulgar content.

[0066] S404: Determine whether the image to be identified is a vulgar image according to the identification result.

[0067] In the embodiment of the present application, it can be determined whether the image to be identified is a vulgar image according to the recognition result. For example, if the recognition result is that the image to be identified includes vulgar content, it can be determined that the image to be identified is a vulgar image according to the recognition result; if the recognition result is that the image to be identified does not include vulgar content, it can be determined that the image to be identified is a non-vulgar image according to the recognition result.

[0068] In the embodiment of the present application, vulgarity recognition is mainly performed based on the portrait area in the image to be recognized, thereby further filtering out the interference caused by other background information in the image to be recognized, thereby improving the recognition accuracy.

[0069] In summary, for the image to be identified, it is determined whether the image to be identified includes a portrait area. If it includes a portrait area, it is determined whether the portrait area only includes non-vulgar objects. If it does not only include non-vulgar objects, it is determined whether the portrait area of ​​the image to be identified includes vulgar content according to the classification model, and whether the image to be identified is a vulgar image according to the recognition result. Since the characteristics of vulgar images are mostly exposed portrait parts, that is, they all have portrait areas, by identifying whether the image includes a portrait area, the images to be identified that do not include portraits at all are effectively screened out, avoiding the classification model from misjudging such images. Moreover, the exposed portrait parts in vulgar images are relatively specific, so by judging the non-vulgar objects in the portrait area, the images to be identified that do not have the aforementioned specific portrait parts are effectively screened out, avoiding the classification model from misjudging such images. In addition, the classification model mainly performs vulgar recognition based on the portrait area in the image to be identified, further filtering out the interference caused by other background information in the image to be identified, and improving the recognition accuracy.

[0070] In order to make the recognition result of the image to be recognized interpretable, in a possible implementation, the classification model in S403 may include a real person classification model and a non-real person classification model. The real person classification model may be used to identify the portrait area corresponding to the real person; the non-real person classification model may be used to identify the portrait area corresponding to the non-real person. For example, the non-real person may be an anime character, a game character, etc. Then, the method for S403 may include:

[0071] S501: Determine whether the image content included in the portrait area corresponds to a real person or a non-real person. If it corresponds to a real person, execute S502; if it corresponds to a non-real person, execute S503.

[0072] S502: Identify whether the portrait area of ​​the image to be identified includes vulgar content according to the real person classification model.

[0073] S503: Identify whether the portrait area of ​​the image to be identified includes vulgar content according to the non-human classification model.

[0074] In the embodiment of the present application, it can be determined whether the image content included in the portrait area of ​​the image to be identified corresponds to a real person or a non-real person. If it corresponds to a real person, S502 is executed, that is, whether the portrait area of ​​the image to be identified includes vulgar content according to the real person classification model, and the identification result is obtained. If it corresponds to a non-real person, S503 is executed, that is, whether the portrait area of ​​the image to be identified includes vulgar content according to the non-real person classification model, and the identification result is obtained.

[0075] In this way, the recognition result of the image to be recognized can be explained, that is, if the image to be recognized is misjudged, it can be determined whether the misjudgment is a real person misjudgment or a non-real person misjudgment.

[0076] The following takes the non-real person as an anime character (the non-real person classification model corresponds to the anime classification model) as an example to illustrate the specific implementation methods corresponding to S501-S503:

[0077] In the embodiment of the present application, a real person / animation classification model can be pre-built, so that it can realize the function of distinguishing whether the image content in the portrait area corresponds to a real person or an anime character. Also, a real person classification model can be pre-built, so that it can realize the function of identifying whether the portrait area corresponding to a real person includes vulgar content. An anime classification model can also be pre-built, so that it can realize the function of identifying whether the portrait area corresponding to an anime character includes vulgar content.

[0078] See also Figure 7 , which shows a flow chart of a method for identifying an image to be identified based on a real person classification model or an animation classification model provided by an embodiment of the present application. Figure 7 As shown, for S501, the image to be identified can be input into the real person / animation classification model to identify whether the image content in the portrait area of ​​the image to be identified corresponds to a real person or an animation character. If it is determined that the image content in the portrait area corresponds to a real person, the image to be identified can be input into the real person classification model for identification.

[0079] If the recognition result after the real person classification model recognizes the image to be recognized is: the portrait area of ​​the image to be recognized includes vulgar content, the vulgar image area can be framed in the image to be recognized, and the vulgarity of the vulgar image area can be scored to obtain the vulgarity score of the image to be recognized. Then, in S404, the image to be recognized is determined to be a vulgar image based on the recognition result. Among them, the vulgarity score can be used to identify the vulgarity of the image to be recognized. The higher the vulgarity score, the deeper the vulgarity of the image to be recognized. If the recognition result after the real person classification model recognizes the image to be recognized is: the portrait area of ​​the image to be recognized does not include vulgar content, then in S404, the image to be recognized can be determined as a non-vulgar image.

[0080] In addition, if the real person / anime classification model determines that the image content of the portrait area corresponds to an anime character, the image to be identified can be input into the anime classification model for identification. Correspondingly, if the recognition result of the anime classification model after identifying the image to be identified is: the portrait area of ​​the image to be identified includes vulgar content, the vulgar image area can be framed in the image to be identified, and the vulgarity of the vulgar image area can be scored to obtain the vulgarity score of the image to be identified. Then, in S404, it is determined that the image to be identified is a vulgar image based on the recognition result. If the recognition result of the anime classification model after identifying the image to be identified is: the portrait area of ​​the image to be identified does not include vulgar content, then in S404, the image to be identified can be determined as a non-vulgar image.

[0081] In a specific implementation, the image recognition method provided by the embodiment of the present application can be applied to an advertising review system. In this way, if it is determined that the image to be identified is not a vulgar image, it can be automatically passed to perform the subsequent detection steps. The auditor can no longer conduct further review of normal images. If it is determined that the image to be identified is a vulgar image, a prompt message that the image to be identified is a vulgar image can be sent to the auditor, and the prompt message may include: information about the vulgar content included in the image to be identified, the image to be identified (wherein the vulgar image area is framed), and the vulgarity score of the image to be identified. As a result, the auditor can conduct an audit based on the vulgar image area framed therein, thereby improving the audit efficiency.

[0082] For example, see Figure 8 , which shows a schematic diagram of a prompt message sent to a reviewer that an image to be identified is a vulgar image, provided by an embodiment of the present application. Figure 8 As shown, in Figure 8 The lower left corner of the image shows the information of "anime characters are vulgar" (information of vulgar content included in the image to be identified). Figure 8 The black solid line frame in the image demarcates the vulgar image area in the image to be identified, and Figure 8 The lower right corner of the image shows that the vulgarity score of the image to be identified is 0.999. It can be seen that the reviewer can make a judgment based on the prompt information, which improves the review efficiency.

[0083] In an embodiment of the present application, in order to avoid repeated image recognition of the same image, in a possible implementation, for each image that has been image recognized and whose recognition result is a vulgar image (such as a training image used to train a neural network model, and an image that has completed image recognition before), the summary information of such an image and its recognition result can be stored to form a summary set. The summary information of the image can be information used to identify the image. In this way, the image summary information in the formed summary set can be the summary information of the image that has been recognized as a vulgar image.

[0084] Based on this, for the current image to be identified, before performing S401, the method may further include:

[0085] S601: Determine target summary information of the image to be recognized.

[0086] The summary information of the image to be identified may be determined, and the summary information may be used as the target summary information of the image to be identified.

[0087] S602: Match the image summary information in the summary set according to the target summary information. If the target summary information matches the summary information of the image that has been identified as vulgar, execute S603. If the target summary information does not match the summary information of the image that has been identified as vulgar, execute S604. The image summary information in the summary set is the summary information of the image that has been identified as vulgar.

[0088] S603: Determine that the image to be identified is a vulgar image.

[0089] S604: Execute the step of determining whether the image to be recognized includes a portrait area.

[0090] In an embodiment of the present application, the target summary information of the image to be identified can be matched with the image summary information in the summary set. If the target summary information can match the summary information of an image that has been identified as a vulgar image, it means that the image to be identified and the image that has been identified as a vulgar image belong to the same image. Therefore, S603 can be executed, that is, it can be determined that the image to be identified is a vulgar image.

[0091] If the target summary information does not match the summary information of all the images in the summary set that have been identified as vulgar, it can be indicated that the image identical to the object to be identified is not currently being identified, and S604 can be executed, that is, the image to be identified as vulgar can be identified by the image recognition method of S401-S404 mentioned above. After the image to be identified is image recognized through S401-S404, in a possible implementation, if the image to be identified is determined to be a vulgar image according to the recognition result, the target summary information of the image to be identified can be added to the summary set, so that the image identical to the image to be identified can be image recognized according to the summary set, thereby avoiding repeated processing of the same image and improving efficiency.

[0092] In addition, in a possible implementation, for each image that has been identified by the image recognition method of S401-S404 and the identification result is a non-vulgar image (i.e., a normal image), the summary information of the image and its identification result can also be stored, that is, the image summary information in the summary set can also include summary information of images that have been identified as non-vulgar.

[0093] Therefore, the method for S602 further includes:

[0094] S605: Determine whether the image to be identified is a non-vulgar image.

[0095] After matching the image summary information in the summary set according to the target summary information, if the target summary information matches the summary information of the image that has been identified as non-vulgar, it means that the image to be identified and the image that has been identified as non-vulgar are the same image, and S605 can be executed, that is, it can be determined that the image to be identified is a non-vulgar image.

[0096] If the target summary information does not match the summary information in the summary set, it may indicate that the same image as the object to be identified is not currently being identified, and the image to be identified may be identified as vulgar through the aforementioned S401-S404 image recognition method. Accordingly, after the image to be identified is image recognized through S401-S404, if it is determined according to the recognition result that the image to be identified is not a vulgar image, the target summary information of the image to be identified may be added to the summary set, so that the image identical to the image to be identified can be identified according to the summary set, thereby avoiding repeated processing of the same image and improving efficiency.

[0097] In this way, before executing the method of S401-S404 for each image to be identified, the target summary information of the image to be identified can be matched with the image summary information in the summary set to determine whether the image to be identified has been identified as vulgar before. If it matches, the image to be identified can be directly determined as a vulgar image (or a non-vulgar image) based on the matched image that has been identified as a vulgar image (or a non-vulgar image), without having to perform S401-S404 on the image to be identified, thereby avoiding repeated processing of the same image and improving image recognition efficiency.

[0098] In a specific implementation, for the training images used to train the aforementioned neural network model, and the images that have completed image recognition before, a 128-bit hash value can be determined for each of these images through Message Digest Algorithm 5 (MD5), as the key of the image, and the recognition result of the image is used as the value of the image, thereby forming a hash table. Among them, the MD5 algorithm can be a widely used cryptographic hash function, which can be used to ensure the integrity and consistency of information transmission.

[0099] In the embodiment of the present application, the formed hash table can be used as a summary set, in which the key of each image is used as the summary information of each image.

[0100] Based on this, see Fig. 9 , which shows a flow chart of a method for matching summary information provided by an embodiment of the present application, such as Fig. 9 As shown, for the image to be identified, before executing the method of S401 for it, the 128-bit hash value of the image to be identified can be calculated by the MD5 algorithm, and the hash value can be used as the target summary information of the image to be identified. According to the target summary information, the summary information of the image that has completed image recognition is matched with the summary information of the image in the summary set. If the match is unsuccessful, the image to be identified is identified by the image recognition method of S401-S404. If the match is successful, it can be determined whether the image to be identified is a vulgar image according to the recognition result (value) of the matched image that has completed image recognition. Among them, if the recognition result of the matched image that has completed image recognition is a non-vulgar image, the image to be identified is determined to be a non-vulgar image, and if the recognition result of the matched image that has completed image recognition is a vulgar image, the image to be identified is determined to be a vulgar image.

[0101] Next, the image recognition method provided by the embodiment of the present application will be introduced in combination with actual application scenarios. Fig.10, which shows a flow chart of an image recognition method provided by an embodiment of the present application. In this application scenario, for the current image to be recognized, first, its corresponding target summary information can be matched with the image summary information in the summary set. If the match is successful, and the target summary information matches the summary information of the non-vulgar image, the image to be recognized can be determined to be a non-vulgar image (i.e., a normal image), and it can be automatically passed to proceed to the subsequent steps. If the match is successful, and the target summary information matches the summary information of the vulgar image, the image to be recognized can be determined to be a vulgar image, and a prompt message that the image to be recognized is a vulgar image is sent to the reviewer, so that the reviewer can conduct further review.

[0102] If the match is not successful, the portrait area can be framed and the image to be identified can be input into the person detection module to determine whether it includes the portrait area. If it is determined that it does not include the portrait area, it can be determined to be a normal image and can be allowed to pass normally to proceed to the subsequent steps.

[0103] If it is determined that the image includes a portrait area, the image to be identified can be input into the special person classification model and the human body part classification model respectively, wherein, after the special person classification model identifies the image to be identified, if it is determined that the portrait area of ​​the image to be identified includes a baby or a pregnant woman, the baby or the pregnant woman can be determined as a non-vulgar object, and after the human body part classification model identifies the image to be identified, if it is determined that the portrait area of ​​the image to be identified includes a human head, hands, feet, etc., the human head, hands, feet, etc. can be determined as non-vulgar objects. In this way, according to the recognition results of the portrait area in the image to be identified by the special person classification model and the human body part classification model, a decision can be made on the image to be identified to determine whether the image to be identified includes only non-vulgar objects. If so, that is, the portrait area of ​​the image to be identified includes only non-vulgar objects, the image to be identified is determined to be a non-vulgar image (normal image), and it is automatically passed to proceed to the subsequent steps.

[0104] Among them, the portrait area of ​​the image to be identified is detected as non-vulgar objects through a special person classification model and a human body part classification model, and the detection results of the aforementioned person detection model can be calibrated twice (including rejecting the detection results of the person detection model).

[0105] If not, that is, it is determined that the portrait area of ​​the image to be identified does not only include non-vulgar objects, the image to be identified can be input into the real person / animation classification model to identify whether the image content in the portrait area of ​​the image to be identified corresponds to a real person or an animation character. If it is determined that the image content in the portrait area corresponds to a real person, the image to be identified can be input into the real person classification model for identification.

[0106] If the real person classification model identifies that the image to be identified includes vulgar content, the vulgar image area can be framed in the image to be identified, and the vulgarity of the vulgar image area can be scored to obtain the vulgarity score of the image to be identified, and the image to be identified can be determined as a vulgar image in the subsequent summary judgment. And if the real person classification model identifies that the image to be identified does not include vulgar content, the image to be identified can be determined as a non-vulgar image (normal image) in the subsequent summary judgment, and it can be automatically passed to proceed to the next step.

[0107] If the real person / anime classification model determines that the image content of the portrait area corresponds to an anime character, the image to be identified can be input into the anime classification model for identification. Correspondingly, if the anime classification model identifies that the image to be identified includes vulgar content, the vulgar image area can be framed in the image to be identified, and the vulgarity of the vulgar image area can be scored to obtain the vulgarity score of the image to be identified, and the image to be identified can be determined as a vulgar image in the subsequent summary judgment. If the anime classification model identifies that the image to be identified does not include vulgar content, the image to be identified can be determined as a non-vulgar image in the subsequent summary judgment.

[0108] Compared with the current image recognition method, the image recognition method based on multi-stage filtering provided in the embodiment of the present application can effectively reduce the probability of misjudgment and improve the recognition accuracy and recall rate.

[0109] Next, the advantages of the image recognition method provided by the embodiment of the present application are proved through experiments. An evaluation set of advertising images can be pre-constructed, which includes 22,008 normal images and 962 vulgar images. The existing image recognition model 1, the existing image recognition model 2 and the image recognition model 3 provided by the embodiment of the present application are used to identify the images in the evaluation set. Fig.11 , which shows a comparison of the recognition results of three different image recognition models provided in an embodiment of the present application.

[0110] like Fig.11 As shown, under the same recall rate, the recognition accuracy of the image recognition model 3 provided in the embodiment of the present application is higher than the recognition accuracy of the existing image recognition model 1 and the existing image recognition model 2.

[0111] The image recognition model provided in the embodiment of the present application can be applied to the advertising review system, which can identify 2% of vulgar images from all advertising images to prompt the reviewer to conduct further review. Among them, these 2% of images include 90% of the vulgar images in all advertising images, thereby reducing the review workload of the reviewer by 98%.

[0112] Next, the training of the neural network model provided in the embodiment of the present application and the data used for training are introduced. For each neural network model in the embodiment of the present application, each model can be trained and optimized separately, and then connected accordingly to be applied to the technical solution of the embodiment of the present application. Among them, for obtaining training data, a large number of images can be pulled from a search engine by retrieving keywords, and they are manually annotated to obtain training data. In the embodiment of the present application, a total of 400,000 images are used, of which 20,000 images are used for model training of the person detection module.

[0113] In an embodiment of the present application, the training and optimization method of the model can be based on a deep learning framework (Convolutional Architecture For Fast Feature Embedding, caffe), and optimized using a stochastic gradient descent method (Stochastic Gradient Descent, SGD).

[0114] For the loss function in classification models such as special person classification models and human body part classification models, the normalized exponential loss (Softmax Loss) function can be applied. Among them, the softmaxloss function is:

[0115] For the Loss function in the detection model such as the person detection module, the weighted softmax Loss function and the L1-loss function can be applied, that is: L(x,c,l,g)=1 / N(L conf (x,c)+αL loc (x, l, g)), L1loss = |f(x)-Y|. Among them, L conf (x,c) can refer to the classification loss, applying the Softmax Losss function, L loc (x,l,g) can refer to the regression loss, applying the L1-loss function. α can refer to the weighting factor used to balance the classification loss and regression loss.

[0116] Based on the image recognition method provided in the above embodiment, the present application also provides an image recognition device, see Fig.12 , which shows a structural diagram of an image recognition device provided in an embodiment of the present application, wherein the image recognition device 1200 includes a first determination unit 1201, a judgment unit 1202, a recognition unit 1203, and a second determination unit 1204:

[0117] The first determining unit 1201 is used to determine whether the image to be identified includes a portrait area;

[0118] The judging unit 1202 is configured to judge whether the portrait region includes only non-vulgar objects;

[0119] The identification unit 1203 is used to identify whether the portrait area of ​​the image to be identified includes vulgar content according to the classification model if no;

[0120] The second determination unit 1204 is used to determine whether the image to be identified is a vulgar image according to the identification result.

[0121] Optionally, the classification model includes a real person classification model and a non-real person classification model, and the identification unit 1203 is further specifically used for:

[0122] Determining whether the image content included in the portrait area corresponds to a real person or a non-real person;

[0123] If the image corresponds to a real person, identifying whether the portrait area of ​​the image to be identified includes vulgar content according to the real person classification model;

[0124] If the image corresponds to a non-real person, it is determined whether the portrait area of ​​the image to be identified includes vulgar content according to the non-real person classification model.

[0125] Optionally, the non-vulgar objects include any one or more combinations of pregnant women, babies, heads, hands or feet.

[0126] Optionally, the first determining unit 1201 is further specifically configured to:

[0127] Before determining whether the image to be identified includes a portrait area, determining target summary information of the image to be identified;

[0128] Matching image summary information in a summary set according to the target summary information, where the image summary information in the summary set is summary information of images that have been identified as vulgar images;

[0129] If the image to be identified matches the summary information of the image that has been identified as vulgar, determining that the image to be identified is a vulgar image;

[0130] If there is no match, the step of determining whether the image to be identified includes a portrait area is performed.

[0131] Optionally, the first determining unit 1201 is further specifically configured to:

[0132] If it matches the summary information of the image that has been identified as non-vulgar, it is determined that the image to be identified is a non-vulgar image, and the image summary information in the summary set also includes the summary information of the image that has been identified as non-vulgar.

[0133] Optionally, the first determining unit 1201 is further specifically configured to:

[0134] If it is determined according to the recognition result that the image to be recognized is a vulgar image, the target summary information of the image to be recognized is added to the summary set.

[0135] In summary, for the image to be identified, it is determined whether the image to be identified includes a portrait area. If it includes a portrait area, it is determined whether the portrait area only includes non-vulgar objects. If it does not only include non-vulgar objects, it is determined whether the portrait area of ​​the image to be identified includes vulgar content according to the classification model, and whether the image to be identified is a vulgar image according to the recognition result. Since the characteristics of vulgar images are mostly exposed portrait parts, that is, they all have portrait areas, by identifying whether the image includes a portrait area, the images to be identified that do not include portraits at all are effectively screened out, avoiding the classification model from misjudging such images. Moreover, the exposed portrait parts in vulgar images are relatively specific, so by judging the non-vulgar objects in the portrait area, the images to be identified that do not have the aforementioned specific portrait parts are effectively screened out, avoiding the classification model from misjudging such images. In addition, the classification model mainly performs vulgar recognition based on the portrait area in the image to be identified, further filtering out the interference caused by other background information in the image to be identified, and improving the recognition accuracy.

[0136] The present application also provides a device for image recognition. The device for image recognition is described below in conjunction with the accompanying drawings. Fig.13 As shown, the embodiment of the present application provides a device 1300 for video editing, and the device 1300 may also be a terminal device, and the terminal device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), a vehicle-mounted computer, etc., and the terminal device is a mobile phone as an example:

[0137] Fig.13 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Fig.13 The mobile phone includes: a radio frequency (RF) circuit 1310, a memory 1320, an input unit 1330, a display unit 1340, a sensor 1350, an audio circuit 1360, a wireless fidelity (WiFi) module 1370, a processor 1380, and a power supply 1390. Those skilled in the art can understand that Fig.13The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0138] Combine the following Fig.13 A detailed introduction to the various components of the mobile phone:

[0139] The RF circuit 1310 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 1380 for processing; in addition, the designed uplink data is sent to the base station. Usually, the RF circuit 1310 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, referred to as LNA), a duplexer, etc. In addition, the RF circuit 1310 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (Global System of Mobile communication, referred to as GSM), General Packet Radio Service (General Packet Radio Service, referred to as GPRS), Code Division Multiple Access (Code Division Multiple Access, referred to as CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, referred to as WCDMA), Long Term Evolution (Long Term Evolution, referred to as LTE), email, Short Messaging Service (SMS), etc.

[0140] The memory 1320 can be used to store software programs and modules. The processor 1380 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1320. The memory 1320 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1320 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0141] The input unit 1330 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 1330 may include a touch panel 1331 and other input devices 1332. The touch panel 1331, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1331 or near the touch panel 1331 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 1331 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1380, and can receive and execute commands sent by the processor 1380. In addition, the touch panel 1331 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1331, the input unit 1330 may also include other input devices 1332. Specifically, other input devices 1332 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.

[0142] The display unit 1340 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1340 may include a display panel 1341. Optionally, the display panel 1341 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 1031 may cover the display panel 1341. When the touch panel 1331 detects a touch operation on or near it, it is transmitted to the processor 1380 to determine the type of touch event. Subsequently, the processor 1380 provides a corresponding visual output on the display panel 1341 according to the type of touch event. Although in Fig.13 In the embodiment, the touch panel 1331 and the display panel 1341 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 1331 and the display panel 1341 can be integrated to realize the input and output functions of the mobile phone.

[0143] The mobile phone may also include at least one sensor 1350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1341 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1341 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0144] The audio circuit 1360, the speaker 1361, and the microphone 1362 can provide an audio interface between the user and the mobile phone. The audio circuit 1360 can transmit the received audio data to the speaker 1361 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1362 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1360 and converted into audio data, and then the audio data is output to the processor 1380 for processing, and then sent to another mobile phone through the RF circuit 1310, or the audio data is output to the memory 1320 for further processing.

[0145] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 1370. It provides users with wireless broadband Internet access. Fig.13 A WiFi module 1370 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.

[0146] The processor 1380 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 1320 and calling data stored in the memory 1320, it executes various functions of the mobile phone and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 1380 may include one or more processing units; preferably, the processor 1380 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1380.

[0147] The mobile phone also includes a power supply 1390 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1380 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption management.

[0148] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0149] In this embodiment, the processor 1380 included in the terminal device also has the following functions:

[0150] Determine whether the image to be recognized includes a portrait area;

[0151] If so, determining whether the portrait region includes only non-vulgar objects;

[0152] If not, identifying whether the portrait area of ​​the image to be identified includes vulgar content according to the classification model;

[0153] Determine whether the image to be identified is a vulgar image according to the identification result.

[0154] The device for video editing provided in the embodiment of the present application may be a server. Fig.14 As shown, Fig.14 The structural diagram of the server 1400 provided in the embodiment of the present application, the server 1400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 1422 (for example, one or more processors) and a memory 1432, and one or more storage media 1430 (for example, one or more mass storage devices) storing application programs 1442 or data 1444. Among them, the memory 1432 and the storage medium 1430 can be short-term storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1422 can be configured to communicate with the storage medium 1430 and execute a series of instruction operations in the storage medium 1430 on the server 1400.

[0155] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458, and / or one or more operating systems 1441, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0156] The steps performed by the server in the above embodiment can be based on the Fig.14 The server structure shown.

[0157] The CPU 1422 is used to perform the following steps:

[0158] Determine whether the image to be recognized includes a portrait area;

[0159] If so, determining whether the portrait region includes only non-vulgar objects;

[0160] If not, identifying whether the portrait area of ​​the image to be identified includes vulgar content according to the classification model;

[0161] Determine whether the image to be identified is a vulgar image according to the identification result.

[0162] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0163] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0164] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0165] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0166] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0167] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0168] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An image recognition method, characterized in that: The method comprises: Determine target summary information of the image to be identified; Matching image summary information in a summary set according to the target summary information, where the image summary information in the summary set is summary information of images that have been identified as vulgar images; If the image to be identified matches the summary information of the image that has been identified as vulgar, determining that the image to be identified is a vulgar image; If there is no match, determining whether the image to be identified includes a portrait area; If so, determining whether the portrait region includes only non-vulgar objects; If the portrait area includes other objects other than non-vulgar objects, identifying whether the portrait area of ​​the image to be identified includes vulgar content according to the classification model; Determining whether the image to be identified is a vulgar image according to the identification result; The classification model includes a real person classification model and a non-real person classification model, and the step of identifying whether the portrait area of ​​the image to be identified includes vulgar content according to the classification model includes: Determining whether the image content included in the portrait area corresponds to a real person or a non-real person; If the image corresponds to a real person, identifying whether the portrait area of ​​the image to be identified includes vulgar content according to the real person classification model; If the image corresponds to a non-real person, it is determined whether the portrait area of ​​the image to be identified includes vulgar content according to the non-real person classification model.

2. The method according to claim 1, characterized in that The non-vulgar objects include any one or more combinations of pregnant women, babies, heads, hands or feet.

3. The method according to claim 1, characterized in that The image summary information in the summary set also includes summary information of images that have been identified as non-vulgar images. The matching of the image summary information in the summary set according to the target summary information includes: If the image to be identified matches the summary information of the image that has been identified as non-vulgar, it is determined that the image to be identified is a non-vulgar image.

4. The method according to claim 1, characterized in that: The method further comprises: If it is determined according to the recognition result that the image to be recognized is a vulgar image, the target summary information of the image to be recognized is added to the summary set.

5. An image recognition device, characterized in that: The device comprises a first determining unit, a judging unit, an identifying unit, and a second determining unit: The first determination unit is used to determine target summary information of the image to be identified before determining whether the image to be identified includes a portrait area; match image summary information in a summary set according to the target summary information, where the image summary information in the summary set is summary information of images that have been identified as vulgar images; if the target summary information matches the summary information of images that have been identified as vulgar images, determine that the image to be identified is a vulgar image; if the target summary information does not match, determine whether the image to be identified includes a portrait area; The judging unit is configured to judge whether the portrait area includes only non-vulgar objects; The recognition unit is used to include other objects other than non-vulgar objects in the portrait area, and to recognize whether the portrait area of ​​the image to be recognized includes vulgar content according to the classification model; The second determination unit is used to determine whether the image to be identified is a vulgar image according to the identification result; The classification model includes a real person classification model and a non-real person classification model, and the recognition unit is further specifically used for: Determining whether the image content included in the portrait area corresponds to a real person or a non-real person; If the image corresponds to a real person, identifying whether the portrait area of ​​the image to be identified includes vulgar content according to the real person classification model; If the image corresponds to a non-real person, it is determined whether the portrait area of ​​the image to be identified includes vulgar content according to the non-real person classification model.

6. The device according to claim 5, characterized in that The non-vulgar objects include any one or more combinations of pregnant women, babies, heads, hands or feet.

7. The device according to claim 5, characterized in that The first determining unit is further specifically configured to: If it matches the summary information of the image that has been identified as non-vulgar, it is determined that the image to be identified is a non-vulgar image, and the image summary information in the summary set also includes the summary information of the image that has been identified as non-vulgar.

8. The device according to claim 5, characterized in that The first determining unit is further specifically configured to: If it is determined according to the recognition result that the image to be recognized is a vulgar image, the target summary information of the image to be recognized is added to the summary set.

9. A device for image recognition, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the image recognition method according to any one of claims 1 to 4 according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and the program codes are used to execute the image recognition method according to any one of claims 1 to 4.