An image recognition method, apparatus, device and medium

Through image feature vector matching and sensitive object recognition model, combined with priority sub-image library and LRU algorithm, the problem of fast and accurate recognition of sensitive images of negative characters in Shanghai-based Internet images is solved, and the recognition efficiency and accuracy are improved.

CN114360011BActive Publication Date: 2025-07-18CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111615362.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-07-18
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

The prior art is difficult to ensure efficiency and accuracy at the same time how to quickly and accurately identify sensitive images of negative people in massive and high repetitive image data on the Internet.

Method used

By determining the feature vector of the image to be recognized and matching it with the pre-save sensitive image feature vector in the image library, if it matches and the label information is a negative person, it is determined as a sensitive image; if it does not match, it is judged using the pre-trained sensitive object recognition model; and the recognition process is optimized through the priority sub-image library and the LRU algorithm.

Benefits of technology

It realizes the rapid and accurate identification of sensitive images of negative people in massive image data, improves the recognition efficiency by 10 times, reaches 99%, and optimizes image recognition performance consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114360011B_ABST
    Figure CN114360011B_ABST
Patent Text Reader

Abstract

The present application discloses an image recognition method, apparatus, device and medium for quickly and accurately recognizing sensitive images of negative figures. Since the present application can determine the feature vector of the image to be recognized and match the feature vector of the image to be recognized with the feature vector of each sensitive image pre-stored in the image library, if the feature vector of the image to be recognized matches the target feature vector of the pre-stored target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative figure, then the image to be recognized is determined as a sensitive image of a negative figure, so that sensitive images of negative figures can be quickly and accurately recognized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image recognition technology, and in particular, to an image recognition method, apparatus, device, and medium. Background Art

[0002] In recent years, with the rapid development of Internet applications and the like, a huge amount of image data has been generated. Among them, if sensitive images of negative figures are spread wantonly on the Internet in large quantities, it will be unfavorable to the healthy development of the Internet environment and the like. Therefore, identifying sensitive images of negative figures in images is of great significance to the healthy development of the Internet environment and the like.

[0003] However, since the number of Internet images is usually in the hundreds of millions, which is very large and there are many duplicate images, in the face of a huge amount of Internet images with a high duplication rate, how to quickly and accurately identify sensitive images of negative figures is a technical problem that urgently needs to be solved at present. Summary of the Invention

[0004] This application provides an image recognition method, apparatus, device, and medium for quickly and accurately identifying sensitive images of negative figures.

[0005] In a first aspect, this application provides an image recognition method, and the method includes:

[0006] Determine the feature vector of the image to be recognized;

[0007] Match the feature vector of the image with the feature vectors of each sensitive image pre-stored in the image library;

[0008] If the feature vector of the image matches the target feature vector of the pre-stored target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative figure, determine the image as a sensitive image of a negative figure.

[0009] In a possible implementation manner, the method further includes:

[0010] If the feature vector of the image does not match the feature vectors of any of the sensitive images pre-stored in the image library, input the image into a pre-trained sensitive object recognition model;

[0011] If the output result of the sensitive object recognition model is that the image contains a negative figure, determine the image as a sensitive image of a negative figure.

[0012] In a possible implementation manner, the method further includes:

[0013] If the output result of the sensitive object recognition model is that the image contains negative figures, determine first label information according to the output result, and save the image and the first label information correspondingly to the image library;

[0014] If the output result of the sensitive object recognition model is that the figures contained in the image are positive figures, determine second label information according to the output result, and save the image and the second label information correspondingly to the image library.

[0015] In a possible implementation manner, saving the image to the image library includes:

[0016] If there are at least two sub-image libraries in the image library, save the image to the sub-image library with the highest priority according to the preset priority for each sub-image library.

[0017] In a possible implementation manner, the matching of the feature vector of the image with the feature vectors of each sensitive image pre-saved in the image library includes:

[0018] If there are at least two sub-image libraries in the image library, sequentially match the feature vector of the image with the feature vectors of each sensitive image pre-saved in each sub-image library according to the sequence of the preset priorities for each sub-image library.

[0019] In a possible implementation manner, the method further includes:

[0020] If the feature vector of the image matches the target feature vector of the target sensitive image pre-saved in the target sub-image library, and in the priority ranking of the sub-image libraries, the target sub-image library is not the sub-image library ranked first, then save the target sensitive image to the previous adjacent ranked sub-image library ranked before the target sub-image library.

[0021] In a possible implementation manner, the method further includes:

[0022] For any sub-image library, determine the least recently used sensitive image in the sub-image library based on the least recently used (LRU) algorithm, and save the least recently used sensitive image to the next adjacent ranked sub-image library ranked after the sub-image library in the priority ranking.

[0023] In a possible implementation manner, saving the least recently used sensitive image to the next adjacent sub-image library with a higher priority includes:

[0024] For the sub - image library with the lowest priority in the prioritization of sub - image libraries, determine whether the currently saved data capacity of this sub - image library exceeds the set capacity threshold. If so, delete the least recently used sensitive images in this sub - image library.

[0025] In a second aspect, the present application provides an image recognition device, and the device includes:

[0026] A determination module, configured to determine the feature vector of the image to be recognized;

[0027] A matching module, configured to match the feature vector of the image with the feature vectors of each sensitive image pre - saved in the image library;

[0028] An identification module, configured to, if the feature vector of the image matches the target feature vector of a pre - saved target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative person, determine the image as a sensitive image of a negative person.

[0029] In a possible implementation manner, the identification module is further configured to, if the feature vector of the image does not match the feature vectors of any sensitive image pre - saved in the image library, input the image into a pre - trained sensitive object recognition model; if the output result of the sensitive object recognition model is that the image contains a negative person, determine the image as a sensitive image of a negative person.

[0030] In a possible implementation manner, the device further includes:

[0031] A storage module, configured to, if the output result of the sensitive object recognition model is that the image contains a negative person, determine the first label information according to the output result, and correspondingly store the image and the first label information in the image library;

[0032] If the output result of the sensitive object recognition model is that the person contained in the image is a positive person, determine the second label information according to the output result, and correspondingly store the image and the second label information in the image library.

[0033] In a possible implementation manner, the storage module is specifically configured to, if the image library contains at least two sub - image libraries, store the image in the sub - image library with the highest priority according to the preset priority for each sub - image library.

[0034] In a possible implementation, the matching module is specifically configured to, if there are at least two sub-image libraries in the image library, sequentially match the feature vector of the image with the feature vectors of each sensitive image pre-stored in each sub-image library according to the priority order preset for each sub-image library.

[0035] In a possible implementation, the saving module is further configured to, if the feature vector of the image matches the target feature vector of the target sensitive image pre-stored in the target sub-image library, and in the priority sorting of the sub-image libraries, the target sub-image library is not the sub-image library ranked first, then save the target sensitive image to the previous adjacent sub-image library ranked before the target sub-image library.

[0036] In a possible implementation, the saving module is further configured to, for any sub-image library, determine the least recently used sensitive image in the sub-image library based on the least recently used (LRU) algorithm, and save the least recently used sensitive image to the next adjacent sub-image library ranked after the sub-image library in the priority sorting.

[0037] In a possible implementation, the saving module is further configured to, for the sub-image library ranked last in the priority sorting of the sub-image libraries, determine whether the currently saved data capacity of the sub-image library exceeds the set capacity threshold. If so, delete the least recently used sensitive image in the sub-image library.

[0038] In a third aspect, the present application provides an electronic device, which at least includes a processor and a memory. When the processor executes the computer program stored in the memory, the steps of an image recognition method as described in any one of the above are implemented.

[0039] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of an image recognition method as described in any one of the above are implemented.

[0040] In a fifth aspect, the present application provides a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer is caused to execute the steps of an image recognition method as described in any one of the above.

[0041] Since the present application can determine the feature vector of the image to be recognized and match the feature vector of the image to be recognized with the feature vector of each sensitive image pre-stored in the image library, if the feature vector of the image to be recognized matches the target feature vector of the pre-stored target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains negative figures, then the image to be recognized is determined as a sensitive image of negative figures, so that the sensitive image of negative figures can be recognized quickly and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the implementation manners in the related art, the following will briefly introduce the drawings required for use in the description of the embodiments or the related art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings.

[0043] Figure 1 FIG. 1 shows a schematic diagram of the first image recognition process provided by some embodiments;

[0044] Figure 2 FIG. 2 shows a schematic diagram of the second image recognition process provided by some embodiments;

[0045] Figure 3 FIG. 3 shows a schematic diagram of the third image recognition process provided by some embodiments;

[0046] Figure 4 FIG. 4 shows a schematic diagram of the fourth image recognition process provided by some embodiments;

[0047] Figure 5 FIG. 5 shows a schematic diagram of the fifth image recognition process provided by some embodiments;

[0048] Figure 6 FIG. 6 shows a schematic diagram of the sixth image recognition process provided by some embodiments;

[0049] Figure 7 FIG. 7 shows a schematic diagram of the seventh image recognition process provided by some embodiments;

[0050] Figure 8 FIG. 8 shows a schematic diagram of an image recognition device provided by some embodiments;

[0051] Figure 9 FIG. 9 shows a schematic diagram of the structure of an electronic device provided by some embodiments. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] To make the objectives, technical solutions, and advantages of this application clearer, the following will further describe this application in detail with reference to the accompanying drawings. Obviously, the described embodiments of this application are only a part of the embodiments of this application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.

[0053] It should be noted that the brief description of the terms in this application is only for facilitating the understanding of the subsequent described embodiments, rather than intending to limit the embodiments of this application. Unless otherwise specified, these terms should be understood in their ordinary and common meanings.

[0054] In this application, terms such as "first", "second", "third", etc. in the description, claims, and the above-mentioned drawings are used to distinguish similar or like objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that such terms can be interchanged under appropriate circumstances.

[0055] The terms "comprising" and "having" and any variations thereof are intended to cover but not exclude inclusion. For example, a product or device comprising a series of components does not necessarily have to be limited to all the clearly listed components, but may include other components that are not clearly listed or are inherent to these products or devices.

[0056] The term "module" refers to any known or later-developed hardware, software, firmware, artificial intelligence, fuzzy logic, or a combination of hardware or / and software code that can perform functions related to that element.

[0057] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of this application.

[0058] To quickly and accurately identify sensitive images of negative characters, this application provides an image recognition method, device, equipment, and medium.

[0059] Figure 1 The first schematic diagram of the image recognition process provided by some embodiments is shown, as Figure 1 shown, and this process includes the following steps:

[0060] S101: Determine the feature vector of the image to be recognized.

[0061] The image recognition method provided by the embodiments of this application is applied to an electronic device, which can be, for example, a device such as a PC, a mobile terminal, or a server device.

[0062] In a possible implementation manner, in order to quickly and accurately identify sensitive images of negative figures, for an image to be recognized in a picture or video frame, the electronic device can determine the feature vector of the image to be recognized. Exemplarily, the electronic device can determine the feature vector of the image based on algorithms such as the sha256 algorithm, which will not be elaborated here.

[0063] S102: Match the feature vector of the image with the feature vectors of each sensitive image pre-stored in the image library.

[0064] In a possible implementation manner, refer to Figure 2 , Figure 2 shows a schematic diagram of the second image recognition process provided by some embodiments. In order to quickly and accurately identify sensitive images of negative figures, multiple sensitive images such as sensitive image 1, sensitive image 2, sensitive image 3... and their respective corresponding feature vectors can be pre-stored in the image library of the electronic device. Optionally, the image library can only contain sensitive images of negative figures, or can contain sensitive images of negative figures and non-negative (positive) figures, which can be flexibly set according to requirements, and this application does not make specific limitations on this. For ease of understanding, the following takes the image library containing sensitive images of negative figures and positive figures as an example for illustration.

[0065] Refer to Figure 2 , for each image to be recognized among multiple images to be recognized such as image to be recognized 1, image to be recognized 2, image to be recognized 3..., after determining the feature vector of the image to be recognized, the electronic device can match the feature vector of the image to be recognized with the feature vectors of each sensitive image pre-stored in the image library, so as to determine whether the image (image to be recognized) is a sensitive image of a negative figure based on the matching result.

[0066] S103: If the feature vector of the image matches the target feature vector of the pre-stored target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative figure, determine the image as a sensitive image of a negative figure.

[0067] In order to quickly and accurately identify sensitive images of negative figures, each sensitive image in the image library corresponds to label information, and this label information can indicate whether the corresponding sensitive image contains a negative figure. Refer to Figure 2, in a possible implementation, if the feature vector of the image to be recognized matches the feature vector of any pre-saved sensitive image (for convenience of description, referred to as the target sensitive image) (for convenience of description, referred to as the target feature vector), then the label information corresponding to the target sensitive image can be used to determine whether the image is a sensitive image of a negative person.

[0068] Exemplarily, if the label information corresponding to the target sensitive image is the label information that can identify that the target sensitive image contains a negative person (for convenience of description, referred to as the first label information), then the image to be recognized can be determined as a sensitive image of a negative person.

[0069] Since the present application can determine the feature vector of the image to be recognized and match the feature vector of the image to be recognized with the feature vector of each pre-saved sensitive image in the image library, if the feature vector of the image to be recognized matches the target feature vector of the pre-saved target sensitive image, and the label information corresponding to the target sensitive image is the first label information that identifies that the target sensitive image contains a negative person, then the image to be recognized is determined as a sensitive image of a negative person, so that the sensitive image of a negative person can be quickly and accurately recognized.

[0070] In addition, face recognition algorithms such as SeataFace, ArcFace, and FSS in the related art are usually mainly applied to face identity authentication application scenarios such as intelligent access control, security inspection and security, electronic certificates, and mobile applications. For the application scenario of identifying sensitive images of negative persons in the hundreds of millions of massive and highly repetitive pictures generated on the Internet in the embodiments of the present application, if the sensitive images of negative persons are identified based on the face recognition algorithms in the related art, it is usually difficult to quickly and accurately identify the sensitive images of negative persons. The image recognition method in the embodiments of the present application can quickly and accurately identify sensitive images of negative persons in massive and highly repetitive pictures. Compared with identifying sensitive images of negative persons based on the face recognition algorithms in the related art, the embodiments of the present application can effectively save the performance consumption of image recognition and can effectively improve the image recognition efficiency. The efficiency of using the image recognition method in the embodiments of the present application to identify sensitive images of negative persons from massive and highly repetitive pictures is about 10 times that of the face recognition algorithm, and the accuracy rate can reach 99%.

[0071] In a possible implementation, considering that the image to be recognized may be different from any sensitive image in the image library, in order to quickly and accurately recognize the sensitive image of a negative person, based on the above embodiment, in the embodiment of the present application, if the feature vector of the image to be recognized does not match the feature vector of any sensitive image pre-stored in the image library, the image to be recognized can be input into a pre-trained sensitive object recognition model. Based on the output result of the sensitive object recognition model, it is determined whether the image to be recognized is a sensitive image of a negative person. In a possible implementation, if the output result of the sensitive object recognition model is that the image to be recognized contains a negative person, the image to be recognized can be determined as a sensitive image of a negative person.

[0072] It can be understood that if the output result of the sensitive object recognition model is that the image to be recognized does not contain a negative person, or the person contained in the image to be recognized is a positive person, etc., the image to be recognized may not be determined as a sensitive image of a negative person.

[0073] For ease of understanding, the following uses a specific example to illustrate the image recognition process provided in the present application. Figure 3 Some embodiments provide a schematic diagram of the third image recognition process, as Figure 3 shown, this process includes the following steps:

[0074] S301: Determine the feature vector of the image to be recognized.

[0075] S302: Match the feature vector of the image to be recognized with the feature vector of each sensitive image pre-stored in the image library.

[0076] S303: If the feature vector of the image to be recognized matches the target feature vector of the pre-stored target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative person, determine the image to be recognized as a sensitive image of a negative person.

[0077] S304: If the feature vector of the image to be recognized does not match the feature vector of any sensitive image pre-stored in the image library, input the image to be recognized into a pre-trained sensitive object recognition model; if the output result of the sensitive object recognition model is that the image to be recognized contains a negative person, determine the image to be recognized as a sensitive image of a negative person.

[0078] In a possible implementation, if the output result of the sensitive object recognition model indicates that the image contains a negative person, the first label information can be determined based on this output result, where the first label information can identify that the image contains a negative person. Exemplarily, the first label information can be text such as "negative person", or a number such as an odd number, or a letter, etc. The present application does not make specific limitations on the specific content of the first label information and can be flexibly set according to requirements.

[0079] After determining the first label information, the image (the image to be recognized) and the first label information can be correspondingly saved in the image library, that is, the image library can save the corresponding relationship between the image and the first label information, so as to facilitate subsequent recognition of other images that are the same as or similar to this image, etc. Based on the image and the corresponding first label information saved in the image library, sensitive images of negative persons can be quickly and accurately recognized.

[0080] In a possible implementation, if the output result of the sensitive object recognition model indicates that the person contained in the image is a positive person, the second label information can be determined based on this output result, where the second label information can identify that the person contained in the image is a positive person or identify that the image does not contain a negative person. Exemplarily, the second label information can be text such as "positive person", "non-negative person", etc., or a number such as an even number, or a letter, etc. The present application does not make specific limitations on the specific content of the second label information and can be flexibly set according to requirements.

[0081] After determining the second label information, the image (the image to be recognized) and the second label information can be correspondingly saved in the image library, that is, the image library can save the corresponding relationship between the image and the second label information, so as to facilitate subsequent recognition of whether the image is a sensitive image of a negative person based on the image and the corresponding second label information saved in the image library.

[0082] In a possible implementation, considering that if all the sensitive images to be matched are saved in the same image library, when recognizing (judging) whether the image to be recognized is a sensitive image of a negative person, there may be a relatively large number of sensitive images that the image to be recognized needs to be matched with, which may affect the recognition efficiency. To further improve the recognition efficiency, at least two (multiple) sub-image libraries with different priorities can be configured in the image library. Exemplarily, the higher the priority of the sub-image library, the higher the probability or frequency of the images in this sub-image library being matched; the lower the priority of the sub-image library, the lower the probability or frequency of the images in this sub-image library being matched.

[0083] In a possible implementation, when an image needs to be saved to an image library, it can be considered that the probability or frequency of subsequent matching of the image may be relatively high. Therefore, if the image library contains at least two sub-image libraries, the image can be saved to the sub-image library with the highest priority according to the preset priority for each sub-image library. Exemplarily, assuming that the image library contains two sub-image libraries, which are the first sub-image library and the second sub-image library in order of priority, the image can be preferentially saved to the first sub-image library.

[0084] In a possible implementation, if the image library contains at least two sub-image libraries, when matching the feature vector of the image to be recognized with the feature vectors of each sensitive image pre-saved in the image library, it can be in the order of the preset priority for each sub-image library, and the feature vector of the image to be recognized is sequentially matched with the feature vectors of each sensitive image pre-saved in each sub-image library.

[0085] Exemplarily, still taking the above embodiment as an example, if the image library contains two sub-image libraries, which are the first sub-image library and the second sub-image library in order of priority. Refer to Figure 4 , Figure 4 which shows a schematic diagram of the fourth image recognition process provided by some embodiments. As Figure 4 shown, after obtaining the image to be recognized, the feature vector of the image to be recognized can be determined first, and the feature vector of the image to be recognized is matched with the feature vectors of each sensitive image pre-saved in the first sub-image library.

[0086] If the feature vector of the image to be recognized matches the target feature vector of one of the sensitive images (target sensitive image) pre-saved in the first sub-image library, when the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative person, the image to be recognized can be determined as a sensitive image of a negative person, and the recognition process of the image to be recognized can be ended. And when the label information corresponding to the target sensitive image is the second label information indicating that the person contained in the target sensitive image is a positive person, the image to be recognized cannot be determined as a sensitive image of a negative person, and the recognition process of the image to be recognized can be ended.

[0087] If the feature vector of the image to be recognized does not match the feature vector of any sensitive image pre - saved in the first sub - image library, the feature vector of the image to be recognized can then be matched with the feature vector of each sensitive image pre - saved in the second sub - image library. If the feature vector of the image to be recognized matches the target feature vector of one of the sensitive images (target sensitive image) pre - saved in the second sub - image library, when the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains negative figures, the image to be recognized can be determined as a sensitive image of negative figures, and the recognition process of the image to be recognized can be ended. When the label information corresponding to the target sensitive image is the second label information indicating that the figures contained in the target sensitive image are positive figures, the image to be recognized cannot be determined as a sensitive image of negative figures, and the recognition process of the image to be recognized can be ended.

[0088] It can be understood that if the feature vector of the image to be recognized also does not match the feature vector of any sensitive image pre - saved in the second sub - image library, the image to be recognized can be input into a pre - trained sensitive object recognition model. If the output result of the sensitive object recognition model is that the image to be recognized contains negative figures, the image to be recognized can be determined as a sensitive image of negative figures. Optionally, the first label information can also be determined according to the output result, and the image and the first label information can be correspondingly saved into the first sub - image library in the image library.

[0089] If the output result of the sensitive object recognition model is that the figures contained in the image to be recognized are positive figures, the image to be recognized cannot be determined as a sensitive image of negative figures. Optionally, the second label information can also be determined according to the output result, and the image and the second label information can be correspondingly saved into the first sub - image library in the image library.

[0090] For ease of understanding, the following uses a specific embodiment to illustrate the image recognition process provided by this application. Figure 5 The fifth - type image recognition process schematic diagram provided by some embodiments is shown, as Figure 5 shown, this process includes the following steps:

[0091] S501: Determine the feature vector of the image to be recognized.

[0092] S502: If there are at least two sub - image libraries in the image library, in the order of the preset priorities for each sub - image library, sequentially match the feature vector of the image to be recognized with the feature vector of each sensitive image pre - saved in each sub - image library.

[0093] S503: If the feature vector of the image to be recognized matches the target feature vector of the target sensitive image pre - saved in any sub - image library, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative person, then determine the image to be recognized as a sensitive image of a negative person.

[0094] S504: If the feature vector of the image to be recognized does not match the feature vector of any sensitive image pre - saved in any sub - image library, then input the image to be recognized into a pre - trained sensitive object recognition model.

[0095] S505: If the output result of the sensitive object recognition model is that the image to be recognized contains a negative person, then determine the image to be recognized as a sensitive image of a negative person. Additionally, the first label information can be determined according to the output result of the sensitive object recognition model, and the image (the image to be recognized) and the first label information are correspondingly saved into the sub - image library with the highest priority.

[0096] S506: If the output result of the sensitive object recognition model is that the person contained in the image is a positive person, then determine the second label information according to this output result, and the image (the image to be recognized) and the second label information are correspondingly saved into the sub - image library with the highest priority.

[0097] In a possible implementation, if the feature vector of the image to be recognized matches the target feature vector of the target sensitive image pre - saved in one of the sub - image libraries (for convenience of description, called the target sub - image library), and in the priority ranking of the sub - image libraries, this target sub - image library is not the top - ranked sub - image library, it can be considered that the probability or frequency of subsequent matching of this target sensitive image may be higher. To improve the image recognition efficiency, this target sensitive image can be saved into the previous adjacent - ranked sub - image library ranked before this target sub - image library.

[0098] Exemplarily, still taking the above - mentioned embodiment as an example, assume that the image library contains two sub - image libraries, which are the first sub - image library and the second sub - image library in sequence according to the priority order. If the feature vector of the image to be recognized matches the target feature vector of the target sensitive image pre - saved in the second sub - image library, then this target sensitive image can be deleted from the second sub - image library and saved into the first sub - image library.

[0099] Since the images (sensitive images) saved in each sub - image library in this application can be adaptively and dynamically adjusted according to the actual recognition results, etc., the image recognition efficiency can be further improved.

[0100] In a possible implementation, for any sub-image library, the least recently used (LRU) algorithm can also be used to determine the least recently used sensitive images in the sub-image library. The least recently used sensitive images in the sub-image library can be considered as images with a lower probability or frequency of being matched subsequently. To further improve the image recognition efficiency, the least recently used sensitive images in any sub-image library can be saved in the sub-image library with the next adjacent ranking after this sub-image library in the priority ranking.

[0101] Exemplarily, still taking the above embodiment as an example, assume that the image library contains two sub-image libraries, namely the first sub-image library and the second sub-image library, in the order of priority. If, based on the LRU algorithm, it is determined that there are 10 sensitive images in the first sub-image library that are the least recently used sensitive images, then these 10 sensitive images can be deleted from the first sub-image library and saved in the second sub-image library.

[0102] In a possible implementation, for the sub-image library with the lowest ranking in the priority ranking of sub-image libraries, considering that since this sub-image library has the lowest priority, the least recently used sensitive images in this sub-image library cannot be removed (saved) to other sub-image libraries. Optionally, when the current data capacity saved in this sub-image library exceeds the set capacity threshold, the least recently used sensitive images in this sub-image library can be deleted, so as to achieve the purpose of improving the image recognition efficiency.

[0103] Exemplarily, still taking the above embodiment as an example, assume that the image library contains two sub-image libraries, namely the first sub-image library and the second sub-image library, in the order of priority. If, based on the LRU algorithm, it is determined that there are 10 sensitive images in the second sub-image library that are the least recently used sensitive images. The preset capacity threshold for the second sub-image library is 1 GB, then when the data capacity of sensitive images and the like saved in the second sub-image library exceeds 1 GB, these 10 sensitive images can be deleted from the second sub-image library.

[0104] For ease of understanding, the image recognition process provided by the present application will be further described below through a specific embodiment. Figure 6 The sixth schematic diagram of the image recognition process provided by some embodiments is shown, as Figure 6 shown, this process includes the following steps:

[0105] The electronic device acquires the image to be recognized and determines the feature vector of the image to be recognized. Based on the Query Interface in the electronic device, it queries the feature vectors of each sensitive image saved in the Level-1 sub-image library in the Cache System, and matches the feature vector of the image to be recognized with the feature vectors of each sensitive image saved in the Level-1 sub-image library. The matching result can be represented by S2_result. Optionally, the Level-1 sub-image library may store the feature vectors (P) corresponding to the sensitive images and the corresponding label information (R), etc. For example, the corresponding relationship (P1, R1) between the feature vector P1 of one sensitive image and the first label information R1, and the corresponding relationship (P2, R2) between the feature vector P2 of another sensitive image and the second label information R2, etc. can be stored correspondingly.

[0106] If the feature vector of the image to be recognized matches the target feature vector of one of the sensitive images (target sensitive image) saved in the Level-1 sub-image library, the S2_result can be a result such as "matched with Level-1", and this matched result is fed back to the Query Interface. Optionally, when the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative person, the recognition result can be: the image to be recognized is a sensitive image of a negative person, and this recognition result (S1_result) is fed back (displayed) to the user (client), and the recognition process of the image to be recognized ends. When the label information corresponding to the target sensitive image is the second label information indicating that the person contained in the target sensitive image is a positive person, the recognition result can be: the image to be recognized is not a sensitive image of a negative person, and this recognition result (S1_result) can be fed back (displayed) to the user (client), and the recognition process of the image to be recognized ends.

[0107] If the feature vector of the image to be recognized does not match the feature vector of any sensitive image pre - saved in the first sub - image library (Level - 1), then the result of S2_result can be "does not match Level - 1" and other results, and this result is fed back to the Query Interface. Subsequently, the feature vector of the image to be recognized can be matched with the feature vector of each sensitive image pre - saved in the second sub - image library (Level - 2), and the matching result can be represented by S3_result. Optionally, the second sub - image library (Level - 2) can store the feature vectors (P) corresponding to sensitive images and the corresponding label information (R), etc. For example, the correspondence (P3, R3) between the feature vector P3 of one sensitive image and the first label information R3, and the correspondence (P4, R4) between the feature vector P4 of another sensitive image and the second label information R4 can be stored correspondingly, etc.

[0108] If the feature vector of the image to be recognized matches the target feature vector of one of the sensitive images (target sensitive image) pre - saved in the second sub - image library (Level - 2), then the result of S3_result can be "matches Level - 2" and other results, and this matching result is fed back to the Query Interface. Optionally, when the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains negative figures, the recognition result can be: the image to be recognized is a sensitive image of negative figures, and this recognition result (S1_result) is fed back (displayed) to the user (client), and the recognition process of the image to be recognized ends. When the label information corresponding to the target sensitive image is the second label information indicating that the figure contained in the target sensitive image is a positive figure, the recognition result can be: the image to be recognized is not a sensitive image of negative figures, and this recognition result (S1_result) is fed back (displayed) to the user (client), and the recognition process of the image to be recognized ends.

[0109] If the feature vector of the image to be recognized does not match the feature vector of any of the sensitive images pre-stored in the second sub-image library (Level-2) either, then the result of S3_result can be "does not match Level-2" or other results, and this result is fed back to the Query Interface. Subsequently, the image to be recognized can be used as one of the images in the image queue (Image Queue) to be recognized (detected), so that the image can be input into the pre-trained sensitive object recognition model, and based on the output result of the pre-trained sensitive object recognition model, it can be determined whether the image is a sensitive image of a negative person. Exemplarily, the image queue (Image Queue) can contain information of multiple images D (PhotoGallery). In one possible implementation, the feature vector P corresponding to each image D can be determined first. Exemplarily, the feature vector P5 of image D5, the feature vector P6 of image D6, the feature vector P7 of image D7... the feature vector Pn of image Dn, etc. can be determined respectively. For each image in the image queue, the feature vector of the image can be input into the pre-trained sensitive object recognition model (Face Auditor). If the output result of the sensitive object recognition model is that the image to be recognized contains a negative person, then the recognition result (S4_result) of the image to be recognized can be: the image to be recognized is a sensitive image of a negative person, and this recognition result (S4_result) is fed back (displayed) to the user (client), and the recognition process of the image to be recognized ends. Additionally, the first label information can be determined according to this output result, and the image and the first label information are correspondingly saved to the first sub-image library in the image library.

[0110] If the output result of the sensitive object recognition model is that the person contained in the image to be recognized is a positive person, then the recognition result (S4_result) of the image to be recognized can be: the image to be recognized is not a sensitive image of a negative person, and this recognition result (S4_result) is fed back (displayed) to the user (client), and the recognition process of the image to be recognized ends. Additionally, the second label information can be determined according to this output result, and the image and the second label information are correspondingly saved to the first sub-image library in the image library.

[0111] In addition, if the feature vector of the image to be recognized matches the target feature vector of the target sensitive image pre-stored in the second sub-image library (Level-2), then the target sensitive image can be deleted from the second sub-image library and saved to the first sub-image library (for convenience of description, it is called Upgrade in the figure).

[0112] In addition, if it is determined based on the LRU algorithm that there is a least recently used sensitive image in the first sub-image library, the determined least recently used sensitive image can be deleted from the first sub-image library and saved to the second sub-image library (for ease of description, referred to as Relegation in the figure).

[0113] In addition, if it is determined based on the LRU algorithm that there is a least recently used sensitive image in the second sub-image library, when the data capacity such as the sensitive images saved in the second sub-image library exceeds a preset capacity threshold, the least recently used sensitive image can be deleted from the second sub-image library (for ease of description, referred to as Eliminate in the figure).

[0114] For ease of understanding, the image recognition process provided by the present application will be further described below through a specific embodiment. Figure 7 The seventh schematic diagram of the image recognition process provided by some embodiments is shown, as Figure 7 shown, and this process includes the following steps:

[0115] S701: Determine the feature vector of the image to be recognized.

[0116] S702: If the image library contains two sub-image libraries, in the order of priority, they are the first sub-image library and the second sub-image library respectively. Match the feature vector of the image to be recognized with the feature vectors of each sensitive image pre-saved in the first sub-image library, and determine whether the feature vector of the image to be recognized matches the feature vector of any sensitive image (target sensitive image) pre-saved in the first sub-image library; if so, proceed to S703; if not, proceed to S704.

[0117] S703: If the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative person, determine the image to be recognized as a sensitive image of a negative person. If the label information corresponding to the target sensitive image is the second label information indicating that the person contained in the target sensitive image is a positive person, do not determine the image to be recognized as a sensitive image of a negative person.

[0118] S704: Match the feature vector of the image to be recognized with the feature vectors of each sensitive image pre-saved in the second sub-image library, and determine whether the feature vector of the image to be recognized matches the feature vector of any sensitive image (target sensitive image) pre-saved in the second sub-image library; if so, proceed to S705; if not, proceed to S707.

[0119] S705: If the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains negative figures, the image to be recognized is determined as a sensitive image of negative figures. If the label information corresponding to the target sensitive image is the second label information indicating that the figures contained in the target sensitive image are positive figures, the image to be recognized is not determined as a sensitive image of negative figures.

[0120] S706: Delete the target sensitive image from the second sub-image library and save the target sensitive image to the first sub-image library.

[0121] S707: Input the image to be recognized into a pre-trained sensitive object recognition model. If the output result of the sensitive object recognition model is that the image to be recognized contains negative figures, the image to be recognized is determined as a sensitive image of negative figures, and according to the output result, the first label information is determined, and the image to be recognized and the corresponding first label information are saved to the first sub-image library in the image library. If the output result of the sensitive object recognition model is that the figures contained in the image to be recognized are positive figures, the image to be recognized is not determined as a sensitive image of negative figures, and according to the output result, the second label information is determined, and the image to be recognized and the corresponding second label information are saved to the first sub-image library in the image library.

[0122] In a possible implementation manner, a sensitive object recognition model can be trained based on the SeataFace algorithm. The process of training the sensitive object recognition model includes:

[0123] Obtain any sample image containing a target figure in the sample set, and the sample image corresponds to a sample label; wherein the sample label is used to indicate that the figure contained in the sample image is a negative figure or a positive figure;

[0124] Through the original sensitive object recognition model, determine the recognition label of the target figure contained in the sample image;

[0125] According to the sample label and the recognition label, train the original sensitive object recognition model to obtain a trained sensitive object recognition model.

[0126] In order to accurately recognize sensitive images of negative figures, in the embodiments of the present application, the sample set contains multiple sample images, and each sample image corresponds to a sample label, and the sample label is used to indicate whether the figure contained in the sample image is a negative figure or a positive figure. Exemplarily, when the sample image contains negative figures, the sample label corresponding to the sample image can be negative figures; when the figure contained in the sample image is a positive figure, the sample label corresponding to the sample image can be positive figures.

[0127] When training the original sensitive object recognition model, any sample image containing the target person in the sample set can be obtained, and the obtained sample image or the feature vector of the sample image is input into the original sensitive object recognition model. Through the original sensitive object recognition model, the recognition label corresponding to the sample image is obtained.

[0128] In specific implementation, after determining the recognition label of the input sample image, since the sample label of the sample image is pre - saved, it is possible to determine whether the recognition result of the sensitive object recognition model is accurate according to whether the sample label is consistent with the recognition label. In specific implementation, if they are inconsistent, it means that the recognition result of the sensitive object recognition model is inaccurate, and then the parameters of the sensitive object recognition model need to be adjusted to train the sensitive object recognition model.

[0129] In specific implementation, when adjusting the parameters in the sensitive object recognition model, the gradient descent algorithm can be used to perform backpropagation on the gradient of the parameters of the sensitive object recognition model, thereby training the sensitive object recognition model.

[0130] In a possible implementation manner, the above operations can be performed on each sample image in the sample set. When the preset convergence condition is met, it is determined that the training of the sensitive object recognition model is completed.

[0131] Among them, meeting the preset convergence condition can be that the number of sample images correctly recognized by the sample images in the sample set through the original sensitive object recognition model is greater than the set number, or the number of iterations for training the sensitive object recognition model reaches the set maximum number of iterations, etc. It can be flexibly set in specific implementation and is not specifically limited here.

[0132] In a possible implementation manner, when training the original sensitive object recognition model, the sample images in the sample set can be divided into training sample images and test sample images. First, the original sensitive object recognition model is trained based on the training sample images, and then the reliability of the above - trained sensitive object recognition model is verified based on the test sample images.

[0133] Based on the same technical concept, the present application provides an image recognition device. Figure 8 The following shows a schematic diagram of an image recognition device provided by some embodiments, as Figure 8 shown, the device includes:

[0134] A determination module 81, configured to determine the feature vector of the image to be recognized;

[0135] A matching module 82, configured to match the feature vector of the image with the feature vectors of each sensitive image pre - saved in the image library;

[0136] An identification module 83, configured to determine the image as a sensitive image of a negative person if the feature vector of the image matches the target feature vector of a pre-saved target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative person.

[0137] In a possible implementation manner, the identification module 83 is further configured to: if the feature vector of the image does not match the feature vector of any sensitive image pre-saved in the image library, input the image into a pre-trained sensitive object recognition model; if the output result of the sensitive object recognition model is that the image contains a negative person, determine the image as a sensitive image of a negative person.

[0138] In a possible implementation manner, the apparatus further includes:

[0139] A saving module, configured to: if the output result of the sensitive object recognition model is that the image contains a negative person, determine first label information according to the output result, and correspondingly save the image and the first label information into the image library;

[0140] if the output result of the sensitive object recognition model is that the person contained in the image is a positive person, determine second label information according to the output result, and correspondingly save the image and the second label information into the image library.

[0141] In a possible implementation manner, the saving module is specifically configured to: if the image library includes at least two sub-image libraries, save the image into the sub-image library with the highest priority according to the priority preset for each sub-image library.

[0142] In a possible implementation manner, the matching module 82 is specifically configured to: if the image library includes at least two sub-image libraries, sequentially match the feature vector of the image with the feature vectors of each sensitive image pre-saved in each sub-image library according to the sequence of the priorities preset for each sub-image library.

[0143] In a possible implementation manner, the saving module is further configured to: if the feature vector of the image matches the target feature vector of a target sensitive image pre-saved in a target sub-image library, and in the priority ranking of the sub-image libraries, the target sub-image library is not the first-ranked sub-image library, save the target sensitive image into the previous adjacent-ranked sub-image library ranked before the target sub-image library.

[0144] In a possible implementation, the saving module is further configured to, for any sub-image library, determine the least recently used sensitive image in the sub-image library based on the least recently used (LRU) algorithm, and save the least recently used sensitive image to the sub-image library at the next adjacent ranking after this sub-image library in the priority ranking.

[0145] In a possible implementation, the saving module is further configured to, for the sub-image library ranked last in the priority ranking of sub-image libraries, determine whether the currently saved data capacity of this sub-image library exceeds a set capacity threshold. If so, delete the least recently used sensitive image in this sub-image library.

[0146] Based on the same technical concept, the present application further provides an electronic device. Figure 9 The following shows a schematic structural diagram of an electronic device provided by some embodiments, as Figure 9 shown. The electronic device includes: a processor 91, a communication interface 92, a memory 93, and a communication bus 94. Among them, the processor 91, the communication interface 92, and the memory 93 communicate with each other through the communication bus 94.

[0147] A computer program is stored in the memory 93. When the program is executed by the processor 91, the processor 91 is caused to execute the following steps:

[0148] Determine the feature vector of the image to be recognized;

[0149] Match the feature vector of the image with the feature vectors of each sensitive image pre-saved in the image library;

[0150] If the feature vector of the image matches the target feature vector of the pre-saved target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative person, determine the image as a sensitive image of a negative person.

[0151] In a possible implementation, the processor 91 is further configured to, if the feature vector of the image does not match the feature vectors of any of the sensitive images pre-saved in the image library, input the image into a pre-trained sensitive object recognition model; if the output result of the sensitive object recognition model is that the image contains a negative person, determine the image as a sensitive image of a negative person.

[0152] In a possible implementation, the processor 91 is further configured to, if the output result of the sensitive object recognition model is that the image contains a negative person, determine the first label information according to the output result, and correspondingly save the image and the first label information to the image library.

[0153] If the output result of the sensitive object recognition model indicates that the person included in the image is a positive person, then based on the output result, second label information is determined, and the image and the second label information are correspondingly saved to the image library.

[0154] In a possible implementation manner, the processor 91 is specifically configured to, if there are at least two sub-image libraries in the image library, save the image to the sub-image library with the highest priority according to the preset priority for each sub-image library.

[0155] In a possible implementation manner, the processor 91 is specifically configured to, if there are at least two sub-image libraries in the image library, sequentially match the feature vector of the image with the feature vectors of each sensitive image pre-saved in each sub-image library according to the preset priority order for each sub-image library.

[0156] In a possible implementation manner, the processor 91 is further configured to, if the feature vector of the image matches the target feature vector of the target sensitive image pre-saved in the target sub-image library, and in the sub-image library priority ranking, the target sub-image library is not the sub-image library ranked first, then save the target sensitive image to the previous adjacent ranked sub-image library ranked before the target sub-image library.

[0157] In a possible implementation manner, the processor 91 is further configured to, for any sub-image library, determine the least recently used sensitive image in the sub-image library based on the least recently used (LRU) algorithm, and save the least recently used sensitive image to the next adjacent ranked sub-image library ranked after the sub-image library in the priority ranking.

[0158] In a possible implementation manner, the processor 91 is further configured to, for the sub-image library ranked last in the sub-image library priority ranking, determine whether the currently saved data capacity of the sub-image library exceeds the set capacity threshold. If so, delete the least recently used sensitive image in the sub-image library.

[0159] Since the principle of the above electronic device for solving problems is similar to that of the image recognition method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be elaborated.

[0160] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0161] The communication interface 92 is used for communication between the above electronic device and other devices.

[0162] The memory may include a Random Access Memory (RAM), or may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0163] The above processor may be a general-purpose processor, including a central processing unit, a Network Processor (NP), etc.; it may also be a Digital Signal Processing (DSP), an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0164] Based on the same technical concept, an embodiment of the present application provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored. When the program runs on the electronic device, the electronic device is caused to execute the following steps when executed:

[0165] Determine the feature vector of the image to be recognized;

[0166] Match the feature vector of the image with the feature vectors of each sensitive image pre-stored in the image library;

[0167] If the feature vector of the image matches the target feature vector of the pre-stored target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains negative characters, determine the image as a sensitive image of negative characters.

[0168] In a possible implementation manner, the method further includes:

[0169] If the feature vector of the image does not match the feature vector of any sensitive image pre - saved in the image library, the image is input into a pre - trained sensitive object recognition model;

[0170] If the output result of the sensitive object recognition model is that the image contains negative figures, the image is determined as a sensitive image of negative figures.

[0171] In a possible implementation manner, the method further includes:

[0172] If the output result of the sensitive object recognition model is that the image contains negative figures, first - label information is determined according to the output result, and the image and the first - label information are correspondingly saved into the image library;

[0173] If the output result of the sensitive object recognition model is that the figures contained in the image are positive figures, second - label information is determined according to the output result, and the image and the second - label information are correspondingly saved into the image library.

[0174] In a possible implementation manner, saving the image into the image library includes:

[0175] If there are at least two sub - image libraries in the image library, the image is saved into the sub - image library with the highest priority according to the preset priority for each sub - image library.

[0176] In a possible implementation manner, matching the feature vector of the image with the feature vector of each sensitive image pre - saved in the image library includes:

[0177] If there are at least two sub - image libraries in the image library, in the order of the preset priorities of each sub - image library, the feature vector of the image is sequentially matched with the feature vector of each sensitive image pre - saved in each sub - image library.

[0178] In a possible implementation manner, the method further includes:

[0179] If the feature vector of the image matches the target feature vector of the target sensitive image pre - saved in the target sub - image library, and in the priority ranking of the sub - image libraries, the target sub - image library is not the sub - image library ranked first, the target sensitive image is saved into the previous adjacent sub - image library ranked before the target sub - image library.

[0180] In a possible implementation manner, the method further includes:

[0181] For any sub-image library, based on the Least Recently Used (LRU) algorithm, determine the least recently used sensitive image in the sub-image library, and save the least recently used sensitive image into the priority ranking in the next adjacent sub-image library ranked after this sub-image library.

[0182] In a possible implementation, saving the least recently used sensitive image into the next adjacent sub-image library with a higher priority includes:

[0183] For the sub-image library ranked last in the priority ranking of sub-image libraries, determine whether the current data capacity saved in this sub-image library exceeds the set capacity threshold. If so, delete the least recently used sensitive image in this sub-image library.

[0184] Since the principle of the above computer-readable storage medium for solving problems is similar to that of the image recognition method, the implementation of the above computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be elaborated.

[0185] The above computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in an electronic device, including but not limited to magnetic memories such as floppy disks, hard disks, magnetic tapes, magneto-optical discs (MO), etc., optical memories such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memories such as ROMs, EPROMs, EEPROMs, non-volatile memories (NANDFLASH), solid-state drives (SSD), etc.

[0186] Based on the same technical concept, the present application provides a computer program product, which includes: computer program code. When the computer program code runs on a computer, it enables the computer to execute the following steps when executed:

[0187] Determine the feature vector of the image to be recognized;

[0188] Match the feature vector of the image with the feature vectors of each sensitive image pre-saved in the image library;

[0189] If the feature vector of the image matches the target feature vector of the pre-saved target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains negative figures, determine the image as a sensitive image of negative figures.

[0190] In a possible implementation, the method further includes:

[0191] If the feature vector of the image does not match the feature vectors of any sensitive image pre-saved in the image library, input the image into a pre-trained sensitive object recognition model.

[0192] If the output result of the sensitive object recognition model is that the image contains a negative person, then determine the image as a sensitive image of a negative person.

[0193] In a possible implementation, the method further includes:

[0194] If the output result of the sensitive object recognition model is that the image contains a negative person, then according to the output result, determine the first label information, and correspondingly save the image and the first label information to the image library.

[0195] If the output result of the sensitive object recognition model is that the person contained in the image is a positive person, then according to the output result, determine the second label information, and correspondingly save the image and the second label information to the image library.

[0196] In a possible implementation, saving the image to the image library includes:

[0197] If the image library contains at least two sub-image libraries, save the image to the sub-image library with the highest priority according to the preset priority for each sub-image library.

[0198] In a possible implementation, the matching of the feature vector of the image with the feature vectors of each sensitive image pre-saved in the image library includes:

[0199] If the image library contains at least two sub-image libraries, sequentially match the feature vector of the image with the feature vectors of each sensitive image pre-saved in each sub-image library according to the order of the preset priorities of each sub-image library.

[0200] In a possible implementation, the method further includes:

[0201] If the feature vector of the image matches the target feature vector of the target sensitive image pre-saved in the target sub-image library, and in the priority ranking of the sub-image libraries, the target sub-image library is not the sub-image library ranked first, then save the target sensitive image to the previous adjacent ranked sub-image library ranked before the target sub-image library.

[0202] In a possible implementation, the method further includes:

[0203] For any sub-image library, based on the least recently used (LRU) algorithm, determine the least recently used sensitive image in the sub-image library, and save the least recently used sensitive image to the next adjacent ranked sub-image library ranked after the sub-image library in the priority ranking.

[0204] In a possible implementation manner, the step of saving the least recently used sensitive image to the sub-image library of the next adjacent priority includes:

[0205] For the sub-image library with the lowest priority in the priority sorting of the sub-image libraries, determine whether the currently saved data capacity of this sub-image library exceeds the set capacity threshold. If so, delete the least recently used sensitive image in this sub-image library.

[0206] Since the present application can determine the feature vector of the image to be recognized, and match the feature vector of the image to be recognized with the feature vectors of each sensitive image pre-saved in the image library. If the feature vector of the image to be recognized matches the target feature vector of the pre-saved target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains negative figures, then the image to be recognized is determined as a sensitive image of negative figures, so that the sensitive image of negative figures can be recognized quickly and accurately.

[0207] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0208] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0209] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1The functions specified in one or more boxes.

[0210] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide for implementing steps of the functions specified in one Figure 1 One process or more processes and / or boxes Figure 1 step of the functions specified in one or more boxes.

[0211] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these changes and modifications.

Claims

1. An image recognition method, characterized in that, The method includes: Determining a feature vector of an image to be recognized; Matching the feature vector of the image with the feature vectors of each sensitive image pre - stored in an image library; If the feature vector of the image matches the target feature vector of a target sensitive image pre - stored, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains a negative person, determining the image as a sensitive image of a negative person; If the feature vector of the image does not match the feature vectors of any sensitive image pre - stored in the image library, inputting the image into a pre - trained sensitive object recognition model; If the output result of the sensitive object recognition model is that the image contains a negative person, determining the image as a sensitive image of a negative person; and determining the first label information according to the output result, and correspondingly saving the image and the first label information into the image library; If the output result of the sensitive object recognition model is that the person contained in the image is a positive person, determining the second label information according to the output result, and correspondingly saving the image and the second label information into the image library; the second label information is label information indicating that the person contained in the image is a positive person or indicating that the image does not contain a negative person; The matching the feature vector of the image with the feature vectors of each sensitive image pre - stored in the image library includes: If there are at least two sub - image libraries in the image library, sequentially matching the feature vector of the image with the feature vectors of each sensitive image pre - stored in each sub - image library according to the priority order preset for each sub - image library; If the feature vector of the image matches the target feature vector of a target sensitive image pre - stored in a target sub - image library, and in the sub - image library priority ranking, the target sub - image library is not the first - ranked sub - image library, saving the target sensitive image into the previous adjacent - ranked sub - image library before the target sub - image library.

2. The method according to claim 1, wherein Saving the image into the image library includes: If there are at least two sub - image libraries in the image library, saving the image into the sub - image library with the highest priority according to the priority preset for each sub - image library.

3. The method according to claim 1, wherein The method further includes: For any sub - image library, determining the least recently used sensitive image in the sub - image library based on the least recently used (LRU) algorithm, and saving the least recently used sensitive image into the next adjacent - ranked sub - image library after the sub - image library in the priority ranking.

4. The method according to claim 3, characterized in that The saving the least recently used sensitive image into the next adjacent - ranked sub - image library with a lower priority includes: For the sub - image library ranked last in the sub - image library priority ranking, determining whether the current data capacity saved in the sub - image library exceeds a set capacity threshold. If so, deleting the least recently used sensitive image in the sub - image library.

5. An image recognition device, characterized in that, The device includes: A determination module, configured to determine a feature vector of an image to be recognized; A matching module, configured to match the feature vector of the image with the feature vectors of each pre - saved sensitive image in the image library; An identification module, configured to, if the feature vector of the image matches the target feature vector of a pre - saved target sensitive image, and the label information corresponding to the target sensitive image is the first label information indicating that the target sensitive image contains negative figures, determine the image as a sensitive image of negative figures; The identification module is further configured to, if the feature vector of the image does not match the feature vectors of any pre - saved sensitive image in the image library, input the image into a pre - trained sensitive object recognition model; if the output result of the sensitive object recognition model is that the image contains negative figures, determine the image as a sensitive image of negative figures; A storage module, configured to, if the output result of the sensitive object recognition model is that the image contains negative figures, determine the first label information according to the output result, and correspondingly store the image and the first label information into the image library; If the output result of the sensitive object recognition model is that the figure in the image is a positive figure, determine the second label information according to the output result, and correspondingly store the image and the second label information into the image library; the second label information is label information indicating that the figure contained in the image is a positive figure or indicating that the image does not contain negative figures; The matching module is specifically configured to, if there are at least two sub - image libraries in the image library, sequentially match the feature vector of the image with the feature vectors of each pre - saved sensitive image in each sub - image library according to the priority order preset for each sub - image library; The storage module is further configured to, if the feature vector of the image matches the target feature vector of a pre - saved target sensitive image in the target sub - image library, and in the sub - image library priority ranking, the target sub - image library is not the first - ranked sub - image library, save the target sensitive image into the previous adjacent sub - image library ranked before the target sub - image library; 6. An electronic device, characterized in that, The electronic device at least includes a processor and a memory, and the processor is configured to implement the steps of an image recognition method as described in any one of claims 1 - 4 when executing the computer program stored in the memory.

7. A computer-readable storage medium, characterized in that, It stores a computer program, and when the computer program is executed by a processor, it implements the steps of an image recognition method as described in any one of claims 1 - 4.

Citation Information

Patent Citations

  • Human face image matching method and apparatus, terminal and storage medium

    CN108009521A

  • Target person recognition method and device, electronic equipment and storage medium

    CN112215136A