CN113869430A - Training method, image recognition method, device, electronic device and storage medium - Google Patents

Training method, image recognition method, device, electronic device and storage medium Download PDF

Info

Publication number
CN113869430A
CN113869430A CN202111155997.4A CN202111155997A CN113869430A CN 113869430 A CN113869430 A CN 113869430A CN 202111155997 A CN202111155997 A CN 202111155997A CN 113869430 A CN113869430 A CN 113869430A
Authority
CN
China
Prior art keywords
training sample
sample image
preset
prediction
graph
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.)
Pending
Application number
CN202111155997.4A
Other languages
Chinese (zh)
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111155997.4A priority Critical patent/CN113869430A/en
Publication of CN113869430A publication Critical patent/CN113869430A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

The present disclosure provides a training method, an image recognition device, an electronic device, and a storage medium, which relate to the technical field of artificial intelligence, and in particular to computer vision and deep learning technologies, and are particularly applicable to smart cities and smart traffic scenes. The specific implementation scheme is as follows: determining a prediction graph corresponding to the training sample image, wherein the prediction graph represents a prediction relation between every two preset categories in a plurality of preset categories related to the training sample image; determining a supervision graph corresponding to the training sample image, wherein the supervision graph represents the real relation between every two preset categories in a plurality of preset categories related to the training sample image; obtaining a prediction classification result corresponding to the training sample image according to the prediction image; and training a preset model according to the prediction graph, the supervision graph, the prediction classification result and the real classification result corresponding to the training sample image to obtain a classification model.

Description

Training method, image recognition method, device, electronic device and storage medium
Technical Field
The utility model relates to an artificial intelligence technical field especially relates to computer vision and deep learning technique, specifically can be used to under wisdom city and the intelligent traffic scene. And in particular, to a training method, an image recognition method, an apparatus, an electronic device, and a storage medium.
Background
Image classification is a fundamental problem in computer vision. Image classification can include both single label classification and multi-label classification. Unlike single label classification, multi-label classification consists in identifying multiple classes that appear in a single image, i.e. assigning multiple classes to a single image.
Disclosure of Invention
The disclosure provides a training method, an image recognition device, an electronic device and a storage medium.
According to an aspect of the present disclosure, there is provided a training method of a classification model, including: determining a prediction graph corresponding to a training sample image, wherein the prediction graph represents a prediction relation between every two preset categories in a plurality of preset categories related to the training sample image; determining a supervision graph corresponding to a training sample image, wherein the supervision graph represents a real relation between every two preset categories in the plurality of preset categories related to the training sample image; obtaining a prediction classification result corresponding to the training sample image according to the prediction graph; and training a preset model according to the prediction graph, the supervision graph, the prediction classification result and the real classification result corresponding to the training sample image to obtain a classification model.
According to another aspect of the present disclosure, there is provided an image recognition method including: acquiring a target image; and inputting the target image into a classification model to obtain a prediction classification result corresponding to the target image, wherein the classification model is trained by the method.
According to another aspect of the present disclosure, there is provided a training apparatus for classification models, including: the device comprises a first determining module, a second determining module and a prediction module, wherein the first determining module is used for determining a prediction graph corresponding to a training sample image, and the prediction graph represents the prediction relation between every two preset categories in a plurality of preset categories related to the training sample image; a second determining module, configured to determine a supervision graph corresponding to a training sample image, where the supervision graph represents a real relationship between every two preset categories of the plurality of preset categories related to the training sample image; a first obtaining module, configured to obtain a prediction classification result corresponding to the training sample image according to the prediction graph; and the second obtaining module is used for training a preset model according to the prediction graph, the supervision graph, the prediction classification result and the real classification result corresponding to the training sample image to obtain a classification model.
According to another aspect of the present disclosure, there is provided an image recognition apparatus including: the acquisition module is used for acquiring a target image; and a third obtaining module, configured to input the target image into a classification model, and obtain a prediction classification result corresponding to the target image, where the classification model is trained by using the apparatus as described above.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method as described above.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method as described above.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 schematically illustrates an exemplary system architecture of a training method, an image recognition method and apparatus to which a classification model may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically shows a flow chart of a method of training a classification model according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a schematic diagram of determining a supervised map corresponding to a training sample image in accordance with an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart for training a pre-set model based on a prediction graph, a supervision graph, a prediction classification result and a real classification result corresponding to a training sample image to obtain a classification model according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates an application schematic of a training process of a classification model according to an embodiment of the present disclosure;
FIG. 6 schematically illustrates an example schematic of a training process of a classification model according to an embodiment of the disclosure;
FIG. 7 schematically illustrates a flow chart of an image recognition method according to an embodiment of the present disclosure;
FIG. 8 schematically shows a block diagram of a training apparatus for a classification model according to an embodiment of the present disclosure;
fig. 9 schematically shows a block diagram of an image recognition apparatus according to an embodiment of the present disclosure; and
fig. 10 schematically shows a block diagram of an electronic device adapted to implement a training method and an image recognition method of a classification model according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In multi-label classification, it is necessary to identify what categories exist in an image. The difficulty of this problem is how to label information according to categories to improve recognition accuracy. The recognition accuracy can be improved by performing enhanced characterization on the image features by using a Graph constructed based on a Graph Convolutional neural Network (GCN) model. The graph may include nodes and edges. An edge characterizes a relationship between two nodes.
The graph constructed based on the graph convolution neural network model is difficult to guarantee self-reliability because the relationship between two nodes in the graph is preset, and the preset relationship may not be consistent with the reality, for example, the preset relationship is set according to the occurrence times of the classes in the training sample image set. Therefore, if the graph constructed based on the graph convolution neural network model is not reliable, the image features of the enhanced representation are inaccurate, and the classification result is negatively affected.
Therefore, the embodiment of the disclosure provides a scheme that a prediction graph is supervised by a supervision graph to ensure the reliability of the prediction graph, and the prediction graph with higher reliability is used to enhance and characterize the image features to improve the identification precision. The supervised graph characterizes a true relationship between each two of a plurality of preset categories associated with the training sample images. The prediction graph represents a prediction relationship between every two preset categories of a plurality of preset categories related to the training sample image. For example, a prediction map corresponding to the training sample image is determined. Determining a supervision picture corresponding to the training sample image, obtaining a prediction classification result corresponding to the training sample image according to the prediction picture, and training a preset model according to the prediction picture, the supervision picture, the prediction classification result and the real classification result corresponding to the training sample image to obtain a classification model.
The supervised map is used for characterizing a real relation between every two preset categories in a plurality of preset categories related to the training sample image. Therefore, the reliability of the supervision map is high. And training a preset model according to the prediction graph, the supervision graph, the prediction classification result and the real classification result corresponding to the training sample image to obtain a classification model. For example, the supervision of the prediction graph is realized by introducing the supervision graph into the training of the classification model. Therefore, the reliability of the prediction map is improved. On the basis, the prediction graph with higher reliability is used for carrying out enhanced representation on the image characteristics, and the identification precision of the classification model is improved.
Fig. 1 schematically illustrates an exemplary system architecture of a training method, an image recognition method and an apparatus to which a classification model may be applied according to an embodiment of the present disclosure.
It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios. For example, in another embodiment, an exemplary system architecture to which the training method, the image recognition method, and the apparatus for the classification model may be applied may include a terminal device, but the terminal device may implement the training method, the image recognition method, and the apparatus for the classification model provided in the embodiments of the present disclosure without interacting with a server.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a knowledge reading application, a web browser application, a search application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be various types of servers providing various services, such as a background management server (for example only) providing support for content browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
The Server 105 may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, and solves the defects of high management difficulty and weak service extensibility in a conventional physical host and a VPS (Virtual Private Server, VPS). Server 105 may also be a server of a distributed system or a server that incorporates a blockchain.
It should be noted that the training method and the image recognition method of the classification model provided by the embodiments of the present disclosure may be generally executed by the terminal device 101, 102, or 103. Accordingly, the training device and the image recognition device of the classification model provided by the embodiment of the present disclosure may also be disposed in the terminal device 101, 102, or 103.
Alternatively, the training method and the image recognition method of the classification model provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the training device and the image recognition device of the classification model provided by the embodiment of the present disclosure may be generally disposed in the server 105. The training method and the image recognition method of the classification model provided by the embodiment of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the training device and the image recognition device for training the model provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
For example, the server 105 may determine a prediction graph corresponding to the training sample image, determine a supervision graph corresponding to the training sample image, obtain a prediction classification result corresponding to the training sample image from the prediction graph, and train a preset model from the prediction graph, the supervision graph, the prediction classification result, and the real classification result corresponding to the training sample image to obtain a classification model. Or a server cluster capable of communicating with the terminal devices 101, 102, 103 and/or the server 105 trains a preset model according to a prediction graph, a supervision graph, a prediction classification result and a real classification result corresponding to the training sample image to obtain a classification model.
The server 105 acquires the target image and inputs the target image into the classification model to obtain a prediction classification result corresponding to the target image. Or a server cluster capable of communicating with the terminal devices 101, 102, 103 and/or the server 105 takes the target image and inputs the target image into the classification model, resulting in a predicted classification result corresponding to the target image.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that, as those skilled in the art will appreciate, the sequence numbers of the operations in the following method are only used as a representation of the operations for description, and should not be regarded as representing the execution sequence of the operations. Unless specifically stated otherwise, the operations of the methods need not be performed in the exact order shown, or certain operations may be performed concurrently.
Fig. 2 schematically shows a flow chart of a training method of a classification model according to an embodiment of the present disclosure.
As shown in FIG. 2, the method 200 includes operations S210-S240.
In operation S210, a prediction map corresponding to a training sample image is determined. The prediction graph represents a prediction relationship between every two preset categories of a plurality of preset categories related to the training sample image.
In operation S220, a supervised map corresponding to the training sample image is determined. The supervised graph characterizes a true relationship between each two of a plurality of preset categories associated with the training sample images.
In operation S230, a prediction classification result corresponding to the training sample image is obtained according to the prediction graph.
In operation S240, a preset model is trained according to the prediction graph, the supervision graph, the prediction classification result, and the real classification result corresponding to the training sample image, so as to obtain a classification model.
According to an embodiment of the present disclosure, the preset category may refer to a category of an object in an image. The plurality of preset categories associated with the training sample image may be all of the preset categories or some of the all of the preset categories. All preset categories may be preset. Or may be determined based on the class appearing in each training sample image included with the set of training sample images. For example, a preset category appearing in the training sample image may be determined for each of a plurality of training sample images comprised by the set of training sample images. And obtaining all preset classes according to the preset classes appearing in each training sample image in the plurality of training sample images.
According to an embodiment of the present disclosure, the two preset categories may include two identical preset categories and two different preset categories. The relationship between the two preset categories may include the presence of a relationship between the two preset categories or the absence of a relationship between the two preset categories. For an image, if two preset categories appear in the image, it can be considered that there is a relationship between the two preset categories in the image. If two preset categories do not appear in the image, it can be considered that there is no relationship between the two preset categories in the image. Accordingly, for a training sample image, if two preset categories appear in the training sample image, it can be considered that a relationship exists between the two preset categories in the training sample image. If two preset classes do not appear in the training sample image, it can be considered that there is no relationship between the two preset classes in the training sample image.
According to the embodiment of the disclosure, the prediction map can be used for performing enhanced characterization on the image features so as to improve the effect of multi-label classification. The prediction graph corresponding to the training sample image may characterize a prediction relationship between each two of a plurality of preset categories associated with the training sample image. For example, the prediction map corresponding to the training sample image may include a plurality of preset categories associated with the training sample image and a prediction relationship between each two preset categories. The representation form of the prediction relationship may be configured according to the actual service requirement, and is not limited herein. For example, the characterizing form of the predicted relationship may include a predicted probability value or a predicted score.
According to an embodiment of the present disclosure, a supervised graph corresponding to a training sample image may be used to supervise a prediction graph corresponding to a training sample image. For example, image feature characterization may be enhanced by monitoring the predictive relationships between classes in a predictive graph in an explicitly supervised manner. The supervised graph corresponding to the training sample image may characterize a true (i.e. group Trouth) relationship between each two of the plurality of preset categories associated with the training image, i.e. the supervised graph corresponding to the training sample image may include the plurality of preset categories associated with the training sample image and a true relationship between each two of the preset categories. The representation form of the real relationship may be configured according to the actual service requirement, and is not limited herein. For example, a true relationship may be characterized by a "1" or a "0". A "1" may characterize that two preset categories exist in relation. A "0" may characterize that there is no relationship between the two preset categories.
For example, the plurality of preset categories include cats, rabbits, dogs, vehicles, and airplanes. The preset categories appearing in the training sample images include cats, rabbits, dogs, and vehicles. The characterizing form of the predictive relationship is a predictive probability value. The true relationship is characterized by a "1" or a "0". "1" represents that two preset categories exist in relation, and "0" represents that two preset categories do not exist in relation.
The cat, the rabbit, the dog and the vehicle are preset categories appearing in the training sample image, and the airplane is a preset category not appearing in the training sample image, and therefore, the true relationship between the cat and the rabbit, the true relationship between the cat and the dog, the true relationship between the cat and the vehicle, the true relationship between the rabbit and the dog, the true relationship between the rabbit and the vehicle and the true relationship between the dog and the vehicle in the plurality of preset categories related to the training sample image are all "1". The true relationship between the cat and the airplane, the true relationship between the rabbit and the airplane, and the true relationship between the vehicle and the airplane are all "0".
In one example, the predicted relationship between the cat and the rabbit in the plurality of preset categories associated with the training sample images is 0.95, the predicted relationship between the cat and the dog is 0.98, the predicted relationship between the cat and the vehicle is 1, the predicted relationship between the rabbit and the dog is 0.9, the predicted relationship between the rabbit and the vehicle is 0.98, and the predicted relationship between the dog and the vehicle is 1. The predicted relationship between cat and airplane was 0.2, the predicted relationship between rabbit and airplane was 0.1, and the predicted relationship between vehicle and airplane was 0.05.
According to an embodiment of the present disclosure, the prediction classification result corresponding to the training sample image may refer to a preset category included in the prediction training sample image. The preset model may be a model based on a graph convolution neural network.
According to the embodiment of the disclosure, after the prediction graph and the supervision graph corresponding to the training sample image are obtained, the prediction classification result corresponding to the training sample image can be obtained according to the prediction graph corresponding to the training sample image. And then adjusting the model parameters of the preset model according to the prediction graph and the supervision graph corresponding to the training sample image and the prediction classification result and the real classification result corresponding to the training sample image until the preset condition is met. A preset model obtained when a preset condition is satisfied may be determined as the classification model.
It should be noted that, as can be understood by those skilled in the art, in the above method, the operation S210 and the operation S220 may be executed at the same time, the operation S210 may be executed first and then the operation S220 is executed, the operation S220 may be executed first and then the operation S210 is executed, and the embodiment of the present disclosure does not limit this.
According to an embodiment of the present disclosure, the supervised map is used for characterizing a true relationship between each two preset classes of a plurality of preset classes related to the training sample image. Therefore, the reliability of the supervision map is high. And training a preset model according to the prediction graph, the supervision graph, the prediction classification result and the real classification result corresponding to the training sample image to obtain a classification model. For example, the supervision of the prediction graph is realized by introducing the supervision graph into the training of the classification model. Therefore, the reliability of the prediction map is improved. On the basis, the prediction graph with higher reliability is used for carrying out enhanced representation on the image characteristics, and the identification precision of the classification model is improved.
According to an embodiment of the present disclosure, operation S210 may include the following operations.
And performing feature extraction on the training sample image to obtain a feature map corresponding to the training sample image. And determining a mask map corresponding to the feature map. And performing point multiplication on the feature map and the mask map corresponding to the training sample image to obtain an initial class representation of each preset class related to the training sample image. And obtaining a prediction graph corresponding to the training sample image according to the initial class characterization of each preset class related to the training sample image.
According to an embodiment of the present disclosure, the initial category characterization of each preset category may refer to an initial content-aware category characterization of each preset category. The preset model may include a convolutional neural network module and a semantic extraction module. The semantic extraction module may include a convolutional layer and a pooling layer. The pooling layer may include a global pooling layer. Performing feature extraction on the training sample image to obtain a feature map corresponding to the training sample image may include: the training sample images may be processed by a convolutional neural network module to obtain a feature map corresponding to the training sample images.
According to the embodiment of the disclosure, after the feature map corresponding to the training sample image is obtained, the feature map and the mask map corresponding to the training sample image may be processed by using a semantic extraction module, so as to obtain an initial category characterization of each preset category related to the training sample image. For example, the feature map and the mask map corresponding to the training sample image may be subjected to point multiplication to obtain a point multiplication result, and the point multiplication result is processed by using the pooling layer of the semantic extraction module to obtain an initial category representation of each preset category related to the training sample image.
According to the embodiment of the disclosure, after the initial class representation of each preset class related to the training sample image is obtained, the initial class representation of each preset class related to the training sample image may be processed by using a convolution layer of a semantic extraction module, so as to obtain a prediction graph corresponding to the training sample image.
According to an embodiment of the present disclosure, determining a mask map corresponding to a feature map may include the following operations.
And (4) convolving the characteristic diagram to obtain a mask diagram corresponding to the characteristic diagram.
According to the embodiment of the disclosure, after the feature map corresponding to the training sample image is obtained, the feature map may be processed by using the convolution layer of the semantic extraction module to obtain the mask map corresponding to the feature map.
According to an embodiment of the present disclosure, operation S230 may include the following operations.
And obtaining an enhanced class representation of each preset class according to the prediction graph and the initial class representation of each preset class related to the training sample image. And classifying the enhanced category characterization of each preset category to obtain a prediction classification result corresponding to each preset category. And obtaining a prediction classification result corresponding to the training sample image according to the prediction classification result corresponding to each preset class.
According to an embodiment of the present disclosure, the enhanced category characterization of each preset category may refer to an enhanced content aware category characterization of each preset category. The preset model may further include a dynamic graph convolutional neural network module and a classification module, and the classification module may include a plurality of two classifiers.
According to an embodiment of the present disclosure, obtaining an enhanced class representation of each preset class according to the prediction graph and the initial class representation of each preset class associated with the training sample image may include: the prediction graph corresponding to the training sample image and the initial class representation of each of the plurality of preset classes associated with the training sample image may be processed by the dynamic graph convolutional neural network module to obtain an enhanced class representation of each of the plurality of preset classes associated with the training sample image. For example, the prediction graph and the initial class representation of each of the plurality of preset classes associated with the training sample image may be point-multiplied to obtain an enhanced class representation of each of the plurality of preset classes associated with the training sample image.
According to the embodiment of the disclosure, after obtaining the enhancement category characterization of each of the multiple preset categories related to the training sample image, the classification module may be utilized to process the enhancement category characterization of each of the multiple preset categories related to the training sample image, and obtain the prediction classification result corresponding to each preset category, that is, the enhancement category characteristics of each of the multiple preset categories related to the training sample image are input into the two classifiers corresponding to the preset categories, so as to obtain the prediction classification result corresponding to each preset category. The predicted classification result corresponding to the training sample image may be obtained according to the predicted classification result corresponding to each preset category.
Referring to fig. 3 to fig. 6, the training method of the classification model shown in fig. 2 will be further described with reference to specific embodiments.
Fig. 3 schematically illustrates a schematic diagram of determining a supervised diagram corresponding to a training sample image according to an embodiment of the present disclosure.
As shown in fig. 3, the method 300 includes operations S321 to S323.
In operation S321, a plurality of preset categories related to the training sample image are determined.
In operation S322, for each two preset categories, elements in the initial matrix corresponding to the two preset categories are modified into preset identifiers.
In operation S323, a supervised diagram corresponding to the training sample image is determined according to the modified initial matrix.
According to the embodiment of the disclosure, the preset identifier may represent that the two preset categories are preset categories having a relationship. The initial matrix may be used to characterize an initial relationship between each two of a plurality of preset categories. The initial matrix may comprise a plurality of elements. Each element may be used to characterize an initial relationship between two preset categories. The two preset categories may include two identical preset categories or two different preset categories. Each element in the initial matrix may be set to an initial identity. The plurality of predetermined classes included in the initial matrix may be determined according to a class appearing in each of the training sample images included in the training sample image set.
According to an embodiment of the present disclosure, for the training sample image, the preset category appearing in the training sample image may be part or all of a plurality of preset categories included in the initial matrix. After determining a plurality of preset categories related to the training sample image, for each two preset categories, modifying elements corresponding to the two preset categories in the initial matrix from the initial identifiers to preset identifiers to obtain a modified initial matrix. If the element in the modified initial matrix is the preset identifier, it can be stated that two preset categories corresponding to the element are preset categories having a relationship.
For example, the initial identification may be characterized by a "0". The preset flag may be characterized by a "1". All preset categories include cats, rabbits, dogs, and airplanes. The preset categories appearing in the training sample images include cats, rabbits, and dogs. X for cat1Characterization, rabbits with x2Characterization, dogs with x3Characterisation, x for aircraft4And (5) characterizing. The matrix is characterized by a. The initial matrix is characterized by B. The modified initial matrix is characterized by C.
Matrix array
Figure BDA0003286817950000111
(x1,x1) Elements corresponding to cats and cats were characterized. (x)1,x2) And (x)2,x1) Elements corresponding to cats and rabbits were characterized. (x)1,x3) And (x)3,x1) Elements corresponding to cats and dogs were characterized. (x)1,x4) And (x)4,x1) Elements corresponding to cats and vehicles are characterized. (x)2,x2) Elements corresponding to rabbits and rabbits were characterized. (x)2,x3) And (x)3,x2) Elements corresponding to rabbits and dogs were characterized. (x)2,x4) And (x)4,x2) Elements corresponding to rabbits and vehicles were characterized. (x)3,x3) Elements corresponding to dogs and dogs were characterized. (x)3,x4) And (x)4,x3) Elements corresponding to dogs and vehicles were characterized. (x)4,x4) Characterization and vehicleThe corresponding elements.
The element in a is set as the initial identity. E.g., "0", to obtain an initial matrix
Figure BDA0003286817950000112
The preset categories appearing in the training sample images include cats, rabbits, and dogs. Thus, will (x)1,x1)、(x1,x2)、(x1,x3)、(x2,x1)、(x2,x2)、(x2,x3)、(x3,x1)、(x3,x2) And (x)3,x3) Modifying the initial identifier into a preset identifier, such as '1', to obtain a modified initial matrix
Figure BDA0003286817950000121
Fig. 4 schematically shows a flowchart for training a preset model according to a prediction graph, a supervision graph, a prediction classification result and a real classification result corresponding to a training sample image to obtain a classification model according to an embodiment of the present disclosure.
As shown in fig. 4, the method 400 includes operations S441 to S444.
In operation S441, a first output value is obtained using the prediction map and the supervision map corresponding to the training sample image based on the first loss function.
In operation S442, a second output value is obtained using the predicted classification result and the true classification result corresponding to the training sample image based on the second loss function.
In operation S443, the model parameters of the preset model are adjusted according to the first output value and the second output value until the first output value and the second output value both converge.
In operation S444, a preset model obtained in a case where both the first output value and the second output value are converged is determined as a classification model.
According to an embodiment of the present disclosure, the first loss function may include a Mean Squared Error (MSE) loss function. The second loss function may comprise a cross entropy loss function.
According to the embodiment of the disclosure, the prediction graph and the supervision graph corresponding to the training sample image can be input into the first loss function, and a first output value is obtained. The predicted classification result and the true classification result corresponding to the training sample image may be input to a second loss function to obtain a second output value. And obtaining an output value according to the first output value and the second output value. And adjusting the model parameters of the preset model according to the output value until the output value is converged.
Fig. 5 schematically shows an application schematic of a training process of a classification model according to an embodiment of the present disclosure.
As shown in fig. 5, in the training process 500, feature extraction is performed on a training sample image 501, and a feature map 502 corresponding to the training sample image 501 is obtained. A mask map 503 corresponding to the feature map 502 is determined. And performing point multiplication on the feature map 502 and the mask map 503 corresponding to the training sample image 502 to obtain an initial class representation 504 of each preset class related to the training sample image 501. According to the initial category characterization 504 of each preset category related to the training sample image 501, a prediction graph 505 corresponding to the training sample image 501 is obtained.
A plurality of preset categories related to the training sample image 501 are determined, and for each two preset categories, elements corresponding to the two preset categories in the initial matrix 506 are modified into preset identifiers. And determining a supervision graph 507 corresponding to the training sample image according to the modified initial matrix.
A first output value 509 is obtained using the prediction graph 505 and the supervised graph 507 corresponding to the training sample image 501 based on a first loss function 508.
An enhanced class representation 510 for each preset class is obtained from the prediction graph 505 and the initial class representation 504 for each preset class associated with the training sample image 501. And classifying the enhanced category characterization 511 of each preset category to obtain a prediction classification result corresponding to each preset category. The predicted classification result 511 corresponding to the training sample image 501 is obtained from the predicted classification result corresponding to each preset category.
A second output value 514 is derived based on a second loss function 513 using the predicted classification result 511 and the true classification result 512 corresponding to the training sample image 501.
The model parameters of the preset model 515 are adjusted according to the first output value 509 and the second output value 514 until the first output value 509 and the second output value 514 converge. A preset model 515 obtained in a case where both the first output value 509 and the second output value 514 converge is determined as the classification model 516.
Fig. 6 schematically shows an example schematic of a training process of a classification model according to an embodiment of the disclosure.
The number of all preset classes is characterized by N. N-25.
As shown in fig. 6, in the training process 600, the training sample image 601 is processed by the convolutional neural network module 602 to obtain a feature map 603 corresponding to the training sample image 601. The feature map 603 may be represented by W1×H1And (8) representing by multiplying by D. W1Width, H, of the characterization feature map 6031The height of the feature map 603 is characterized and D the depth of the feature map 603. The training sample image 601 is an RGB image, and thus D is 3.
The feature map 603 is convolved to obtain a mask map 604 corresponding to the feature map 603. Mask map 604 may be represented by W2×H2And x K characterization. W2Characterizing the width, H, of the mask map 6042The height of the mask map 604 is characterized and K represents the number of channels. W1=W2。H1=H2. Different colors in mask map 604 characterize different preset categories.
And performing point multiplication on the feature map 603 and the mask map 604 corresponding to the training sample image 601, and performing global pooling to obtain an initial class representation of each preset class related to the training sample image 601. For example, the result includes the initial class representation 605A, the initial class representation 606A, the initial class representation 607A, and the initial class representation 608A shown in fig. 6. In addition, other initial class representations are included, and the other initial class representations include 21 initial class representations in addition to the 4 initial class representations. The dimensions of each initial class representation are characterized by C.
Convolving the initial class representation 605A, the initial class representation 606A, the initial class representation 607A, the initial class representation 608A, and other initial class representations to obtain a prediction map 609 corresponding to the training sample image 601.
The initial class characterization of each preset class related to the prediction graph and the training sample image is point-multiplied to obtain an enhanced class characterization of each preset class, that is, an enhanced class characterization 605B, an enhanced class characterization 606B, an enhanced class characterization 607B, and an enhanced class characterization 608B shown in fig. 6 are obtained. In addition, other enhancement category characterization is also included, and the other enhancement category characterization includes 21 enhancement category characterization besides the above-mentioned 4 enhancement category characterization. The enhanced class representation 605B is an enhanced class representation corresponding to the initial class representation 605A. The enhanced class representation 606B is an enhanced class representation corresponding to the initial class representation 606A. The enhanced class representation 607B is the enhanced class representation corresponding to the initial class representation 607A. The enhanced class representation 608B is an enhanced class representation corresponding to the initial class representation 608A.
Each enhanced class representation is processed by the classification module 611 to obtain a prediction classification result 612 corresponding to the training sample image 601.
During the training process, the prediction graph 609 is supervised by the supervision graph 610, that is, a first output value can be obtained by using the supervision graph 610 and the prediction graph 609 based on the first loss function. And on the basis, combining the second output value, and adjusting the model parameters of the preset model according to the first output value and the second output value until the first output value and the second output value are converged. And determining the preset model obtained under the condition that the first output value and the second output value are both converged as a classification model. The second output value is based on a second penalty function, using the predicted classification result 612 and the true classification result.
The present invention is not limited to the exemplary embodiment, and may also include other training methods of the classification model known in the art as long as the training of the classification model can be achieved.
Fig. 7 schematically shows a flow chart of an image recognition method according to an embodiment of the present disclosure.
As shown in fig. 7, the method 700 includes operations S710 to S720.
In operation S710, a target image is acquired.
In operation S720, the target image is input into the classification model, and a prediction classification result corresponding to the target image is obtained.
According to an embodiment of the present disclosure, the classification model may be trained by using a training method of the classification model according to an embodiment of the present disclosure.
According to an embodiment of the present disclosure, inputting the target image into the classification model, and obtaining the category related to the target image may include: and performing feature extraction on the target image to obtain a feature map corresponding to the target image. And (4) convolving the feature map corresponding to the target image to obtain a mask map corresponding to the feature map. And performing dot multiplication on the feature map and the mask map corresponding to the target image to obtain an initial category representation of each preset category related to the target image. And obtaining a prediction graph corresponding to the target image according to the initial class characterization of each preset class related to the target image. And obtaining the enhanced category representation of each preset category according to the prediction graph corresponding to the target image and the initial category representation of each preset category relevant to the target image. And classifying the enhanced category characterization of each preset category to obtain a prediction classification result corresponding to each preset category. And obtaining a prediction classification result corresponding to the target image according to the prediction classification result corresponding to each preset category.
In the technical scheme of the present disclosure, the processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the related users all conform to the regulations of the related laws and regulations, and do not violate the good custom of the public order.
Fig. 8 schematically shows a block diagram of a training apparatus of a classification model according to an embodiment of the present disclosure.
As shown in fig. 8, the training apparatus 800 of the classification model may include a first determining module 810, a second determining module 820, a first obtaining module 830, and a second obtaining module 840.
A first determining module 810, configured to determine a prediction graph corresponding to the training sample image. The prediction graph represents a prediction relationship between every two preset categories of a plurality of preset categories related to the training sample image.
And a second determining module 820, configured to determine a supervised map corresponding to the training sample image. The supervised graph characterizes a true relationship between each two of a plurality of preset categories associated with the training sample images.
The first obtaining module 830 is configured to obtain a prediction classification result corresponding to the training sample image according to the prediction graph.
The second obtaining module 840 is configured to train the preset model according to the prediction graph, the supervision graph, the prediction classification result, and the real classification result corresponding to the training sample image, so as to obtain a classification model.
According to an embodiment of the present disclosure, the second obtaining module 840 may include a first obtaining sub-module, a second obtaining sub-module, an adjusting sub-module, and a first determining module.
And the first obtaining submodule is used for obtaining a first output value by utilizing the prediction graph and the supervision graph corresponding to the training sample image based on the first loss function.
And the second obtaining submodule is used for obtaining a second output value by utilizing the prediction classification result and the real classification result corresponding to the training sample image based on the second loss function.
And the adjusting submodule is used for adjusting the model parameters of the preset model according to the first output value and the second output value until the first output value and the second output value are converged.
And the first determining submodule is used for determining the preset model obtained under the condition that the first output value and the second output value are both converged as the classification model.
According to an embodiment of the present disclosure, the second determination module 820 may include a second determination submodule, a modification submodule, and a third determination submodule.
And the second determining submodule is used for determining a plurality of preset categories related to the training sample image.
And the modification submodule is used for modifying the elements corresponding to the two preset categories in the initial matrix into preset identifications aiming at every two preset categories. The preset identification represents that two preset categories exist in the training sample image.
And the third determining submodule is used for determining a supervision picture corresponding to the training sample image according to the modified initial matrix.
According to an embodiment of the present disclosure, the first determining module 810 may include a third obtaining sub-module, a third determining sub-module, a fourth obtaining sub-module, and a fifth obtaining sub-module.
And the third obtaining submodule is used for carrying out feature extraction on the training sample image to obtain a feature map corresponding to the training sample image.
And the third determining submodule is used for determining a mask map corresponding to the characteristic map.
And the fourth obtaining submodule is used for performing point multiplication on the feature map and the mask map corresponding to the training sample image to obtain an initial class representation of each preset class relevant to the training sample image.
And the fifth obtaining submodule is used for obtaining a prediction graph corresponding to the training sample image according to the initial class characterization of each preset class relevant to the training sample image.
According to an embodiment of the present disclosure, the third determining sub-module includes:
and the obtaining unit is used for performing convolution on the characteristic diagram to obtain a mask diagram corresponding to the characteristic diagram.
According to an embodiment of the present disclosure, the first obtaining module 830 may include a sixth obtaining sub-module, a seventh obtaining sub-module, and an eighth obtaining sub-module.
And the sixth obtaining submodule is used for obtaining the enhanced class representation of each preset class according to the prediction graph and the initial class representation of each preset class relevant to the training sample image.
And the seventh obtaining submodule is used for classifying the enhanced category characterization of each preset category to obtain a prediction classification result corresponding to each preset category.
And the eighth obtaining submodule is used for obtaining a prediction classification result corresponding to the training sample image according to the prediction classification result corresponding to each preset class.
Fig. 9 schematically shows a block diagram of an image recognition apparatus according to an embodiment of the present disclosure.
As shown in fig. 9, the image recognition apparatus 900 may include an obtaining module 910 and a third obtaining module 920.
An obtaining module 910, configured to obtain a target image.
The third obtaining module 920 is configured to input the target image into the classification model, so as to obtain a prediction classification result corresponding to the target image.
According to an embodiment of the present disclosure, the classification model is trained using a training apparatus of the classification model according to an embodiment of the present disclosure.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described above.
According to an embodiment of the present disclosure, a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method as described above.
According to an embodiment of the disclosure, a computer program product comprising a computer program which, when executed by a processor, implements the method as described above.
Fig. 10 schematically shows a block diagram of an electronic device adapted to implement a training method and an image recognition method of a classification model according to an embodiment of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the electronic device 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the electronic apparatus 1000 can also be stored. The calculation unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
A number of components in the electronic device 1000 are connected to the I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, or the like. The communication unit 1009 allows the electronic device 1000 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 1001 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 1001 performs the respective methods and processes described above, such as a training method of a classification model or an image recognition method. For example, in some embodiments, the training method or the image recognition method of the classification model may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto electronic device 1000 via ROM 1002 and/or communications unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the training method of the classification model or the image recognition method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured by any other suitable means (e.g. by means of firmware) to perform a training method or an image recognition method of the classification model.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (17)

1. A training method of a classification model comprises the following steps:
determining a prediction graph corresponding to a training sample image, wherein the prediction graph represents a prediction relation between every two preset categories in a plurality of preset categories related to the training sample image;
determining a supervision graph corresponding to a training sample image, wherein the supervision graph characterizes a real relation between every two preset categories in the plurality of preset categories related to the training sample image;
obtaining a prediction classification result corresponding to the training sample image according to the prediction graph; and
and training a preset model according to the prediction graph, the supervision graph, the prediction classification result and the real classification result corresponding to the training sample image to obtain a classification model.
2. The method of claim 1, wherein the training a preset model according to a prediction graph, a supervision graph, a prediction classification result and a real classification result corresponding to the training sample image to obtain a classification model comprises:
obtaining a first output value by utilizing a prediction graph and a supervision graph corresponding to the training sample image based on a first loss function;
obtaining a second output value by utilizing a prediction classification result and a real classification result corresponding to the training sample image based on a second loss function;
adjusting the model parameters of the preset model according to the first output value and the second output value until the first output value and the second output value are converged; and
and determining a preset model obtained under the condition that the first output value and the second output value are both converged as the classification model.
3. The method of claim 1 or 2, wherein the determining a supervised map corresponding to a training sample image comprises:
determining a plurality of preset categories related to the training sample image;
modifying elements corresponding to the two preset categories in the initial matrix into preset marks aiming at every two preset categories, wherein the preset marks represent that the two preset categories exist in the training sample image; and
and determining a supervision picture corresponding to the training sample image according to the modified initial matrix.
4. The method of any of claims 1-3, wherein the determining a prediction graph corresponding to a training sample image comprises:
extracting features of the training sample images to obtain feature maps corresponding to the training sample images;
determining a mask map corresponding to the feature map;
performing point multiplication on the feature map and the mask map corresponding to the training sample image to obtain an initial class representation of each preset class related to the training sample image; and
and obtaining a prediction graph corresponding to the training sample image according to the initial class characterization of each preset class related to the training sample image.
5. The method of claim 4, wherein the determining a mask map corresponding to the feature map comprises:
and performing convolution on the characteristic diagram to obtain a mask diagram corresponding to the characteristic diagram.
6. The method according to claim 4 or 5, wherein the obtaining of the prediction classification result corresponding to the training sample image according to the prediction graph comprises:
obtaining an enhanced class representation of each preset class according to the prediction graph and the initial class representation of each preset class related to the training sample image;
classifying the enhanced category characterization of each preset category to obtain a prediction classification result corresponding to each preset category; and
and obtaining a prediction classification result corresponding to the training sample image according to the prediction classification result corresponding to each preset class.
7. An image recognition method, comprising:
acquiring a target image; and
inputting the target image into a classification model to obtain a prediction classification result corresponding to the target image,
wherein the classification model is trained using the method according to any one of claims 1-6.
8. A training apparatus for classification models, comprising:
the device comprises a first determination module, a second determination module and a prediction module, wherein the first determination module is used for determining a prediction graph corresponding to a training sample image, and the prediction graph represents the prediction relation between every two preset categories in a plurality of preset categories related to the training sample image;
a second determining module, configured to determine a supervision graph corresponding to a training sample image, where the supervision graph represents a real relationship between each two preset categories of the plurality of preset categories related to the training sample image;
the first obtaining module is used for obtaining a prediction classification result corresponding to the training sample image according to the prediction graph; and
and the second obtaining module is used for training a preset model according to the prediction graph, the supervision graph, the prediction classification result and the real classification result corresponding to the training sample image to obtain a classification model.
9. The apparatus of claim 8, wherein the second obtaining means comprises:
the first obtaining submodule is used for obtaining a first output value by utilizing a prediction graph and a supervision graph corresponding to the training sample image based on a first loss function;
the second obtaining submodule is used for obtaining a second output value by utilizing a prediction classification result and a real classification result corresponding to the training sample image based on a second loss function;
the adjusting submodule is used for adjusting the model parameters of the preset model according to the first output value and the second output value until the first output value and the second output value are converged; and
and the first determining submodule is used for determining a preset model obtained under the condition that the first output value and the second output value are both converged as the classification model.
10. The apparatus of claim 8 or 9, wherein the second determining means comprises:
a second determining submodule for determining a plurality of preset categories associated with the training sample image;
the modification submodule is used for modifying elements corresponding to the two preset categories in the initial matrix into preset identifications aiming at every two preset categories, wherein the preset identifications represent that the two preset categories exist in the training sample image; and
and the third determining submodule is used for determining a supervision picture corresponding to the training sample image according to the modified initial matrix.
11. The apparatus of any of claims 8-10, wherein the first determining module comprises:
the third obtaining submodule is used for carrying out feature extraction on the training sample image to obtain a feature map corresponding to the training sample image;
a third determining submodule, configured to determine a mask map corresponding to the feature map;
the fourth obtaining submodule is used for performing point multiplication on the feature map and the mask map corresponding to the training sample image to obtain an initial class representation of each preset class related to the training sample image; and
and the fifth obtaining submodule is used for obtaining a prediction graph corresponding to the training sample image according to the initial class characterization of each preset class relevant to the training sample image.
12. The apparatus of claim 11, wherein the third determination submodule comprises:
and the obtaining unit is used for carrying out convolution on the characteristic diagram to obtain a mask diagram corresponding to the characteristic diagram.
13. The apparatus of claim 11 or 12, wherein the first obtaining means comprises:
a sixth obtaining submodule, configured to obtain an enhanced class representation of each preset class according to the prediction graph and the initial class representation of each preset class related to the training sample image;
a seventh obtaining submodule, configured to classify the enhanced category characterization of each preset category, and obtain a predicted classification result corresponding to each preset category; and
and the eighth obtaining submodule is used for obtaining a prediction classification result corresponding to the training sample image according to the prediction classification result corresponding to each preset category.
14. An image recognition apparatus comprising:
the acquisition module is used for acquiring a target image; and
a third obtaining module, configured to input the target image into a classification model to obtain a prediction classification result corresponding to the target image,
wherein the classification model is trained using an apparatus according to any one of claims 8 to 13.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6 or claim 7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6 or claim 7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1 to 6 or claim 7.
CN202111155997.4A 2021-09-29 2021-09-29 Training method, image recognition method, device, electronic device and storage medium Pending CN113869430A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111155997.4A CN113869430A (en) 2021-09-29 2021-09-29 Training method, image recognition method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111155997.4A CN113869430A (en) 2021-09-29 2021-09-29 Training method, image recognition method, device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN113869430A true CN113869430A (en) 2021-12-31

Family

ID=79000865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111155997.4A Pending CN113869430A (en) 2021-09-29 2021-09-29 Training method, image recognition method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113869430A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170337481A1 (en) * 2016-05-17 2017-11-23 Xerox Corporation Complex embeddings for simple link prediction
CN109784392A (en) * 2019-01-07 2019-05-21 华南理工大学 A kind of high spectrum image semisupervised classification method based on comprehensive confidence
CN110210535A (en) * 2019-05-21 2019-09-06 北京市商汤科技开发有限公司 Neural network training method and device and image processing method and device
CN111626119A (en) * 2020-04-23 2020-09-04 北京百度网讯科技有限公司 Target recognition model training method, device, equipment and storage medium
CN111639710A (en) * 2020-05-29 2020-09-08 北京百度网讯科技有限公司 Image recognition model training method, device, equipment and storage medium
WO2020207377A1 (en) * 2019-04-10 2020-10-15 腾讯科技(深圳)有限公司 Method, device, and system for image recognition model training and image recognition
CN113222942A (en) * 2021-05-17 2021-08-06 北京百度网讯科技有限公司 Training method of multi-label classification model and method for predicting labels
US20220414490A1 (en) * 2020-03-03 2022-12-29 Fujitsu Limited Storage medium, machine learning method, and machine learning device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170337481A1 (en) * 2016-05-17 2017-11-23 Xerox Corporation Complex embeddings for simple link prediction
CN109784392A (en) * 2019-01-07 2019-05-21 华南理工大学 A kind of high spectrum image semisupervised classification method based on comprehensive confidence
WO2020207377A1 (en) * 2019-04-10 2020-10-15 腾讯科技(深圳)有限公司 Method, device, and system for image recognition model training and image recognition
CN110210535A (en) * 2019-05-21 2019-09-06 北京市商汤科技开发有限公司 Neural network training method and device and image processing method and device
US20220414490A1 (en) * 2020-03-03 2022-12-29 Fujitsu Limited Storage medium, machine learning method, and machine learning device
CN111626119A (en) * 2020-04-23 2020-09-04 北京百度网讯科技有限公司 Target recognition model training method, device, equipment and storage medium
CN111639710A (en) * 2020-05-29 2020-09-08 北京百度网讯科技有限公司 Image recognition model training method, device, equipment and storage medium
CN113222942A (en) * 2021-05-17 2021-08-06 北京百度网讯科技有限公司 Training method of multi-label classification model and method for predicting labels

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WU,J等: "Multi-Label Active Learning Algorithms for Image Classification: Overview and Future Promise", ACM COMPUTING SURVEYS, vol. 53, no. 2, 1 April 2020 (2020-04-01) *
青晨;禹晶;肖创柏;段娟;: "深度卷积神经网络图像语义分割研究进展", 中国图象图形学报, no. 06, 16 June 2020 (2020-06-16) *

Similar Documents

Publication Publication Date Title
CN114549874A (en) Training method of multi-target image-text matching model, image-text retrieval method and device
CN111931859B (en) Multi-label image recognition method and device
CN110633594A (en) Target detection method and device
CN114444619B (en) Sample generation method, training method, data processing method and electronic device
CN115358392A (en) Deep learning network training method, text detection method and text detection device
CN113887615A (en) Image processing method, apparatus, device and medium
CN114898266B (en) Training method, image processing device, electronic equipment and storage medium
CN113643260A (en) Method, apparatus, device, medium and product for detecting image quality
CN113378857A (en) Target detection method and device, electronic equipment and storage medium
CN112560461A (en) News clue generation method and device, electronic equipment and storage medium
CN108734718B (en) Processing method, device, storage medium and equipment for image segmentation
CN113051911B (en) Method, apparatus, device, medium and program product for extracting sensitive words
CN113963197A (en) Image recognition method and device, electronic equipment and readable storage medium
CN114360027A (en) Training method and device for feature extraction network and electronic equipment
CN113902899A (en) Training method, target detection method, device, electronic device and storage medium
CN112508005B (en) Method, apparatus, device and storage medium for processing image
CN113887630A (en) Image classification method and device, electronic equipment and storage medium
CN116385789A (en) Image processing method, training device, electronic equipment and storage medium
CN114549961B (en) Target object detection method, device, equipment and storage medium
CN115116080A (en) Table analysis method and device, electronic equipment and storage medium
CN115937742A (en) Video scene segmentation and visual task processing method, device, equipment and medium
CN113869430A (en) Training method, image recognition method, device, electronic device and storage medium
CN114048376A (en) Advertisement service information mining method and device, electronic equipment and storage medium
CN113554062A (en) Training method, device and storage medium of multi-classification model
CN113032251A (en) Method, device and storage medium for determining service quality of application program

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