CN-115761717-B - Method and device for identifying topic image, electronic equipment and storage medium
Abstract
The disclosure provides a method and a device for identifying a topic image, electronic equipment and a storage medium, and belongs to the field of image processing. The method comprises the steps of obtaining a target image to be identified, determining whether the target image is a topic image or not based on image features of the target image, determining confidence that the target image is the topic image based on the image features and text features of the target image in response to the fact that the target image is the topic image, determining whether the target image is the topic image again based on the confidence and the similarity between the target image and each preset topic in response to the fact that the target image is the topic image based on the confidence and the similarity between the target image and each preset topic, and determining a topic identification result corresponding to the target image. By adopting the method and the device, the non-subject images can be accurately filtered.
Inventors
- XING BAIQIAO
Assignees
- 深圳市星桐科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20221109
Claims (8)
- 1. A method of identifying a topic image, the method comprising: acquiring a target image to be identified; Determining whether the target image is a topic image based on image features of the target image; Determining the confidence that the target image is a topic image based on the image characteristics and text characteristics of the target image in response to determining the target image is a topic image based on the image characteristics of the target image; Determining again whether the target image is a topic image based on the confidence level; In response to determining that the target image is a topic image based on the confidence, determining whether the target image is a topic image again based on the confidence and the similarity between the target image and each preset topic; Determining the target image as a topic image based on the confidence and the similarity between the target image and each preset topic, and determining a topic identification result corresponding to the target image; the determining the confidence that the target image is a topic image based on the image features and the text features of the target image comprises the following steps: performing text recognition on the target image to obtain a text feature vector of the target image; Extracting image features of the target image to obtain an image feature vector of the target image; Extracting features of the text feature vector and the image feature vector through a first full-connection network to obtain an intermediate feature vector; And determining the confidence that the target image is a topic image based on the intermediate feature vector through a second fully connected network.
- 2. The method of claim 1, wherein the determining whether the target image is a topic image based on image features of the target image comprises: Inputting the target image into a lightweight image classification model, and determining the probability of the target image being a question image based on the image characteristics of the target image in the lightweight image classification model; And determining that the target image is a question image in response to the probability being greater than or equal to a preset probability threshold.
- 3. The method of claim 1, further comprising, after the text recognition of the target image, obtaining text content in the target image; after the intermediate feature vector is obtained, the method further comprises the steps of extracting features of the intermediate feature vector through a third fully-connected network to obtain a target feature vector of the target image, wherein the target feature vector carries image feature information and text feature information; The similarity between the target image and each preset question is determined by the following method: Determining a first similarity between the target feature vector of the target image and the target feature vector of each preset question, and/or And determining a second similarity between the text content of the target image and the text content of each preset question.
- 4. A method according to any one of claims 1-3, wherein the re-determining whether the target image is a topic image based on the confidence level and the similarity between the target image and each preset topic comprises: determining a reference question in each preset question based on the similarity between the target image and each preset question, and acquiring target similarity corresponding to the reference question, wherein the similarity comprises a first similarity determined based on a target feature vector and/or a second similarity determined based on text content; calculating the similarity score of the reference title by the following formula: Pq = W1*Pq1 + W2*Pq2 Wherein Pq is a similarity score of the reference question, pq1 is a confidence coefficient of the target image, pq2 is a target similarity corresponding to the reference question, W1 is a weight corresponding to the confidence coefficient of the target image, and W2 is a weight corresponding to the target similarity of the reference question; And determining that the target image is a question image in response to the similarity score being greater than a preset score threshold.
- 5. An apparatus for identifying a subject image, the apparatus comprising: the acquisition module is used for acquiring a target image to be identified; the first judging module is used for determining whether the target image is a question image or not based on the image characteristics of the target image; The second judging module is used for responding to the image characteristics of the target image to determine that the target image is a question image, and determining the confidence degree of the target image being the question image based on the image characteristics and the text characteristics of the target image; The third judging module is used for responding to the confidence degree to determine whether the target image is a question image or not, and determining whether the target image is a question image or not again based on the confidence degree and the similarity between the target image and each preset question; the determining module is used for determining the target image as a question image and determining a question recognition result corresponding to the target image in response to the confidence and the similarity between the target image and each preset question; The second judging module is configured to: Extracting image features of the target image to obtain an image feature vector of the target image; performing text recognition on the target image to obtain a text feature vector of the target image; Extracting features of the text feature vector and the image feature vector through a first full-connection network to obtain an intermediate feature vector; And determining the confidence that the target image is a topic image based on the intermediate feature vector through a second fully connected network.
- 6. The apparatus of any one of claims 5, wherein the third determining module is configured to: determining a reference question in each preset question based on the similarity between the target image and each preset question, and acquiring target similarity corresponding to the reference question, wherein the similarity comprises a first similarity determined based on a target feature vector and/or a second similarity determined based on text content; calculating the similarity score of the reference title by the following formula: Pq = W1*Pq1 + W2*Pq2 Wherein Pq is a similarity score of the reference question, pq1 is a confidence coefficient of the target image, pq2 is a target similarity corresponding to the reference question, W1 is a weight corresponding to the confidence coefficient of the target image, and W2 is a weight corresponding to the target similarity of the reference question; And determining that the target image is a question image in response to the similarity score being greater than a preset score threshold.
- 7. An electronic device, comprising: Processor, and A memory in which a program is stored, Wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method according to any of claims 1-4.
- 8. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-4.
Description
Method and device for identifying topic image, electronic equipment and storage medium Technical Field The present invention relates to the field of image processing, and in particular, to a method and apparatus for identifying a topic image, an electronic device, and a storage medium. Background When a user uses the answering system, the questions to be answered can be uploaded to the answering system in the form of images, and the answering system automatically returns a question with detailed answering, which is most similar to the questions, according to the uploaded images. In practice, the user may optionally take a non-topic image, which is not needed to return a solution. However, it is often difficult to filter these non-topic images, such as commercial advertising images, newspapers, product specifications, and the like, in existing systems. Thus, the loopholes of the answering system can be easily grasped, the technology is utilized to simulate and generate non-question images, the answering system is requested, the normal questions and answers of the answering system are crawled and analyzed, and the data of the answering system are revealed. Therefore, there is a need for a method for identifying topic images, which filters non-topic images. Disclosure of Invention In view of this, embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a storage medium for identifying a topic image, which can implement accurate filtering of a non-topic image. According to an aspect of the present disclosure, there is provided a method for identifying a topic image, the method including: acquiring a target image to be identified; Determining whether the target image is a topic image based on image features of the target image; Determining the confidence that the target image is a topic image based on the image characteristics and text characteristics of the target image in response to determining the target image is a topic image based on the image characteristics of the target image; Determining again whether the target image is a topic image based on the confidence level; In response to determining that the target image is a topic image based on the confidence, determining whether the target image is a topic image again based on the confidence and the similarity between the target image and each preset topic; and determining the target image as a topic image based on the confidence and the similarity between the target image and each preset topic, and determining a topic identification result corresponding to the target image. According to another aspect of the present disclosure, there is provided an apparatus for recognizing a subject image, the apparatus including: the acquisition module is used for acquiring a target image to be identified; the first judging module is used for determining whether the target image is a question image or not based on the image characteristics of the target image; The second judging module is used for responding to the image characteristics of the target image to determine that the target image is a question image, and determining the confidence degree of the target image being the question image based on the image characteristics and the text characteristics of the target image; The third judging module is used for responding to the confidence degree to determine whether the target image is a question image or not, and determining whether the target image is a question image or not again based on the confidence degree and the similarity between the target image and each preset question; And the determining module is used for determining the target image as a question image and determining a question recognition result corresponding to the target image in response to the confidence and the similarity between the target image and each preset question. According to another aspect of the present disclosure, there is provided an electronic device including: Processor, and A memory in which a program is stored, The program includes instructions that, when executed by the processor, cause the processor to perform the method of identifying the topic image. According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the above-described method of recognizing a topic image. In the disclosure, after the target image to be identified is acquired, three layers of judgment can be performed to determine whether the target image is a question image, wherein the first layer of judgment is performed based on the image characteristics of the target image, the second layer of judgment is performed based on the image characteristics and the text characteristics of the target image, the third layer of judgment is performed based on the similarity between the target image and each preset question and the confidence obtained by calcul