CN111931844A - 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
CN111931844A
CN111931844A CN202010790826.8A CN202010790826A CN111931844A CN 111931844 A CN111931844 A CN 111931844A CN 202010790826 A CN202010790826 A CN 202010790826A CN 111931844 A CN111931844 A CN 111931844A
Authority
CN
China
Prior art keywords
image
sample
network
training
sample image
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.)
Granted
Application number
CN202010790826.8A
Other languages
Chinese (zh)
Other versions
CN111931844B (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

Images

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; the method comprises the steps of identifying a target image by using a trained image identification network, and determining class information of a 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 a confidence coefficient corresponding to a sample label of the 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. The image recognition method and device can improve the accuracy of image recognition.

Description

Image processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an image processing method and apparatus, an electronic device, and a storage medium.
Background
In computer vision tasks of a deep learning network, such as face recognition tasks, image classification tasks, and the like, a large amount of accurate annotation data is often required to be relied on. The label data can be obtained in a manual labeling mode, and in order to save the cost of labeling the image, a network image data set can be formed by taking keywords for network image search as network labels of the network image. The most basic method for utilizing the network labels is to treat the network labels as real labels of the network images, so that the network labels are directly used for training the deep learning network.
However, due to problems such as semantic ambiguity, the accuracy of web tags is often difficult to guarantee.
Disclosure of Invention
The present disclosure proposes an image processing technical solution.
According to an aspect of the present disclosure, there is provided an image processing method including: acquiring a target image to be identified; the method comprises the steps of identifying a target image by using a trained image identification network, and determining class information of a 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 a confidence coefficient corresponding to a sample label of the 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.
In some possible implementations, the target image has a web tag; the method further comprises the following steps: based on the category information of the target object in the target image, the network label of the target image is checked to obtain a checking result; and determining the labeling information of the target image according to the inspection result.
In some possible implementations, the method further includes: and 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 method further includes: performing N rounds of training on the image recognition network in the initial state to obtain the trained image recognition network, where N is an integer greater than 1, and for an ith round of training in the N rounds of training, performing N rounds of training on the image recognition network in the initial state to obtain the trained image recognition network includes: and performing one-round training on the image recognition network in the ith-1 training state based on the first loss corresponding to the sample label, the second loss corresponding to the first recognition result and the confidence corresponding to the sample label to obtain the image recognition network in the ith training state, wherein i is an integer and is more than 1 and less than or equal to N.
In some possible implementation manners, the performing one round of training 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 degree corresponding to the sample label to obtain the image recognition network in the i-th training state includes: according to the confidence corresponding to the sample label, carrying out weighted summation on the first loss and the second loss to obtain the network loss corresponding to the sample image; and training the image recognition network in the ith-1 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: acquiring 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 of 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 the 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 recognition result according to the first recognition result and the second recognition result.
In some possible implementations, the method further includes: and determining the probability corresponding to the first class indicated by the sample label of the sample image as the confidence corresponding to the sample label in the probabilities corresponding to the multiple classes in the first recognition 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 the image characteristics of the first sample image, wherein the first sample image is any one 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 obtaining a plurality of second sample images of the plurality of sample images according to the image feature 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 greater 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 fused 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 the confidence corresponding to the sample label of the first sample image based on the fusion result includes: and determining the probability corresponding to the first class 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 multiple classes 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 determination module is configured to identify the target image by using a trained image recognition network, and determine class 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 degree corresponding to a sample label of a sample image, and the confidence degree corresponding to the sample label is obtained based on a first identification 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 device further comprises: the verification module is used for verifying the network label 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 inspection 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: and the training module is used for 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 round of training in the N rounds of training, one round of training is 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, i is an integer and is more than 1 and less than or equal to N.
In some possible implementation manners, the training module is configured to perform weighted summation on the first loss and the second loss according to a confidence 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-1 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 enhancement processing on the sample image; inputting the enhanced image into the image recognition network of 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 the 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 recognition result according to the first recognition result and the second recognition result.
In some possible implementations, the training module is further configured to determine, as the confidence corresponding to the sample label, a probability corresponding to the first class indicated by the sample label of the sample image, among the probabilities corresponding to the multiple classes in the first recognition result of the sample image.
In some possible implementations, the training module is further configured to, for a first sample image of a plurality of sample images, obtain a plurality of second sample images of the plurality of sample images according to an image feature of the first sample image, where the first sample image is any one 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 an image feature of the first sample image and an image feature 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 greater 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, as the confidence corresponding to the sample label of the first sample image, a probability corresponding to the first class indicated by the sample label of the first sample image among the probabilities corresponding to the multiple classes in the fusion result.
According to an aspect of the present disclosure, there is provided an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described 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, a target image to be recognized may be acquired, and then the trained image recognition network is used to recognize the target image, so as to determine the category information of the target object in the target image. The image recognition network is obtained by training the image recognition network in the initial state based on the confidence degrees corresponding to the sample labels of the sample images, and the confidence degrees corresponding to the sample labels are obtained based on the first recognition result of the sample images output by the image recognition network in the initial state, so that in the training process of the image recognition network, the uncertainty of the image recognition network prediction is considered, and the accuracy of the trained image recognition network recognition 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 present disclosure and, together with the description, serve to explain the principles 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 of an image processing network training process according to an embodiment of the present disclosure.
Fig. 3 illustrates 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 in accordance with an embodiment of the present disclosure.
Fig. 5 shows a block diagram of an example of an electronic device in accordance with an embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively 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" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, 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, in the following detailed description, numerous specific details are set forth 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 that are well known to those skilled in the art have not been described in detail so as 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 used for recognizing 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 the uncertainty of the image recognition network prediction is considered in the training process of the image recognition network, and the recognition accuracy of the trained image recognition network can be improved.
The image processing scheme provided by the embodiment of the present disclosure may be applied to the expansion of application scenarios such as the identification, analysis, and labeling of images or videos, and the embodiment of the present disclosure does not limit this. For example, the category information of the target image output by the trained 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 image labeling on manpower is reduced, and the manpower resource is saved.
The image processing method provided by the embodiment of the present disclosure may be executed 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 Assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, or the like. In some possible implementations, the data processing method may be implemented by a processor calling computer readable instructions stored in a memory. The following describes an image processing method according to an embodiment of the present disclosure, taking an electronic device as an execution subject.
Fig. 1 illustrates a flowchart of an image processing method according to an embodiment of the present disclosure, which includes, as illustrated in fig. 1:
in step S11, a target image to be recognized is acquired.
In the embodiment of the present disclosure, the image to be recognized may be an image waiting for image recognition. The electronic equipment can have an image acquisition function, and can acquire images of a scene where the electronic equipment is located and acquire a target image 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 an image capturing device, a monitoring device, a network server, or the like. In some implementations, the image to be recognized may be one image frame in a video.
In step S12, the target image is recognized by using the trained image recognition network, and the category information of the target object in the target image is determined.
In the embodiment of the present disclosure, the target image may be input into a trained image recognition network, and the trained image recognition network is used to recognize the target image, so as to obtain the category information output by the trained image recognition network. The category information may indicate a category of a target object in the target image, for example, an apple (target object) is included in the target image, and after the target image is input into the trained image recognition network, the indication information output by the trained image recognition network may be obtained, and 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 network layers of the neural network such as convolutional layers, pooling layers, anti-convolutional layers, full connectivity layers, etc., and the present disclosure does not limit the 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 degrees corresponding to the sample labels of the sample images, 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 in multiple rounds by using the confidence degrees corresponding to the sample images and the image labels of the sample images, so that the trained image recognition network can be obtained after the multiple rounds of training.
Here, the sample label may indicate a category to which the sample object in the sample image belongs. The confidence corresponding to the sample label can be understood as the credibility of the sample label. For the sample label of a sample image, the sample label of the sample image may be determined by a manual labeling manner, or a search word of the sample image may be used as the sample label of the sample image, for example, an image searched through a network 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 network. Accordingly, a certain error exists in the sample label of one sample image, that is, the sample label of one sample image may not be able to accurately indicate the type of the sample object in the sample image, so that the confidence level corresponding to the sample label can be used to represent the credibility of the sample label. The confidence degree of the sample label is considered in the training process of the image recognition network, so that 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, and the network tag of the target image may be verified based on the target category information in the target image to obtain a verification result, and the annotation information of the target image is determined according to the verification result.
In this implementation, the target image may be a target image obtained by image search, for example, an image may be searched in a search engine by a keyword, the searched image may be the target image, and accordingly, the keyword used for searching the image may be a web tag of the target image. The trained image recognition network can accurately recognize the target image, so that the network label of the target image can be checked by utilizing the class 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 is judged. For example, the category information of the target image may be matched with the network tag, and when the degree of matching between the category 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 annotation information of the target image. In the case that the matching degree of the category information of the target image and the network tag is equal to or lower than the matching threshold, the detection result may be considered to indicate that the network tag is inaccurate, and the category information of the target image may be used as the annotation information of the target image. By the method, the network label of the target image can be automatically checked, so that the determined labeling information of the target image is more accurate.
In another possible implementation manner, the category information of the target object in the target image may be used as the labeling information of the target image, that is, the category information output by the trained image recognition network may be directly used as the labeling information of the target object in the target image, so that the automatic labeling of the target image may be implemented, and the waste of human resources may be reduced.
In the embodiment of the present 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 a higher recognition accuracy. The disclosed embodiments also provide a process for training an image recognition network in an initial state.
In one possible implementation manner, N rounds of training may be performed on the image recognition network in the initial state to obtain a trained image recognition network, where N is an integer greater than 1. For the ith round of training in the N rounds of training, one round of training may 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 corresponding to the sample label, to obtain the image recognition network in the ith training state, where i is an integer and 1< i ≦ N.
In this implementation, a plurality of sample images may be sequentially input to the image recognition network in the initial state, and N rounds of training may be performed on the image recognition network in the initial state to obtain a trained image recognition network. In the ith round of training in the N rounds of training, the sample image or the enhanced image of the sample image may be input to the image recognition network in the (i-1) th training state, so as to obtain a second recognition result output by the image recognition network in the (i-1) th training state. The image recognition network in the i-1 th training state can be obtained by training the image recognition network in the initial state through an i-1 round. Then, a round of training may 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 corresponding to the sample label, so as to obtain the image recognition network in the i-th training state, for example, the network loss of the image recognition network in the i-1 th training state may 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 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 may be adjusted by using the calculated network loss, so as to obtain the image recognition network in the i-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 in the i-1 st training state with the first recognition result obtained by the image recognition network in the initial state. The image recognition network of the i-1 th training state is supervised by the sample label of the sample image and the first recognition result together, so that the precision of the trained image recognition network can be improved.
In this implementation, when i is 1, i-1 is 0, and the image recognition network is in the 0 th training state at this time, 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 round of training is performed on the image recognition network in the initial state, so as to obtain the image recognition network in the 1 st training state, where the image recognition network in the 1 st training state may 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 is 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, 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 a training phase (including i ═ 1) of the image recognition network in any i-1 th training state, a binary cross entropy loss function may be used to determine the first loss and/or the second loss, in the case of using the binary cross entropy loss function, each of the plurality of classes may be trained independently, and accordingly, the confidence corresponding to the sample label of the sample image may also be used to measure the reliability corresponding to the sample label in a certain class, which may provide more effective network loss and confidence for training the image recognition network in i-1 th training state.
In this implementation manner, one round of training may be performed on the image recognition network in the i-1 th training state 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 as to obtain the image recognition network in the i-th training state. In an example of this implementation, the first loss and the second loss may be weighted and summed according to the confidence degrees corresponding to the sample labels, for example, a weighting coefficient of the first loss and the second loss may be determined according to the confidence degrees corresponding to the sample labels of one sample image, for example, the confidence degree C corresponding to the sample label of one sample image is used as the weighting coefficient of the first loss, 1-C is used as the weighting coefficient of the second loss, and then the first loss and the second loss are weighted and summed, so that the network loss corresponding to the sample image may be obtained. And then, carrying out primary training on the image recognition network in the i-1 th training state by utilizing the network loss corresponding to the sample image to obtain the image recognition network in the i-th training state. The proportion of the first loss and the second loss in the network loss can be balanced through the confidence corresponding to the sample label of the sample image, so that the network loss can be adaptive to the image recognition network at the level of one sample image, and the recognition accuracy of the trained image recognition network is improved.
In this example, an enhanced image of the sample image may be obtained, and then the enhanced image may be input to the image recognition network in the ith training state, so as to obtain a second recognition result of the enhanced image. According to the sample label of the sample image and the second recognition result, a first loss corresponding to the sample label can be determined.
In this example, the enhanced image may be obtained by performing enhancement processing on the sample image, for example, performing enhancement processing such as flipping, cropping, and color conversion on the sample image, so as to obtain an enhanced image of the sample image. And 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 output by the image recognition network in the (i-1) th training state, and then comparing the sample label of the sample image with the second recognition result to determine a first loss corresponding to the sample label. Here, the first loss may be determined using a loss function, and 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.
The second recognition result can be determined according to the enhanced image of the sample image, so that 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 th training state is trained by using 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 1 × c vector, and c represents the number of classes of the class, wherein the numerical value corresponding to each class may be the probability that the sample object belongs to the class. In this example, when 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).
Figure BDA0002623687830000091
Wherein,
Figure BDA0002623687830000092
representing a first loss corresponding to the sample label; w represents the category indicated by the sample label; x' represents an enhanced image; s represents a set of all categories; j represents the jth category in S; theta denotes the image recognition network for the i-1 st training state. p (y)(w)| x', θ) represents the probability corresponding to the category w in the second recognition result; p (y)(j)| x', θ) represents the probability corresponding to the category j in the second result.
The present implementation further provides an example of determining the second loss, and in this example, the sample image may be input to an image recognition network in an initial state to obtain a first recognition result of the sample image. According to the first recognition result and the second recognition result, a second loss corresponding to the first recognition result can be determined.
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, and for example, may be calculated using a cross entropy loss function, a binary cross entropy loss function, a mean square error loss function, or the like. The example can monitor the image recognition network in the i-1 training state by using 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 also be a 1 × c vector, where c represents the number of categories of the category, and the numerical value corresponding to each category may be the probability that the sample object belongs to the category. In this example, when the second loss corresponding to the first recognition result is determined from the first recognition result and the second recognition result, the first loss can be determined by the following formula (2).
Figure BDA0002623687830000101
Wherein,
Figure BDA0002623687830000102
representing a first loss corresponding to the first recognition result; x represents a sample image; s represents a set of all categories; j represents the jth category in S; theta0Image recognition network representing initial state。p(y(j)| x', θ) represents the probability corresponding to the category j in the second recognition result; p (y)(j)|x,θ0) Indicating the probability that the category j corresponds to in the first result.
In the embodiment of the present disclosure, the image recognition network in the initial state may be trained based on the confidence corresponding to the sample label, so as to obtain a trained image recognition network. The confidence corresponding to the sample label may be obtained based on the 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 label may be determined based on the first recognition result of the sample image. Here, the confidence degrees corresponding to different sample labels may be different, so that the network loss of the image recognition network calculated by the confidence degrees corresponding to the sample labels may be adaptive to the image recognition network at a sample level, so that the trained image recognition network obtained after training has higher recognition accuracy.
In this implementation, among the probabilities corresponding to the multiple categories in the first recognition result of the sample image, the probability corresponding to the first category indicated by the sample label of the sample image may be determined as the confidence corresponding to the sample label. Here, the first recognition result of the sample image may be output by the image recognition network in the initial state, and as described above, the first recognition result may be a vector of 1 × c, c represents the number of classes of the class, and the numerical value corresponding to each class may be the probability that the sample object belongs to the class. Under the condition that the confidence corresponding to the sample label of one sample image is determined, the probability corresponding to the first class indicated by the sample label of the sample image can be determined as the confidence corresponding to the sample label of the sample image in the probabilities of the classes 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 judging whether the sample label is accurate or not, so that the confidence 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 corresponding to the sample label of the sample image is 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 an image feature of the first sample image, for example, a plurality of second sample images similar to the image feature of the first sample image may be acquired. Then, the first recognition result of the first sample image and the first recognition results of the plurality of second sample images may be fused, for example, the first recognition result of the first sample image and the first recognition results of the plurality of second sample images are weighted and averaged to obtain a fusion result. And determining the confidence corresponding to the sample label of the first sample image according to the fusion result.
Here, the first sample image may be any one of the sample images, and for the second sample image having similar image features to the first sample image, since the image features of the second sample image are similar to the image features 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, and the first recognition results of the plurality of second sample images can be fused with the first recognition result of the first sample image. Here, fusing the plurality of first recognition results is equivalent to performing smoothing processing on the plurality of first recognition results, and the obtained fusion result is more accurate than the first recognition result of one sample image, and the confidence determined by the fusion result is equivalent to performing smoothing processing, so that the confidence corresponding to the sample label of the first sample image determined based on the fusion result is more accurate, and the quality of the confidence 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 according to the image feature of the first sample image and the image feature 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 feature of the first sample image and the image feature of each sample image. Then, a preset number of second sample images in the plurality of sample images may be obtained according to the similarity, where the similarity between the first sample image and the second sample image is greater than the similarity between the first sample image and a third sample image, and the third sample image is a sample image other than the second sample image in the plurality of sample images. For example, a preset number of sample images having the highest similarity to the first sample image may be determined as the second sample image, and the preset 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, or the like. The second sample images with the preset number can be obtained through the similarity between the first sample image and each sample image, so that the confidence corresponding to the sample labels of the first sample image can be determined by the first recognition results of the second sample images with the preset number and the first recognition results of the first sample images together, the accuracy of the confidence is improved, and meanwhile, the calculated amount for determining the confidence can be controlled within a reasonable range.
In an example of the present implementation, the fusion weight may be further determined according to a similarity between the first sample image and the second sample image, for example, a topological graph representing the similarity between the first sample image and the second sample image may be generated, and 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 respectively determined according to the topological graph, where the greater the similarity, the greater the corresponding fusion weight, the smaller the similarity, and the smaller the corresponding fusion weight. Further, the first recognition result of the first sample image and the first recognition results of the plurality of second sample images may be fused according to the fusion weight, 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 result 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 weight, 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, and the obtained fusion result and the confidence coefficient obtained based on the fusion result may be enhanced by the image features of the second sample images neighboring the first sample image in the image feature space, so that the fusion result and the confidence coefficient are more accurate.
In an example of the present implementation, among the probabilities corresponding to the plurality of categories in the fusion result, the probability corresponding to the first category 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. For example, the fusion result may be a 1 × c vector, c represents the number of categories of the categories, the numerical value corresponding to each category may be the probability that the sample object belongs to the category, and in the case of determining the confidence corresponding to the sample label of the first sample image, the probability corresponding to the first category 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 categories of the fusion result. In this way, more accurate confidence can be obtained, and thus the trained image recognition network can be more accurate.
The following describes a training process of the image processing network provided by the present disclosure by way of an example. FIG. 2 shows a block diagram of an example of an image processing network training process according to an embodiment of the present disclosure. Wherein M isθ0The image recognition network of the initial state may be trained by training data in a data set, or may be obtained from other devices. MθImage recognition network, M, which can represent the ith training stateθAnd Mθ0Has the same network structure as that of MθIn the case of training, MθAnd Mθ0The same applies to the network parameters of (2).
In pair MθIn the training process, a sample picture in the network label data set can be obtained, and the sample picture is input into the Mθ0In using Mθ0Carrying out primary identification on the sample picture to obtain a first identification result p (y | x, theta)0),p(y|x,θ0) May be a 1 xcC represents the number of categories of the category, and the corresponding value of each category may be the probability of the category. Sample label y from the sample image*May be in p (y | x, theta)0) In determining y*The numerical value corresponding to the indicated category can be further used as the sample label y of the sample image*The corresponding confidence conf.
Accordingly, the sample image may be enhanced to obtain an enhanced image of the sample image, and the enhanced image may be input to MθIn (d), a second recognition result p (y | x', θ) is obtained. And then according to the first recognition result p (y | x, theta)0) And the second recognition result p (y | x', θ) may determine the first recognition result p (y | x, θ)0) First loss of supervision LsBased on the second recognition result p (y | x', θ) and the sample label y*The sample label y can be determined*Second loss of supervision Lw. The sample label y may then be utilized*Determining the weight coefficients of the two losses according to the corresponding confidence conf, and utilizing the determined weight coefficients to carry out the weighting on the first loss LsAnd a second loss LwWeighted summation is carried out to obtain MθThe network loss of (2). Further, M may be determined according to the obtained network loss pairθThe network parameters (weight parameters) of the network loss are adjusted, and the back propagation direction of the network loss can be shown as a dotted line in the figure. MθAfter multiple rounds of training, a trained image recognition network can be obtained. Wherein the first loss LsMay be (1-conf), the second loss LwThe weight coefficient of (c) may be conf.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
In addition, the present disclosure also provides an image processing apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any one of the image processing methods provided by the present disclosure, and the corresponding technical solutions and descriptions and corresponding descriptions in the methods section are not repeated.
Fig. 3 shows a block diagram of an image processing apparatus according to an embodiment of the present disclosure, which includes, as shown in fig. 3:
an obtaining module 31, configured to obtain a target image to be identified;
a determining module 32, configured to identify the target image by using a trained image recognition network, and determine class 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 identification 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 device further comprises: the verification module is used for verifying the network label 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 inspection 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: and the training module is used for 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 round of training in the N rounds of training, one round of training is 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, i is an integer and is more than 1 and less than or equal to N.
In some possible implementation manners, the training module is configured to perform weighted summation on the first loss and the second loss according to a confidence 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-1 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 enhancement processing on the sample image; inputting the enhanced image into the image recognition network of 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 the 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 recognition result according to the first recognition result and the second recognition result.
In some possible implementations, the training module is further configured to determine, as the confidence corresponding to the sample label, a probability corresponding to the first class indicated by the sample label of the sample image, among the probabilities corresponding to the multiple classes in the first recognition result of the sample image.
In some possible implementations, the training module is further configured to, for a first sample image of a plurality of sample images, obtain a plurality of second sample images of the plurality of sample images according to an image feature of the first sample image, where the first sample image is any one 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 an image feature of the first sample image and an image feature 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 greater 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, as the confidence corresponding to the sample label of the first sample image, a probability corresponding to the first class indicated by the sample label of the first sample image among the probabilities corresponding to the multiple classes in the fusion result.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the above-mentioned method. The computer readable storage medium may be a non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
The embodiments of the present disclosure also provide a computer program product, which includes computer readable code, and when the computer readable code runs on a device, a processor in the device executes instructions for implementing the image processing method provided in any one of the above embodiments.
The embodiments of the present disclosure also provide another computer program product for storing computer readable instructions, which 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 in accordance with an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
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 components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction 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 non-volatile 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 disks.
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 supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. 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 an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
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 further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also 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 keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, 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 gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. 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 an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an 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, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 5 illustrates a block diagram of an electronic device 1900 in accordance with an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 5, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
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. The electronic device 1900 may operate based on an operating system, such as the Microsoft Server operating system (Windows Server), stored in the memory 1932TM) Apple Inc. of the present application based on the graphic user interface operating System (Mac OS X)TM) Multi-user, multi-process computer operating system (Unix)TM) Free and open native code Unix-like operating System (Linux)TM) Open native code Unix-like operating System (FreeBSD)TM) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory 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: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical 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 via 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 transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter 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.
The computer program instructions for carrying out operations of the present disclosure may be assembler 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 execute 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
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 storing the instructions comprises 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 flowchart 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 embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (15)

1. An image processing method, comprising:
acquiring a target image to be identified;
the method comprises the steps of identifying a target image by using a trained image identification network, and determining class information of a 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 a confidence coefficient corresponding to a sample label of the 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.
2. The method of claim 1, wherein the target image has a web tag; the method further comprises the following steps:
based on the category information of the target object in the target image, the network label of the target image is checked to obtain a checking result;
and determining the labeling information of the target image according to the inspection result.
3. The method of claim 1, further comprising:
and taking the category information of the target object in the target image as the labeling 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,
for the ith round of training in the N rounds of training, performing N rounds of training on the image recognition network in the initial state to obtain the trained image recognition network includes:
and performing one-round training on the image recognition network in the ith-1 training state based on the first loss corresponding to the sample label, the second loss corresponding to the first recognition result and the confidence corresponding to the sample label to obtain the image recognition network in the ith training state, wherein i is an integer and is more than 1 and less than or equal to N.
5. The method according to claim 4, wherein the performing a round of training 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 corresponding to the sample label to obtain the image recognition network in the i-th training state comprises:
according to the confidence corresponding to the sample label, carrying out weighted summation on the first loss and the second loss to obtain the network loss corresponding to the sample image;
and training the image recognition network in the ith-1 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:
acquiring 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 of 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, further comprising:
inputting the sample image into the 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 recognition result according to the first recognition result and the second recognition result.
8. The method according to any one of claims 1 to 7, further comprising:
and determining the probability corresponding to the first class indicated by the sample label of the sample image as the confidence corresponding to the sample label in the probabilities corresponding to the multiple classes in the first recognition result of the sample image.
9. The method according to any one of claims 1 to 7, further comprising:
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 the image characteristics of the first sample image, wherein the first sample image is any one 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.
10. The method of claim 9, wherein the obtaining a plurality of second sample images of the plurality of sample images based on the 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 greater 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.
11. The method according to claim 9, wherein the fusing the first recognition result of the first sample image and the first recognition result of the second sample image to obtain a fused result comprises:
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. The method of claim 9, wherein the 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 class 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 multiple classes in the fusion result.
13. An image processing apparatus characterized by comprising:
the acquisition module is used for acquiring a target image to be identified;
the determination module is configured to identify the target image by using a trained image recognition network, and determine class 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 degree corresponding to a sample label of a sample image, and the confidence degree corresponding to the sample label is obtained based on a first identification result of the sample image output by the image recognition network in the initial state.
14. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any of claims 1 to 12.
15. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 12.
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 true CN111931844A (en) 2020-11-13
CN111931844B 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)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112613553A (en) * 2020-12-18 2021-04-06 中电金信软件有限公司 Picture sample set generation method and device, computer equipment and storage medium
CN112764700A (en) * 2020-12-31 2021-05-07 维沃移动通信有限公司 Image display processing method, device, electronic equipment and storage medium
CN112873212A (en) * 2021-02-25 2021-06-01 深圳市商汤科技有限公司 Grab point detection method and device, electronic equipment and storage medium
CN113506324A (en) * 2021-07-15 2021-10-15 清华大学 Image processing method and device, electronic equipment and storage medium
CN113807369A (en) * 2021-09-26 2021-12-17 北京市商汤科技开发有限公司 Target re-identification method and device, electronic equipment and storage medium
CN113837986A (en) * 2020-12-15 2021-12-24 京东科技控股股份有限公司 Method, apparatus, electronic device, and medium for recognizing tongue picture
CN114821252A (en) * 2022-03-16 2022-07-29 电子科技大学 Self-growing method of image recognition algorithm
WO2023185497A1 (en) * 2022-03-30 2023-10-05 北京字节跳动网络技术有限公司 Tissue image recognition method and apparatus, and readable medium and electronic device

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
徐有正;黄刚;: "多标签图像的识别分类处理算法", 计算机时代, no. 10 *

Cited By (11)

* 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
CN112613553A (en) * 2020-12-18 2021-04-06 中电金信软件有限公司 Picture sample set generation method and device, computer equipment and storage medium
CN112764700A (en) * 2020-12-31 2021-05-07 维沃移动通信有限公司 Image display processing method, device, electronic equipment and storage medium
CN112873212A (en) * 2021-02-25 2021-06-01 深圳市商汤科技有限公司 Grab point detection method and device, electronic equipment and storage medium
CN112873212B (en) * 2021-02-25 2022-05-13 深圳市商汤科技有限公司 Grab point detection method and device, electronic equipment and storage medium
CN113506324A (en) * 2021-07-15 2021-10-15 清华大学 Image processing 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
CN113807369A (en) * 2021-09-26 2021-12-17 北京市商汤科技开发有限公司 Target re-identification method and device, electronic equipment and storage medium
CN114821252A (en) * 2022-03-16 2022-07-29 电子科技大学 Self-growing method of image recognition algorithm
CN114821252B (en) * 2022-03-16 2023-05-26 电子科技大学 Self-growth method of image recognition algorithm
WO2023185497A1 (en) * 2022-03-30 2023-10-05 北京字节跳动网络技术有限公司 Tissue image recognition method and apparatus, and readable medium and electronic device

Also Published As

Publication number Publication date
CN111931844B (en) 2023-11-28

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
CN110889469B (en) Image processing method and device, electronic equipment and storage medium
CN110009090B (en) Neural network training and image processing method and device
CN109359056B (en) Application program testing method and device
CN114078118A (en) Defect detection method and device, electronic equipment and storage medium
CN110781813B (en) Image recognition method and device, electronic equipment and storage medium
CN109615006B (en) Character recognition method and device, electronic equipment and storage medium
CN111881956A (en) Network training method and device, target detection method and device and electronic equipment
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
CN111612070A (en) Image description generation method and device based on scene graph
CN111242303A (en) Network training method and device, and image processing method and device
CN113792207A (en) Cross-modal retrieval method based on multi-level feature representation alignment
CN114338083A (en) Controller local area network bus abnormality detection method and device and electronic equipment
CN109685041B (en) Image analysis method and device, electronic equipment and storage medium
US20220383517A1 (en) Method and device for target tracking, and storage medium
CN111898676A (en) Target detection method and device, electronic equipment and storage medium
CN113139471A (en) Target detection method and device, electronic equipment and storage medium
US20220270352A1 (en) Methods, apparatuses, devices, storage media and program products for determining performance parameters
CN114332503A (en) Object re-identification method and device, electronic equipment and storage medium
CN113269307B (en) Neural network training method and target re-identification method
US20210326578A1 (en) Face recognition method and apparatus, electronic device, and storage medium
CN112559673A (en) Language processing model training 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