CN111931844B - Image processing method and device, electronic equipment and storage medium - Google Patents

Image processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111931844B
CN111931844B CN202010790826.8A CN202010790826A CN111931844B CN 111931844 B CN111931844 B CN 111931844B CN 202010790826 A CN202010790826 A CN 202010790826A CN 111931844 B CN111931844 B CN 111931844B
Authority
CN
China
Prior art keywords
image
sample
sample image
network
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010790826.8A
Other languages
Chinese (zh)
Other versions
CN111931844A (en
Inventor
杨靖康
冯俐铜
陈伟嵘
严肖朋
郑华滨
张伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sensetime Group Ltd
Original Assignee
Sensetime Group Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sensetime Group Ltd filed Critical Sensetime Group Ltd
Priority to CN202010790826.8A priority Critical patent/CN111931844B/en
Publication of CN111931844A publication Critical patent/CN111931844A/en
Application granted granted Critical
Publication of CN111931844B publication Critical patent/CN111931844B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The present disclosure relates to an image processing method and apparatus, an electronic device, and a storage medium, the method including: acquiring a target image to be identified; and identifying the target image by using a trained image identification network, and determining the category information of the target object in the target image, wherein the trained image identification network is obtained by training the image identification network in an initial state based on the confidence corresponding to a sample label of a sample image, and the confidence corresponding to the sample label is obtained based on a first identification result of the sample image output by the image identification network in the initial state. The embodiment of the disclosure can improve the accuracy of image recognition.

Description

Image processing method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the field of computer technology, and in particular, to an image processing method and apparatus, an electronic device, and a storage medium.
Background
In computer vision tasks of deep learning networks, such as face recognition tasks, image classification tasks, etc., it is often necessary to rely on a large amount of accurate annotation data. The label data can be obtained by manual labeling, and in order to save the cost of labeling the images, a network image dataset can be formed by taking keywords used for searching the network images as network labels of the network images. The most basic method for utilizing the network tag is to consider the network tag as a real tag of a network image, so that the network tag is directly used for training the deep learning network.
However, due to problems such as semantic ambiguity, the accuracy of the network tag is often difficult to guarantee.
Disclosure of Invention
The present disclosure proposes an image processing technique.
According to an aspect of the present disclosure, there is provided an image processing method including: acquiring a target image to be identified; and identifying the target image by using a trained image identification network, and determining the category information of the target object in the target image, wherein the trained image identification network is obtained by training the image identification network in an initial state based on the confidence corresponding to a sample label of a sample image, and the confidence corresponding to the sample label is obtained based on a first identification result of the sample image output by the image identification network in the initial state.
In some possible implementations, the target image has a web tag; the method further comprises the steps of: based on the category information of the target object in the target image, checking the network tag of the target image to obtain a checking result; and determining the labeling information of the target image according to the test result.
In some possible implementations, the method further includes: and taking the category information of the target object in the target image as the annotation information of the target image.
In some possible implementations, the method further includes: performing N rounds of training on the image recognition network in the initial state to obtain the trained image recognition network, wherein N is an integer greater than 1, and performing N rounds of training on the image recognition network in the initial state to obtain the trained image recognition network according to the i-th round training in the N rounds of training, and the method comprises the following steps: and training the image recognition network in the ith training state for one round based on the first loss corresponding to the sample label, the second loss corresponding to the first recognition result and the confidence coefficient corresponding to the sample label to obtain the image recognition network in the ith training state, wherein i is an integer and 1<i is less than or equal to N.
In some possible implementations, the training the image recognition network in the i-1 training state for one round based on the first loss corresponding to the sample tag, the second loss corresponding to the first recognition result, and the confidence level corresponding to the sample tag to obtain the image recognition network in the i training state includes: according to the confidence coefficient corresponding to the sample label, carrying out weighted summation on the first loss and the second loss to obtain network loss corresponding to the sample image; and training the image recognition network in the ith training state for one time based on the network loss to obtain the image recognition network in the ith training state.
In some possible implementations, the method further includes: obtaining an enhanced image of the sample image, wherein the enhanced image is obtained by enhancing the sample image; inputting the enhanced image into the image recognition network in the (i-1) th training state to obtain a second recognition result of the enhanced image; and determining a first loss corresponding to the sample label according to the sample label of the sample image and the second identification result.
In some possible implementations, the method further includes: inputting the sample image into an image recognition network in the initial state to obtain a first recognition result of the sample image; and determining a second loss corresponding to the first identification result according to the first identification result and the second identification result.
In some possible implementations, the method further includes: and determining the probability corresponding to the first category indicated by the sample label of the sample image as the confidence corresponding to the sample label in the probabilities corresponding to the plurality of categories in the first identification result of the sample image.
In some possible implementations, the method further includes: for a first sample image in a plurality of sample images, acquiring a plurality of second sample images in the plurality of sample images according to image features of the first sample image, wherein the first sample image is any sample image in the plurality of sample images; fusing the first identification result of the first sample image and the first identification result of the second sample image to obtain a fusion result; and determining the confidence corresponding to the sample label of the first sample image based on the fusion result.
In some possible implementations, the acquiring a plurality of second sample images from the plurality of sample images according to the image features of the first sample image includes: determining the similarity between the first sample image and each sample image according to the image characteristics of the first sample image and the image characteristics of each sample image; and acquiring a preset number of second sample images in the plurality of sample images according to the similarity, wherein the similarity between the first sample image and the second sample image is larger than the similarity between the first sample image and a third sample image, and the third sample image is a sample image except the second sample image in the plurality of sample images.
In some possible implementations, the fusing the first recognition result of the first sample image and the first recognition result of the second sample image to obtain a fusion result includes: determining a fusion weight according to the similarity between the first sample image and the second sample image; and fusing the first identification result of the first sample image and the first identification result of the second sample image according to the fusion weight to obtain the fusion result.
In some possible implementations, the determining, based on the fusion result, a confidence level corresponding to a sample label of the first sample image includes: and determining the probability corresponding to the first category indicated by the sample label of the first sample image as the confidence corresponding to the sample label of the first sample image in the probabilities corresponding to the categories in the fusion result.
According to an aspect of the present disclosure, there is provided an image processing apparatus including:
the acquisition module is used for acquiring a target image to be identified;
the determining module is used for identifying the target image by using a trained image identification network and determining the category information of the target object in the target image, wherein the trained image identification network is obtained by training the image identification network in an initial state based on the confidence coefficient corresponding to the sample label of the sample image, and the confidence coefficient corresponding to the sample label is obtained based on the first identification result of the sample image output by the image identification network in the initial state.
In some possible implementations, the target image has a web tag; the apparatus further comprises: the verification module is used for verifying the network tag of the target image based on the category information of the target object in the target image to obtain a verification result; and determining the labeling information of the target image according to the test result.
In some possible implementations, the apparatus further includes: and the labeling module is used for taking the category information of the target object in the target image as the labeling information of the target image.
In some possible implementations, the apparatus further includes: the training module is used for carrying out N rounds of training on the image recognition network in the initial state to obtain the trained image recognition network, N is an integer greater than 1, wherein the i-th round of training in the N rounds of training is carried out on the image recognition network in the i-1 th training state based on the first loss corresponding to the sample label, the second loss corresponding to the first recognition result and the confidence coefficient corresponding to the sample label, so that the image recognition network in the i-1 th training state is obtained, i is an integer and is equal to or less than 1<i N.
In some possible implementations, the training module is configured to perform weighted summation on the first loss and the second loss according to the confidence coefficient corresponding to the sample label, so as to obtain a network loss corresponding to the sample image; and training the image recognition network in the ith training state for one time based on the network loss to obtain the image recognition network in the ith training state.
In some possible implementations, the training module is further configured to obtain an enhanced image of the sample image, where the enhanced image is obtained by performing an enhancement process on the sample image; inputting the enhanced image into the image recognition network in the (i-1) th training state to obtain a second recognition result of the enhanced image; and determining a first loss corresponding to the sample label according to the sample label of the sample image and the second identification result.
In some possible implementations, the training module is further configured to input the sample image into an image recognition network in the initial state, to obtain a first recognition result of the sample image; and determining a second loss corresponding to the first identification result according to the first identification result and the second identification result.
In some possible implementations, the training module is further configured to determine, from probabilities corresponding to a plurality of categories in the first recognition result of the sample image, a probability corresponding to the first category indicated by the sample tag of the sample image as a confidence corresponding to the sample tag.
In some possible implementations, the training module is further configured to obtain, for a first sample image of a plurality of sample images, a plurality of second sample images of the plurality of sample images according to image features of the first sample image, where the first sample image is any one sample image of the plurality of sample images; fusing the first identification result of the first sample image and the first identification result of the second sample image to obtain a fusion result; and determining the confidence corresponding to the sample label of the first sample image based on the fusion result.
In some possible implementations, the training module is configured to determine a similarity between the first sample image and each of the sample images according to image features of the first sample image and image features of each of the sample images; and acquiring a preset number of second sample images in the plurality of sample images according to the similarity, wherein the similarity between the first sample image and the second sample image is larger than the similarity between the first sample image and a third sample image, and the third sample image is a sample image except the second sample image in the plurality of sample images.
In some possible implementations, the training module is configured to determine a fusion weight according to a similarity between the first sample image and the second sample image; and fusing the first identification result of the first sample image and the first identification result of the second sample image according to the fusion weight to obtain the fusion result.
In some possible implementations, the training module is configured to determine, from probabilities corresponding to a plurality of categories in the fusion result, a probability corresponding to a first category indicated by a sample tag of the first sample image as a confidence level corresponding to the sample tag of the first sample image.
According to an aspect of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to perform the above method.
According to an aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
In the embodiment of the disclosure, the target image to be identified can be acquired, then the trained image identification network is utilized to identify the target image, and the category information of the target object in the target image is determined. The image recognition network is obtained by training the image recognition network in the initial state based on the confidence coefficient corresponding to the sample label of the sample image, and the confidence coefficient corresponding to the sample label is obtained based on the first recognition result of the sample image output by the image recognition network in the initial state, so that uncertainty of prediction of the image recognition network is considered in the training process of the image recognition network, and the accuracy of the trained image recognition network can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the technical aspects of the disclosure.
Fig. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure.
Fig. 2 shows a block diagram of an example image processing network training process according to an embodiment of the present disclosure.
Fig. 3 shows a block diagram of an image processing apparatus according to an embodiment of the present disclosure.
Fig. 4 shows a block diagram of an example of an electronic device, according to an embodiment of the disclosure.
Fig. 5 shows a block diagram of an example of an electronic device, according to an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the disclosure will be described in detail below with reference to the drawings. In the drawings, like reference numbers indicate identical or functionally similar elements. Although various aspects of the embodiments are illustrated in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, numerous specific details are set forth in the following detailed description in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order not to obscure the present disclosure.
According to the image processing scheme provided by the embodiment of the disclosure, the trained image recognition network can be utilized to recognize the target image, and the trained image recognition network is obtained by training the image recognition network in the initial state based on the confidence corresponding to the sample label of the sample image, so that uncertainty of image recognition network prediction is considered in the training process of the image recognition network, and the accuracy of trained image recognition network recognition can be improved.
The image processing scheme provided by the embodiment of the disclosure can be applied to the expansion of application scenes such as identification, analysis, labeling and the like of images or videos, and the embodiment of the disclosure is not limited to the expansion. For example, the category information of the target image output by the training image recognition network can be used as the labeling information of the target image, so that the automation of image labeling is realized, the dependence of the image labeling on manpower is reduced, and the manpower resource is saved.
The image processing method provided by the embodiments of the present disclosure may be performed by a terminal device, a server, or other types of electronic devices, where the terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a personal digital processing (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like. In some possible implementations, the data processing method may be implemented by way of a processor invoking computer readable instructions stored in a memory. The image processing method of the embodiment of the present disclosure will be described below taking an electronic device as an execution subject.
Fig. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure, as shown in fig. 1, including:
In step S11, a target image to be recognized is acquired.
In the embodiment of the present disclosure, the image to be identified may be an image to be subjected to image identification. The electronic equipment can have an image acquisition function, can acquire images of scenes where the electronic equipment is located, and acquire target images to be identified. Alternatively, the electronic device may acquire the target image to be recognized from another device, for example, the electronic device may acquire the target image to be recognized from a camera device, a monitoring device, a web server, or the like to the device. In some implementations, the image to be identified can be one image frame in the video.
In step S12, the trained image recognition network is used to recognize the target image, and the category information of the target object in the target image is determined.
In the embodiment of the disclosure, the target image can be input into the trained image recognition network, and the trained image recognition network is utilized to recognize the target image, so that the class information output by the trained image recognition network is obtained. The category information may indicate a category of a target object in the target image, for example, the target image includes an apple (target object), and after the target image is input into the trained image recognition network, indication information output by the trained image recognition network may be obtained, where the indication information may indicate the category of the apple. The image recognition network may be a neural network, for example, the image recognition network may include a network layer of a neural network such as a convolutional layer, a pooling layer, a deconvolution layer, a full connection layer, etc., and the present disclosure is not limited to a specific network structure of the image recognition network.
In the embodiment of the present disclosure, the trained image recognition network may be obtained by training the image recognition network in the initial state based on the confidence corresponding to the sample label of the sample image, for example, a plurality of sample images are continuously input into the image recognition network in the initial state, and the image recognition network in the initial state is trained for multiple times by using the sample images and the confidence corresponding to the image label of the sample image, and the trained image recognition network may be obtained after multiple times of training.
Here, the sample tag may indicate a category to which the sample object belongs in the sample image. The confidence level corresponding to the sample tag can be understood as the confidence level of the sample tag. For the sample label of one sample image, the sample label of one sample image may be determined by a manual labeling mode, or a search word of the sample image may be used as the sample label of one sample image, for example, an image which may be searched through a network, a searched image may be used as the sample image, a search word used for searching the image may be used as the sample label of the sample image, or the sample image may be automatically labeled through some classification networks. Accordingly, there is a certain error in the sample label of one sample image, that is, the sample label of one sample image may not accurately indicate the category of the sample object in the sample image, so that the credibility of the sample label can be represented by the corresponding confidence of the sample label. Because the confidence coefficient of the sample label is considered in the training process of the image recognition network, the trained image recognition network has higher recognition accuracy.
The embodiment of the disclosure can identify the target image through the trained image identification network, so as to determine the category information of the target object. In one possible implementation manner, the target image may have a network tag, the network tag of the target image may be verified based on the target category information in the target image, a verification result is obtained, and the labeling information of the target image is determined according to the verification result.
In this implementation manner, the target image may be a target image obtained by image searching, for example, the image may be searched in a search engine by a keyword, the searched image may be used as the target image, and accordingly, the keyword used for searching the image may be a web tag of the target image. Because the trained image recognition network can accurately recognize the target image, the network label of the target image can be checked by using the category information of the target object output by the trained image recognition network, and whether the network label of the target image is accurate or not can be judged. For example, the type information of the target image may be matched with the network tag, and when the matching degree of the type information of the target image and the network tag is greater than the matching threshold, the detection result may be considered to indicate that the network tag is accurate, and further the network tag of the target image may be used as the labeling information of the target image. Under the condition that the matching degree of the category information of the target image and the network label is lower than or equal to a matching threshold value, the detection result can be considered to indicate that the network label is inaccurate, and the category information of the target image can be used as the labeling information of the target image. By the method, the network label of the target image can be automatically checked, so that the labeling information of the determined target image is more accurate.
In another possible implementation manner, the class information of the target object in the target image can be used as the labeling information of the target image, namely, the class information output by the trained image recognition network can be directly used as the labeling information of the target object in the target image, so that automatic labeling of the target image can be realized, and waste of human resources is reduced.
In the embodiment of the disclosure, the trained image recognition network is obtained by training the image recognition network in the initial state based on the confidence corresponding to the sample label of the sample image, and has higher recognition accuracy. The embodiment of the disclosure also provides a process for training the image recognition network in the initial state.
In one possible implementation, the image recognition network in the initial state may be trained in N rounds, where N is an integer greater than 1, to obtain a trained image recognition network. The method comprises the steps of training an ith training in N rounds, wherein the ith training is performed on an ith training state image recognition network based on a first loss corresponding to a sample label, a second loss corresponding to a first recognition result and a confidence coefficient corresponding to the sample label, so that the ith training state image recognition network is obtained, i is an integer and 1<i is less than or equal to N.
In this implementation manner, a plurality of sample images may be sequentially input into the image recognition network in the initial state, and N-round training may be performed on the image recognition network in the initial state, to obtain a trained image recognition network. In the ith training in the N training, a sample image or an enhanced image of the sample image can be input into an image recognition network in the ith-1 training state to obtain a second recognition result output by the image recognition network in the ith-1 training state. The image recognition network in the i-1 th training state can be obtained by i-1 round training of the image recognition network in the initial state. Then, a round of training can be performed on the image recognition network in the i-1 th training state based on the first loss corresponding to the sample label, the second loss corresponding to the first recognition result and the confidence coefficient corresponding to the sample label to obtain the image recognition network in the i-1 th training state, for example, the network loss of the image recognition network in the i-1 th training state can be calculated based on the first loss corresponding to the image label of the sample image, the second loss corresponding to the first recognition result obtained by the image recognition network in the initial state and the confidence coefficient corresponding to the image label of the sample image, and then the network parameters of the image recognition network in the i-1 th training state are adjusted by utilizing the calculated network loss to obtain the image recognition network in the i-1 th training state.
Here, the first loss may be a loss obtained by supervising the image recognition network of the i-1 st training state with the sample label of the sample image. The second loss may be a loss obtained by supervising the image recognition network of the i-1 th training state using the first recognition result obtained by the image recognition network of the initial state. The sample label of the sample image and the first recognition result are used for jointly supervising the image recognition network in the (i-1) th training state, so that the accuracy of the trained image recognition network can be improved.
In this implementation, when i=1, i-1=0, and the image recognition network is in the 0 th training state, it may be understood that the image recognition network is in an untrained state, that is, the image recognition network is in an initial state, and the image recognition network in the 0 th training state is the image recognition network in the 0 th training state. At this time, the 1 st training is performed on the image recognition network in the initial state, so that the image recognition network in the 1 st training state can be obtained, where the image recognition network in the 1 st training state can be obtained by training the image recognition network in the initial state based on the first loss corresponding to the sample label. For example, the enhanced image of the sample image may be input to the image recognition network in the initial state, and the second recognition result output by the image recognition network in the initial state may be obtained. Then, based on the sample label of the sample image and the second recognition result, a first loss corresponding to the sample label can be determined, and then the image recognition network in the initial state is trained based on the determined first loss, so that the image recognition network in the 1 st training state can be obtained.
Here, the first loss and/or the second loss may be determined using a loss function, and for example, the first loss and/or the second loss may be calculated using a loss function such as a cross entropy loss function, a binary cross entropy loss function, a mean square error loss function, or the like. For example, in the training stage (including i=1) of the image recognition network in any i-1 training state, the first loss and/or the second loss may be determined using a binary cross entropy loss function, where each of the multiple classes may be independently trained using the binary cross entropy loss function, and accordingly, the confidence level corresponding to the sample label of the sample image may also independently measure the reliability of the sample label corresponding to a certain class, which may provide more efficient network loss and confidence level for training of the image recognition network in i-1 training states.
In the implementation manner, the image recognition network in the i-1 training state can be trained for one round based on the first loss corresponding to the sample label of the sample image, the second loss corresponding to the first recognition result and the confidence corresponding to the sample label, so that the image recognition network in the i training state is obtained. In one example of this implementation, the first loss and the second loss may be weighted and summed according to the confidence corresponding to the sample tag, for example, the weight coefficients of the first loss and the second loss may be determined according to the confidence corresponding to the sample tag of one sample image, for example, the confidence corresponding to the sample tag of one sample image is used as the weight coefficient of the first loss, 1-C is used as the weight coefficient of the second loss, and then the first loss and the second loss are weighted and summed, so as to obtain the network loss corresponding to the sample image. And then, training the image recognition network in the ith training state for one time by utilizing the network loss corresponding to the sample image to obtain the image recognition network in the ith training state. The proportion of the first loss and the second loss in the network loss can be balanced through the confidence coefficient corresponding to the sample label of the sample image, so that the network loss can be self-adaptive to the image recognition network on the level of one sample image, and the recognition precision of the trained image recognition network is improved.
The present implementation also provides an example of determining the first penalty, in which an enhanced image of the sample image may be obtained, and then the enhanced image is input into the image recognition network in the ith training state, to obtain a second recognition result of the enhanced image. According to the sample label of the sample image and the second recognition result, the first loss corresponding to the sample label can be determined.
In this example, the enhanced image may be obtained by subjecting the sample image to enhancement processing, for example, subjecting the sample image to enhancement processing such as flipping, clipping, color conversion, or the like, and an enhanced image of the sample image may be obtained. The enhanced image is input into the image recognition network in the i-1 training state, a second recognition result of the enhanced image output by the image recognition network in the i-1 training state can be obtained, then a sample label of the sample image can be compared with the second recognition result, and the first loss corresponding to the sample label is determined. Here, the first loss may be determined using a loss function, for example, the first loss may be calculated using a loss function such as a cross entropy loss function, a binary cross entropy loss function, a mean square error loss function, or the like.
According to the method and the device, the second recognition result can be determined according to the enhanced image of the sample image, and further the first loss corresponding to the sample label is determined, and the enhanced image is obtained by enhancing the sample image, so that the image recognition network in the i-1 training state is trained by utilizing the enhanced image, the training effect can be enhanced, and the recognition accuracy of the image recognition network is improved.
Here, the second recognition result may be a vector of 1×c, and c represents the number of categories of the category, where the value corresponding to each category may be a probability that the sample object belongs to the category. In this example, in the case where the first loss corresponding to the sample label is determined from the sample label of the sample image and the second recognition result, the first loss can be determined by the following formula (1).
Wherein,representing a first penalty corresponding to the sample tag; w represents the class indicated by the sample tag; x' represents an enhanced image; s represents the total category set; j represents the j-th category in S; θ represents the image recognition network for the i-1 st training state. p (y) (w) I x', θ) represents the probability corresponding to the category w in the second recognition result; p (y) (j) I x', θ) represents the probability of the category j corresponding in the second result.
The present implementation also provides an example of determining the second loss, in which the sample image may be input into the image recognition network in the initial state to obtain the first recognition result of the sample image. And determining a second loss corresponding to the first identification result according to the first identification result and the second identification result.
In this example, the sample image may be input to the image recognition network in the initial state, to obtain a first recognition result of the sample image output by the image recognition network in the initial state, and then the first recognition result output by the image recognition network in the initial state may be compared with a second recognition result output by the image recognition network in the i-1 th training state, to determine a second loss corresponding to the first recognition result. Here, the second loss may be determined using a loss function, for example, the second loss may be calculated using a loss function such as a cross entropy loss function, a binary cross entropy loss function, a mean square error loss function, or the like. The method and the device can monitor the image recognition network in the (i-1) th training state by utilizing the first recognition result output by the image recognition network in the initial state, so that the recognition accuracy of the image recognition network can be improved.
Here, the first recognition result may be a vector of 1×c, where c represents the number of categories of the category, and the value corresponding to each category may be a probability that the sample object belongs to the category. In this example, in the case where the second loss corresponding to the first recognition result is determined based on the first recognition result and the second recognition result, the first loss can be determined by the following formula (2).
Wherein,representing a first loss corresponding to the first recognition result; x represents a sample image; s represents the total category set; j represents the j-th category in S; θ 0 An image recognition network representing an initial state. p (y) (j) I x', θ) represents the probability corresponding to the category j in the second recognition result; p (y) (j) |x,θ 0 ) And representing the probability corresponding to the category j in the first result.
In the embodiment of the disclosure, the image recognition network in the initial state can be trained based on the confidence corresponding to the sample label, and the trained image recognition network is obtained. The confidence corresponding to the sample tag may be obtained based on a first recognition result of the sample image output by the image recognition network in the initial state, so that the confidence corresponding to the sample tag may be determined based on the first recognition result of the sample image. Here, the confidence degrees corresponding to different sample tags may be different, so that the network loss of the image recognition network obtained by calculating the confidence degrees corresponding to the sample tags may be adaptive to the image recognition network at the sample level, so that the trained image recognition network obtained after training has higher recognition accuracy.
In one possible implementation manner of determining the confidence level, in this implementation manner, the probability corresponding to the first category indicated by the sample label of the sample image may be determined as the confidence level corresponding to the sample label in probabilities corresponding to a plurality of categories in the first identification result of the sample image. Here, the first recognition result of the sample image may be an output of the image recognition network in the initial state, and as described above, the first recognition result may be a 1×c vector, c represents the number of categories of the category, and the value corresponding to each category may be a probability that the sample object belongs to the category. Under the condition that the confidence coefficient corresponding to the sample label of one sample image is determined, the probability corresponding to the first category indicated by the sample label of the sample image can be determined as the confidence coefficient corresponding to the sample label of the sample image in the probabilities of the categories of the first identification result, and the first identification result output by the image identification network in the initial state can be used as a reference for whether the sample label is accurate or not, so that the confidence coefficient corresponding to the sample label can be considered in the training process of the image identification network, and the trained image identification network is more accurate.
In one possible implementation, another way of determining the confidence level to which the sample tag of the sample image corresponds is also provided. In this implementation, for a first sample image of the plurality of sample images, a plurality of second sample images of the plurality of sample images may be acquired according to image features of the first sample image, for example, a plurality of second sample images similar to the image features of the first sample image are acquired. The first recognition result of the first sample image and the first recognition results of the plurality of second sample images may then be fused, for example, weighted average is performed on the first recognition result of the first sample image and the first recognition result of the plurality of second sample images, to obtain a fused result. And determining the confidence coefficient corresponding to the sample label of the first sample image according to the fusion result.
Here, the first sample image may be any sample image, and for the second sample image similar to the image feature of the first sample image, since the image feature of the second sample image is similar to the image feature of the first sample image, the first recognition result of the second sample image is also similar to the first recognition result of the first sample image, so that the first recognition results of the plurality of second sample images and the first recognition result of the first sample image can be fused. Here, the merging of the plurality of first recognition results is equivalent to smoothing the plurality of first recognition results, so that the obtained merging result is more accurate than the first recognition result of one sample image, and the confidence coefficient determined by the merging result is equivalent to smoothing, so that the confidence coefficient corresponding to the sample label of the first sample image determined based on the merging result is more accurate, and the quality of the confidence coefficient of the sample label is improved.
In one example of the present implementation, the similarity between the first sample image and each sample image may be determined from the image features of the first sample image and the image features of each sample image, for example, the similarity between the first sample image and each sample image may be determined by calculating a cosine distance or a euclidean distance between the image features of the first sample image and the image features of each sample image. And then a preset number of second sample images in the plurality of sample images can be acquired according to the similarity, wherein the similarity between the first sample image and the second sample image is larger than the similarity between the first sample image and a third sample image, and the third sample image is a sample image except the second sample image in the plurality of sample images. For example, a predetermined number of sample images having the highest similarity to the first sample image may be determined as the second sample images, and the predetermined number of second sample images may be acquired. The preset number may be set according to an actual application scenario, for example, the preset number is set to 5, 10, etc. values. Through the similarity between the first sample image and each sample image, a preset number of second sample images can be obtained, so that the confidence coefficient corresponding to the sample labels of the first sample images can be determined by the first identification results of the preset number of second sample images and the first identification results of the first sample images together, the accuracy of the confidence coefficient is improved, and meanwhile, the calculated amount of the confidence coefficient determination can be controlled within a reasonable range.
In one example of this implementation manner, the fusion weight may also be determined according to the similarity between the first sample image and the second sample image, for example, a topology map that represents the similarity between the first sample image and the second sample image may be generated, and according to the topology map, the fusion weights of the first recognition result of the first sample image and the first recognition results of the plurality of second sample images may be determined respectively, where the greater the similarity is, the greater the corresponding fusion weight is, the smaller the similarity is, and the smaller the corresponding fusion weight is. Further, the first recognition results of the first sample image and the first recognition results of the plurality of second sample images may be fused according to the fusion weights, for example, the plurality of first recognition results may be weighted and summed according to the fusion weight corresponding to each first recognition result, so as to obtain a final fusion result. In this example, the first recognition results of the first sample image and the first recognition results of the plurality of second sample images may be fused according to the determined fusion weights, so that the similarity between the plurality of second sample images and the first sample image is considered when the plurality of first recognition results are fused, the obtained fusion results and the confidence obtained based on the fusion results may be enhanced by the image features of the second sample images neighboring the first sample image in the image feature space, and the fusion results and the confidence may be more accurate.
In one example of the present implementation, the probability corresponding to the first class indicated by the sample label of the first sample image may be determined as the confidence corresponding to the sample label of the first sample image from the probabilities corresponding to the multiple classes in the fusion result. For example, the fusion result may be a vector of 1×c, c represents the number of classes of the classes, and the value corresponding to each class may be a probability that the sample object belongs to the class, and in the case of determining the confidence corresponding to the sample label of the first sample image, the probability corresponding to the first class indicated by the sample label of the first sample image may be determined as the confidence corresponding to the sample label of the first sample image in the probabilities of the respective classes of the fusion result. In this way, a more accurate confidence level can be obtained, and thus the trained image recognition network can be more accurate.
The training process of the image processing network provided by the present disclosure is described below by way of one example. Fig. 2 shows a block diagram of an example image processing network training process according to an embodiment of the present disclosure. Wherein M is θ0 The image recognition network may represent an initial state, which may be trained by training data in a dataset, or may be acquired from other devices. M is M θ Image recognition network, M, capable of representing the ith training state θ And M is as follows θ0 The network structure of (a) is the same, but M is not the same θ In the case of training, M θ And M is as follows θ0 The network parameters of (a) are also the same.
In the pair M θ In the training process, a sample image in the network tag data set can be obtained and input into M θ0 In using M θ0 The sample picture is identified once to obtain a first identification result p (y|x, theta) 0 ),p(y|x,θ 0 ) May be a 1×c vector, c represents the number of categories of the category, and the value corresponding to each category may be the probability of that category. Sample tag y from the sample image * Can be represented by p (y|x, θ 0 ) In determining y * The value corresponding to the indicated category can be further used as a sample label y of the sample image * The corresponding confidence conf.
Accordingly, the sample image may be subjected to enhancement processing to obtain an enhanced image of the sample image, and the enhanced image may be input to M θ In (2), a second recognition result p (y|x', θ) is obtained. And then based on the first recognition result p (y|x, θ 0 ) And the second recognition result p (y|x', θ) can determine the first recognition result p (y|x, θ) 0 ) Supervision ofFirst loss L of (2) s Based on the second recognition result p (y|x', θ) and the sample tag y * Can determine the sample tag y * Second loss of supervision L w . The sample tag y can then be utilized * The corresponding confidence level conf determines the weight coefficient of two losses, and uses the determined weight coefficient to determine the first loss L s And a second loss L w Weighted summation is carried out to obtain M θ Network loss of (c). Further can be based on the obtained network loss pair M θ The network parameters (weight parameters) of the network loss are adjusted, the counter-propagation direction of which can be shown by the dashed line in the figure. M is M θ After multiple rounds of training, a trained image recognition network can be obtained. Wherein the first loss L s The weight coefficient of (2) may be (1-conf), the second loss L w The weight coefficient of (c) may be conf.
It will be appreciated that the above-mentioned method embodiments of the present disclosure may be combined with each other to form a combined embodiment without departing from the principle logic, and are limited to the description of the present disclosure. It will be appreciated by those skilled in the art that in the above-described methods of the embodiments, the particular order of execution of the steps should be determined by their function and possible inherent logic.
In addition, the disclosure further provides an image processing apparatus, an electronic device, a computer readable storage medium, and a program, where the foregoing may be used to implement any one of the image processing methods provided in the disclosure, and corresponding technical schemes and descriptions and corresponding descriptions referring to method parts are not repeated.
Fig. 3 shows a block diagram of an image processing apparatus according to an embodiment of the present disclosure, as shown in fig. 3, the apparatus including:
an acquisition module 31, configured to acquire a target image to be identified;
the determining module 32 is configured to identify the target image by using a trained image recognition network, and determine category information of a target object in the target image, where the trained image recognition network is obtained by training an image recognition network in an initial state based on a confidence level corresponding to a sample label of a sample image, and the confidence level corresponding to the sample label is obtained based on a first recognition result of the sample image output by the image recognition network in the initial state.
In some possible implementations, the target image has a web tag; the apparatus further comprises: the verification module is used for verifying the network tag of the target image based on the category information of the target object in the target image to obtain a verification result; and determining the labeling information of the target image according to the test result.
In some possible implementations, the apparatus further includes: and the labeling module is used for taking the category information of the target object in the target image as the labeling information of the target image.
In some possible implementations, the apparatus further includes: the training module is used for carrying out N rounds of training on the image recognition network in the initial state to obtain the trained image recognition network, N is an integer greater than 1, wherein the i-th round of training in the N rounds of training is carried out on the image recognition network in the i-1 th training state based on the first loss corresponding to the sample label, the second loss corresponding to the first recognition result and the confidence coefficient corresponding to the sample label, so that the image recognition network in the i-1 th training state is obtained, i is an integer and is equal to or less than 1<i N.
In some possible implementations, the training module is configured to perform weighted summation on the first loss and the second loss according to the confidence coefficient corresponding to the sample label, so as to obtain a network loss corresponding to the sample image; and training the image recognition network in the ith training state for one time based on the network loss to obtain the image recognition network in the ith training state.
In some possible implementations, the training module is further configured to obtain an enhanced image of the sample image, where the enhanced image is obtained by performing an enhancement process on the sample image; inputting the enhanced image into the image recognition network in the (i-1) th training state to obtain a second recognition result of the enhanced image; and determining a first loss corresponding to the sample label according to the sample label of the sample image and the second identification result.
In some possible implementations, the training module is further configured to input the sample image into an image recognition network in the initial state, to obtain a first recognition result of the sample image; and determining a second loss corresponding to the first identification result according to the first identification result and the second identification result.
In some possible implementations, the training module is further configured to determine, from probabilities corresponding to a plurality of categories in the first recognition result of the sample image, a probability corresponding to the first category indicated by the sample tag of the sample image as a confidence corresponding to the sample tag.
In some possible implementations, the training module is further configured to obtain, for a first sample image of a plurality of sample images, a plurality of second sample images of the plurality of sample images according to image features of the first sample image, where the first sample image is any one sample image of the plurality of sample images; fusing the first identification result of the first sample image and the first identification result of the second sample image to obtain a fusion result; and determining the confidence corresponding to the sample label of the first sample image based on the fusion result.
In some possible implementations, the training module is configured to determine a similarity between the first sample image and each of the sample images according to image features of the first sample image and image features of each of the sample images; and acquiring a preset number of second sample images in the plurality of sample images according to the similarity, wherein the similarity between the first sample image and the second sample image is larger than the similarity between the first sample image and a third sample image, and the third sample image is a sample image except the second sample image in the plurality of sample images.
In some possible implementations, the training module is configured to determine a fusion weight according to a similarity between the first sample image and the second sample image; and fusing the first identification result of the first sample image and the first identification result of the second sample image according to the fusion weight to obtain the fusion result.
In some possible implementations, the training module is configured to determine, from probabilities corresponding to a plurality of categories in the fusion result, a probability corresponding to a first category indicated by a sample tag of the first sample image as a confidence level corresponding to the sample tag of the first sample image.
In some embodiments, functions or modules included in an apparatus provided by the embodiments of the present disclosure may be used to perform a method described in the foregoing method embodiments, and specific implementations thereof may refer to descriptions of the foregoing method embodiments, which are not repeated herein for brevity.
The disclosed embodiments also provide a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method. The computer readable storage medium may be a non-volatile computer readable storage medium.
The embodiment of the disclosure also provides an electronic device, which comprises: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to perform the above method.
The disclosed embodiments also provide a computer program product comprising computer readable code which, when run on a device, causes a processor in the device to execute instructions for implementing the image processing method as provided in any of the embodiments above.
The disclosed embodiments also provide another computer program product for storing computer readable instructions that, when executed, cause a computer to perform the operations of the image processing method provided in any of the above embodiments.
The electronic device may be provided as a terminal, server or other form of device.
Fig. 4 illustrates a block diagram of an electronic device 800, according to an embodiment of the disclosure. For example, electronic device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 4, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen between the electronic device 800 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operational mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the electronic device 800. For example, the sensor assembly 814 may detect an on/off state of the electronic device 800, a relative positioning of the components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of a user's contact with the electronic device 800, an orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a photosensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices, either wired or wireless. The electronic device 800 may access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including computer program instructions executable by processor 820 of electronic device 800 to perform the above-described methods.
Fig. 5 illustrates a block diagram of an electronic device 1900 according to an embodiment of the disclosure. For example, electronic device 1900 may be provided as a server. Referring to FIG. 5, electronic device 1900 includes a processing component 1922 that further includes one or more processors and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by processing component 1922. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. Further, processing component 1922 is configured to execute instructions to perform the methods described above.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. Electronic device 1900 may operate an operating system based on memory 1932, such as the Microsoft Server operating system (Windows Server) TM ) Apple Inc. developed graphical user interface based operating System (Mac OS X TM ) Multi-user multi-process computer operating system (Unix) TM ) Unix-like operating system (Linux) of free and open source code TM ) Unix-like operating system (FreeBSD) with open source code TM ) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 1932, including computer program instructions executable by processing component 1922 of electronic device 1900 to perform the methods described above.
The present disclosure may be a system, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for performing the operations of the present disclosure can be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present disclosure are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information of computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be realized in particular by means of hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium, and in another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the improvement of technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (13)

1. An image processing method, comprising:
acquiring a target image to be identified;
identifying the target image by using a trained image identification network, and determining category information of a target object in the target image, wherein the trained image identification network is obtained by training an image identification network in an initial state based on a confidence coefficient corresponding to a sample label of a sample image, and the confidence coefficient corresponding to the sample label is obtained based on a first identification result of the sample image output by the image identification network in the initial state;
Wherein the method further comprises:
for a first sample image in a plurality of sample images, acquiring a plurality of second sample images in the plurality of sample images according to image features of the first sample image, wherein the first sample image is any sample image in the plurality of sample images;
fusing the first identification result of the first sample image and the first identification result of the second sample image to obtain a fusion result;
determining the confidence corresponding to the sample label of the first sample image based on the fusion result;
fusing the first recognition result of the first sample image and the first recognition result of the second sample image to obtain a fusion result, wherein the fusion result comprises the following steps:
determining a fusion weight according to the similarity between the first sample image and the second sample image;
and fusing the first identification result of the first sample image and the first identification result of the second sample image according to the fusion weight to obtain the fusion result.
2. The method of claim 1, wherein the target image has a web label; the method further comprises the steps of:
Based on the category information of the target object in the target image, checking the network tag of the target image to obtain a checking result;
and determining the labeling information of the target image according to the test result.
3. The method according to claim 1, wherein the method further comprises:
and taking the category information of the target object in the target image as the annotation information of the target image.
4. A method according to any one of claims 1 to 3, characterized in that the method further comprises:
performing N rounds of training on the image recognition network in the initial state to obtain the trained image recognition network, wherein N is an integer greater than 1,
aiming at the ith training in the N training rounds, the training is carried out on the image recognition network in the initial state for N training rounds to obtain the trained image recognition network, and the training method comprises the following steps:
and training the image recognition network in the ith training state for one round based on the first loss corresponding to the sample label, the second loss corresponding to the first recognition result and the confidence coefficient corresponding to the sample label to obtain the image recognition network in the ith training state, wherein i is an integer and 1<i is less than or equal to N.
5. The method of claim 4, wherein the performing a round of training on the image recognition network in the i-1 th training state to obtain the image recognition network in the i-1 th training state based on the first loss corresponding to the sample tag, the second loss corresponding to the first recognition result, and the confidence level corresponding to the sample tag comprises:
according to the confidence coefficient corresponding to the sample label, carrying out weighted summation on the first loss and the second loss to obtain network loss corresponding to the sample image;
and training the image recognition network in the ith training state for one time based on the network loss to obtain the image recognition network in the ith training state.
6. The method according to claim 4 or 5, characterized in that the method further comprises:
obtaining an enhanced image of the sample image, wherein the enhanced image is obtained by enhancing the sample image;
inputting the enhanced image into the image recognition network in the (i-1) th training state to obtain a second recognition result of the enhanced image;
and determining a first loss corresponding to the sample label according to the sample label of the sample image and the second identification result.
7. The method of claim 6, wherein the method further comprises:
inputting the sample image into an image recognition network in the initial state to obtain a first recognition result of the sample image;
and determining a second loss corresponding to the first identification result according to the first identification result and the second identification result.
8. The method according to any one of claims 1 to 7, further comprising:
and determining the probability corresponding to the first category indicated by the sample label of the sample image as the confidence corresponding to the sample label in the probabilities corresponding to the plurality of categories in the first identification result of the sample image.
9. The method of claim 1, wherein the acquiring a plurality of second sample images of the plurality of sample images based on image features of the first sample image comprises:
determining the similarity between the first sample image and each sample image according to the image characteristics of the first sample image and the image characteristics of each sample image;
and acquiring a preset number of second sample images in the plurality of sample images according to the similarity, wherein the similarity between the first sample image and the second sample image is larger than the similarity between the first sample image and a third sample image, and the third sample image is a sample image except the second sample image in the plurality of sample images.
10. The method of claim 1, wherein determining the confidence level corresponding to the sample label of the first sample image based on the fusion result comprises:
and determining the probability corresponding to the first category indicated by the sample label of the first sample image as the confidence corresponding to the sample label of the first sample image in the probabilities corresponding to the categories in the fusion result.
11. An image processing apparatus, comprising:
the acquisition module is used for acquiring a target image to be identified;
the determining module is used for identifying the target image by using a trained image identification network and determining the category information of the target object in the target image, wherein the trained image identification network is obtained by training the image identification network in an initial state based on the confidence coefficient corresponding to the sample label of the sample image, and the confidence coefficient corresponding to the sample label is obtained based on the first identification result of the sample image output by the image identification network in the initial state;
wherein, training module is used for:
for a first sample image in a plurality of sample images, acquiring a plurality of second sample images in the plurality of sample images according to image features of the first sample image, wherein the first sample image is any sample image in the plurality of sample images;
Fusing the first identification result of the first sample image and the first identification result of the second sample image to obtain a fusion result;
determining the confidence corresponding to the sample label of the first sample image based on the fusion result;
fusing the first recognition result of the first sample image and the first recognition result of the second sample image to obtain a fusion result, wherein the fusion result comprises the following steps:
determining a fusion weight according to the similarity between the first sample image and the second sample image;
and fusing the first identification result of the first sample image and the first identification result of the second sample image according to the fusion weight to obtain the fusion result.
12. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the instructions stored in the memory to perform the method of any of claims 1 to 10.
13. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of claims 1 to 10.
CN202010790826.8A 2020-08-07 2020-08-07 Image processing method and device, electronic equipment and storage medium Active CN111931844B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010790826.8A CN111931844B (en) 2020-08-07 2020-08-07 Image processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010790826.8A CN111931844B (en) 2020-08-07 2020-08-07 Image processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111931844A CN111931844A (en) 2020-11-13
CN111931844B true CN111931844B (en) 2023-11-28

Family

ID=73307029

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010790826.8A Active CN111931844B (en) 2020-08-07 2020-08-07 Image processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111931844B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113837986A (en) * 2020-12-15 2021-12-24 京东科技控股股份有限公司 Method, apparatus, electronic device, and medium for recognizing tongue picture
CN112613553B (en) * 2020-12-18 2022-03-08 中电金信软件有限公司 Picture sample set generation method and device, computer equipment and storage medium
CN112873212B (en) * 2021-02-25 2022-05-13 深圳市商汤科技有限公司 Grab point detection method and device, electronic equipment and storage medium
CN113506324B (en) * 2021-07-15 2024-04-12 清华大学 Image processing method and device, electronic equipment and storage medium
CN114821252B (en) * 2022-03-16 2023-05-26 电子科技大学 Self-growth method of image recognition algorithm
CN114495176B (en) * 2022-03-30 2022-12-06 北京字节跳动网络技术有限公司 Tissue image identification method and device, readable medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108171274A (en) * 2018-01-17 2018-06-15 百度在线网络技术(北京)有限公司 For identifying the method and apparatus of animal
CN108460787A (en) * 2018-03-06 2018-08-28 北京市商汤科技开发有限公司 Method for tracking target and device, electronic equipment, program, storage medium
CN109559300A (en) * 2018-11-19 2019-04-02 上海商汤智能科技有限公司 Image processing method, electronic equipment and computer readable storage medium
CN109871883A (en) * 2019-01-24 2019-06-11 北京市商汤科技开发有限公司 Neural network training method and device, electronic equipment and storage medium
WO2020155711A1 (en) * 2019-02-02 2020-08-06 深圳市商汤科技有限公司 Image generating method and apparatus, electronic device, and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108171274A (en) * 2018-01-17 2018-06-15 百度在线网络技术(北京)有限公司 For identifying the method and apparatus of animal
CN108460787A (en) * 2018-03-06 2018-08-28 北京市商汤科技开发有限公司 Method for tracking target and device, electronic equipment, program, storage medium
CN109559300A (en) * 2018-11-19 2019-04-02 上海商汤智能科技有限公司 Image processing method, electronic equipment and computer readable storage medium
CN109871883A (en) * 2019-01-24 2019-06-11 北京市商汤科技开发有限公司 Neural network training method and device, electronic equipment and storage medium
WO2020155711A1 (en) * 2019-02-02 2020-08-06 深圳市商汤科技有限公司 Image generating method and apparatus, electronic device, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
多标签图像的识别分类处理算法;徐有正;黄刚;;计算机时代(第10期);全文 *

Also Published As

Publication number Publication date
CN111931844A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
CN111931844B (en) Image processing method and device, electronic equipment and storage medium
US11120078B2 (en) Method and device for video processing, electronic device, and storage medium
CN113743535B (en) Neural network training method and device and image processing method and device
CN110889469B (en) Image processing method and device, electronic equipment and storage medium
CN111612070B (en) Image description generation method and device based on scene graph
CN109615006B (en) Character recognition method and device, electronic equipment and storage medium
CN113326768B (en) Training method, image feature extraction method, image recognition method and device
CN111539410B (en) Character recognition method and device, electronic equipment and storage medium
CN111435432B (en) Network optimization method and device, image processing method and device and storage medium
CN110781813B (en) Image recognition method and device, electronic equipment and storage medium
CN114338083B (en) Controller local area network bus abnormality detection method and device and electronic equipment
CN111242303B (en) Network training method and device, and image processing method and device
CN111259967B (en) Image classification and neural network training method, device, equipment and storage medium
CN111582383B (en) Attribute identification method and device, electronic equipment and storage medium
CN113792207A (en) Cross-modal retrieval method based on multi-level feature representation alignment
US20220383517A1 (en) Method and device for target tracking, and storage medium
CN111523599B (en) Target detection method and device, electronic equipment and storage medium
CN114332503A (en) Object re-identification method and device, electronic equipment and storage medium
CN113269307B (en) Neural network training method and target re-identification method
CN113313115B (en) License plate attribute identification method and device, electronic equipment and storage medium
CN112559673A (en) Language processing model training method and device, electronic equipment and storage medium
CN110070046B (en) Face image recognition method and device, electronic equipment and storage medium
CN112801116B (en) Image feature extraction method and device, electronic equipment and storage medium
CN115422932A (en) Word vector training method and device, electronic equipment and storage medium
CN111582402B (en) Target detection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant