Image recognition method, device, equipment and storage medium
By retrieving and updating uncomfortable pictures in the image retrieval library, combined with the multi-modal recognition model, the problem of difficulty in identifying new types of uncomfortable pictures in the existing technology is solved, and the rapid prevention of uncomfortable pictures from being online is achieved, improving user experience and recognition efficiency. .
Patent Information
- Application Number
- CN202110285272.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-17
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-03-17
AI Technical Summary
Existing technology is difficult to effectively identify and prevent new types of uncomfortable images from appearing on the Internet in a timely manner, affecting users' information reading experience.
By retrieving the matching reference uncomfortable pictures of the target picture in the image retrieval database, using user reports and review status, new types of uncomfortable pictures are added in a timely manner, and based on the multi-modal recognition model, it is determined whether the picture is an uncomfortable picture.
It achieves rapid identification of new types of inappropriate pictures and prevents them from going online, improves user reading experience, and reduces the time cost of image recognition model update and training.
Smart Images

Figure CN115114469B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence (AI) technology, and in particular to an image recognition method, device, equipment and storage medium. Background Art
[0002] In recent years, with the rapid development of mobile Internet, users spend more and more time browsing and reading information, and the quality of information is crucial to the user's reading experience. However, the quality of information flooding the Internet every day varies, and some of the information contains scary, disgusting, and offensive pictures, which seriously affects the user's reading experience. The relevant technical field defines the above-mentioned pictures that affect the user's reading experience and make the user feel uncomfortable as inappropriate pictures. Identifying and managing inappropriate pictures contained in information is crucial to improving the content ecology and improving the user's information reading experience.
[0003] In the related technology, a single-modal image recognition model is currently mainly used to identify inappropriate images, that is, the image to be identified is input into a pre-trained image recognition model, the type of the image is identified by the image recognition model, and then, whether the image is an inappropriate image is determined based on the output result of the image recognition model.
[0004] However, the above implementation currently has the following problems: in actual application scenarios, new types of inappropriate pictures emerge in an endless stream, and the picture recognition model is often prone to miss recall of new types of inappropriate pictures, which leads to the appearance of new types of inappropriate pictures online, affecting the user's reading experience; and collecting new types of inappropriate pictures as training samples and updating the picture recognition model so that the picture recognition model can recognize new types of inappropriate pictures usually takes a long time. It can be seen that the implementation method in the above related technology is currently unable to timely and effectively prevent new types of inappropriate pictures from appearing online. Summary of the invention
[0005] The embodiments of the present application provide an image recognition method, apparatus, device, and storage medium, which can timely and effectively prevent new types of inappropriate images from appearing online.
[0006] In view of this, the first aspect of the present application provides an image recognition method, the method comprising:
[0007] Get the target image to be identified;
[0008] Retrieve a matching reference inappropriate picture corresponding to the target picture in a picture retrieval library; the similarity between the matching reference inappropriate picture and the target picture satisfies a preset similarity condition; the picture retrieval library includes a plurality of reference inappropriate pictures, and the plurality of reference inappropriate pictures include pictures reported by users and passed the inappropriate picture review;
[0009] If the matching reference inappropriate picture is retrieved in the picture retrieval library, it is determined that the target picture is an inappropriate picture.
[0010] A second aspect of the present application provides an image recognition device, the device comprising:
[0011] An image acquisition module is used to acquire a target image to be identified;
[0012] An image retrieval module is used to retrieve a matching reference inappropriate image corresponding to the target image in an image retrieval library; the similarity between the matching reference inappropriate image and the target image satisfies a preset similarity condition; the image retrieval library includes a plurality of reference inappropriate images, and the plurality of reference inappropriate images include images reported by users and passed the inappropriate image review;
[0013] The picture recognition module is used to determine that the target picture is an inappropriate picture if the matching reference inappropriate picture is retrieved in the picture retrieval library.
[0014] A third aspect of the present application provides a device, the device comprising a processor and a memory:
[0015] The memory is used to store computer programs;
[0016] The processor is used to execute the steps of the image recognition method as described in the first aspect according to the computer program.
[0017] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the steps of the image recognition method described in the first aspect above.
[0018] In a fifth aspect, the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of the image recognition method described in the first aspect above.
[0019] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0020] The embodiment of the present application provides a method for image recognition, in which a target image to be recognized is first obtained; then, a matching reference inappropriate image corresponding to the target image is retrieved in an image retrieval library, the matching reference inappropriate image refers to an image whose similarity with the target image meets a preset similarity condition, and the image retrieval library includes a large number of reference inappropriate images, and these reference inappropriate images include images reported by users and passed the inappropriate image review; if the matching reference image is retrieved in the image retrieval library, it can be determined that the target image belongs to an inappropriate image. The above-mentioned image recognition method identifies whether the target image belongs to an inappropriate image based on the image retrieval library. Since the image retrieval library supports adding images to it at any time, when a new type of inappropriate image appears, the new type of inappropriate image can be added to the image retrieval library in a timely manner according to the user's reporting of the inappropriate image and the review of the inappropriate image; in this way, the new type of inappropriate image can be quickly identified based on the image retrieval library, thereby preventing the new type of inappropriate image from going online, thereby avoiding affecting the user's information reading experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A schematic diagram of an application scenario of the image recognition method provided in an embodiment of the present application;
[0022] Figure 2 A schematic diagram of a process flow of an image recognition method provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of the working principle of the multimodal recognition model provided in the embodiment of the present application;
[0024] Figure 4 A schematic diagram of the structure of a first image recognition device provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of the structure of a second image recognition device provided in an embodiment of the present application;
[0026] Figure 6 A schematic diagram of the structure of a third image recognition device provided in an embodiment of the present application;
[0027] Figure 7 A schematic diagram of the structure of a fourth image recognition device provided in an embodiment of the present application;
[0028] Figure 8 A schematic diagram of the structure of a fifth image recognition device provided in an embodiment of the present application;
[0029] Fig. 9 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0030] Fig.10A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0032] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims 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. 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.
[0033] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0034] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0035] Computer vision technology (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision that uses cameras and computers to replace human eyes to identify, manage and measure targets, and further performs graphic processing to make computer processing into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0036] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0037] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0038] The solution provided in the embodiments of the present application relates to computer vision technology and machine learning technology in the field of artificial intelligence, which is specifically described by the following embodiments:
[0039] In the related art, currently, a single-mode image recognition model is mainly used to identify inappropriate images. However, this implementation method is often prone to miss the recognition of new types of inappropriate images, resulting in new types of inappropriate images appearing online; in addition, it usually takes a long time to collect new types of inappropriate images and update and train the image recognition model so that the image recognition model can recognize new types of inappropriate images. It can be seen that the image recognition method in the related art is currently unable to timely and effectively identify new types of inappropriate images, and new types of inappropriate images may appear online for a long time.
[0040] In response to the problems existing in the above-mentioned related technologies, an embodiment of the present application provides an image recognition method, which can timely and effectively identify new types of inappropriate images, thereby preventing the new types of inappropriate images from appearing online for a long time and affecting the user's information reading experience.
[0041] Specifically, in the image recognition method provided in the embodiment of the present application, a target image to be identified is first obtained; then, a matching reference inappropriate image corresponding to the target image is retrieved in an image retrieval library, wherein the matching reference inappropriate image refers to an image whose similarity with the target image satisfies a preset similarity condition, and the image retrieval library includes a large number of reference inappropriate images, and these reference inappropriate images include images reported by users and passed the inappropriate image review; if the matching reference image is retrieved in the image retrieval library, it can be determined that the target image is an inappropriate image.
[0042] The above-mentioned image recognition method identifies whether the target image is an inappropriate image based on the image retrieval library. Since the image retrieval library supports adding images at any time, when a new type of inappropriate image appears, the new type of inappropriate image can be added to the image retrieval library in a timely manner according to the user's report on the inappropriate image and the review of the inappropriate image; in this way, the new type of inappropriate image can be quickly identified based on the image retrieval library in the future, thereby preventing the new type of inappropriate image from appearing online for a long time, thereby avoiding affecting the user's information reading experience.
[0043] It should be understood that the image recognition method provided in the embodiments of the present application can be applied to devices with computing capabilities, such as terminal devices or servers. The terminal devices can specifically be smart phones, computers, tablet computers, personal digital assistants (PDAs), etc.; the servers can specifically be application servers or Web servers. When actually deployed, they can be stand-alone servers, cluster servers, or cloud servers.
[0044] To facilitate understanding of the image recognition method provided in the embodiment of the present application, the following uses the execution subject of the image recognition method as a server as an example to exemplarily introduce the application scenario of the image recognition method.
[0045] See also Figure 1 , Figure 1 Schematic diagram of application scenarios of the image recognition method provided in the embodiment of the present application. Figure 1As shown, the application scenario includes a terminal device 110 and a server 120, and the terminal device 110 and the server 120 can communicate through a network. The terminal device 110 supports users to create and edit information to be published, and the information may include pictures and texts; the server 120 may be a background server for reviewing information, which is used to execute the image recognition method provided in the embodiment of the present application.
[0046] In actual applications, the user can create and edit the information to be released through the terminal device 110, and can insert relevant pictures into the edited information; after the user confirms that the editing of the information is completed through the terminal device 110, the edited information can be transmitted to the server 120 through the network. The above information includes but is not limited to articles and news to be pushed.
[0047] After receiving the information sent by the terminal device 110, the server 120 can obtain the picture inserted in the information as the target picture to be identified; then, retrieve the matching reference inappropriate picture corresponding to the target picture in the picture retrieval library 121, that is, retrieve the reference inappropriate picture whose similarity with the target picture meets the preset similarity condition in the picture retrieval library 121; if the server 120 retrieves the matching reference inappropriate picture corresponding to the target picture in the picture retrieval library 121, it means that the similarity between the target picture and the reference inappropriate picture is high, so it can be determined that the target picture belongs to an inappropriate picture.
[0048] It should be noted that the above-mentioned image retrieval library 121 usually includes a large number of reference inappropriate images, and these reference inappropriate images may include images reported by users and have passed the inappropriate image review; in other words, images reported by users as inappropriate images on the Internet will be added to the image retrieval library 121 accordingly after being confirmed as inappropriate images through the inappropriate image review. In this way, for newly added types of inappropriate images, after being reported by users and passing the inappropriate image review, they will be quickly added to the image retrieval library 121, and accordingly, such newly added inappropriate images can be effectively identified based on the image retrieval library 121 later.
[0049] In order to further prevent inappropriate pictures from being posted online, the server 120 can also determine the probability that the target picture is an inappropriate picture through the pre-trained multimodal recognition model 122 when no matching reference inappropriate pictures corresponding to the target picture are retrieved in the picture retrieval library 121. The multimodal recognition model 122 includes a picture recognition sub-model, a text recognition sub-model and a multimodal fusion module, wherein the picture recognition sub-model is used to identify the probability that the picture itself is an inappropriate picture, the text recognition sub-model is used to identify the probability that the picture is an inappropriate picture based on the text information related to the picture (such as the title of the information, the content text in the information, etc.), and the multimodal fusion module is used to fuse the recognition results of the picture recognition sub-model and the recognition results of the text recognition sub-model, and then determine the probability that the picture is an inappropriate picture based on the fused results. Furthermore, the server 120 can determine whether the target picture is an inappropriate picture based on the result output by the multimodal recognition model 122, that is, the probability that the target picture is an inappropriate picture.
[0050] It should be understood that Figure 1 The application scenarios shown are only examples. In actual applications, in addition to the server being able to execute the image recognition method provided in the embodiments of the present application, the image recognition method provided in the embodiments of the present application can also be executed by a terminal device. No limitation is made herein on the application scenarios to which the image recognition method provided in the embodiments of the present application is applicable.
[0051] The image recognition method provided by the present application is described in detail below through a method embodiment.
[0052] See also Figure 2 , Figure 2 The following is a flow chart of the image recognition method provided in the embodiment of the present application. For the convenience of description, the following embodiment is still introduced by taking the execution subject of the image recognition method as a server as an example. Figure 2 As shown, the image recognition method includes the following steps:
[0053] Step 201: Obtain a target image to be identified.
[0054] When the image recognition method provided in the embodiment of the present application is applied in different scenarios, the server can adopt a corresponding method to obtain a target image that needs to be identified as an inappropriate image.
[0055] Exemplarily, when the image recognition method provided by the embodiment of the present application is applied to the scenario of reviewing information to be released (such as articles to be pushed, news, etc.), the server can obtain the image inserted in the information as the target image to be identified after receiving the information to be released uploaded by the terminal device; or, the server can also retrieve the information to be released from the database, and then obtain the image inserted in the retrieved information as the target image to be identified. When the image recognition method provided by the embodiment of the present application is applied to the scenario of reviewing the image to be put online, the server can obtain the image to be put online uploaded by the terminal device as the target image to be identified, or, the server can also retrieve the image to be put online from the database as the target image to be identified. When the image recognition method provided by the embodiment of the present application is applied to the scenario of reviewing the video to be put online, the server can obtain the video uploaded by the terminal device, and then extract the video frame from the video as the target image to be identified; or, the server can also retrieve the video to be put online from the database, and extract the video frame from the retrieved video as the target image to be identified.
[0056] It should be understood that in practical applications, the image recognition method provided in the embodiment of the present application can be applied to other scenarios in addition to the above-mentioned scenarios, and the application scenarios of the image recognition method provided in the embodiment of the present application are not limited in any way. In addition, in addition to obtaining the target image to be identified in the above-mentioned manner, the server can also obtain the target image in other ways, and the present application does not limit the method of obtaining the target image in any way.
[0057] Step 202: Retrieve a matching reference inappropriate picture corresponding to the target picture in a picture retrieval library; the similarity between the matching reference inappropriate picture and the target picture satisfies a preset similarity condition; the picture retrieval library includes a plurality of reference inappropriate pictures, and the plurality of reference inappropriate pictures include pictures reported by users and passed the inappropriate picture review.
[0058] After the server obtains the target image, it can search for the matching reference image corresponding to the target image in the image retrieval library, that is, search for the matching reference inappropriate image whose similarity with the target image meets the preset similarity condition in the image retrieval library. The retrieval result obtained by the above retrieval operation can be used to determine whether the target image is an inappropriate image.
[0059] It should be noted that a large number of reference discomfort pictures are usually stored in the above-mentioned picture retrieval library, and the stored reference discomfort pictures can specifically be feature vectors corresponding to the reference discomfort pictures. These reference discomfort pictures can include pictures reported by users and have been determined to be discomfort pictures through discomfort picture review, and these reference discomfort pictures can also include relatively typical discomfort pictures initially added to the picture retrieval library. The picture retrieval library supports adding new pictures to it at any time, that is, as long as the server detects the existence of pictures that have passed the discomfort picture review, the discomfort picture can be added to the picture retrieval library. Accordingly, subsequent picture recognition based on the picture retrieval library can effectively identify other discomfort pictures similar to the discomfort picture.
[0060] Generally, in order to facilitate the rapid retrieval of matching reference discomfort pictures in the picture retrieval library, the picture retrieval library can store the feature vectors corresponding to multiple reference discomfort pictures. Accordingly, when the server retrieves the matching reference picture corresponding to the target picture in the picture retrieval library, it can first vectorize the target picture to obtain the feature vector corresponding to the target picture; then, for each feature vector corresponding to the reference discomfort picture included in the picture retrieval library, calculate the similarity between the feature vector corresponding to the target picture and the feature vector corresponding to the reference discomfort picture. If the similarity exceeds the preset similarity threshold, it can be determined that the reference discomfort picture is the matching reference discomfort picture corresponding to the target picture.
[0061] Exemplarily, the above-mentioned image retrieval library can be the Faiss retrieval library, which is a high-performance similarity retrieval library open sourced by Facebook, supporting the search of billions of vectors, and can efficiently and quickly retrieve similar vectors. The Faiss retrieval library stores a large number of feature vectors corresponding to the reference inappropriate images, and the feature vectors corresponding to the reference inappropriate images can specifically be a 64-bit binary code obtained by the server using the pHash algorithm to vectorize the reference inappropriate images. When the server retrieves the matching reference image corresponding to the target image based on the Faiss retrieval library, it can first use the pHash algorithm to vectorize the target image to obtain a 64-bit binary code, that is, the feature vector corresponding to the target image; then, search the Faiss retrieval library to see if there is a feature vector whose similarity with the feature vector corresponding to the target image exceeds a preset similarity threshold. If a feature vector whose similarity with the feature vector corresponding to the target image exceeds a preset similarity threshold is retrieved, it can be determined that the reference inappropriate image corresponding to the feature vector is the matching reference inappropriate image corresponding to the target image.
[0062] It should be understood that in actual applications, the image retrieval library may also be other retrieval libraries, for example, it may be a retrieval library for storing reference mismatched images themselves, and the present application does not impose any restrictions on the type of image retrieval library. Accordingly, the server may also use other methods to retrieve matching reference images corresponding to the target images in the image retrieval library, for example, it may retrieve reference mismatched images whose similarity with the target images exceeds a preset similarity threshold in the image retrieval library by comparing image features, and the present application does not impose any restrictions on the method of searching for matching reference images.
[0063] Considering that in actual applications, the number of pictures on the Internet reported by users as inappropriate pictures may be huge, and the data reported by users is noisy, there are many pictures reported as inappropriate pictures but are actually normal pictures. Adding such pictures to the picture retrieval library may mistakenly identify normal pictures as inappropriate pictures. Based on this, the technical solution provided in the embodiment of the present application can review the pictures reported as inappropriate pictures before adding them to the picture retrieval library. After confirming that the pictures have passed the inappropriate picture review, they are added to the picture retrieval library. However, picture review is often performed manually, and the review human resources are limited. It is often easy to have a large number of pictures to be reviewed. In order to make better use of the review human resources, the technical solution provided in the embodiment of the present application allows pictures that are more likely to be inappropriate pictures to be reviewed and added to the picture retrieval library as soon as possible. The embodiment of the present application also provides a review scheduling mechanism for reported pictures.
[0064] In specific implementation, the server can obtain pictures that have been reported more than a preset number of times within a preset time period as the first candidate inappropriate pictures, transmit the first candidate inappropriate pictures to the review channel, and obtain the review results corresponding to the first candidate inappropriate pictures; if the review result indicates that the first candidate inappropriate pictures are inappropriate pictures, then the first candidate inappropriate pictures are determined to be reference inappropriate pictures, and the reference inappropriate pictures are added to the picture retrieval library.
[0065] That is, the server can use pictures that have been reported as inappropriate pictures by a large number of users within a certain period of time as the first candidate inappropriate pictures, send such first candidate inappropriate pictures directly to manual review, and obtain the review results corresponding to the first candidate inappropriate pictures accordingly. If the review result corresponding to the first candidate inappropriate picture indicates that the first candidate inappropriate picture is indeed an inappropriate picture, then the first candidate inappropriate picture is correspondingly determined as a reference inappropriate picture, and the reference inappropriate picture is added to the picture retrieval library; in specific implementation, the server can vectorize the reference inappropriate picture to obtain the feature vector corresponding to the reference inappropriate picture, and then add the feature vector corresponding to the reference inappropriate picture to the picture retrieval library. On the contrary, if the review result corresponding to the first candidate inappropriate picture indicates that the first candidate inappropriate picture is not an inappropriate picture, then no processing is performed on the first candidate inappropriate picture.
[0066] In addition, the server can obtain pictures that have been reported no more than a preset number of times within a preset time period as second candidate inappropriate pictures; then, the second candidate inappropriate pictures are identified through a multimodal recognition model, and the review order corresponding to the second candidate inappropriate pictures is determined according to the recognition results; then, based on the review order corresponding to the second candidate inappropriate pictures, the second candidate inappropriate pictures are transmitted to the review channel, and the review results corresponding to the second candidate inappropriate pictures are obtained; if the review result indicates that the second candidate inappropriate picture is an inappropriate picture, the second candidate inappropriate picture is determined to be a reference inappropriate picture, and the reference inappropriate picture is added to the picture retrieval library.
[0067] It should be noted that the above-mentioned multimodal recognition model includes an image recognition sub-model, a text recognition sub-model and a multimodal fusion module, wherein the image recognition sub-model is used to identify whether the image is an inappropriate image, the text recognition sub-model is used to identify whether the image is an inappropriate image based on text information related to the image, and the multimodal fusion module is used to fuse the recognition results of the image recognition sub-model and the text recognition sub-model, so as to determine the probability that the image is an inappropriate image.
[0068] That is, the server can use pictures that have been reported as inappropriate pictures less frequently within a certain period of time as second candidate inappropriate pictures. For such second candidate inappropriate pictures, the server can score the second candidate inappropriate pictures using a multimodal recognition model, and determine the review order corresponding to the second candidate inappropriate pictures based on the scoring results, and then send the second candidate inappropriate pictures to the waiting review queue accordingly based on the review order, so as to be sent to manual review.
[0069] Specifically, for each second candidate inappropriate picture, the server can input the second candidate inappropriate picture itself and text information related to the second candidate inappropriate picture (such as the title of the second candidate inappropriate picture, the text in the information to which the second candidate inappropriate picture belongs, etc.) into a pre-trained multimodal recognition model. The image recognition submodel in the multimodal recognition model can recognize the second candidate inappropriate picture and output the probability that the second candidate inappropriate picture belongs to an inappropriate picture; the text recognition submodel in the multimodal recognition model can recognize the text information related to the second candidate inappropriate picture and output the probability that the second candidate inappropriate picture belongs to an inappropriate picture accordingly; the multimodal fusion module in the multimodal recognition model can splice the probability output by the image recognition submodel with the probability output by the text recognition submodel, and then pass through the fully connected network and the softmax classification layer in sequence to output the recognition result of the multimodal recognition model, that is, output the probability that the second candidate inappropriate picture belongs to an inappropriate picture determined by the multimodal recognition model. Then, the server can configure the corresponding review order for each second candidate uncomfortable picture according to the probability that each second candidate uncomfortable picture belongs to an uncomfortable picture. It should be understood that the higher the probability that the second candidate uncomfortable picture belongs to an uncomfortable picture, the higher the corresponding review order should be. Furthermore, the server can transmit each second candidate uncomfortable picture to the review channel in turn for manual review according to the review order corresponding to each second candidate uncomfortable picture, and obtain the review result corresponding to each second candidate uncomfortable picture accordingly. If the review result corresponding to the second candidate uncomfortable picture indicates that the second candidate uncomfortable picture does belong to an uncomfortable picture, then the second candidate uncomfortable picture is determined as a reference uncomfortable picture accordingly, and the reference uncomfortable picture is added to the picture retrieval library; in specific implementation, the server can vectorize the reference uncomfortable picture to obtain the feature vector corresponding to the reference uncomfortable picture, and then add the feature vector corresponding to the reference uncomfortable picture to the picture retrieval library. On the contrary, if the review result corresponding to the second candidate uncomfortable picture indicates that the second candidate uncomfortable picture does not belong to an uncomfortable picture, then no processing is performed on the second candidate uncomfortable picture.
[0070] It should be understood that the above-mentioned preset time period can be set according to actual needs, for example, it can be set to one hour, two hours, etc. before the current time, and this application does not make any limitation on the preset time period. In addition, the above-mentioned preset number of times can also be set according to actual needs, for example, it can be set to 200 times, and this application does not make any limitation on the preset number of times.
[0071] In practical applications, the image recognition submodel included in the above multimodal recognition model can be specifically any one of the BiT model, InceptionV3 model, EfficientNet model, MobileNet model and VGGNet (Visual Geometry Group Network) model, and the text recognition submodel included in the above multimodal recognition model can be specifically any one of the BERT (Bidirectional Encoder Representation from Transformers) model, fasttext (fast text recognition) model, Long Short-Term Memory Network (Long Short-Term Memory, LSTM) model, and Text Convolutional Neural Networks (Text Convolutional Neural Networks, TextCNN) model. Preferably, the image recognition submodel can be a Bit model, and the text recognition submodel can be a BERT model.
[0072] In addition, in practical applications, when the above-mentioned multimodal recognition model identifies whether a picture is an inappropriate picture, in addition to comprehensively considering the picture features and text features, it can also integrate features of other dimensions to identify whether the picture is an inappropriate picture, for example, integrating information of dimensions such as picture labels and picture classifications.
[0073] In this way, through the review scheduling mechanism of the above-mentioned reported images, when the review human resources are limited, priority can be given to processing the reported images with worse impact (i.e. the first candidate inappropriate images mentioned above); for the reported images with relatively lighter impact (i.e. the second candidate inappropriate images mentioned above), priority can be given to reviewing the reported images that are more likely to be inappropriate images based on the recognition results of the images by the multimodal recognition model, and the reported images that are less likely to be inappropriate images can be reviewed later, so that the review human resources are reasonably allocated and utilized.
[0074] Step 203: If the matching reference inappropriate picture is retrieved in the picture retrieval library, it is determined that the target picture is an inappropriate picture.
[0075] If the server retrieves a matching reference inappropriate picture corresponding to the target picture in the picture retrieval library through the above step 202, it means that the target picture is similar to one or several reference inappropriate pictures stored in the picture retrieval library. Therefore, it can be determined that the target picture is an inappropriate picture, and the target picture can be prohibited from going online or the online scope of the target picture can be limited.
[0076] If the server does not retrieve a matching reference inappropriate picture corresponding to the target picture in the picture retrieval library through the above step 202, in order to more effectively prevent inappropriate pictures from appearing online, the method provided in the embodiment of the present application can further determine the probability that the target picture belongs to an inappropriate picture through a multimodal recognition model, and determine whether the target picture belongs to an inappropriate picture based on the probability that the target picture belongs to an inappropriate picture. The multimodal recognition model used here can be the same model as the multimodal recognition model used in the above text for the preliminary judgment of the second candidate inappropriate picture.
[0077] Combine the following Figure 3 The working principle diagram of the multimodal recognition model shown in FIG. 1 is used to exemplify the above implementation process. Figure 3 As shown, the multimodal recognition model includes an image recognition sub-model 301 , a text recognition sub-model 302 and a multimodal fusion module 303 .
[0078] In specific implementation, the server can input the target image itself and the text information related to the target image into the multimodal recognition model; in different application scenarios, the above-mentioned text information related to the target image can be different types of text information; for example, in the application scenario of reviewing the information to be released, the text information related to the target image can be the picture title of the target image, the title of the information to which the target image belongs, or the text content in the information to which the target image belongs; for example, in the application scenario of reviewing the video to be launched, the text information related to the target image can be the subtitle text in the target image; the present application does not impose any limitation on the text information related to the target text.
[0079] After the target image itself and the text information related to the target image are input into the multimodal recognition model, the image recognition submodel 301 in the multimodal recognition model can analyze and process the input target image itself, and then output the probability that the target image belongs to an inappropriate image. The image recognition submodel 301 can be any one of the BiT model, InceptionV3 model, EfficientNet model, MobileNet model and VGGNet model. Preferably, the image recognition submodel 301 can be a BiT model, which optimizes the pre-training process and can be trained using a larger pre-training corpus, that is, using GN+Weight Standardization to replace the BN (BatchNormalization) layer in the pre-training stage, which can reduce the impact of batch-size on training; in addition, the BiT model also proposes a hyper rule mechanism, which can reduce the parameter adjustment work in the parameter fine-tuning stage; the representation ability of the BiT model can be greatly improved through the optimization of pre-training, and only a small number of labeled samples are needed for fine-tuning in downstream tasks to achieve better results.
[0080] After the target image itself and the text information related to the target image are input into the multimodal recognition model, the text recognition submodel 302 in the multimodal recognition model can analyze and process the text information related to the target image, and then output the probability that the target image belongs to an inappropriate image. The text recognition submodel 302 can be any one of the BERT model, the fasttext model, the LSTM model, and the TextCNN model. Preferably, the text recognition submodel 302 can be a BERT model. The BERT model has achieved good results in many natural language processing (NLP) tasks. BERT uses a bidirectional Transformer structure to train two tasks on a large-scale unsupervised corpus; one task is a Masked LM task, for example, randomly masking (masking) 15% of the tokens in the corpus, of which 80% of the tokens are replaced by masked tokens, 10% of the tokens are replaced by arbitrary tokens, and the remaining 10% of the tokens remain unchanged. The model needs to predict the corresponding values of the masked tokens through contextual semantics; the other task is Next SentencePrediction task, for example, given two sentences A and B, where B has a 50% chance of being the next sentence of A, the model needs to predict whether B is the next sentence of A; the BERT model trains these two tasks on large-scale unsupervised corpus, which enables it to learn sufficient contextual semantic features. And because no labeled data is required in the pre-training stage, a large amount of unsupervised corpus can be collected for pre-training. The representation ability of the pre-trained model can be greatly improved, and only a small amount of labeled samples are needed to obtain good results when fine-tuning the parameters of the BERT model on downstream tasks.
[0081] After the image recognition sub-model 301 and the text recognition sub-model 302 output their respective recognition results, the multimodal fusion module 303 can comprehensively consider the recognition results of the image recognition sub-model 301 and the recognition results of the text recognition sub-model 302 to determine the probability that the target image is an inappropriate image. Specifically, the multimodal fusion module 303 can adopt a late fusion-based approach, that is, the multimodal fusion module 303 can concatenate the probabilities output by the image recognition sub-model 301 and the probabilities output by the text recognition sub-model 302, and then classify them through the fully connected network and the softmax layer in turn, and output the probability that the target image is an inappropriate image.
[0082] In addition, in practical applications, the multimodal fusion module 303 can also adopt a feature fusion (early fusion)-based approach, that is, the multimodal fusion module 303 can obtain the feature vector output by the fully connected layer before the softmax layer in the image recognition submodel 301, and the feature vector output by the fully connected layer before the softmax layer in the text recognition submodel 302, and then concatenate the two feature vectors, and then classify them through the fully connected network and the softmax layer in turn, and output the probability that the target image belongs to an inappropriate image. This application does not make any limitation on the specific implementation method of the fusion feature of the multimodal fusion module 303.
[0083] After the server obtains the probability that the target image output by the multimodal recognition model is an inappropriate image, it can determine whether the probability exceeds the preset probability threshold. If the probability exceeds the preset probability threshold, it can be determined that the target image is an inappropriate image; conversely, if the probability does not exceed the preset probability threshold, it can be determined that the target image is not an inappropriate image.
[0084] In this way, the characteristics of the image content can be expressed to a certain extent by means of the text related to the image. The embodiment of the present application uses a multimodal recognition model to identify whether the image to be identified is an inappropriate image from two dimensions: the image and the related text, thereby more effectively preventing the occurrence of missed recognition. Compared with the related art that only uses a single-modal image recognition model to identify whether an image is an inappropriate image, the technical solution provided by the embodiment of the present application can use the text related to the image to identify inappropriate images containing inappropriate elements with unclear semantic information, thereby more effectively preventing the occurrence of missed recognition of inappropriate images.
[0085] Experiments have shown that the multimodal recognition model provided in the embodiment of the present application can identify inappropriate pictures with an error rate of 0.3% and a recall rate of 70%. Compared with the single-modal picture recognition model in the related technology, the recall rate of the model is increased by 10% under the same error rate.
[0086] It should be noted that a two-stage training method can be specifically adopted when training the above-mentioned multimodal recognition model. First, the classification tasks under the single modality are trained separately, that is, the image recognition sub-model and the text recognition sub-model are trained separately; illustratively, a large-scale labeled image sample can be used to train the image recognition sub-model, so that the image recognition sub-model can effectively recognize inappropriate images, that is, complete the Image Task, and a large-scale text sample can be used to train the text recognition sub-model, so that the text recognition sub-model can effectively recognize text containing inappropriate content, that is, complete the Text Task. After completing the training of the image recognition sub-model and the text recognition sub-model, the training samples that include both image and text information can be used to train the multimodal recognition model as a whole, that is, complete the Fusion Task.
[0087] The advantage of the above training method is that, for the two unimodal recognition models (i.e., the image recognition sub-model and the text recognition sub-model), large-scale unimodal data can be used for training respectively, so that the image recognition sub-model and the text recognition sub-model can learn sufficient semantic features; then, small-scale common data (i.e., training sample data that includes both images and texts) are used to train the entire multimodal recognition model to learn fusion features.
[0088] In addition, in the technical solution provided in the embodiment of the present application, in addition to comprehensively considering image features and related text features to identify whether an image is an inappropriate image, the multimodal fusion model can further integrate features such as image tags and image classification to identify whether an image is an inappropriate image, thereby further reducing the missed recognition rate of inappropriate images.
[0089] Specifically, the multimodal recognition model may further include a reference recognition submodel, which may include at least one of a label recognition submodel and a picture type recognition submodel; wherein the label recognition submodel is used to recognize whether a picture is an inappropriate picture according to the label corresponding to the picture, and the picture type recognition submodel is used to recognize whether a picture is an inappropriate picture according to the picture type corresponding to the picture. Accordingly, the multimodal fusion module is used to fuse the recognition results of the picture recognition submodel, the text recognition submodel, and the reference recognition submodel to determine the probability that the picture is an inappropriate picture.
[0090] Considering that many pictures on the Internet are configured with corresponding labels, the labels corresponding to the pictures can reflect the elements included in the pictures or the elements related to the pictures in many cases. Therefore, the technical solution provided in the embodiments of the present application can construct and train a label recognition sub-model. Through the label recognition sub-model, it is possible to identify whether the picture is an inappropriate picture according to the labels corresponding to the picture.
[0091] Taking into account that many pictures on the Internet are divided into corresponding categories, and the category to which the picture belongs (i.e., the picture type) can also reflect to a certain extent whether the picture is an inappropriate picture, therefore, the technical solution provided in the embodiment of the present application can construct and train a picture type recognition sub-model. Through the picture type recognition sub-model, whether the picture is an inappropriate picture can be identified according to the picture type corresponding to the picture.
[0092] Accordingly, the multimodal fusion module included in the multimodal recognition model should fuse the recognition results of the label recognition submodel and / or the recognition results of the picture type recognition submodel with the recognition results of the picture recognition submodel and the recognition results of the text recognition submodel, so as to determine the probability that the picture is an inappropriate picture based on the fused results. In this way, inappropriate pictures can be identified more accurately.
[0093] In addition, in order to improve the model performance of the above-mentioned multimodal recognition model so that it can be suitable for identifying more types of inappropriate pictures, the technical solution provided in the embodiment of the present application can also use the reference inappropriate pictures included in the picture retrieval library mentioned above as training samples to update the multimodal recognition model.
[0094] Considering that in some cases, the image recognition performance of the multimodal recognition model is limited, it may be difficult to accurately recognize and process some newly added types of discomfort pictures; therefore, in the technical solution provided in the embodiment of the present application, the server can use the reference discomfort pictures included in the image retrieval library as training samples to regularly update and train the multimodal recognition model. Since the reference discomfort pictures included in the image retrieval library are usually comprehensive and cover newly added types of discomfort pictures, updating and training the multimodal recognition model based on the reference discomfort pictures included in the image retrieval library can enable the multimodal recognition model to effectively recognize newly added types of discomfort pictures, thereby realizing a closed-loop feedback mechanism, which helps to improve the overall performance of the discomfort picture recognition system.
[0095] The above-mentioned image recognition method identifies whether the target image is an inappropriate image based on the image retrieval library. Since the image retrieval library supports adding images at any time, when a new type of inappropriate image appears, the new type of inappropriate image can be added to the image retrieval library in a timely manner according to the user's report on the inappropriate image and the review of the inappropriate image; in this way, the new type of inappropriate image can be quickly identified based on the image retrieval library in the future, thereby preventing the new type of inappropriate image from appearing online for a long time, thereby avoiding affecting the user's information reading experience.
[0096] With respect to the image recognition method described above, the present application also provides a corresponding image recognition device to enable the above-mentioned image recognition method to be applied and implemented in practice.
[0097] See also Figure 4 , Figure 4 It is the above Figure 2 The structural diagram of the picture recognition device 400 corresponding to the picture recognition method shown in FIG. Figure 4 As shown, the image recognition device 400 includes:
[0098] The image acquisition module 401 is used to acquire the target image to be identified;
[0099] The image retrieval module 402 is used to retrieve a matching reference inappropriate image corresponding to the target image in an image retrieval library; the similarity between the matching reference inappropriate image and the target image satisfies a preset similarity condition; the image retrieval library includes a plurality of reference inappropriate images, and the plurality of reference inappropriate images include images reported by users and passed the inappropriate image review;
[0100] The picture identification module 403 is used to determine that the target picture is an inappropriate picture if the matching reference inappropriate picture is retrieved in the picture retrieval library.
[0101] Optionally, the image retrieval library includes feature vectors corresponding to each of the plurality of reference inappropriate images; then the image retrieval module 402 is specifically used for:
[0102] Performing vectorization processing on the target image to obtain a feature vector corresponding to the target image;
[0103] For each feature vector corresponding to the reference inappropriate picture included in the picture retrieval library, the similarity between the feature vector corresponding to the target picture and the feature vector corresponding to the reference inappropriate picture is calculated; if the similarity exceeds a preset similarity threshold, the reference inappropriate picture is determined to be the matching reference inappropriate picture.
[0104] Optional, in Figure 4 Based on the picture recognition device 400 shown in FIG. Figure 5 , Figure 5 A schematic diagram of the structure of another image recognition device 500 provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the device also includes:
[0105] The first image retrieval library construction module 501 is used to obtain images that have been reported more than a preset number of times within a preset time period as first candidate inappropriate images; transmit the first candidate inappropriate images to the review channel, and obtain the review results corresponding to the first candidate inappropriate images; if the review results indicate that the first candidate inappropriate images are inappropriate images, then determine that the first candidate inappropriate images are the reference inappropriate images, and add the reference inappropriate images to the image retrieval library.
[0106] Optional, in Figure 4 Based on the picture recognition device 400 shown in FIG. Figure 6 , Figure 6 A structural diagram of another image recognition device 600 provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device also includes:
[0107] The second image retrieval library construction module 601 is used to obtain images that have not been reported more than a preset number of times within a preset time period as second candidate inappropriate images; identify the second candidate inappropriate images through a multimodal recognition model, and determine the review order corresponding to the second candidate inappropriate images according to the recognition result; the multimodal recognition model includes an image recognition sub-model, a text recognition sub-model and a multimodal fusion module, the image recognition sub-model is used to identify whether the image is an inappropriate image, the text recognition sub-model is used to identify whether the image is an inappropriate image according to text information related to the image, and the multimodal fusion module is used to fuse the recognition result of the image recognition sub-model and the recognition result of the text recognition sub-model to determine the probability that the image is an inappropriate image; based on the review order corresponding to the second candidate inappropriate image, the second candidate inappropriate image is transmitted to the review channel, and the review result corresponding to the second candidate inappropriate image is obtained; if the review result indicates that the second candidate inappropriate image is an inappropriate image, the second candidate inappropriate image is determined to be the reference inappropriate image, and the reference inappropriate image is added to the image retrieval library.
[0108] Optional, in Figure 4 Based on the picture recognition device 400 shown in FIG. Figure 7 , Figure 7 A structural diagram of another image recognition device 700 provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device also includes:
[0109] A model recognition module 701 is used to determine the probability that the target image is an inappropriate image through a multimodal recognition model if the matching reference inappropriate image is not retrieved in the image retrieval library; the multimodal recognition model includes an image recognition sub-model, a text recognition sub-model and a multimodal fusion module, the image recognition sub-model is used to identify whether the image is an inappropriate image, the text recognition sub-model is used to identify whether the image is an inappropriate image based on text information related to the image, and the multimodal fusion module is used to fuse the recognition results of the image recognition sub-model and the recognition results of the text recognition sub-model to determine the probability that the image is an inappropriate image;
[0110] The picture recognition module 403 is further configured to determine whether the target picture is an inappropriate picture according to the probability that the target picture is an inappropriate picture.
[0111] Optional, in Figure 7 On the basis of the picture recognition device shown, the multimodal recognition model further includes a reference recognition sub-model, and the reference recognition sub-model includes at least one of a label recognition sub-model and a picture type recognition sub-model; the label recognition sub-model is used to recognize whether the picture is an inappropriate picture according to the label corresponding to the picture; the picture type recognition sub-model is used to recognize whether the picture is an inappropriate picture according to the picture type corresponding to the picture;
[0112] The multimodal fusion module is used to fuse the recognition result of the image recognition sub-model, the recognition result of the text recognition sub-model and the recognition result of the reference recognition sub-model to determine the probability that the image is an inappropriate image.
[0113] Optional, in Figure 7 Based on the picture recognition device shown, see Figure 8 , Figure 8 A structural diagram of another image recognition device 800 provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the device also includes:
[0114] The model updating training module 801 is used to use the reference discomfort pictures included in the picture retrieval library as training samples to perform updating training on the multimodal recognition model.
[0115] The above-mentioned image recognition device identifies whether the target image is an inappropriate image based on the image retrieval library. Since the image retrieval library supports adding images thereto at any time, when a new type of inappropriate image appears, the new type of inappropriate image can be promptly added to the image retrieval library based on the user's report on the inappropriate image and the review of the inappropriate image; in this way, the new type of inappropriate image can be quickly identified based on the image retrieval library in the future, thereby preventing the new type of inappropriate image from appearing online for a long time, thereby avoiding affecting the user's information reading experience.
[0116] The embodiment of the present application also provides a device for image recognition, which may specifically be a terminal device or a server. The terminal device and server provided in the embodiment of the present application will be introduced below from the perspective of hardware entity.
[0117] See also Fig. 9 , Fig. 9 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Fig. 9For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The terminal can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (English full name: Personal Digital Assistant, English abbreviation: PDA), a sales terminal (English full name: Point of Sales, English abbreviation: POS), a car computer, etc., taking the terminal as a computer as an example:
[0118] Fig. 9 FIG. 1 is a block diagram showing a partial structure of a computer related to a terminal provided in an embodiment of the present application. Fig. 9 The computer includes: a radio frequency (RF) circuit 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless fidelity (WiFi) module 970, a processor 980, and a power supply 990. Those skilled in the art will appreciate that Fig. 9 The computer structure shown in the figure does not constitute a limitation of the computer, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0119] The memory 920 can be used to store software programs and modules. The processor 980 executes various functional applications and data processing of the computer by running the software programs and modules stored in the memory 920. The memory 920 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 computer (such as audio data, a phone book, etc.), etc. In addition, the memory 920 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.
[0120] The processor 980 is the control center of the computer. It uses various interfaces and lines to connect various parts of the entire computer. It executes various functions of the computer and processes data by running or executing software programs and / or modules stored in the memory 920 and calling data stored in the memory 920. Optionally, the processor 980 may include one or more processing units; preferably, the processor 980 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 980.
[0121] In the embodiment of the present application, the processor 980 included in the terminal also has the following functions:
[0122] Get the target image to be identified;
[0123] Retrieve a matching reference inappropriate picture corresponding to the target picture in a picture retrieval library; the similarity between the matching reference inappropriate picture and the target picture satisfies a preset similarity condition; the picture retrieval library includes a plurality of reference inappropriate pictures, and the plurality of reference inappropriate pictures include pictures reported by users and passed the inappropriate picture review;
[0124] If the matching reference inappropriate picture is retrieved in the picture retrieval library, it is determined that the target picture is an inappropriate picture.
[0125] Optionally, the processor 980 is also used to execute the steps of any implementation method of the image recognition method provided in the embodiments of the present application.
[0126] See also Fig.10 , Fig.10 A schematic diagram of the structure of a server 1000 provided for an embodiment of the present application. The server 1000 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1022 (for example, one or more processors) and a memory 1032, and one or more storage media 1030 (for example, one or more mass storage devices) storing application programs 1042 or data 1044. Among them, the memory 1032 and the storage medium 1030 may be temporary storage or permanent storage. The program stored in the storage medium 1030 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 1022 may be configured to communicate with the storage medium 1030 and execute a series of instruction operations in the storage medium 1030 on the server 1000.
[0127] The server 1000 may also include one or more power supplies 1026, one or more wired or wireless network interfaces 1050, one or more input and output interfaces 1058, and / or one or more operating systems, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0128] The steps performed by the server in the above embodiment can be based on the Fig.10 The server structure shown.
[0129] The CPU 1022 is used to execute the following steps:
[0130] Get the target image to be identified;
[0131] Retrieve a matching reference inappropriate picture corresponding to the target picture in a picture retrieval library; the similarity between the matching reference inappropriate picture and the target picture satisfies a preset similarity condition; the picture retrieval library includes a plurality of reference inappropriate pictures, and the plurality of reference inappropriate pictures include pictures reported by users and passed the inappropriate picture review;
[0132] If the matching reference inappropriate picture is retrieved in the picture retrieval library, it is determined that the target picture is an inappropriate picture.
[0133] Optionally, the CPU 1022 may also be used to execute steps of any implementation method of the image recognition method provided in the embodiments of the present application.
[0134] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute any one of the implementation methods of an image recognition method described in the aforementioned embodiments.
[0135] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes any one of the implementation methods of the image recognition method described in the above embodiments.
[0136] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0137] 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.
[0138] 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.
[0139] 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.
[0140] 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 (full name in English: Read-Only Memory, English abbreviation: ROM), random access memory (full name in English: Random Access Memory, English abbreviation: RAM), disk or optical disk and other media that can store computer programs.
[0141] 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.
[0142] 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. A method for image recognition, characterized in that: The method comprises: Get the target image to be identified; Retrieve a matching reference inappropriate picture corresponding to the target picture in a picture retrieval library; the similarity between the matching reference inappropriate picture and the target picture satisfies a preset similarity condition; the picture retrieval library includes a plurality of reference inappropriate pictures, and the plurality of reference inappropriate pictures include pictures reported by users and passed the inappropriate picture review; If the matching reference inappropriate picture is retrieved in the picture retrieval library, determining that the target picture is an inappropriate picture; If the matching reference inappropriate picture is not retrieved in the picture retrieval library, the probability that the target picture belongs to an inappropriate picture is determined by a multimodal recognition model; the multimodal recognition model includes a picture recognition submodel, a text recognition submodel and a multimodal fusion module, the picture recognition submodel is used to identify whether the picture belongs to an inappropriate picture, and the text recognition submodel is used to identify whether the picture belongs to an inappropriate picture according to text information related to the picture, the text information related to the picture is the picture title of the picture, the title of the information to which the picture belongs, or the text content in the information to which the picture belongs, the multimodal fusion module splices the probability output by the picture recognition submodel and the probability output by the text recognition submodel based on the probability fusion method, and classifies them through the fully connected network and the softmax layer in turn, and outputs the probability that the target picture belongs to an inappropriate picture, or, the multimodal fusion module splices the feature vector output by the fully connected layer before the softmax layer in the picture recognition submodel and the feature vector output by the fully connected layer before the softmax layer in the text recognition submodel based on the feature fusion method, and classifies them through the fully connected network and the softmax layer in turn, and outputs the probability that the target picture belongs to an inappropriate picture; Determining whether the target picture is an inappropriate picture according to the probability that the target picture is an inappropriate picture; The image retrieval library is constructed in the following manner: Obtaining pictures that have been reported more than a preset number of times within a preset period of time as first candidate inappropriate pictures; Transmitting the first candidate inappropriate picture to a review channel, and obtaining a review result corresponding to the first candidate inappropriate picture; If the review result indicates that the first candidate discomfort picture is an discomfort picture, determining the first candidate discomfort picture as the reference discomfort picture, and adding the reference discomfort picture to the picture retrieval library; Obtaining pictures whose number of reports within a preset period does not exceed a preset number of times as second candidate inappropriate pictures; The second candidate inappropriate picture is identified by a multimodal recognition model, and the review order corresponding to the second candidate inappropriate picture is determined according to the recognition result; the multimodal recognition model includes a picture recognition sub-model, a text recognition sub-model and a multimodal fusion module, the picture recognition sub-model is used to identify whether the picture is an inappropriate picture, the text recognition sub-model is used to identify whether the picture is an inappropriate picture according to text information related to the picture, the text information related to the picture is the picture title of the picture, the title of the information to which the picture belongs, or the text content in the information to which the picture belongs, and the multimodal fusion module is used to fuse the recognition result of the picture recognition sub-model and the recognition result of the text recognition sub-model to determine the probability that the picture is an inappropriate picture; Based on the review order corresponding to the second candidate inappropriate picture, transmitting the second candidate inappropriate picture to the review channel, and obtaining the review result corresponding to the second candidate inappropriate picture; If the review result indicates that the second candidate inappropriate picture is an inappropriate picture, the second candidate inappropriate picture is determined to be the reference inappropriate picture, and the reference inappropriate picture is added to the picture retrieval library.
2. The method according to claim 1, characterized in that: The image retrieval library includes feature vectors corresponding to the plurality of reference inappropriate images respectively; then searching the image retrieval library for a matching reference inappropriate image corresponding to the target image includes: Performing vectorization processing on the target image to obtain a feature vector corresponding to the target image; For each feature vector corresponding to the reference inappropriate picture included in the picture retrieval library, the similarity between the feature vector corresponding to the target picture and the feature vector corresponding to the reference inappropriate picture is calculated; if the similarity exceeds a preset similarity threshold, the reference inappropriate picture is determined to be the matching reference inappropriate picture.
3. The method according to claim 1, characterized in that The multimodal recognition model further includes a reference recognition sub-model, and the reference recognition sub-model includes at least one of a label recognition sub-model and a picture type recognition sub-model; the label recognition sub-model is used to recognize whether the picture is an inappropriate picture according to the label corresponding to the picture; the picture type recognition sub-model is used to recognize whether the picture is an inappropriate picture according to the picture type corresponding to the picture; The multimodal fusion module is used to fuse the recognition result of the image recognition sub-model, the recognition result of the text recognition sub-model and the recognition result of the reference recognition sub-model to determine the probability that the image is an inappropriate image.
4. The method according to claim 1, characterized in that: The method further comprises: The reference discomfort pictures included in the picture retrieval library are used as training samples to update the multimodal recognition model.
5. A picture recognition device, characterized in that: The device comprises: An image acquisition module is used to acquire a target image to be identified; An image retrieval module is used to retrieve a matching reference inappropriate image corresponding to the target image in an image retrieval library; the similarity between the matching reference inappropriate image and the target image satisfies a preset similarity condition; the image retrieval library includes a plurality of reference inappropriate images, and the plurality of reference inappropriate images include images reported by users and passed the inappropriate image review; A picture recognition module, configured to determine that the target picture is an inappropriate picture if the matching reference inappropriate picture is retrieved in the picture retrieval library; A model recognition module is used to determine the probability that the target image is an inappropriate image through a multimodal recognition model if the matching reference inappropriate image is not retrieved in the image retrieval library; the multimodal recognition model includes an image recognition sub-model, a text recognition sub-model and a multimodal fusion module, the image recognition sub-model is used to identify whether the image is an inappropriate image, the text recognition sub-model is used to identify whether the image is an inappropriate image based on text information related to the image, the text information related to the image is the image title of the image, the title of the information to which the image belongs, or the text content in the information to which the image belongs, and the multimodal fusion module The block is based on a probability fusion method, splicing the probability output by the image recognition sub-model and the probability output by the text recognition sub-model, classifying them through a fully connected network and a softmax layer in turn, and outputting the probability that the target image is an inappropriate image, or, the multimodal fusion module is based on a feature fusion method, splicing the feature vector output by the fully connected layer before the softmax layer in the image recognition sub-model and the feature vector output by the fully connected layer before the softmax layer in the text recognition sub-model, classifying them through a fully connected network and a softmax layer in turn, and outputting the probability that the target image is an inappropriate image; The picture recognition module is further used to determine whether the target picture is an inappropriate picture according to the probability that the target picture is an inappropriate picture; A first picture retrieval library construction module is used to obtain pictures that have been reported more than a preset number of times within a preset period of time as first candidate inappropriate pictures; transmit the first candidate inappropriate pictures to the review channel, and obtain the review result corresponding to the first candidate inappropriate pictures; if the review result indicates that the first candidate inappropriate pictures are inappropriate pictures, determine that the first candidate inappropriate pictures are the reference inappropriate pictures, and add the reference inappropriate pictures to the picture retrieval library; The second image retrieval library construction module is used to obtain images that have been reported less than a preset number of times within a preset period of time as second candidate inappropriate images; the second candidate inappropriate images are identified by a multimodal recognition model, and the review order corresponding to the second candidate inappropriate images is determined according to the recognition result; the multimodal recognition model includes an image recognition sub-model, a text recognition sub-model and a multimodal fusion module, the image recognition sub-model is used to identify whether the image is an inappropriate image, the text recognition sub-model is used to identify whether the image is an inappropriate image according to text information related to the image, the text information related to the image is the image title of the image, the title of the information to which the image belongs, or the text content in the information to which the image belongs, and the multimodal fusion module is used to fuse the recognition result of the image recognition sub-model and the recognition result of the text recognition sub-model to determine the probability that the image is an inappropriate image; based on the review order corresponding to the second candidate inappropriate image, the second candidate inappropriate image is transmitted to the review channel, and the review result corresponding to the second candidate inappropriate image is obtained; if the review result indicates that the second candidate inappropriate image is an inappropriate image, the second candidate inappropriate image is determined to be the reference inappropriate image, and the reference inappropriate image is added to the image retrieval library.
6. The device according to claim 5, characterized in that The image retrieval library includes the feature vectors corresponding to the plurality of reference inappropriate images respectively; the image retrieval module is specifically used to: Performing vectorization processing on the target image to obtain a feature vector corresponding to the target image; For each feature vector corresponding to the reference inappropriate picture included in the picture retrieval library, the similarity between the feature vector corresponding to the target picture and the feature vector corresponding to the reference inappropriate picture is calculated; if the similarity exceeds a preset similarity threshold, the reference inappropriate picture is determined to be the matching reference inappropriate picture.
7. The device according to claim 5, characterized in that The multimodal recognition model further includes a reference recognition sub-model, and the reference recognition sub-model includes at least one of a label recognition sub-model and a picture type recognition sub-model; the label recognition sub-model is used to recognize whether the picture is an inappropriate picture according to the label corresponding to the picture; the picture type recognition sub-model is used to recognize whether the picture is an inappropriate picture according to the picture type corresponding to the picture; The multimodal fusion module is used to fuse the recognition results of the image recognition sub-model, the recognition results of the text recognition sub-model and the recognition results of the reference recognition sub-model to determine the probability that the image is an inappropriate image.
8. The device according to claim 5, characterized in that The device also includes: The model updating training module is used to update the multimodal recognition model by using the reference discomfort pictures included in the picture retrieval library as training samples.
9. A device, characterized in that: The device includes a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the image recognition method according to any one of claims 1 to 4 according to the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the image recognition method according to any one of claims 1 to 4.
11. A computer program product, characterized in that The computer program product includes computer instructions, and a processor of a computer device executes the computer instructions, so that the computer device executes the image recognition method according to any one of claims 1 to 4.
