CN116306895A - Training method and device for image classification model, electronic equipment and storage medium - Google Patents
Training method and device for image classification model, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116306895A CN116306895A CN202310251934.1A CN202310251934A CN116306895A CN 116306895 A CN116306895 A CN 116306895A CN 202310251934 A CN202310251934 A CN 202310251934A CN 116306895 A CN116306895 A CN 116306895A
- Authority
- CN
- China
- Prior art keywords
- sample data
- classification model
- image classification
- image
- training sample
- 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
Links
- 238000012549 training Methods 0.000 title claims abstract description 212
- 238000013145 classification model Methods 0.000 title claims abstract description 211
- 238000000034 method Methods 0.000 title claims abstract description 61
- 238000004590 computer program Methods 0.000 claims description 16
- 238000007781 pre-processing Methods 0.000 claims description 8
- 238000009792 diffusion process Methods 0.000 claims description 7
- 238000010606 normalization Methods 0.000 claims description 6
- 238000011144 upstream manufacturing Methods 0.000 claims description 6
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 238000012545 processing Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000013473 artificial intelligence Methods 0.000 description 4
- 239000003795 chemical substances by application Substances 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- PCHJSUWPFVWCPO-UHFFFAOYSA-N gold Chemical compound [Au] PCHJSUWPFVWCPO-UHFFFAOYSA-N 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Multimedia (AREA)
- Medical Informatics (AREA)
- Databases & Information Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Biomedical Technology (AREA)
- Mathematical Physics (AREA)
- General Engineering & Computer Science (AREA)
- Molecular Biology (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a training method and device of an image classification model, electronic equipment and a storage medium. The method comprises the following steps: acquiring initial training sample data of an image classification model; adding noise to the initial training sample data of the image classification model to obtain noise image sample data; denoising the noise image sample data to obtain target training sample data of an image classification model; training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain a trained image classification model. According to the technical scheme, the high-fidelity target training sample data is generated, so that the image classification model is trained through the high-fidelity training sample data, and the learning capacity and the model training precision of the model can be improved.
Description
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a training method and apparatus for an image classification model, an electronic device, and a storage medium.
Background
With the development of artificial intelligence technology, the artificial intelligence technology is widely used in the medical field.
The artificial intelligence method based on deep learning is based on training of a large amount of data, however, in the medical field, the data amount of medical images is small, high-quality doctors are difficult to annotate, and training requirements are difficult to meet, so that the training precision of an image classification model is low.
Disclosure of Invention
The invention provides a training method and device for an image classification model, electronic equipment and a storage medium, so as to improve the training precision of the image classification model.
According to an aspect of the present invention, there is provided a training method of an image classification model, including:
acquiring initial training sample data of an image classification model;
adding noise to the initial training sample data of the image classification model to obtain noise image sample data;
denoising the noise image sample data to obtain target training sample data of an image classification model;
training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain a trained image classification model.
According to another aspect of the present invention, there is provided a training apparatus for an image classification model, including:
the initial training sample data acquisition module is used for acquiring initial training sample data of the image classification model;
the noise adding module is used for adding noise to the initial training sample data of the image classification model to obtain noise image sample data;
the data denoising module is used for denoising the noise image sample data to obtain target training sample data of the image classification model;
the model training module is used for training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain a trained image classification model.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of training an image classification model according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the training method of the image classification model according to any of the embodiments of the present invention when executed.
According to the technical scheme, noise is added to the initial training sample data of the image classification model by acquiring the initial training sample data of the image classification model, noise image sample data is obtained, noise is removed from the noise image sample data, target training sample data of the image classification model is obtained, and the image classification model to be trained is trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model, so that the trained image classification model is obtained. According to the technical scheme, the high-fidelity target training sample data is generated, so that the image classification model is trained through the high-fidelity training sample data, and the learning capacity and the model training precision of the model can be improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a training method of an image classification model according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a training method of an image classification model according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a training method of an image classification model according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a training device for an image classification model according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing a training method of an image classification model according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a training method for an image classification model according to an embodiment of the present invention, where the method may be performed by a training device for an image classification model, the training device for an image classification model may be implemented in hardware and/or software, and the training device for an image classification model may be configured in a computer terminal. As shown in fig. 1, the method includes:
s110, acquiring initial training sample data of the image classification model.
In this embodiment, the initial training sample data refers to sample data for training an image classification model, and may include a plurality of images and labeling information corresponding to each image. For example, the initial training sample data may be medical image data of a hospital or a medical center and labels of the medical image data, and the medical image data may be a nuclear magnetic image, a CT image, or the like, which is not limited herein.
Specifically, the initial training sample data to be processed may be obtained from a preset storage location of the electronic device, or the initial training sample data may be obtained from other electronic devices or cloud connected to the electronic device, which is not limited herein.
S120, adding noise to the initial training sample data of the image classification model to obtain noise image sample data.
In this embodiment, the noise image sample data refers to initial training sample data after gradually adding noise, and the noise adding process follows a markov chain.
S130, denoising the noise image sample data to obtain target training sample data of the image classification model.
In this embodiment, the target training sample data refers to noise image sample data after denoising processing.
Specifically, the noise image sample data may be input into the denoising network model, and the denoising network model outputs the target training sample data of the image classification model.
And S140, training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain a trained image classification model.
In this embodiment, the image classification model refers to a network prediction model for image classification. Specifically, the image classification model may be previously trained by a large amount of initial training sample data and target training sample data. In the process of training the image classification model, image feature extraction is carried out on initial training sample data of the image classification model and target training sample data of the image classification model in advance, then classification is carried out according to the extracted image features, a prediction classification result is obtained, and model parameters are adjusted according to loss iteration between the prediction classification result and a label until the loss meets a model training termination condition, so that the trained image classification model is obtained.
In some alternative embodiments, after acquiring the initial training sample data of the image classification model, further comprising: preprocessing initial training sample data of the image classification model to obtain preprocessed initial training sample data, wherein the preprocessing method comprises one or more of format conversion and normalization; correspondingly, adding noise to the initial training sample data of the image classification model to obtain noise image sample data, including: noise is added to the initial training sample data after preprocessing, and noise image sample data is obtained.
Taking a medical image scene as an example, after medical image data is acquired, format conversion can be performed on medical image data in a DICOM format to obtain medical image data in an NIFTI format, further normalization processing is performed on the medical image data in the NIFTI format to obtain medical image data after normalization processing, the medical image data after normalization processing is converted into a digital matrix, and the digital matrix is used as initial training sample data of an image classification model.
According to the technical scheme, noise is added to the initial training sample data of the image classification model by acquiring the initial training sample data of the image classification model, noise image sample data is obtained, noise is removed from the noise image sample data, target training sample data of the image classification model is obtained, and the image classification model to be trained is trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model, so that the trained image classification model is obtained. According to the technical scheme, the high-fidelity target training sample data is generated, so that the image classification model is trained through the high-fidelity training sample data, the learning capacity and the model training precision of the model can be improved, and the classification prediction performance and the generalization capacity of the model are improved.
Example two
Fig. 2 is a flowchart of a training method for an image classification model according to a second embodiment of the present invention, where the method according to the present embodiment may be combined with each of the alternatives in the training method for an image classification model provided in the foregoing embodiment. The training method of the image classification model provided by the embodiment is further optimized. Optionally, the adding noise to the initial training sample data of the image classification model to obtain noise image sample data includes: the method comprises the steps of adding Gaussian noise to initial training sample data of an image classification model through forward propagation of a diffusion model to obtain noise image sample data; denoising the noise image sample data to obtain target training sample data of an image classification model, wherein the denoising is performed on the noise image sample data, and the denoising comprises the following steps: acquiring noise data added to the noise image sample data; and inputting the noise image sample data and the noise data added to the noise image sample data into an encoder-decoder network model to obtain target training sample data of an image classification model.
As shown in fig. 2, the method includes:
s210, acquiring initial training sample data of an image classification model.
S220, adding Gaussian noise to the initial training sample data of the image classification model through forward propagation of the diffusion model, and obtaining noise image sample data.
S230, acquiring noise data added to the noise image sample data.
S240, inputting the noise image sample data and the noise data added to the noise image sample data into an encoder-decoder network model to obtain target training sample data of an image classification model.
S250, training the image classification model to be trained based on initial training sample data of the image classification model and target training sample data of the image classification model to obtain a trained image classification model.
Taking a medical image scene as an example, the initial training sample data may be medical image data, after the medical image data is obtained, gaussian noise may be gradually added to the medical image data through forward propagation of a diffusion model, so that the medical image data is changed into a pure noise image, that is, noise image sample data is obtained, and the noise data added to the noise image sample data is recorded. Further, the noise image sample data and the noise data added to the noise image sample data are input to an encoder-decoder network model, and the noise data added to the noise image sample data are used as a gold standard for model learning, so that the encoder-decoder network model learns the data distribution of each step of noise, the adjustment of the parameters of the encoder-decoder network model is realized, and the noise image sample data are denoised based on the encoder-decoder network model after the parameters are adjusted, so that the target training sample data with originality and high fidelity is obtained. The encoder-decoder network model may be a U-Net network, among others.
According to the technical scheme, the Gaussian noise is added to the initial training sample data of the image classification model through forward propagation of the diffusion model, noise image sample data are obtained, the noise data added to the noise image sample data are obtained, the noise image sample data and the noise data added to the noise image sample data are input to the encoder-decoder network model, high-fidelity target training sample data are generated, and therefore the image classification model is trained through the high-fidelity training sample data, and the learning capacity and model training accuracy of the model can be improved.
Example III
Fig. 3 is a flowchart of a training method for an image classification model according to a third embodiment of the present invention, where the method according to the present embodiment may be combined with each of the alternatives in the training method for an image classification model provided in the foregoing embodiment. The training method of the image classification model provided by the embodiment is further optimized. Optionally, the training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain a trained image classification model, including: performing self-supervision learning based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain initial parameters of a network model; and adjusting network model parameters of the image classification model to be trained based on the network model initial parameters to obtain the trained image classification model.
As shown in fig. 3, the method includes:
s310, initial training sample data of the image classification model is obtained.
S320, adding noise to the initial training sample data of the image classification model to obtain noise image sample data.
S330, denoising the noise image sample data to obtain target training sample data of the image classification model.
S340, performing self-supervision learning based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain initial parameters of the network model.
S350, adjusting network model parameters of the image classification model to be trained based on the network model initial parameters to obtain the image classification model after training.
In this embodiment, training of the image classification model may be achieved by means of self-supervised learning.
Alternatively, the self-supervised learning process may include: and extracting features of the initial training sample data of the image classification model and the target training sample data of the image classification model through an upstream agent task to obtain initial parameters of the network model.
The upstream agent task and the downstream image classification model to be trained may be a network model including modules such as an encoder and a decoder, which are not limited herein.
Taking a medical image scene as an example, the initial training sample data may be a small amount of medical image data, the target training sample data is a large amount of medical image data generated through a diffusion model, the initial training sample data and the target training sample data are further used for a self-supervision learning task at the same time, an upstream proxy task of image restoration is adopted, the medical image is diced and randomly disturbed, and the real dicing sequence of the medical image is predicted through the model. Further, the network model initial parameters obtained by the upstream agent task are used as the initialization model parameters of the downstream classification model, and the network model parameters of the image classification model to be trained at the downstream are adjusted, so that the trained image classification model is obtained.
On the basis of the above embodiments, training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain a trained image classification model, further includes: acquiring an image to be classified; inputting the images to be classified into a trained image classification model to obtain image classification probability of at least one category; an image classification result is determined based on the image classification probabilities of the respective categories.
Taking a medical image scene as an example, an image to be classified may be a medical image, specifically, one or more medical images may be input into a trained image classification model, image classification probabilities of multiple possible categories of the medical image may be obtained, and a category with the highest image classification probability in each possible category is taken as an image classification result and output.
According to the technical scheme, the image classification model to be trained is subjected to self-supervision training based on the initial training sample data of the image classification model and the target training sample data of a large number of image classification models, so that the model training precision is improved.
Example IV
Fig. 4 is a schematic structural diagram of a training device for an image classification model according to a fourth embodiment of the present invention. As shown in fig. 4, the apparatus includes:
a data acquisition module 410, configured to acquire initial training sample data of the image classification model;
a noise adding module 420, configured to add noise to the initial training sample data of the image classification model, so as to obtain noise image sample data;
the data denoising module 430 is configured to denoise the noise image sample data to obtain target training sample data of an image classification model;
the model training module 440 is configured to train the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model, so as to obtain a trained image classification model.
According to the technical scheme, noise is added to the initial training sample data of the image classification model by acquiring the initial training sample data of the image classification model, noise image sample data is obtained, noise is removed from the noise image sample data, target training sample data of the image classification model is obtained, and the image classification model to be trained is trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model, so that the trained image classification model is obtained. According to the technical scheme, the high-fidelity target training sample data is generated, so that the image classification model is trained through the high-fidelity training sample data, and the learning capacity and the model training precision of the model can be improved.
In some alternative embodiments, the training device of the image classification model further includes:
the image preprocessing module is used for preprocessing the initial training sample data of the image classification model to obtain preprocessed initial training sample data, wherein the preprocessing method comprises one or more of format conversion and normalization;
in some alternative embodiments, noise adding module 420 is further configured to:
and adding noise to the preprocessed initial training sample data to obtain noise image sample data.
In some alternative embodiments, noise adding module 420 is further configured to:
and adding Gaussian noise to the initial training sample data of the image classification model through forward propagation of the diffusion model to obtain noise image sample data.
In some alternative embodiments, the data denoising module 430 is further configured to:
acquiring noise data added to the noise image sample data;
and inputting the noise image sample data and the noise data added to the noise image sample data into an encoder-decoder network model to obtain target training sample data of an image classification model.
In some alternative embodiments, model training module 440 includes:
the self-supervision learning unit is used for performing self-supervision learning based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain initial parameters of the network model;
and the classification model parameter adjustment unit is used for adjusting the network model parameters of the image classification model to be trained based on the network model initial parameters to obtain the image classification model after training.
In some alternative embodiments, the self-supervised learning unit is further configured to:
and extracting features of the initial training sample data of the image classification model and the target training sample data of the image classification model through an upstream proxy task to obtain initial parameters of the network model.
In some alternative embodiments, the training device of the image classification model is further configured to:
acquiring an image to be classified;
inputting the images to be classified into the trained image classification model to obtain image classification probability of at least one category;
an image classification result is determined based on the image classification probabilities of the respective categories.
The training device for the image classification model provided by the embodiment of the invention can execute the training method for the image classification model provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example five
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. 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. Electronic equipment may also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., helmets, eyeglasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An I/O interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a training method for an image classification model, the method comprising:
acquiring initial training sample data of an image classification model;
adding noise to the initial training sample data of the image classification model to obtain noise image sample data;
denoising the noise image sample data to obtain target training sample data of an image classification model;
training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain a trained image classification model.
In some embodiments, the method of training the image classification model may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the training method of the image classification model described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the training method of the image classification model in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program 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 the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage 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. Alternatively, the computer readable storage medium may be a machine readable signal medium. 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 an electronic device 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) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically 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 can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. A method for training an image classification model, comprising:
acquiring initial training sample data of an image classification model;
adding noise to the initial training sample data of the image classification model to obtain noise image sample data;
denoising the noise image sample data to obtain target training sample data of an image classification model;
training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain a trained image classification model.
2. The method of claim 1, further comprising, after the acquiring the initial training sample data of the image classification model:
preprocessing initial training sample data of the image classification model to obtain preprocessed initial training sample data, wherein the preprocessing method comprises one or more of format conversion and normalization;
correspondingly, the adding noise to the initial training sample data of the image classification model to obtain noise image sample data includes:
and adding noise to the preprocessed initial training sample data to obtain noise image sample data.
3. The method of claim 1, wherein adding noise to the initial training sample data of the image classification model results in noisy image sample data, comprising:
and adding Gaussian noise to the initial training sample data of the image classification model through forward propagation of the diffusion model to obtain noise image sample data.
4. The method according to claim 1, wherein denoising the noisy image sample data to obtain target training sample data of an image classification model comprises:
acquiring noise data added to the noise image sample data;
and inputting the noise image sample data and the noise data added to the noise image sample data into an encoder-decoder network model to obtain target training sample data of an image classification model.
5. The method according to claim 1, wherein the training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain a trained image classification model comprises:
performing self-supervision learning based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain initial parameters of a network model;
and adjusting network model parameters of the image classification model to be trained based on the network model initial parameters to obtain the trained image classification model.
6. The method of claim 5, wherein the self-supervised learning based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain network model initial parameters comprises:
and extracting features of the initial training sample data of the image classification model and the target training sample data of the image classification model through an upstream proxy task to obtain initial parameters of the network model.
7. The method according to claim 1, further comprising, after training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model, after obtaining a trained image classification model:
acquiring an image to be classified;
inputting the images to be classified into the trained image classification model to obtain image classification probability of at least one category;
an image classification result is determined based on the image classification probabilities of the respective categories.
8. A training device for an image classification model, comprising:
the data acquisition module is used for acquiring initial training sample data of the image classification model;
the noise adding module is used for adding noise to the initial training sample data of the image classification model to obtain noise image sample data;
the data denoising module is used for denoising the noise image sample data to obtain target training sample data of the image classification model;
the model training module is used for training the image classification model to be trained based on the initial training sample data of the image classification model and the target training sample data of the image classification model to obtain a trained image classification model.
9. An electronic device, the electronic device comprising:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the training method of the image classification model of any of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the method of training the image classification model of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310251934.1A CN116306895A (en) | 2023-03-15 | 2023-03-15 | Training method and device for image classification model, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310251934.1A CN116306895A (en) | 2023-03-15 | 2023-03-15 | Training method and device for image classification model, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116306895A true CN116306895A (en) | 2023-06-23 |
Family
ID=86793801
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310251934.1A Pending CN116306895A (en) | 2023-03-15 | 2023-03-15 | Training method and device for image classification model, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116306895A (en) |
-
2023
- 2023-03-15 CN CN202310251934.1A patent/CN116306895A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11436863B2 (en) | Method and apparatus for outputting data | |
JP7394809B2 (en) | Methods, devices, electronic devices, media and computer programs for processing video | |
CN113436100B (en) | Method, apparatus, device, medium, and article for repairing video | |
CN112929695B (en) | Video duplicate removal method and device, electronic equipment and storage medium | |
CN114020950B (en) | Training method, device, equipment and storage medium for image retrieval model | |
JP2023531350A (en) | A method for incrementing a sample image, a method for training an image detection model and a method for image detection | |
US12118770B2 (en) | Image recognition method and apparatus, electronic device and readable storage medium | |
CN112800919A (en) | Method, device and equipment for detecting target type video and storage medium | |
CN113378855A (en) | Method for processing multitask, related device and computer program product | |
CN117593083A (en) | Commodity image generation method, commodity image generation device, electronic equipment and storage medium | |
CN113792876A (en) | Backbone network generation method, device, equipment and storage medium | |
CN111292333A (en) | Method and apparatus for segmenting an image | |
CN115690143B (en) | Image segmentation method, device, electronic equipment and storage medium | |
CN114724144B (en) | Text recognition method, training device, training equipment and training medium for model | |
CN115482248B (en) | Image segmentation method, device, electronic equipment and storage medium | |
CN116761020A (en) | Video processing method, device, equipment and medium | |
CN116363444A (en) | Fuzzy classification model training method, fuzzy image recognition method and device | |
CN116306895A (en) | Training method and device for image classification model, electronic equipment and storage medium | |
CN112560848B (en) | Training method and device for POI (Point of interest) pre-training model and electronic equipment | |
CN115565186A (en) | Method and device for training character recognition model, electronic equipment and storage medium | |
CN115312042A (en) | Method, apparatus, device and storage medium for processing audio | |
CN114842541A (en) | Model training and face recognition method, device, equipment and storage medium | |
CN114120410A (en) | Method, apparatus, device, medium and product for generating label information | |
CN114463361A (en) | Network model training method, device, equipment, medium and program product | |
CN114093006A (en) | Training method, device and equipment of living human face detection model 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 |