WO2022227169A1 - Image classification method and apparatus, and electronic device and storage medium - Google Patents

Image classification method and apparatus, and electronic device and storage medium Download PDF

Info

Publication number
WO2022227169A1
WO2022227169A1 PCT/CN2021/096513 CN2021096513W WO2022227169A1 WO 2022227169 A1 WO2022227169 A1 WO 2022227169A1 CN 2021096513 W CN2021096513 W CN 2021096513W WO 2022227169 A1 WO2022227169 A1 WO 2022227169A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
image classification
classification network
annotation
guessing
Prior art date
Application number
PCT/CN2021/096513
Other languages
French (fr)
Chinese (zh)
Inventor
刘杰
王健宗
瞿晓阳
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022227169A1 publication Critical patent/WO2022227169A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • 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

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to an image classification method, apparatus, electronic device, and computer-readable storage medium.
  • Semi-supervised methods can reduce the labeling burden.
  • Semi-supervised methods can use a large amount of unlabeled data and a small amount of labeled data to enhance the performance of the model.
  • an important goal in semi-supervised learning is to avoid the network overfitting on small-scale labeled data.
  • a common necessary assumption to achieve this is the smoothness and consistency of the function fitted by the network, i.e., similar points in the manifold should predict the same label. For example, self-ensembling penalizes inconsistent predictions on unlabeled data with local perturbations, while adversarial learning maintains consistency by forcing the same predictions on different inputs with adversarial perturbations.
  • An image classification method provided by this application includes:
  • the original image set includes an annotated image set and an unlabeled image set
  • the images to be classified are classified by using the standard image classification network to obtain an image classification result.
  • the present application also provides an image classification device, the device comprising:
  • an image acquisition module configured to acquire an original image set, wherein the original image set includes a marked image set and an unmarked image set;
  • An annotation guessing module configured to perform annotation guessing on the images in the unlabeled image set, obtain an annotation guess image set, summarize the annotated guess image set and the annotated image set, and obtain an image training set;
  • the hybrid layer building module is used to construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
  • a model training module for training the hybrid image classification network using the image training set to obtain a standard image classification network
  • the image classification module is used for classifying the images to be classified by using the standard image classification network to obtain image classification results.
  • the present application also provides an electronic device, the electronic device comprising:
  • a processor that executes the instructions stored in the memory to achieve the following steps:
  • the original image set includes an annotated image set and an unlabeled image set
  • the images to be classified are classified by using the standard image classification network to obtain an image classification result.
  • the present application also provides a computer-readable storage medium, where the computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the following steps:
  • the original image set includes an annotated image set and an unlabeled image set
  • the images to be classified are classified by using the standard image classification network to obtain an image classification result.
  • FIG. 1 is a schematic flowchart of an image classification method provided by an embodiment of the present application.
  • Fig. 2 is a detailed implementation flow diagram of one of the steps in Fig. 1;
  • Fig. 3 is the detailed implementation flow schematic diagram of another step in Fig. 1;
  • Fig. 4 is a detailed implementation flow diagram of another step in Fig. 1;
  • FIG. 5 is a functional block diagram of an image classification apparatus provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an electronic device implementing the image classification method according to an embodiment of the present application.
  • the embodiment of the present application provides an image classification method.
  • the execution subject of the image classification method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal.
  • the image classification method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
  • the image classification method includes:
  • the original image set may be a medical image in the medical field.
  • the original image may be an MRI (magnetic resonance) image or a CT image of a tumor.
  • the labeled image set includes the labeled image X and its corresponding label Y
  • the unlabeled image set includes the unlabeled image U.
  • performing annotated guessing on the images in the unlabeled image set to obtain annotated guessing image set including:
  • the pre-built generative adversarial network may be a generative adversarial network (GAN, Generative Adversarial Networks), and the generative adversarial network is a deep learning model, including a generative model (Generative Model) and a discriminant network.
  • Model Discriminative Model
  • the generation model is used to generate a simulated forward face image set based on a real head tilted face image set.
  • the discriminant model is used to judge whether the simulated positive face image set and the real positive face image set are true or false, until the discriminant model cannot distinguish the true and false positive face images well, the description is generated.
  • the model can better correct the head tilted face image to the point where it can almost simulate the frontal face image with falsehood. That is, the task of the generative adversarial network (GAN) is to make the discriminant model (D) have a worse and worse discriminative ability of the simulated positive face image generated by the generative model (G), that is, to maximize (max) the discriminant model (D). ) error, and at the same time hope that the gap between the simulated positive face image generated by the generative model (G) based on the tilted face image and the real positive face image is getting smaller and smaller, that is, to minimize (min) the generative model ( G) error.
  • GAN generative adversarial network
  • this method based on generative adversarial network synthesis is more complicated than the traditional data enhancement technology, but the generated samples are more diverse, and can also be applied to various image editing, image denoising, etc. scene, improving the applicability.
  • using a preset annotation guessing formula to perform annotation guessing on the enhanced image to obtain an annotation guessing image including:
  • q b represents the guessed annotation of the unlabeled image
  • ub represents the unlabeled image set
  • ub ,m represents the m-th image in the unlabeled image set
  • f(ub ,m ; ⁇ ) represents the network fitting of the parameter ⁇
  • the function takes the mth image of ub as the input and output
  • M represents the number of data enhancements.
  • an image training set including:
  • a preset number of images are randomly selected from the original training set as the image training set.
  • the memory may not be able to load or may not be able to perform calculations, randomly selecting a part of the data from the original training set as the image training set can improve the model training speed.
  • the preset image classification network may be VGGNet, which is a type of deep convolutional neural network.
  • VGGNet all use 3*3 convolution kernels And the 2*2 pooling kernel, the performance is improved by continuously deepening the network structure.
  • the increase in the number of network layers will not bring about an explosion in the amount of parameters, because the amount of parameters is mainly concentrated in the last three fully connected layers.
  • the representation hybrid layer is constructed in the preset image classification network to obtain a hybrid image classification network, including:
  • a series of intermediate layers may be selected from the image classification network to form a set, and one layer is randomly selected from the set as the representation mixing layer, and the representation mixing layer is used to combine the input
  • the mixed data (including labeled data and unlabeled data) to this layer is represented and mixed.
  • the encoding layer is used for encoding data in the image training set into the representation mixing layer, and the decoding layer is used for decoding the mixed representation.
  • the smoothness of the network can be improved, thereby improving the classification accuracy of the image classification network.
  • the hybrid image classification network is trained by using the image training set to obtain a standard image classification network, including:
  • the image training set includes a bunch of random training pairs (x 1 , y 1 ) and (x 2 , y 2 ), and x 1 and x 2 may all be labeled images or none of them are labeled images. , or a labeled image and an unlabeled image, y 1 , y 2 are the corresponding labels, among which, the labeled images correspond to the real labels, and the unlabeled images correspond to the guess labels.
  • the use of the representation mixing layer in the hybrid image classification network to linearly mix the latent representation pairs to obtain linearly mixed latent representation pairs including:
  • e l (x)′ ⁇ ′ ⁇ e l (x 1 )+(1- ⁇ ′) ⁇ e l (x 2 )
  • ( el (x)′) represents the linear mixture image
  • y′ represents the linear mixture label
  • is the hyperparameter that determines the Beta distribution
  • ⁇ ′ is to make e l (x)′ closer to e l (x 1 )
  • (e l (x 1 ), y 1 ) and ( el (x 2 ), y 2 ) are pairs of latent representations
  • e l represents the encoding layer
  • x 1 , x 2 are any two images in the image training set
  • y 1 , y 2 are the labels corresponding to the images x 1 and x 2 , respectively.
  • calculating the loss value according to the pair of linear mixed latent representations includes:
  • the first loss function is used to calculate the linear hybrid latent The loss item of the representation pair; when the difference between the linear mixed annotation in the linear mixed implicit representation pair and the real annotation of the labeled image is less than or equal to the preset threshold, it means that the mixed data is close to the unlabeled data, then the second loss is used
  • the function computes a loss term for the pair of linear mixed latent representations.
  • the first loss function L X may be a cross entropy (CE) loss:
  • B is the image training set
  • X is the labeled image
  • l is the representation mixing layer
  • S is the middle layer
  • dl is the decoding layer.
  • the second loss function LU may be L 2 loss:
  • B is the image training set
  • U is the unlabeled image
  • l is the representation mixing layer
  • S is the intermediate layer
  • dl is the decoding layer.
  • the total loss function may be:
  • ⁇ U is a manually defined hyperparameter weight term.
  • the image to be classified may be an unlabeled image in the medical field (for example, an MRI (nuclear magnetic resonance) image or a CT image of a tumor), and the standard image classification network is used to predict the label of the unlabeled image. sort.
  • the image classification result includes classified images and labels corresponding to the classified images.
  • an image training set is obtained by annotating and guessing images in an unmarked image set to obtain a marked guessing image set, and by summarizing the marked guessing image set and the marked image set, which can improve the diversity of training data.
  • a representation mixing layer is constructed in the preset image classification network to obtain a mixed image classification network.
  • the labeled data and unlabeled data in the image training set can be linearly mixed, and the mixed data can be used to perform linear mixing. Training can improve the smoothness and consistency of network fitting, thereby improving the performance of the network and making the network classification more accurate.
  • the mixed data in this application includes labeled and unlabeled data, so the global smoothness and smoothness of the network between different data points can be adjusted. Consistency is constrained to further improve the accuracy of image classification. Therefore, the embodiments of the present application can solve the problem of low image classification accuracy.
  • FIG. 5 it is a functional block diagram of an image classification apparatus provided by an embodiment of the present application.
  • the image classification apparatus 100 described in this application can be installed in an electronic device. According to the implemented functions, the image classification apparatus 100 may include an image acquisition module 101 , an annotation guessing module 102 , a hybrid layer construction module 103 , a model training module 104 and an image classification module 105 .
  • the modules described in this application may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of an electronic device and can perform fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the image acquisition module 101 is configured to acquire an original image set, wherein the original image set includes a marked image set and an unmarked image set.
  • the original image set may be a medical image in the medical field.
  • the original image may be an MRI (magnetic resonance) image or a CT image of a tumor.
  • the labeled image set includes the labeled image X and its corresponding label Y
  • the unlabeled image set includes the unlabeled image U.
  • the annotation guessing module 102 is configured to perform annotation guessing on the images in the unannotated image set to obtain an annotated guess image set, and summarize the annotated guess image set and the annotated image set to obtain an image training set.
  • annotation guessing module 102 obtains an annotation guessing image set through the following operations:
  • the annotated guess images are aggregated to obtain the annotated guess image set.
  • the pre-built generative adversarial network may be a generative adversarial network (GAN, Generative Adversarial Networks), and the generative adversarial network is a deep learning model, including a generative model (Generative Model) and a discriminant network.
  • Model Discriminative Model
  • the generation model is used to generate a simulated forward face image set based on a real head tilted face image set.
  • the discriminant model is used to judge whether the simulated positive face image set and the real positive face image set are true or false, until the discriminant model cannot distinguish the true and false positive face images well, the description is generated.
  • the model can better correct the head tilted face image to almost simulate the positive face image with a fake one. That is, the task of the generative adversarial network (GAN) is to make the discriminant model (D) have a worse and worse discriminative ability of the simulated positive face image generated by the generative model (G), that is, to maximize (max) the discriminant model (D). ) error, and at the same time hope that the gap between the simulated positive face image generated by the generative model (G) based on the tilted face image and the real positive face image is getting smaller and smaller, that is, to minimize (min) the generative model ( G) error.
  • GAN generative adversarial network
  • this method based on generative adversarial network synthesis is more complicated than the traditional data enhancement technology, but the generated samples are more diverse, and can also be applied to various image editing, image denoising, etc. scene, improving the applicability.
  • the annotation guessing module 102 obtains an annotation guessing image through the following operations:
  • q b represents the guessed annotation of the unlabeled image
  • ub represents the unlabeled image set
  • ub ,m represents the m-th image in the unlabeled image set
  • f(ub ,m ; ⁇ ) represents the network fitting of the parameter ⁇
  • the function takes the mth image of ub as the input and output
  • M represents the number of data enhancements.
  • the label guessing module 102 obtains the image training set through the following operations:
  • a preset number of images are randomly selected from the original training set as the image training set.
  • the memory may not be able to load or may not be able to perform calculations, randomly selecting a part of the data from the original training set as the image training set can improve the model training speed.
  • the hybrid layer construction module 103 is used to construct a representation hybrid layer in a preset image classification network to obtain a hybrid image classification network.
  • the preset image classification network may be VGGNet, which is a type of deep convolutional neural network.
  • VGGNet all use 3*3 convolution kernels And the 2*2 pooling kernel, the performance is improved by continuously deepening the network structure.
  • the increase in the number of network layers will not bring about an explosion in the amount of parameters, because the amount of parameters is mainly concentrated in the last three fully connected layers.
  • the hybrid layer building module 103 obtains the hybrid image classification network through the following operations:
  • a layer is randomly selected as the representation mixing layer in the image classification network
  • the encoding layer, the representation mixing layer and the decoding layer are aggregated to obtain the mixed image classification network.
  • a series of intermediate layers may be selected from the image classification network to form a set, and one layer is randomly selected from the set as the representation mixing layer, and the representation mixing layer is used to combine the input
  • the mixed data (including labeled data and unlabeled data) to this layer is represented and mixed.
  • the encoding layer is used for encoding data in the image training set into the representation mixing layer, and the decoding layer is used for decoding the mixed representation.
  • the smoothness of the network can be improved, thereby improving the classification accuracy of the image classification network.
  • the model training module 104 is configured to use the image training set to train the hybrid image classification network to obtain a standard image classification network.
  • model training module 104 obtains a standard image classification network through the following operations:
  • the latent representation pair is linearly mixed by using the representation mixing layer in the mixed image classification network to obtain a linear mixed latent representation pair;
  • a loss value is calculated according to the linear mixed latent representation pair, and when the loss value is less than a preset loss threshold, the standard image classification network is obtained.
  • the image training set includes a bunch of random training pairs (x 1 , y 1 ) and (x 2 , y 2 ), and x 1 and x 2 may all be labeled images or none of them are labeled images. , or a labeled image and an unlabeled image, y 1 , y 2 are the corresponding labels, among which, the labeled images correspond to the real labels, and the unlabeled images correspond to the guess labels.
  • the model training module 104 obtains a pair of linear mixed latent representations through the following operations:
  • e l (x)′ ⁇ ′ ⁇ e l (x 1 )+(1- ⁇ ′) ⁇ e l (x 2 )
  • ( el (x)′) represents the linear mixture image
  • y′ represents the linear mixture label
  • is the hyperparameter that determines the Beta distribution
  • ⁇ ′ is to make e l (x)′ closer to e l (x 1 )
  • (e l (x 1 ), y 1 ) and ( el (x 2 ), y 2 ) are pairs of latent representations
  • e l represents the encoding layer
  • x 1 , x 2 are any two images in the image training set
  • y 1 , y 2 are the labels corresponding to the images x 1 and x 2 , respectively.
  • model training module 104 calculates the loss value through the following operations:
  • the first loss function is used to calculate the linear hybrid latent The loss item of the representation pair; when the difference between the linear mixed annotation in the linear mixed implicit representation pair and the real annotation of the labeled image is less than or equal to the preset threshold, it means that the mixed data is close to the unlabeled data, then the second loss is used
  • the function computes a loss term for the pair of linear mixed latent representations.
  • the first loss function L X may be a cross entropy (CE) loss:
  • B is the image training set
  • X is the labeled image
  • l is the representation mixing layer
  • S is the middle layer
  • dl is the decoding layer.
  • the second loss function LU may be L 2 loss:
  • B is the image training set
  • U is the unlabeled image
  • l is the representation mixing layer
  • S is the intermediate layer
  • dl is the decoding layer.
  • the total loss function may be:
  • ⁇ U is a manually defined hyperparameter weight term.
  • the image classification module 105 is configured to use the standard image classification network to classify the images to be classified to obtain an image classification result.
  • the image to be classified may be an unlabeled image in the medical field (for example, an MRI (nuclear magnetic resonance) image or a CT image of a tumor), and the standard image classification network is used to predict the label of the unlabeled image. sort.
  • the image classification result includes classified images and labels corresponding to the classified images.
  • FIG. 6 it is a schematic structural diagram of an electronic device for implementing an image classification method provided by an embodiment of the present application, including a processor 111 , a communication interface 112 , a memory 113 and a communication bus 114 , wherein the processor 111 , the communication interface 112 , the memory 113 completes the communication with each other through the communication bus 114,
  • the memory 113 is used to store computer programs, such as image classification programs;
  • the processor 111 is configured to implement the image classification method provided by any one of the foregoing method embodiments when executing the program stored in the memory 113, including:
  • the original image set includes an annotated image set and an unlabeled image set
  • the images to be classified are classified by using the standard image classification network to obtain an image classification result.
  • the above-mentioned communication bus 114 may be a Peripheral Component Interconnect (PCI for short) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA for short) bus or the like.
  • the communication bus 114 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the communication interface 112 is used for communication between the above-mentioned electronic device and other devices.
  • the memory 113 may include random access memory (Random Access Memory, RAM for short), or may include non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM Random Access Memory
  • non-volatile memory such as at least one disk memory.
  • the memory 113 may also be at least one storage device located away from the aforementioned processor 111 .
  • the above-mentioned processor 111 may be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor (referred to as NP), etc.; it may also be a digital signal processor (Digital Signal Processing, referred to as DSP), an application-specific integrated circuit (ApplicationSpecificIntegratedCircuit, ASIC for short), Field-Programmable Gate Array (Field-ProgrammableGateArray, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC ApplicationSpecificIntegratedCircuit
  • FPGA Field-ProgrammableGateArray
  • the present application also provides a computer-readable storage medium, where the computer-readable storage medium may be non-volatile or volatile.
  • the computer-readable storage medium stores a computer program, and when the computer program is executed by the processor of the electronic device, it can realize:
  • the original image set includes an annotated image set and an unlabeled image set
  • the images to be classified are classified by using the standard image classification network to obtain an image classification result.
  • modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

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

Abstract

Provided is an image classification method, which relates to artificial intelligence technology. The method comprises: acquiring an original image set, wherein the original image set comprises an image set with annotations and an image set without annotations; performing annotation speculation on images in the image set without annotations, so as to obtain an annotation speculation image set, and summarizing the annotation speculation image set and the image set with annotations, so as to obtain an image training set; constructing a representation mixing layer in a preset image classification network, so as to obtain a mixed image classification network; training the mixed image classification network by using the image training set, so as to obtain a standard image classification network; and classifying, by using the standard image classification network, an image to be classified, so as to obtain an image classification result. In addition, blockchain technology is also involved, and the image classification result can be stored in a node of a blockchain. Further provided are an image classification apparatus, and an electronic device and a computer-readable storage medium. By means of the method, the problem of the relatively low accuracy of image classification can be solved.

Description

图像分类方法、装置、电子设备及存储介质Image classification method, device, electronic device and storage medium
本申请要求于2021年4月28日提交中国专利局、申请号为CN202110465701.2、名称为“图像分类方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number CN202110465701.2 and the title of "Image Classification Method, Apparatus, Electronic Equipment and Storage Medium" filed with the China Patent Office on April 28, 2021, the entire contents of which are by reference Incorporated in this application.
技术领域technical field
本申请涉及人工智能技术领域,尤其涉及一种图像分类方法、装置、电子设备及计算机可读存储介质。The present application relates to the technical field of artificial intelligence, and in particular, to an image classification method, apparatus, electronic device, and computer-readable storage medium.
背景技术Background technique
深度学习时代到来后,图像分类领域出现了一系列的突破,然而,这种突破是建立在有着大规模有标注数据集的基础上的。而大规模有标注数据集,则是一种奢侈。在类如医学图像领域,图像标注往往要花费领域专家的大量时间。专家间的认知差异也会导致标注出现噪声,而为了消除这种噪声则需要更多的专家进行盲标注。After the arrival of the deep learning era, there have been a series of breakthroughs in the field of image classification. However, these breakthroughs are based on large-scale annotated datasets. Large-scale labeled datasets are a luxury. In domains such as medical images, image annotation often takes a lot of time from domain experts. Cognitive differences among experts can also lead to noise in the annotation, and in order to eliminate this noise, more experts are required to perform blind annotation.
使用半监督学***滑性和一致性,即流形中相近的点应预测出相同的标注。举例来说,self-ensembling对在有局部扰动的无标注数据上出现不一致的预测进行惩罚,而对抗学***滑性做出了规范,并没有考虑到对不同数据点间的网络的全局平滑性和一致性进行约束,使得网络性能较低,导致图像分类准确性较低。Using semi-supervised learning methods can reduce the labeling burden. Semi-supervised methods can use a large amount of unlabeled data and a small amount of labeled data to enhance the performance of the model. However, an important goal in semi-supervised learning is to avoid the network overfitting on small-scale labeled data. A common necessary assumption to achieve this is the smoothness and consistency of the function fitted by the network, i.e., similar points in the manifold should predict the same label. For example, self-ensembling penalizes inconsistent predictions on unlabeled data with local perturbations, while adversarial learning maintains consistency by forcing the same predictions on different inputs with adversarial perturbations. However, the inventor found that these methods only consider the disturbance around a single data point, that is, only the local smoothness of a single data point is specified, and the global smoothness and consistency of the network between different data points are not considered. Constraints, making the network performance lower, resulting in lower image classification accuracy.
发明内容SUMMARY OF THE INVENTION
本申请提供的一种图像分类方法,包括:An image classification method provided by this application includes:
获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集;obtaining an original image set, wherein the original image set includes an annotated image set and an unlabeled image set;
对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集;Carrying out annotated guessing on the images in the unlabeled image set to obtain an annotated guess image set, summarizing the annotated guess image set and the annotated image set to obtain an image training set;
在预设的图像分类网络中构建表征混合层,得到混合图像分类网络;Construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络;Use the image training set to train the hybrid image classification network to obtain a standard image classification network;
利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The images to be classified are classified by using the standard image classification network to obtain an image classification result.
本申请还提供一种图像分类装置,所述装置包括:The present application also provides an image classification device, the device comprising:
图像获取模块,用于获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集;an image acquisition module, configured to acquire an original image set, wherein the original image set includes a marked image set and an unmarked image set;
标注猜测模块,用于对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集;An annotation guessing module, configured to perform annotation guessing on the images in the unlabeled image set, obtain an annotation guess image set, summarize the annotated guess image set and the annotated image set, and obtain an image training set;
混合层构建模块,用于在预设的图像分类网络中构建表征混合层,得到混合图像分类网络;The hybrid layer building module is used to construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
模型训练模块,用于利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络;a model training module for training the hybrid image classification network using the image training set to obtain a standard image classification network;
图像分类模块,用于利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The image classification module is used for classifying the images to be classified by using the standard image classification network to obtain image classification results.
本申请还提供一种电子设备,所述电子设备包括:The present application also provides an electronic device, the electronic device comprising:
存储器,存储至少一个指令;及a memory that stores at least one instruction; and
处理器,执行所述存储器中存储的指令以实现如下步骤:A processor that executes the instructions stored in the memory to achieve the following steps:
获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集;obtaining an original image set, wherein the original image set includes an annotated image set and an unlabeled image set;
对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集;Carrying out annotated guessing on the images in the unlabeled image set to obtain an annotated guess image set, summarizing the annotated guess image set and the annotated image set to obtain an image training set;
在预设的图像分类网络中构建表征混合层,得到混合图像分类网络;Construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络;Use the image training set to train the hybrid image classification network to obtain a standard image classification network;
利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The images to be classified are classified by using the standard image classification network to obtain an image classification result.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现如下步骤:The present application also provides a computer-readable storage medium, where the computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the following steps:
获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集;obtaining an original image set, wherein the original image set includes an annotated image set and an unlabeled image set;
对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集;Carrying out annotated guessing on the images in the unlabeled image set to obtain an annotated guess image set, summarizing the annotated guess image set and the annotated image set to obtain an image training set;
在预设的图像分类网络中构建表征混合层,得到混合图像分类网络;Construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络;Use the image training set to train the hybrid image classification network to obtain a standard image classification network;
利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The images to be classified are classified by using the standard image classification network to obtain an image classification result.
附图说明Description of drawings
图1为本申请一实施例提供的图像分类方法的流程示意图;1 is a schematic flowchart of an image classification method provided by an embodiment of the present application;
图2为图1中其中一个步骤的详细实施流程示意图;Fig. 2 is a detailed implementation flow diagram of one of the steps in Fig. 1;
图3为图1中另一个步骤的详细实施流程示意图;Fig. 3 is the detailed implementation flow schematic diagram of another step in Fig. 1;
图4为图1中另一个步骤的详细实施流程示意图;Fig. 4 is a detailed implementation flow diagram of another step in Fig. 1;
图5为本申请一实施例提供的图像分类装置的功能模块图;FIG. 5 is a functional block diagram of an image classification apparatus provided by an embodiment of the present application;
图6为本申请一实施例提供的实现所述图像分类方法的电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device implementing the image classification method according to an embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the purpose of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请实施例提供一种图像分类方法。所述图像分类方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述图像分类方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。The embodiment of the present application provides an image classification method. The execution subject of the image classification method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal. In other words, the image classification method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
参照图1所示,为本申请一实施例提供的图像分类方法的流程示意图。在本实施例中,所述图像分类方法包括:Referring to FIG. 1 , a schematic flowchart of an image classification method provided by an embodiment of the present application is shown. In this embodiment, the image classification method includes:
S1、获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集。S1. Acquire an original image set, wherein the original image set includes a labeled image set and an unlabeled image set.
本申请实施例中,所述原始图像集可以为医疗领域的医学图像,比如,临床医疗领域中,所述原始图像可以为肿瘤的MRI(核磁共振)图像或CT图像。In the embodiment of the present application, the original image set may be a medical image in the medical field. For example, in the clinical medical field, the original image may be an MRI (magnetic resonance) image or a CT image of a tumor.
其中,本申请实施例中,有标注图像集中包括有标注图像X及其对应的标注Y,无标注图像集中包括无标注图像U。Among them, in the embodiment of the present application, the labeled image set includes the labeled image X and its corresponding label Y, and the unlabeled image set includes the unlabeled image U.
S2、对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集。S2. Perform annotated guessing on the images in the unlabeled image set to obtain an annotated guess image set, and summarize the annotated guess image set and the labeled image set to obtain an image training set.
具体地,参照图2所示,所述对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,包括:Specifically, referring to FIG. 2 , performing annotated guessing on the images in the unlabeled image set to obtain annotated guessing image set, including:
S20、利用预构建的生成对抗网络,对所述无标注图像集中的图像进行预设次数的数据增强处理,得到增强图像;S20, using a pre-built generative adversarial network to perform data enhancement processing on the images in the unlabeled image set for a preset number of times to obtain an enhanced image;
S21、利用预设的标注猜测公式对所述增强图像进行标注猜测,得到标注猜测图像;S21, using a preset annotation guessing formula to perform annotation guessing on the enhanced image to obtain an annotation guessing image;
S22、汇总所述标注猜测图像得到所述标注猜测图像集。S22. Summarize the annotated guess images to obtain the annotated guess image set.
本申请实施例中,所述预构建的生成对抗网络可以为生成式对抗网络(GAN,Generative Adversarial Networks),所述生成式对抗网络是一种深度学习模型,包括生成模型(Generative Model)和判别模型(Discriminative Model),以人脸图像为例,所述生成模型用来依据真实的歪头人脸图像集生成模拟的正向人脸图像集。所述判别模型用来判断所述模拟的正向人脸图像集和真实的正向人脸图像集的真假,直至判别模型无法很好地辨别真假正向人脸图像的时候,说明生成模型可以较好地将歪头人脸图像矫正至几乎可以以假乱真的模拟正向人脸图像。即生成式对抗网络(GAN)的任务是要让判别模型(D)对生成模型(G)生成的模拟正向人脸图像的判别能力越来越差,即最大化(max)判别模型(D)的误差,同时又希望让生成模型(G)基于歪头人脸图像生成的模拟正向人脸图像与真实正向人脸图像的差距越来越小,即最小化(min)生成模型(G)的误差。In the embodiment of the present application, the pre-built generative adversarial network may be a generative adversarial network (GAN, Generative Adversarial Networks), and the generative adversarial network is a deep learning model, including a generative model (Generative Model) and a discriminant network. Model (Discriminative Model), taking a face image as an example, the generation model is used to generate a simulated forward face image set based on a real head tilted face image set. The discriminant model is used to judge whether the simulated positive face image set and the real positive face image set are true or false, until the discriminant model cannot distinguish the true and false positive face images well, the description is generated. The model can better correct the head tilted face image to the point where it can almost simulate the frontal face image with falsehood. That is, the task of the generative adversarial network (GAN) is to make the discriminant model (D) have a worse and worse discriminative ability of the simulated positive face image generated by the generative model (G), that is, to maximize (max) the discriminant model (D). ) error, and at the same time hope that the gap between the simulated positive face image generated by the generative model (G) based on the tilted face image and the real positive face image is getting smaller and smaller, that is, to minimize (min) the generative model ( G) error.
本申请实施例中,这种基于生成式对抗网络合成的方法相比于传统的数据增强技术虽然过程更加复杂,但是生成的样本更加多样,同时还可以应用于图像编辑,图像去噪等各种场景,提高了应用性。In the embodiment of this application, this method based on generative adversarial network synthesis is more complicated than the traditional data enhancement technology, but the generated samples are more diverse, and can also be applied to various image editing, image denoising, etc. scene, improving the applicability.
本申请一可选实施例中,所述利用预设的标注猜测公式对所述增强图像进行标注猜测,得到标注猜测图像,包括:In an optional embodiment of the present application, using a preset annotation guessing formula to perform annotation guessing on the enhanced image to obtain an annotation guessing image, including:
利用下述猜测公式对所述增强图像进行标注猜测,得到标注猜测图像:Use the following guessing formula to perform annotated guessing on the enhanced image to obtain annotated guessing image:
Figure PCTCN2021096513-appb-000001
Figure PCTCN2021096513-appb-000001
其中,q b表示无标注图像的猜测标注,u b表示无标注图像集,u b,m表示无标注图像集中第m个图像,f(u b,m;θ)表示参数θ的网络拟合函数对u b的第m个图像为输入的输出,M表示数据增强的次数。 Among them, q b represents the guessed annotation of the unlabeled image, ub represents the unlabeled image set, ub ,m represents the m-th image in the unlabeled image set, and f(ub ,m ; θ) represents the network fitting of the parameter θ The function takes the mth image of ub as the input and output, and M represents the number of data enhancements.
具体地,所述汇总所述标记猜测图像集及所述有标注图像集,得到图像训练集,包括:Specifically, by summarizing the labeled guess image set and the labeled image set, an image training set is obtained, including:
汇总所述标记猜测图像集及所述有标注图像集,得到原始训练集;Summarize the labeled guess image set and the labeled image set to obtain the original training set;
从所述原始训练集中随机选取预设数量的图像作为所述图像训练集。A preset number of images are randomly selected from the original training set as the image training set.
本申请一可选实施例中,因为全部的原始训练集的数据太大,内存可能无法加载也可能无法进行计算,从原始训练集中随机选取一部分数据作为图像训练集,可以提高模型训练速度。In an optional embodiment of the present application, because the data of all the original training sets is too large, the memory may not be able to load or may not be able to perform calculations, randomly selecting a part of the data from the original training set as the image training set can improve the model training speed.
S3、在预设的图像分类网络中构建表征混合层,得到混合图像分类网络。S3 , constructing a mixed representation layer in a preset image classification network to obtain a mixed image classification network.
本申请实施例中,所述预设的图像分类网络可以为为VGGNet,所述VGGNet是深度卷积神经网络的一种,相较于一般的神经网络,VGGNet全部使用3*3的卷积核和2*2的池化核,通过不断加深网络结构来提升性能,同时网络层数的增长并不会带来参数量上的***,因为参数量主要集中在最后三个全连接层中。In the embodiment of the present application, the preset image classification network may be VGGNet, which is a type of deep convolutional neural network. Compared with general neural networks, VGGNet all use 3*3 convolution kernels And the 2*2 pooling kernel, the performance is improved by continuously deepening the network structure. At the same time, the increase in the number of network layers will not bring about an explosion in the amount of parameters, because the amount of parameters is mainly concentrated in the last three fully connected layers.
具体地,参照图3所示,所述在预设的图像分类网络中构建表征混合层,得到混合图像分类网络,包括:Specifically, as shown in FIG. 3 , the representation hybrid layer is constructed in the preset image classification network to obtain a hybrid image classification network, including:
S30、在所述图像分类网络中随机选取一层作为表征混合层;S30, randomly select a layer in the image classification network as the representation mixing layer;
S31、将所述表征混合层之前的网络设置为编码层,及将所述表征混合层之后的网络设置为解码层;S31, setting the network before the characterization mixing layer as an encoding layer, and setting the network after the characterization mixing layer as a decoding layer;
S32、汇总所述编码层、所述表征混合层及所述解码层,得到所述混合图像分类网络。S32. Summarize the encoding layer, the representation mixing layer and the decoding layer to obtain the mixed image classification network.
本申请一可选实施例中,可以从所述图像分类网络中选择一系列中间层组成集合,并在该集合中随机选择一层作为所述表征混合层,所述表征混合层用来将输入到该层的混合数据(包括有标注数据及无标注数据)进行表征混合。所述编码层用来将所述图像训练集中的数据编码到所述表征混合层,所述解码层用来对混合后的表征进行解码。In an optional embodiment of the present application, a series of intermediate layers may be selected from the image classification network to form a set, and one layer is randomly selected from the set as the representation mixing layer, and the representation mixing layer is used to combine the input The mixed data (including labeled data and unlabeled data) to this layer is represented and mixed. The encoding layer is used for encoding data in the image training set into the representation mixing layer, and the decoding layer is used for decoding the mixed representation.
本申请实施例中,通过在输入空间进行初次混合(即从原始训练集中随机选取一定数 量的图像作为图像训练集),及在所述表征混合层对有标注数据及无标注数据进行表征混合,可以提高网络的平滑性,进而提高图像分类网络的分类准确性。In the embodiment of the present application, by performing initial mixing in the input space (that is, randomly selecting a certain number of images from the original training set as the image training set), and characterizing and mixing the labeled data and the unlabeled data in the characterization mixing layer, The smoothness of the network can be improved, thereby improving the classification accuracy of the image classification network.
S4、利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络。S4. Use the image training set to train the hybrid image classification network to obtain a standard image classification network.
详细地,参照图4所示,所述利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络,包括:In detail, as shown in FIG. 4 , the hybrid image classification network is trained by using the image training set to obtain a standard image classification network, including:
S40、利用所述混合图像分类网络中的编码层对所述图像训练集中图像对应的标注进行表征编码,得到隐表征对;S40, using the coding layer in the hybrid image classification network to characterize and encode the labels corresponding to the images in the image training set to obtain pairs of latent representations;
S41、利用所述混合图像分类网络中的表征混合层对所述隐表征对进行线性混合,得到线性混合隐表征对;S41, using the representation mixing layer in the mixed image classification network to linearly mix the latent representation pairs to obtain linearly mixed latent representation pairs;
S42、根据所述线性混合隐表征对计算损失值,当所述损失值小于预设的损失阈值时,得到所述标准图像分类网络。S42. Calculate a loss value according to the linear mixed latent representation pair, and obtain the standard image classification network when the loss value is less than a preset loss threshold.
本申请实施例中,所述图像训练集中包括一堆随机的训练对(x 1,y 1)和(x 2,y 2),x 1,x 2可以全是有标注图像或都无标注图像,也可以一个有标注图像一个无标注图像,y 1,y 2为对应的标注,其中,有标注图像对应的为真实标注,无标注图像对应的是猜测标注。利用所述编码层对所述训练对(x 1,y 1)和(x 2,y 2)进行编码,得到隐表征对(e l(x 1),y 1)和(e l(x 2),y 2),e l表示编码层。 In the embodiment of the present application, the image training set includes a bunch of random training pairs (x 1 , y 1 ) and (x 2 , y 2 ), and x 1 and x 2 may all be labeled images or none of them are labeled images. , or a labeled image and an unlabeled image, y 1 , y 2 are the corresponding labels, among which, the labeled images correspond to the real labels, and the unlabeled images correspond to the guess labels. Use the encoding layer to encode the training pairs (x 1 , y 1 ) and (x 2 , y 2 ) to obtain latent representation pairs ( el (x 1 ), y 1 ) and ( el (x 2 ) ), y 2 ), e l represents the coding layer.
本申请实施例中,所述利用所述混合图像分类网络中的表征混合层对所述隐表征对进行线性混合,得到线性混合隐表征对,包括:In the embodiment of the present application, the use of the representation mixing layer in the hybrid image classification network to linearly mix the latent representation pairs to obtain linearly mixed latent representation pairs, including:
通过下述公式计算线性混合隐表征对((e l(x)′),y′): The linear mixed latent representation pair ((e l (x)′),y′) is calculated by the following formula:
e l(x)′=λ′·e l(x 1)+(1-λ′)·e l(x 2) e l (x)′=λ′·e l (x 1 )+(1-λ′)·e l (x 2 )
y′=λ′·y 1+(1-λ′)·y 1 y′=λ′·y 1 +(1-λ′)·y 1
λ′=max(λ,1-λ)λ′=max(λ,1-λ)
λ~Beta(α,α)λ~Beta(α,α)
其中,(e l(x)′)表示线性混合图像,y′表示线性混合标注,α是决定Beta分布的超参数,λ′是为了使e l(x)′更接近e l(x 1),(e l(x 1),y 1)和(e l(x 2),y 2)为隐表征对,e l表示编码层,x 1,x 2是图像训练集中的任意两个图像,y 1,y 2分别为图像x 1,x 2对应的标注。 where ( el (x)′) represents the linear mixture image, y′ represents the linear mixture label, α is the hyperparameter that determines the Beta distribution, and λ′ is to make e l (x)′ closer to e l (x 1 ) , (e l (x 1 ), y 1 ) and ( el (x 2 ), y 2 ) are pairs of latent representations, e l represents the encoding layer, x 1 , x 2 are any two images in the image training set, y 1 , y 2 are the labels corresponding to the images x 1 and x 2 , respectively.
进一步地,所述根据所述线性混合隐表征对计算损失值,包括:Further, calculating the loss value according to the pair of linear mixed latent representations includes:
利用均方差方法计算所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值;Calculate the difference between the linear mixed annotation in the linear mixed latent representation pair and the real annotation of the labeled image by using the mean square error method;
当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值大于预设的阈值时,使用第一损失函数计算所述线性混合隐表征对的损失项;When the difference between the linear mixed annotation in the linear mixed latent representation pair and the real annotation of the labeled image is greater than a preset threshold, use the first loss function to calculate the loss term of the linear mixed latent representation pair;
当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值小于等于预设的阈值时,使用第二损失函数计算所述线性混合隐表征对的损失项;When the difference between the linear mixed label in the pair of linear mixed latent representations and the real label of the labeled image is less than or equal to a preset threshold, use the second loss function to calculate the loss term of the pair of linear mixed latent representations;
汇总所述线性混合隐表征对的损失项得到总损失函数,并计算所述总损失函数的损失值。Summarize the loss terms of the linear mixed latent representation pairs to obtain a total loss function, and calculate the loss value of the total loss function.
本申请一可选实施例中,由于使用混合的数据进行训练,在训练中根据混合后数据更接近有标注还是无标注数据选择不同的损失函数。当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值大于预设的阈值时,表示混合数据接近有标注数据,则使用第一损失函数计算所述线性混合隐表征对的损失项;当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值小于等于预设的阈值时,表示混合数据接近无标注数据,则使用第二损失函数计算所述线性混合隐表征对的损失项。In an optional embodiment of the present application, since mixed data is used for training, different loss functions are selected during training according to whether the mixed data is closer to labeled data or unlabeled data. When the difference between the linear hybrid annotation in the linear hybrid latent representation pair and the real annotation of the labeled image is greater than a preset threshold, indicating that the hybrid data is close to the labeled data, the first loss function is used to calculate the linear hybrid latent The loss item of the representation pair; when the difference between the linear mixed annotation in the linear mixed implicit representation pair and the real annotation of the labeled image is less than or equal to the preset threshold, it means that the mixed data is close to the unlabeled data, then the second loss is used The function computes a loss term for the pair of linear mixed latent representations.
本申请一可选实施例中,在一个图像训练集Batch中,第一损失函数L X可以为交叉熵(CE)损失: In an optional embodiment of the present application, in an image training set Batch, the first loss function L X may be a cross entropy (CE) loss:
Figure PCTCN2021096513-appb-000002
Figure PCTCN2021096513-appb-000002
其中,B为图像训练集,X为有标注图像,l为表征混合层,S为中间层,d l表示解码层。 Among them, B is the image training set, X is the labeled image, l is the representation mixing layer, S is the middle layer, and dl is the decoding layer.
本申请一可选实施例中,第二损失函数L U可以为L 2损失: In an optional embodiment of the present application, the second loss function LU may be L 2 loss:
Figure PCTCN2021096513-appb-000003
Figure PCTCN2021096513-appb-000003
其中,B为图像训练集,U为无标注图像,l为表征混合层,S为中间层,d l表示解码层。 Among them, B is the image training set, U is the unlabeled image, l is the representation mixing layer, S is the intermediate layer, and dl is the decoding layer.
本申请实施例中,总损失函数可以为:In this embodiment of the present application, the total loss function may be:
L=L XU·L U L=L XU ·L U
其中,λ U为一个手动定义的超参数权重项。 where λ U is a manually defined hyperparameter weight term.
本申请实施例中,由于猜测标注比真实标注更不可靠,因此在混合后的数据靠近真实标注及猜测标注时分别采用不同的损失函数,可以提高网络分类的准确率。In the embodiment of the present application, since the guessed annotation is less reliable than the real annotation, different loss functions are respectively used when the mixed data is close to the real annotation and the guessed annotation, which can improve the accuracy of network classification.
S5、利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。S5. Use the standard image classification network to classify the images to be classified to obtain an image classification result.
本申请实施例中,通过待分类图像可以为医学领域的未标注图像(比如,肿瘤的MRI(核磁共振)图像或CT图像),利用所述标准图像分类网络预测所述未标注图像的标注来进行分类。所述图像分类结果包括分类图像及分类图像对应的标注。In the embodiment of the present application, the image to be classified may be an unlabeled image in the medical field (for example, an MRI (nuclear magnetic resonance) image or a CT image of a tumor), and the standard image classification network is used to predict the label of the unlabeled image. sort. The image classification result includes classified images and labels corresponding to the classified images.
本申请通过对无标注图像集中的图像进行标注猜测,得到标记猜测图像集,汇总所述标记猜测图像集及有标注图像集,得到图像训练集,可以提高训练数据的多样性。并且,在预设的图像分类网络中构建表征混合层,得到混合图像分类网络,利用所述表征混合层可以对图像训练集中的有标注数据及无标注数据进行线性混合,利用混合后的数据进行训练可以提高网络拟合平滑性和一致性,从而提高网络的性能,使得网络分类的准确性更高。同时,相较于背景技术中仅对单一数据点局部的平滑性做出了规范,本申请中的混合数据包含有标注和无标注数据,因此可以对不同数据点间的网络的全局平滑性和一致性进行约束,进一步提高了图像分类的准确性。因此本申请实施例可以解决图像分类准确率较低的问题。In the present application, an image training set is obtained by annotating and guessing images in an unmarked image set to obtain a marked guessing image set, and by summarizing the marked guessing image set and the marked image set, which can improve the diversity of training data. In addition, a representation mixing layer is constructed in the preset image classification network to obtain a mixed image classification network. Using the representation mixing layer, the labeled data and unlabeled data in the image training set can be linearly mixed, and the mixed data can be used to perform linear mixing. Training can improve the smoothness and consistency of network fitting, thereby improving the performance of the network and making the network classification more accurate. At the same time, compared with the background art that only regulates the local smoothness of a single data point, the mixed data in this application includes labeled and unlabeled data, so the global smoothness and smoothness of the network between different data points can be adjusted. Consistency is constrained to further improve the accuracy of image classification. Therefore, the embodiments of the present application can solve the problem of low image classification accuracy.
如图5所示,是本申请一实施例提供的图像分类装置的功能模块图。As shown in FIG. 5 , it is a functional block diagram of an image classification apparatus provided by an embodiment of the present application.
本申请所述图像分类装置100可以安装于电子设备中。根据实现的功能,所述图像分类装置100可以包括图像获取模块101、标注猜测模块102、混合层构建模块103、模型训练模块104及图像分类模块105。本申请所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The image classification apparatus 100 described in this application can be installed in an electronic device. According to the implemented functions, the image classification apparatus 100 may include an image acquisition module 101 , an annotation guessing module 102 , a hybrid layer construction module 103 , a model training module 104 and an image classification module 105 . The modules described in this application may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of an electronic device and can perform fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述图像获取模块101,用于获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集。The image acquisition module 101 is configured to acquire an original image set, wherein the original image set includes a marked image set and an unmarked image set.
本申请实施例中,所述原始图像集可以为医疗领域的医学图像,比如,临床医疗领域中,所述原始图像可以为肿瘤的MRI(核磁共振)图像或CT图像。In the embodiment of the present application, the original image set may be a medical image in the medical field. For example, in the clinical medical field, the original image may be an MRI (magnetic resonance) image or a CT image of a tumor.
其中,本申请实施例中,有标注图像集中包括有标注图像X及其对应的标注Y,无标注图像集中包括无标注图像U。Among them, in the embodiment of the present application, the labeled image set includes the labeled image X and its corresponding label Y, and the unlabeled image set includes the unlabeled image U.
所述标注猜测模块102,用于对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集。The annotation guessing module 102 is configured to perform annotation guessing on the images in the unannotated image set to obtain an annotated guess image set, and summarize the annotated guess image set and the annotated image set to obtain an image training set.
具体地,所述标注猜测模块102通过下述操作得到标注猜测图像集:Specifically, the annotation guessing module 102 obtains an annotation guessing image set through the following operations:
利用预构建的生成对抗网络,对所述无标注图像集中的图像进行预设次数的数据增强处理,得到增强图像;Using a pre-built generative adversarial network, perform data enhancement processing on the images in the unlabeled image set for a preset number of times to obtain an enhanced image;
利用预设的标注猜测公式对所述增强图像进行标注猜测,得到标注猜测图像;Using a preset annotation guessing formula to perform annotation guessing on the enhanced image to obtain an annotation guessing image;
汇总所述标注猜测图像得到所述标注猜测图像集。The annotated guess images are aggregated to obtain the annotated guess image set.
本申请实施例中,所述预构建的生成对抗网络可以为生成式对抗网络(GAN,Generative Adversarial Networks),所述生成式对抗网络是一种深度学习模型,包括生成模型(Generative Model)和判别模型(Discriminative Model),以人脸图像为例,所述生成模型用来依据真实的歪头人脸图像集生成模拟的正向人脸图像集。所述判别模型用来判断所述模拟的正向人脸图像集和真实的正向人脸图像集的真假,直至判别模型无法很好地辨别真假正向人脸图像的时候,说明生成模型可以较好地将歪头人脸图像矫正至几乎可以以假乱真的模拟正向人脸图像。即生成式对抗网络(GAN)的任务是要让判别模型(D)对生成模型(G)生成的模拟正向人脸图像的判别能力越来越差,即最大化(max)判别模型(D)的误差,同时又希望让生成模型(G)基于歪头人脸图像生成的模拟正向人脸图像与真实正向人脸图像的差距越来越小,即最小化(min)生成模型(G)的误差。In the embodiment of the present application, the pre-built generative adversarial network may be a generative adversarial network (GAN, Generative Adversarial Networks), and the generative adversarial network is a deep learning model, including a generative model (Generative Model) and a discriminant network. Model (Discriminative Model), taking a face image as an example, the generation model is used to generate a simulated forward face image set based on a real head tilted face image set. The discriminant model is used to judge whether the simulated positive face image set and the real positive face image set are true or false, until the discriminant model cannot distinguish the true and false positive face images well, the description is generated. The model can better correct the head tilted face image to almost simulate the positive face image with a fake one. That is, the task of the generative adversarial network (GAN) is to make the discriminant model (D) have a worse and worse discriminative ability of the simulated positive face image generated by the generative model (G), that is, to maximize (max) the discriminant model (D). ) error, and at the same time hope that the gap between the simulated positive face image generated by the generative model (G) based on the tilted face image and the real positive face image is getting smaller and smaller, that is, to minimize (min) the generative model ( G) error.
本申请实施例中,这种基于生成式对抗网络合成的方法相比于传统的数据增强技术虽然过程更加复杂,但是生成的样本更加多样,同时还可以应用于图像编辑,图像去噪等各种场景,提高了应用性。In the embodiment of this application, this method based on generative adversarial network synthesis is more complicated than the traditional data enhancement technology, but the generated samples are more diverse, and can also be applied to various image editing, image denoising, etc. scene, improving the applicability.
本申请一可选实施例中,所述标注猜测模块102通过下述操作得到标注猜测图像:In an optional embodiment of the present application, the annotation guessing module 102 obtains an annotation guessing image through the following operations:
利用下述猜测公式对所述增强图像进行标注猜测,得到标注猜测图像:Use the following guessing formula to perform annotated guessing on the enhanced image to obtain annotated guessing image:
Figure PCTCN2021096513-appb-000004
Figure PCTCN2021096513-appb-000004
其中,q b表示无标注图像的猜测标注,u b表示无标注图像集,u b,m表示无标注图像集中第m个图像,f(u b,m;θ)表示参数θ的网络拟合函数对u b的第m个图像为输入的输出,M表示数据增强的次数。 Among them, q b represents the guessed annotation of the unlabeled image, ub represents the unlabeled image set, ub ,m represents the m-th image in the unlabeled image set, and f(ub ,m ; θ) represents the network fitting of the parameter θ The function takes the mth image of ub as the input and output, and M represents the number of data enhancements.
具体地,所述标注猜测模块102通过下述操作得到图像训练集:Specifically, the label guessing module 102 obtains the image training set through the following operations:
汇总所述标记猜测图像集及所述有标注图像集,得到原始训练集;Summarize the labeled guess image set and the labeled image set to obtain the original training set;
从所述原始训练集中随机选取预设数量的图像作为所述图像训练集。A preset number of images are randomly selected from the original training set as the image training set.
本申请一可选实施例中,因为全部的原始训练集的数据太大,内存可能无法加载也可能无法进行计算,从原始训练集中随机选取一部分数据作为图像训练集,可以提高模型训练速度。In an optional embodiment of the present application, because the data of all the original training sets is too large, the memory may not be able to load or may not be able to perform calculations, randomly selecting a part of the data from the original training set as the image training set can improve the model training speed.
所述混合层构建模块103,用于在预设的图像分类网络中构建表征混合层,得到混合图像分类网络。The hybrid layer construction module 103 is used to construct a representation hybrid layer in a preset image classification network to obtain a hybrid image classification network.
本申请实施例中,所述预设的图像分类网络可以为为VGGNet,所述VGGNet是深度卷积神经网络的一种,相较于一般的神经网络,VGGNet全部使用3*3的卷积核和2*2的池化核,通过不断加深网络结构来提升性能,同时网络层数的增长并不会带来参数量上的***,因为参数量主要集中在最后三个全连接层中。In the embodiment of the present application, the preset image classification network may be VGGNet, which is a type of deep convolutional neural network. Compared with general neural networks, VGGNet all use 3*3 convolution kernels And the 2*2 pooling kernel, the performance is improved by continuously deepening the network structure. At the same time, the increase in the number of network layers will not bring about an explosion in the amount of parameters, because the amount of parameters is mainly concentrated in the last three fully connected layers.
具体地,所述混合层构建模块103通过下述操作得到得到混合图像分类网络:Specifically, the hybrid layer building module 103 obtains the hybrid image classification network through the following operations:
在所述图像分类网络中随机选取一层作为表征混合层;A layer is randomly selected as the representation mixing layer in the image classification network;
将所述表征混合层之前的网络设置为编码层,及将所述表征混合层之后的网络设置为解码层;Setting the network before the characterization mixing layer as an encoding layer, and setting the network after the characterization mixing layer as a decoding layer;
汇总所述编码层、所述表征混合层及所述解码层,得到所述混合图像分类网络。The encoding layer, the representation mixing layer and the decoding layer are aggregated to obtain the mixed image classification network.
本申请一可选实施例中,可以从所述图像分类网络中选择一系列中间层组成集合,并在该集合中随机选择一层作为所述表征混合层,所述表征混合层用来将输入到该层的混合数据(包括有标注数据及无标注数据)进行表征混合。所述编码层用来将所述图像训练集中的数据编码到所述表征混合层,所述解码层用来对混合后的表征进行解码。In an optional embodiment of the present application, a series of intermediate layers may be selected from the image classification network to form a set, and one layer is randomly selected from the set as the representation mixing layer, and the representation mixing layer is used to combine the input The mixed data (including labeled data and unlabeled data) to this layer is represented and mixed. The encoding layer is used for encoding data in the image training set into the representation mixing layer, and the decoding layer is used for decoding the mixed representation.
本申请实施例中,通过在输入空间进行初次混合(即从原始训练集中随机选取一定数量的图像作为图像训练集),及在所述表征混合层对有标注数据及无标注数据进行表征混 合,可以提高网络的平滑性,进而提高图像分类网络的分类准确性。In the embodiment of the present application, by performing initial mixing in the input space (that is, randomly selecting a certain number of images from the original training set as the image training set), and characterizing and mixing the labeled data and the unlabeled data in the characterization mixing layer, The smoothness of the network can be improved, thereby improving the classification accuracy of the image classification network.
所述模型训练模块104,用于利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络。The model training module 104 is configured to use the image training set to train the hybrid image classification network to obtain a standard image classification network.
详细地,所述模型训练模块104通过下述操作得到标准图像分类网络:In detail, the model training module 104 obtains a standard image classification network through the following operations:
利用所述混合图像分类网络中的编码层对所述图像训练集中图像对应的标注进行表征编码,得到隐表征对;Using the coding layer in the hybrid image classification network to characterize and encode the annotations corresponding to the images in the image training set to obtain pairs of latent representations;
利用所述混合图像分类网络中的表征混合层对所述隐表征对进行线性混合,得到线性混合隐表征对;The latent representation pair is linearly mixed by using the representation mixing layer in the mixed image classification network to obtain a linear mixed latent representation pair;
根据所述线性混合隐表征对计算损失值,当所述损失值小于预设的损失阈值时,得到所述标准图像分类网络。A loss value is calculated according to the linear mixed latent representation pair, and when the loss value is less than a preset loss threshold, the standard image classification network is obtained.
本申请实施例中,所述图像训练集中包括一堆随机的训练对(x 1,y 1)和(x 2,y 2),x 1,x 2可以全是有标注图像或都无标注图像,也可以一个有标注图像一个无标注图像,y 1,y 2为对应的标注,其中,有标注图像对应的为真实标注,无标注图像对应的是猜测标注。利用所述编码层对所述训练对(x 1,y 1)和(x 2,y 2)进行编码,得到隐表征对(e l(x 1),y 1)和(e l(x 2),y 2),e l表示编码层。 In the embodiment of the present application, the image training set includes a bunch of random training pairs (x 1 , y 1 ) and (x 2 , y 2 ), and x 1 and x 2 may all be labeled images or none of them are labeled images. , or a labeled image and an unlabeled image, y 1 , y 2 are the corresponding labels, among which, the labeled images correspond to the real labels, and the unlabeled images correspond to the guess labels. Use the encoding layer to encode the training pairs (x 1 , y 1 ) and (x 2 , y 2 ) to obtain latent representation pairs ( el (x 1 ), y 1 ) and ( el (x 2 ) ), y 2 ), e l represents the coding layer.
本申请实施例中,所述模型训练模块104通过下述操作得到线性混合隐表征对:In the embodiment of the present application, the model training module 104 obtains a pair of linear mixed latent representations through the following operations:
通过下述公式计算线性混合隐表征对((e l(x)′),y′): The linear mixed latent representation pair ((e l (x)′),y′) is calculated by the following formula:
e l(x)′=λ′·e l(x 1)+(1-λ′)·e l(x 2) e l (x)′=λ′·e l (x 1 )+(1-λ′)·e l (x 2 )
y′=λ′·y 1+(1-λ′)·y 1 y′=λ′·y 1 +(1-λ′)·y 1
λ′=max(λ,1-λ)λ′=max(λ,1-λ)
λ~Beta(α,α)λ~Beta(α,α)
其中,(e l(x)′)表示线性混合图像,y′表示线性混合标注,α是决定Beta分布的超参数,λ′是为了使e l(x)′更接近e l(x 1),(e l(x 1),y 1)和(e l(x 2),y 2)为隐表征对,e l表示编码层,x 1,x 2是图像训练集中的任意两个图像,y 1,y 2分别为图像x 1,x 2对应的标注。 where ( el (x)′) represents the linear mixture image, y′ represents the linear mixture label, α is the hyperparameter that determines the Beta distribution, and λ′ is to make e l (x)′ closer to e l (x 1 ) , (e l (x 1 ), y 1 ) and ( el (x 2 ), y 2 ) are pairs of latent representations, e l represents the encoding layer, x 1 , x 2 are any two images in the image training set, y 1 , y 2 are the labels corresponding to the images x 1 and x 2 , respectively.
进一步地,所述模型训练模块104通过下述操作计算损失值:Further, the model training module 104 calculates the loss value through the following operations:
利用均方差方法计算所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值;Calculate the difference between the linear mixed annotation in the linear mixed latent representation pair and the real annotation of the labeled image by using the mean square error method;
当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值大于预设的阈值时,使用第一损失函数计算所述线性混合隐表征对的损失项;When the difference between the linear mixed annotation in the linear mixed latent representation pair and the real annotation of the labeled image is greater than a preset threshold, use the first loss function to calculate the loss term of the linear mixed latent representation pair;
当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值小于等于预设的阈值时,使用第二损失函数计算所述线性混合隐表征对的损失项;When the difference between the linear mixed label in the pair of linear mixed latent representations and the real label of the labeled image is less than or equal to a preset threshold, use the second loss function to calculate the loss term of the pair of linear mixed latent representations;
汇总所述线性混合隐表征对的损失项得到总损失函数,并计算所述总损失函数的损失值。Summarize the loss terms of the linear mixed latent representation pairs to obtain a total loss function, and calculate the loss value of the total loss function.
本申请一可选实施例中,由于使用混合的数据进行训练,在训练中根据混合后数据更接近有标注还是无标注数据选择不同的损失函数。当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值大于预设的阈值时,表示混合数据接近有标注数据,则使用第一损失函数计算所述线性混合隐表征对的损失项;当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值小于等于预设的阈值时,表示混合数据接近无标注数据,则使用第二损失函数计算所述线性混合隐表征对的损失项。In an optional embodiment of the present application, since mixed data is used for training, different loss functions are selected during training according to whether the mixed data is closer to labeled data or unlabeled data. When the difference between the linear hybrid annotation in the linear hybrid latent representation pair and the real annotation of the labeled image is greater than a preset threshold, indicating that the hybrid data is close to the labeled data, the first loss function is used to calculate the linear hybrid latent The loss item of the representation pair; when the difference between the linear mixed annotation in the linear mixed implicit representation pair and the real annotation of the labeled image is less than or equal to the preset threshold, it means that the mixed data is close to the unlabeled data, then the second loss is used The function computes a loss term for the pair of linear mixed latent representations.
本申请一可选实施例中,在一个图像训练集Batch中,第一损失函数L X可以为交叉熵(CE)损失: In an optional embodiment of the present application, in an image training set Batch, the first loss function L X may be a cross entropy (CE) loss:
Figure PCTCN2021096513-appb-000005
Figure PCTCN2021096513-appb-000005
其中,B为图像训练集,X为有标注图像,l为表征混合层,S为中间层,d l表示解码层。 Among them, B is the image training set, X is the labeled image, l is the representation mixing layer, S is the middle layer, and dl is the decoding layer.
本申请一可选实施例中,第二损失函数L U可以为L 2损失: In an optional embodiment of the present application, the second loss function LU may be L 2 loss:
Figure PCTCN2021096513-appb-000006
Figure PCTCN2021096513-appb-000006
其中,B为图像训练集,U为无标注图像,l为表征混合层,S为中间层,d l表示解码层。 Among them, B is the image training set, U is the unlabeled image, l is the representation mixing layer, S is the intermediate layer, and dl is the decoding layer.
本申请实施例中,总损失函数可以为:In this embodiment of the present application, the total loss function may be:
L=L XU·L U L=L XU ·L U
其中,λ U为一个手动定义的超参数权重项。 where λ U is a manually defined hyperparameter weight term.
本申请实施例中,由于猜测标注比真实标注更不可靠,因此在混合后的数据靠近真实标注及猜测标注时分别采用不同的损失函数,可以提高网络分类的准确率。In the embodiment of the present application, since the guessed annotation is less reliable than the real annotation, different loss functions are respectively used when the mixed data is close to the real annotation and the guessed annotation, which can improve the accuracy of network classification.
所述图像分类模块105,用于利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The image classification module 105 is configured to use the standard image classification network to classify the images to be classified to obtain an image classification result.
本申请实施例中,通过待分类图像可以为医学领域的未标注图像(比如,肿瘤的MRI(核磁共振)图像或CT图像),利用所述标准图像分类网络预测所述未标注图像的标注来进行分类。所述图像分类结果包括分类图像及分类图像对应的标注。In the embodiment of the present application, the image to be classified may be an unlabeled image in the medical field (for example, an MRI (nuclear magnetic resonance) image or a CT image of a tumor), and the standard image classification network is used to predict the label of the unlabeled image. sort. The image classification result includes classified images and labels corresponding to the classified images.
如图6所示,是本申请一实施例提供的实现图像分类方法的电子设备的结构示意图,包括处理器111、通信接口112、存储器113和通信总线114,其中,处理器111,通信接口112,存储器113通过通信总线114完成相互间的通信,As shown in FIG. 6 , it is a schematic structural diagram of an electronic device for implementing an image classification method provided by an embodiment of the present application, including a processor 111 , a communication interface 112 , a memory 113 and a communication bus 114 , wherein the processor 111 , the communication interface 112 , the memory 113 completes the communication with each other through the communication bus 114,
存储器113,用于存放计算机程序,如图像分类程序;The memory 113 is used to store computer programs, such as image classification programs;
在本申请一个实施例中,处理器111,用于执行存储器113上所存放的程序时,实现前述任意一个方法实施例提供的图像分类方法,包括:In an embodiment of the present application, the processor 111 is configured to implement the image classification method provided by any one of the foregoing method embodiments when executing the program stored in the memory 113, including:
获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集;obtaining an original image set, wherein the original image set includes an annotated image set and an unlabeled image set;
对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集;Carrying out annotated guessing on the images in the unlabeled image set to obtain an annotated guess image set, summarizing the annotated guess image set and the annotated image set to obtain an image training set;
在预设的图像分类网络中构建表征混合层,得到混合图像分类网络;Construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络;Use the image training set to train the hybrid image classification network to obtain a standard image classification network;
利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The images to be classified are classified by using the standard image classification network to obtain an image classification result.
上述通信总线114可以是外设部件互连标准(PeripheralComponentInterconnect,简称PCI)总线或扩展工业标准结构(ExtendedIndustryStandardArchitecture,简称EISA)总线等。该通信总线114可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The above-mentioned communication bus 114 may be a Peripheral Component Interconnect (PCI for short) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA for short) bus or the like. The communication bus 114 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
通信接口112用于上述电子设备与其他设备之间的通信。The communication interface 112 is used for communication between the above-mentioned electronic device and other devices.
存储器113可以包括随机存取存储器(RandomAccessMemory,简称RAM),也可以包括非易失性存储器(non-volatilememory),例如至少一个磁盘存储器。可选的,存储器113还可以是至少一个位于远离前述处理器111的存储装置。The memory 113 may include random access memory (Random Access Memory, RAM for short), or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory 113 may also be at least one storage device located away from the aforementioned processor 111 .
上述的处理器111可以是通用处理器,包括中央处理器(CentralProcessingUnit,简称CPU)、网络处理器(NetworkProcessor,简称NP)等;还可以是数字信号处理器(DigitalSignalProcessing,简称DSP)、专用集成电路(ApplicationSpecificIntegratedCircuit,简称ASIC)、现场可编程门阵列(Field-ProgrammableGateArray,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor 111 may be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor (referred to as NP), etc.; it may also be a digital signal processor (Digital Signal Processing, referred to as DSP), an application-specific integrated circuit (ApplicationSpecificIntegratedCircuit, ASIC for short), Field-Programmable Gate Array (Field-ProgrammableGateArray, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性。所述计算机可读存储介质存储有计算机程序,所述计算机程序在被电子 设备的处理器所执行时,可以实现:The present application also provides a computer-readable storage medium, where the computer-readable storage medium may be non-volatile or volatile. The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor of the electronic device, it can realize:
获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集;obtaining an original image set, wherein the original image set includes an annotated image set and an unlabeled image set;
对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集;Carrying out annotated guessing on the images in the unlabeled image set to obtain an annotated guess image set, summarizing the annotated guess image set and the annotated image set to obtain an image training set;
在预设的图像分类网络中构建表征混合层,得到混合图像分类网络;Construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络;Use the image training set to train the hybrid image classification network to obtain a standard image classification network;
利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The images to be classified are classified by using the standard image classification network to obtain an image classification result.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division manners in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。It will be apparent to those skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, but that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Accordingly, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the application is to be defined by the appended claims rather than the foregoing description, which is therefore intended to fall within the scope of the claims. All changes within the meaning and scope of the equivalents of , are included in this application. Any reference signs in the claims shall not be construed as limiting the involved claim.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。***权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. Several units or means recited in the system claims can also be realized by one unit or means by means of software or hardware. Second-class terms are used to denote names and do not denote any particular order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application rather than limitations. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present application.

Claims (22)

  1. 一种图像分类方法,其中,所述方法包括:An image classification method, wherein the method comprises:
    获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集;obtaining an original image set, wherein the original image set includes an annotated image set and an unlabeled image set;
    对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集;Carrying out annotated guessing on the images in the unlabeled image set to obtain an annotated guess image set, summarizing the annotated guess image set and the annotated image set to obtain an image training set;
    在预设的图像分类网络中构建表征混合层,得到混合图像分类网络;Construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
    利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络;Use the image training set to train the hybrid image classification network to obtain a standard image classification network;
    利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The images to be classified are classified by using the standard image classification network to obtain an image classification result.
  2. 如权利要求1所述的图像分类方法,其中,所述对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,包括:The image classification method according to claim 1, wherein said performing annotated guessing on the images in the unlabeled image set to obtain annotated guessing image set, comprising:
    利用预构建的生成对抗网络,对所述无标注图像集中的图像进行预设次数的数据增强处理,得到增强图像;Using a pre-built generative adversarial network, perform data enhancement processing on the images in the unlabeled image set for a preset number of times to obtain an enhanced image;
    利用预设的标注猜测公式对所述增强图像进行标注猜测,得到标注猜测图像;Using a preset annotation guessing formula to perform annotation guessing on the enhanced image to obtain an annotation guessing image;
    汇总所述标注猜测图像得到所述标注猜测图像集。The annotated guess images are aggregated to obtain the annotated guess image set.
  3. 如权利要求2所述的图像分类方法,其中,所述利用预设的标注猜测公式对所述增强图像进行标注猜测,得到标注猜测图像,包括:The image classification method according to claim 2, wherein said using a preset annotation guessing formula to perform annotation guessing on the enhanced image to obtain an annotation guessing image, comprising:
    利用下述猜测公式对所述增强图像进行标注猜测,得到标注猜测图像:Use the following guessing formula to perform annotated guessing on the enhanced image to obtain annotated guessing image:
    Figure PCTCN2021096513-appb-100001
    Figure PCTCN2021096513-appb-100001
    其中,q b表示无标注图像的猜测标注,u b表示无标注图像集,u b,m表示无标注图像集中第m个图像,f(u b,m;θ)表示参数θ的网络拟合函数对u b的第m个图像为输入的输出,M表示数据增强的次数。 Among them, q b represents the guessed annotation of the unlabeled image, ub represents the unlabeled image set, ub ,m represents the m-th image in the unlabeled image set, and f(ub ,m ; θ) represents the network fitting of the parameter θ The function takes the mth image of ub as the input and output, and M represents the number of data enhancements.
  4. 如权利要求1所述的图像分类方法,其中,所述在预设的图像分类网络中构建表征混合层,得到混合图像分类网络,包括:The image classification method according to claim 1, wherein, constructing a mixed layer of representation in a preset image classification network to obtain a mixed image classification network, comprising:
    在所述图像分类网络中随机选取一层作为表征混合层;A layer is randomly selected as the representation mixing layer in the image classification network;
    将所述表征混合层之前的网络设置为编码层,及将所述表征混合层之后的网络设置为解码层;Setting the network before the characterization mixing layer as an encoding layer, and setting the network after the characterization mixing layer as a decoding layer;
    汇总所述编码层、所述表征混合层及所述解码层,得到所述混合图像分类网络。The encoding layer, the representation mixing layer and the decoding layer are aggregated to obtain the mixed image classification network.
  5. 如权利要求4所述的图像分类方法,其中,所述利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络,包括:The image classification method according to claim 4, wherein the training of the hybrid image classification network by using the image training set to obtain a standard image classification network comprises:
    利用所述混合图像分类网络中的编码层对所述图像训练集中图像对应的标注进行表征编码,得到隐表征对;Using the coding layer in the hybrid image classification network to characterize and encode the annotations corresponding to the images in the image training set to obtain pairs of latent representations;
    利用所述混合图像分类网络中的表征混合层对所述隐表征对进行线性混合,得到线性混合隐表征对;The latent representation pair is linearly mixed by using the representation mixing layer in the mixed image classification network to obtain a linear mixed latent representation pair;
    根据所述线性混合隐表征对计算损失值,当所述损失值小于预设的损失阈值时,得到所述标准图像分类网络。A loss value is calculated according to the linear mixed latent representation pair, and when the loss value is less than a preset loss threshold, the standard image classification network is obtained.
  6. 如权利要求5所述的图像分类方法,其中,所述利用所述混合图像分类网络中的表征混合层对所述隐表征对进行线性混合,得到线性混合隐表征对,包括:The image classification method according to claim 5, wherein the use of a representation mixing layer in the mixed image classification network to linearly mix the latent representation pairs to obtain linearly mixed latent representation pairs, comprising:
    通过下述公式计算线性混合隐表征对((e l(x)′),y′): The linear mixed latent representation pair ((e l (x)′),y′) is calculated by the following formula:
    e l(x)′=λ′·e l(x 1)+(1-λ′)·e l(x 2) e l (x)′=λ′·e l (x 1 )+(1-λ′)·e l (x 2 )
    y′=λ′·y 1+(1-λ′)·y 1 y′=λ′·y 1 +(1-λ′)·y 1
    λ′=max(λ,1-λ)λ′=max(λ,1-λ)
    λ~Beta(α,α)λ~Beta(α,α)
    其中,(e l(x)′)表示线性混合图像,y′表示线性混合标注,α是决定Beta分布的超参数,λ′是为了使e l(x)′更接近e l(x 1),(e l(x 1),y 1)和(e l(x 2),y 2)为隐表征对,e l表示编码层,x 1,x 2是图像训练集中的任意两个图像,y 1,y 2分别为图像x 1,x 2对应的标注。 where ( el (x)′) represents the linear mixture image, y′ represents the linear mixture label, α is the hyperparameter that determines the Beta distribution, and λ′ is to make e l (x)′ closer to e l (x 1 ) , (e l (x 1 ), y 1 ) and ( el (x 2 ), y 2 ) are pairs of latent representations, e l represents the encoding layer, x 1 , x 2 are any two images in the image training set, y 1 , y 2 are the labels corresponding to the images x 1 and x 2 , respectively.
  7. 如权利要求5所述的图像分类方法,其中,所述根据所述线性混合隐表征对计算损失值,包括:The image classification method according to claim 5, wherein the calculating a loss value according to the pair of linear mixed latent representations comprises:
    利用均方差方法计算所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值;Calculate the difference between the linear mixed annotation in the linear mixed latent representation pair and the real annotation of the labeled image by using the mean square error method;
    当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值大于预设的阈值时,使用第一损失函数计算所述线性混合隐表征对的损失项;When the difference between the linear mixed annotation in the linear mixed latent representation pair and the real annotation of the labeled image is greater than a preset threshold, use the first loss function to calculate the loss term of the linear mixed latent representation pair;
    当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值小于等于预设的阈值时,使用第二损失函数计算所述线性混合隐表征对的损失项;When the difference between the linear mixed label in the pair of linear mixed latent representations and the real label of the labeled image is less than or equal to a preset threshold, use the second loss function to calculate the loss term of the pair of linear mixed latent representations;
    汇总所述线性混合隐表征对的损失项得到总损失函数,并计算所述总损失函数的损失值。Summarize the loss terms of the linear mixed latent representation pairs to obtain a total loss function, and calculate the loss value of the total loss function.
  8. 一种图像分类装置,其中,所述装置包括:An image classification device, wherein the device comprises:
    图像获取模块,用于获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集;an image acquisition module, configured to acquire an original image set, wherein the original image set includes a marked image set and an unmarked image set;
    标注猜测模块,用于对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集;An annotation guessing module, configured to perform annotation guessing on the images in the unlabeled image set, obtain an annotation guess image set, summarize the annotated guess image set and the annotated image set, and obtain an image training set;
    混合层构建模块,用于在预设的图像分类网络中构建表征混合层,得到混合图像分类网络;The hybrid layer building module is used to construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
    模型训练模块,用于利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络;a model training module for training the hybrid image classification network using the image training set to obtain a standard image classification network;
    图像分类模块,用于利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The image classification module is used for classifying the images to be classified by using the standard image classification network to obtain image classification results.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device comprises:
    至少一个处理器;以及,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, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of:
    获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集;obtaining an original image set, wherein the original image set includes an annotated image set and an unlabeled image set;
    对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜测图像集及所述有标注图像集,得到图像训练集;Carrying out annotated guessing on the images in the unlabeled image set to obtain an annotated guess image set, summarizing the annotated guess image set and the annotated image set to obtain an image training set;
    在预设的图像分类网络中构建表征混合层,得到混合图像分类网络;Construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
    利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络;Use the image training set to train the hybrid image classification network to obtain a standard image classification network;
    利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The images to be classified are classified by using the standard image classification network to obtain an image classification result.
  10. 如权利要求9所述的电子设备,其中,所述对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,包括:The electronic device according to claim 9, wherein, performing annotated guessing on the images in the unlabeled image set to obtain annotated guessing image set, comprising:
    利用预构建的生成对抗网络,对所述无标注图像集中的图像进行预设次数的数据增强处理,得到增强图像;Using a pre-built generative adversarial network, perform data enhancement processing on the images in the unlabeled image set for a preset number of times to obtain an enhanced image;
    利用预设的标注猜测公式对所述增强图像进行标注猜测,得到标注猜测图像;Using a preset annotation guessing formula to perform annotation guessing on the enhanced image to obtain an annotation guessing image;
    汇总所述标注猜测图像得到所述标注猜测图像集。The annotated guess images are aggregated to obtain the annotated guess image set.
  11. 如权利要求10所述的电子设备,其中,所述利用预设的标注猜测公式对所述增强图像进行标注猜测,得到标注猜测图像,包括:The electronic device according to claim 10 , wherein, using a preset annotation guessing formula to perform annotation guessing on the enhanced image to obtain an annotation guessing image, comprising:
    利用下述猜测公式对所述增强图像进行标注猜测,得到标注猜测图像:Use the following guessing formula to perform annotated guessing on the enhanced image to obtain annotated guessing image:
    Figure PCTCN2021096513-appb-100002
    Figure PCTCN2021096513-appb-100002
    其中,q b表示无标注图像的猜测标注,u b表示无标注图像集,u b,m表示无标注图像集中第m个图像,f(u b,m;θ)表示参数θ的网络拟合函数对u b的第m个图像为输入的输出,M表示数据增强的次数。 Among them, q b represents the guessed annotation of the unlabeled image, ub represents the unlabeled image set, ub ,m represents the m-th image in the unlabeled image set, and f(ub ,m ; θ) represents the network fitting of the parameter θ The function takes the mth image of ub as the input and output, and M represents the number of data enhancements.
  12. 如权利要求9所述的电子设备,其中,所述在预设的图像分类网络中构建表征混合层,得到混合图像分类网络,包括:The electronic device according to claim 9, wherein, constructing a mixed layer of representation in a preset image classification network to obtain a mixed image classification network, comprising:
    在所述图像分类网络中随机选取一层作为表征混合层;A layer is randomly selected as the representation mixing layer in the image classification network;
    将所述表征混合层之前的网络设置为编码层,及将所述表征混合层之后的网络设置为解码层;Setting the network before the characterization mixing layer as an encoding layer, and setting the network after the characterization mixing layer as a decoding layer;
    汇总所述编码层、所述表征混合层及所述解码层,得到所述混合图像分类网络。The encoding layer, the representation mixing layer and the decoding layer are aggregated to obtain the mixed image classification network.
  13. 如权利要求12所述的电子设备,其中,所述利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络,包括:The electronic device according to claim 12 , wherein the hybrid image classification network is trained by using the image training set to obtain a standard image classification network, comprising:
    利用所述混合图像分类网络中的编码层对所述图像训练集中图像对应的标注进行表征编码,得到隐表征对;Using the coding layer in the hybrid image classification network to characterize and encode the annotations corresponding to the images in the image training set to obtain pairs of latent representations;
    利用所述混合图像分类网络中的表征混合层对所述隐表征对进行线性混合,得到线性混合隐表征对;The latent representation pair is linearly mixed by using the representation mixing layer in the mixed image classification network to obtain a linear mixed latent representation pair;
    根据所述线性混合隐表征对计算损失值,当所述损失值小于预设的损失阈值时,得到所述标准图像分类网络。A loss value is calculated according to the linear mixed latent representation pair, and when the loss value is less than a preset loss threshold, the standard image classification network is obtained.
  14. 如权利要求13所述的电子设备,其中,所述利用所述混合图像分类网络中的表征混合层对所述隐表征对进行线性混合,得到线性混合隐表征对,包括:The electronic device according to claim 13, wherein the linear mixing of the latent representation pairs by using a representation mixing layer in the hybrid image classification network to obtain a linearly mixed latent representation pair, comprising:
    通过下述公式计算线性混合隐表征对((e l(x)′),y′): The linear mixed latent representation pair ((e l (x)′),y′) is calculated by the following formula:
    e l(x)′=λ′·e l(x 1)+(1-λ′)·e l(x 2) e l (x)′=λ′·e l (x 1 )+(1-λ′)·e l (x 2 )
    y′=λ′·y 1+(1-λ′)·y 1 y′=λ′·y 1 +(1-λ′)·y 1
    λ′=max(λ,1-λ)λ′=max(λ,1-λ)
    λ~Beta(α,α)λ~Beta(α,α)
    其中,(e l(x)′)表示线性混合图像,y′表示线性混合标注,α是决定Beta分布的超参数,λ′是为了使e l(x)′更接近e l(x 1),(e l(x 1),y 1)和(e l(x 2),y 2)为隐表征对,e l表示编码层,x 1,x 2是图像训练集中的任意两个图像,y 1,y 2分别为图像x 1,x 2对应的标注。 where ( el (x)′) represents the linear mixture image, y′ represents the linear mixture label, α is the hyperparameter that determines the Beta distribution, and λ′ is to make e l (x)′ closer to e l (x 1 ) , (e l (x 1 ), y 1 ) and ( el (x 2 ), y 2 ) are pairs of latent representations, e l represents the encoding layer, x 1 , x 2 are any two images in the image training set, y 1 , y 2 are the labels corresponding to the images x 1 and x 2 , respectively.
  15. 如权利要求13所述的电子设备,其中,所述根据所述线性混合隐表征对计算损失值,包括:The electronic device of claim 13, wherein the calculating a loss value according to the pair of linear mixed latent representations comprises:
    利用均方差方法计算所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值;Calculate the difference between the linear mixed annotation in the linear mixed latent representation pair and the real annotation of the labeled image by using the mean square error method;
    当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值大于预设的阈值时,使用第一损失函数计算所述线性混合隐表征对的损失项;When the difference between the linear mixed annotation in the linear mixed latent representation pair and the real annotation of the labeled image is greater than a preset threshold, use the first loss function to calculate the loss term of the linear mixed latent representation pair;
    当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值小于等于预设的阈值时,使用第二损失函数计算所述线性混合隐表征对的损失项;When the difference between the linear mixed label in the pair of linear mixed latent representations and the real label of the labeled image is less than or equal to a preset threshold, use the second loss function to calculate the loss term of the pair of linear mixed latent representations;
    汇总所述线性混合隐表征对的损失项得到总损失函数,并计算所述总损失函数的损失值。Summarize the loss terms of the linear mixed latent representation pairs to obtain a total loss function, and calculate the loss value of the total loss function.
  16. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium storing a computer program, wherein the computer program implements the following steps when executed by a processor:
    获取原始图像集,其中,所述原始图像集中包括有标注图像集及无标注图像集;obtaining an original image set, wherein the original image set includes an annotated image set and an unlabeled image set;
    对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,汇总所述标注猜 测图像集及所述有标注图像集,得到图像训练集;The images in the unmarked image set are labeled and guessed, and the labeled and guessed image set is obtained, and the labeled and guessed image set and the labeled image set are summarized to obtain an image training set;
    在预设的图像分类网络中构建表征混合层,得到混合图像分类网络;Construct a representation hybrid layer in the preset image classification network to obtain a hybrid image classification network;
    利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络;Use the image training set to train the hybrid image classification network to obtain a standard image classification network;
    利用所述标准图像分类网络对待分类图像进行分类,得到图像分类结果。The images to be classified are classified by using the standard image classification network to obtain an image classification result.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述对所述无标注图像集中的图像进行标注猜测,得到标注猜测图像集,包括:The computer-readable storage medium of claim 16 , wherein the performing annotated guessing on the images in the unlabeled image set to obtain annotated guessing image set, comprising:
    利用预构建的生成对抗网络,对所述无标注图像集中的图像进行预设次数的数据增强处理,得到增强图像;Using a pre-built generative adversarial network, perform data enhancement processing on the images in the unlabeled image set for a preset number of times to obtain an enhanced image;
    利用预设的标注猜测公式对所述增强图像进行标注猜测,得到标注猜测图像;Using a preset annotation guessing formula to perform annotation guessing on the enhanced image to obtain an annotation guessing image;
    汇总所述标注猜测图像得到所述标注猜测图像集。The annotated guess images are aggregated to obtain the annotated guess image set.
  18. 如权利要求17所述的计算机可读存储介质,其中,所述利用预设的标注猜测公式对所述增强图像进行标注猜测,得到标注猜测图像,包括:The computer-readable storage medium according to claim 17, wherein, performing an annotation guess on the enhanced image by using a preset annotation guess formula to obtain an annotation guess image, comprising:
    利用下述猜测公式对所述增强图像进行标注猜测,得到标注猜测图像:Use the following guessing formula to perform annotated guessing on the enhanced image to obtain annotated guessing image:
    Figure PCTCN2021096513-appb-100003
    Figure PCTCN2021096513-appb-100003
    其中,q b表示无标注图像的猜测标注,u b表示无标注图像集,u b,m表示无标注图像集中第m个图像,f(u b,m;θ)表示参数θ的网络拟合函数对u b的第m个图像为输入的输出,M表示数据增强的次数。 Among them, q b represents the guessed annotation of the unlabeled image, ub represents the unlabeled image set, ub ,m represents the m-th image in the unlabeled image set, and f(ub ,m ; θ) represents the network fitting of the parameter θ The function takes the mth image of u b as the input and output, and M represents the number of data enhancements.
  19. 如权利要求16所述的计算机可读存储介质,其中,所述在预设的图像分类网络中构建表征混合层,得到混合图像分类网络,包括:The computer-readable storage medium of claim 16 , wherein the constructing a representation hybrid layer in a preset image classification network to obtain a hybrid image classification network comprises:
    在所述图像分类网络中随机选取一层作为表征混合层;A layer is randomly selected as the representation mixing layer in the image classification network;
    将所述表征混合层之前的网络设置为编码层,及将所述表征混合层之后的网络设置为解码层;Setting the network before the characterization mixing layer as an encoding layer, and setting the network after the characterization mixing layer as a decoding layer;
    汇总所述编码层、所述表征混合层及所述解码层,得到所述混合图像分类网络。The encoding layer, the representation mixing layer and the decoding layer are aggregated to obtain the mixed image classification network.
  20. 如权利要求19所述的计算机可读存储介质,其中,所述利用所述图像训练集对所述混合图像分类网络进行训练,得到标准图像分类网络,包括:The computer-readable storage medium of claim 19, wherein the training of the hybrid image classification network using the image training set to obtain a standard image classification network comprises:
    利用所述混合图像分类网络中的编码层对所述图像训练集中图像对应的标注进行表征编码,得到隐表征对;Using the coding layer in the hybrid image classification network to characterize and encode the annotations corresponding to the images in the image training set to obtain pairs of latent representations;
    利用所述混合图像分类网络中的表征混合层对所述隐表征对进行线性混合,得到线性混合隐表征对;The latent representation pair is linearly mixed by using the representation mixing layer in the mixed image classification network to obtain a linear mixed latent representation pair;
    根据所述线性混合隐表征对计算损失值,当所述损失值小于预设的损失阈值时,得到所述标准图像分类网络。A loss value is calculated according to the linear mixed latent representation pair, and when the loss value is less than a preset loss threshold, the standard image classification network is obtained.
  21. 如权利要求20所述的计算机可读存储介质,其中,所述利用所述混合图像分类网络中的表征混合层对所述隐表征对进行线性混合,得到线性混合隐表征对,包括:The computer-readable storage medium of claim 20, wherein the linearly mixing the latent representation pairs by using a representation mixing layer in the hybrid image classification network to obtain a linearly mixed latent representation pair, comprising:
    通过下述公式计算线性混合隐表征对((e l(x)′),y′): The linear mixed latent representation pair ((e l (x)′),y′) is calculated by the following formula:
    e l(x)′=λ′·e l(x 1)+(1-λ′)·e l(x 2) e l (x)′=λ′·e l (x 1 )+(1-λ′)·e l (x 2 )
    y′=λ′·y 1+(1-λ′)·y 1 y′=λ′·y 1 +(1-λ′)·y 1
    λ′=max(λ,1-λ)λ′=max(λ,1-λ)
    λ~Beta(α,α)λ~Beta(α,α)
    其中,(e l(x)′)表示线性混合图像,y′表示线性混合标注,α是决定Beta分布的超参数,λ′是为了使e l(x)′更接近e l(x 1),(e l(x 1),y 1)和(e l(x 2),y 2)为隐表征对,e l表示编码层,x 1,x 2是图像训练集中的任意两个图像,y 1,y 2分别为图像x 1,x 2对应的标注。 where ( el (x)′) represents the linear mixture image, y′ represents the linear mixture label, α is the hyperparameter that determines the Beta distribution, and λ′ is to make e l (x)′ closer to e l (x 1 ) , (e l (x 1 ), y 1 ) and ( el (x 2 ), y 2 ) are pairs of latent representations, e l represents the encoding layer, x 1 , x 2 are any two images in the image training set, y 1 , y 2 are the labels corresponding to the images x 1 and x 2 , respectively.
  22. 如权利要求20所述的计算机可读存储介质,其中,所述根据所述线性混合隐表 征对计算损失值,包括:The computer-readable storage medium of claim 20, wherein said calculating a loss value according to the pair of linear mixed latent representations comprises:
    利用均方差方法计算所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值;Calculate the difference between the linear mixed annotation in the linear mixed latent representation pair and the real annotation of the labeled image by using the mean square error method;
    当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值大于预设的阈值时,使用第一损失函数计算所述线性混合隐表征对的损失项;When the difference between the linear mixed annotation in the linear mixed latent representation pair and the real annotation of the labeled image is greater than a preset threshold, use the first loss function to calculate the loss term of the linear mixed latent representation pair;
    当所述线性混合隐表征对中的线性混合标注与有标注图像的真实标注的差值小于等于预设的阈值时,使用第二损失函数计算所述线性混合隐表征对的损失项;When the difference between the linear mixed label in the pair of linear mixed latent representations and the real label of the labeled image is less than or equal to a preset threshold, use the second loss function to calculate the loss term of the pair of linear mixed latent representations;
    汇总所述线性混合隐表征对的损失项得到总损失函数,并计算所述总损失函数的损失值。Summarize the loss terms of the linear mixed latent representation pairs to obtain a total loss function, and calculate the loss value of the total loss function.
PCT/CN2021/096513 2021-04-28 2021-05-27 Image classification method and apparatus, and electronic device and storage medium WO2022227169A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110465701.2 2021-04-28
CN202110465701.2A CN113159202B (en) 2021-04-28 2021-04-28 Image classification method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022227169A1 true WO2022227169A1 (en) 2022-11-03

Family

ID=76871775

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/096513 WO2022227169A1 (en) 2021-04-28 2021-05-27 Image classification method and apparatus, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN113159202B (en)
WO (1) WO2022227169A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113807356B (en) * 2021-07-29 2023-07-25 北京工商大学 End-to-end low-visibility image semantic segmentation method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190164086A1 (en) * 2017-11-30 2019-05-30 Palo Alto Networks (Israel Analytics) Ltd. Framework for semi-supervised learning when no labeled data is given
CN111783981A (en) * 2020-06-29 2020-10-16 百度在线网络技术(北京)有限公司 Model training method and device, electronic equipment and readable storage medium
CN111931865A (en) * 2020-09-17 2020-11-13 平安科技(深圳)有限公司 Training method and device of image classification model, computer equipment and storage medium
CN112381831A (en) * 2020-11-26 2021-02-19 南开大学 Personalized image segmentation method and system based on semantic assistance between images

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11074495B2 (en) * 2013-02-28 2021-07-27 Z Advanced Computing, Inc. (Zac) System and method for extremely efficient image and pattern recognition and artificial intelligence platform
EP3251087B1 (en) * 2015-01-29 2018-11-28 Ventana Medical Systems, Inc. Dot detection, color classification of dots and counting of color classified dots
CN108509627B (en) * 2018-04-08 2021-08-31 腾讯科技(深圳)有限公司 Data discretization model training method and device and data discretization method
CN110210535B (en) * 2019-05-21 2021-09-10 北京市商汤科技开发有限公司 Neural network training method and device and image processing method and device
CN112381168B (en) * 2020-11-23 2022-04-01 浙江大学 Image editing method for guiding object representation splitting based on single sample
CN112465071A (en) * 2020-12-18 2021-03-09 深圳赛安特技术服务有限公司 Image multi-label classification method and device, electronic equipment and medium
CN112528908B (en) * 2020-12-18 2024-06-28 平安科技(深圳)有限公司 Living body detection method, living body detection device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190164086A1 (en) * 2017-11-30 2019-05-30 Palo Alto Networks (Israel Analytics) Ltd. Framework for semi-supervised learning when no labeled data is given
CN111783981A (en) * 2020-06-29 2020-10-16 百度在线网络技术(北京)有限公司 Model training method and device, electronic equipment and readable storage medium
CN111931865A (en) * 2020-09-17 2020-11-13 平安科技(深圳)有限公司 Training method and device of image classification model, computer equipment and storage medium
CN112381831A (en) * 2020-11-26 2021-02-19 南开大学 Personalized image segmentation method and system based on semantic assistance between images

Also Published As

Publication number Publication date
CN113159202A (en) 2021-07-23
CN113159202B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
CN111126574B (en) Method, device and storage medium for training machine learning model based on endoscopic image
US11645833B2 (en) Generative adversarial network medical image generation for training of a classifier
US10540578B2 (en) Adapting a generative adversarial network to new data sources for image classification
Liu et al. Cdas: a crowdsourcing data analytics system
WO2020253127A1 (en) Facial feature extraction model training method and apparatus, facial feature extraction method and apparatus, device, and storage medium
US20190198156A1 (en) Medical Image Classification Based on a Generative Adversarial Network Trained Discriminator
WO2018145604A1 (en) Sample selection method, apparatus and server
WO2018166114A1 (en) Picture identification method and system, electronic device, and medium
WO2021174723A1 (en) Training sample expansion method and apparatus, electronic device, and storage medium
WO2019169700A1 (en) Data classification method and device, equipment, and computer readable storage medium
WO2017215370A1 (en) Method and apparatus for constructing decision model, computer device and storage device
WO2022116424A1 (en) Method and apparatus for training traffic flow prediction model, electronic device, and storage medium
CN110196908A (en) Data classification method, device, computer installation and storage medium
CN111754596A (en) Editing model generation method, editing model generation device, editing method, editing device, editing equipment and editing medium
WO2019091402A1 (en) Method and device for age estimation
WO2021068563A1 (en) Sample date processing method, device and computer equipment, and storage medium
CN110633786A (en) Techniques for determining artificial neural network topology
WO2023040506A1 (en) Model-based data processing method and apparatus, electronic device, computer-readable storage medium, and computer program product
US20220269927A1 (en) Optimizing machine learning
CN111126347B (en) Human eye state identification method, device, terminal and readable storage medium
WO2022227192A1 (en) Image classification method and apparatus, and electronic device and medium
WO2024045442A1 (en) Image correction model training method, image correction method, device and storage medium
WO2023207790A1 (en) Classification model training method and device
WO2022227169A1 (en) Image classification method and apparatus, and electronic device and storage medium
CN112131322A (en) Time series classification method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21938639

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE