WO2022134338A1 - 领域适应方法、装置、电子设备及存储介质 - Google Patents

领域适应方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2022134338A1
WO2022134338A1 PCT/CN2021/082603 CN2021082603W WO2022134338A1 WO 2022134338 A1 WO2022134338 A1 WO 2022134338A1 CN 2021082603 W CN2021082603 W CN 2021082603W WO 2022134338 A1 WO2022134338 A1 WO 2022134338A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
network
semantic segmentation
image
segmentation
Prior art date
Application number
PCT/CN2021/082603
Other languages
English (en)
French (fr)
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 WO2022134338A1 publication Critical patent/WO2022134338A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • 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 image recognition, and in particular, to a field adaptation method, apparatus, electronic device and storage medium.
  • Semantic segmentation has become a key step in many modern technological applications. Since the advent of the deep learning era, automatic semantic segmentation methods in various problems have made great progress. However, during the research process of the inventors, it is found that the performance of the semantic segmentation network used for semantic segmentation will drop significantly in different fields where the samples have different distributions. Therefore, these semantic segmentation networks require pixel-by-pixel annotated images as training samples. Labeling samples is a time-consuming and expensive task.
  • Domain adaptation refers to the process of migrating a model trained in a labeled source domain to a target domain with little or no labeling.
  • Adversarial learning strategies have become a popular and common technique in domain adaptation methods, and a major limitation of adversarial learning techniques is that they need to acquire image data from both the source and target domains during the adaptation phase for adaptation.
  • the inventor realizes that sometimes, due to privacy considerations or data loss, the image data of Yuanling cannot be obtained. Therefore, due to the limitation of source domain image data acquisition, the domain adaptation efficiency is low, and it is urgent to provide an efficient domain adaptation method.
  • the embodiment of the present application provides a domain adaptation method, which does not need to use the image data of the source domain to complete the domain adaptation, so that the network trained through the target domain has the characteristics of the source domain, and the domain adaptation efficiency is improved.
  • the embodiments of the present application provide a method for adapting to the field, including:
  • Domain adaptation is performed on the second segmentation network based on the first class scale, the second class scale, and the entropy map.
  • an embodiment of the present application provides a field adaptation device, including:
  • an acquisition unit used to acquire the image to be recognized from the target domain
  • a processing unit configured to input the to-be-recognized image into a first segmentation network to obtain a first category ratio, where the first segmentation network is obtained by training with images in the source domain;
  • Domain adaptation is performed on the second segmentation network based on the first class scale, the second class scale, and the entropy map.
  • an embodiment of the present application provides an electronic device, including: a processor, the processor is connected to a memory, the memory is used for storing a computer program, and the processor is used for executing the computer program stored in the memory , so that the electronic device performs the following methods:
  • Domain adaptation is performed on the second segmentation network based on the first class scale, the second class scale, and the entropy map.
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program causes a computer to execute the following method:
  • Domain adaptation is performed on the second segmentation network based on the first class scale, the second class scale, and the entropy map.
  • an embodiment of the present application provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer is operable to cause the computer to execute as described in the first aspect Methods.
  • the image to be recognized in the target domain can be directly used to perform domain adaptation on the second segmentation network in the target domain, without using the image in the source domain, thereby solving the problem of difficulty in obtaining images in the source domain, and improving the performance of the target domain. the efficiency of domain adaptation.
  • the information entropy of each pixel is also counted, so that the adapted second segmentation network can accurately classify each pixel and improve the accuracy of semantic segmentation.
  • FIG. 1 is a schematic flowchart of a field adaptation method provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a second segmentation network provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a training process of a first segmentation network provided by an embodiment of the present application.
  • FIG. 4 is a block diagram of functional units of a domain adaptation device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a field adaptation device provided by an embodiment of the present application.
  • the technical solution of the present application relates to the field of artificial intelligence technology, and can be applied to scenarios such as smart medical treatment to realize digital medical treatment and promote the construction of smart cities.
  • the data involved in this application such as images of the sample source domain and/or target domain, can be stored in a database, or can be stored in a blockchain, such as distributed storage through a blockchain, which is not limited in this application. .
  • FIG. 1 is a schematic flowchart of a domain adaptation method provided by an embodiment of the present application. The method is applied to a domain adaptation device. The method includes the following steps:
  • the domain adaptation apparatus acquires the image to be recognized from the target domain.
  • the image to be recognized may be any image in the target domain. For the images in the target domain, most of them do not contain tags. In this application, the image to be recognized does not contain tags as an example for description.
  • the domain adaptation device inputs the image to be recognized into the first segmentation network to obtain the first category ratio, and the first segmentation network is obtained by training using images in the source domain.
  • the first segmentation network is obtained through training using images in the source domain, and the training process of the first segmentation network will be described later, which will not be described here.
  • the to-be-recognized image is input into the first image segmentation network, a feature map is performed on the to-be-recognized image, a feature map of the to-be-recognized image is obtained, and each pixel in the to-be-recognized image is obtained according to the feature map.
  • the point is semantically segmented, and the first semantic segmentation result of each pixel is obtained, wherein the semantic segmentation result of each pixel represents the probability that the pixel belongs to k categories, and the value of k is an integer from 1 to N, N is an integer greater than 1. That is to say, perform semantic segmentation on each pixel in the image to be recognized, and obtain the probability that each pixel falls into 1 category, 2 categories, ..., N categories respectively.
  • the first semantic segmentation result of each pixel is averaged to obtain the first semantic segmentation result of the image to be recognized, and the first category ratio is obtained.
  • the first semantic segmentation result of the image to be recognized can be represented by formula (1):
  • s is the image to be recognized
  • k represents k categories
  • ⁇ (s,k) is the first semantic segmentation result of the image to be recognized
  • represents the number of pixels in the image to be recognized
  • i represents the number of pixels to be recognized
  • Identify the ith pixel in the image is the first semantic segmentation result of the ith pixel in the image to be recognized, that is, the probability of belonging to k categories.
  • the first semantic segmentation result of the to-be-recognized image represents the probability that the to-be-recognized image belongs to k categories, that is, the class ratio of the to-be-recognized image, that is, the probability that the to-be-recognized image belongs to each class, as the probability of the to-be-recognized image belonging to each class. Proportion.
  • the domain adaptation device inputs the image to be recognized into the second segmentation network, and obtains a second category ratio and an entropy map, where the entropy map is a matrix formed by the information entropy of each pixel in the image to be recognized.
  • the image to be recognized is input into the second segmentation network, and each pixel in the image to be recognized is semantically segmented to obtain a second semantic segmentation result of each pixel. Similarly, the first segment of each pixel is obtained.
  • the second semantic segmentation result is used to represent the probability that each pixel belongs to k categories; then, the second semantic segmentation results of each pixel are averaged.
  • the information entropy of each pixel can be determined according to the second semantic segmentation result of each pixel, and then the information entropy of each pixel is formed into an entropy map, that is, a matrix formed by the information entropy.
  • the information entropy of each pixel can be represented by formula (2):
  • H(i) represents the information entropy of the ith pixel, Indicates the probability that the ith pixel belongs to the j category, where j is an integer from 1 to N.
  • the domain adaptation device performs domain adaptation on the second segmentation network according to the first category scale, the second category scale, and the entropy map.
  • the target loss can be expressed by formula (3):
  • Loss is the target loss
  • is the preset parameter
  • KL is the KL divergence operation
  • lent is the information entropy operation
  • the to-be-recognized image of the target domain in the process of domain adaptation, can be directly used to perform domain adaptation on the second segmentation network of the target domain, without using the image of the source domain, and then It solves the problem of difficult image acquisition in the source domain and improves the efficiency of domain adaptation.
  • the information entropy of each pixel is also counted, so that the adapted second segmentation network can accurately classify each pixel and improve the accuracy of semantic segmentation.
  • the following describes the process of semantically segmenting the pixels in the image to be recognized in conjunction with the network structure of the second segmentation network.
  • the network structure of the first segmentation network is similar to that of the second segmentation network, and the method of semantic segmentation of the image to be recognized is similar to the segmentation method of the image to be recognized by the second network structure, and will not be described again.
  • the second segmentation network includes an encoding network, a first convolutional layer, a decoding network and a second convolutional layer. Therefore, perform downsampling processing on the to-be-recognized image through the encoding network to obtain the first feature map, and perform upsampling processing on the first feature map through the decoding network to obtain the second feature map; the second feature map is obtained through the second convolution layer.
  • the feature map is segmented, and the second semantic segmentation result of each pixel is obtained.
  • the dimension of the convolution kernel of the convolution layer is 1*1, then the pixel value of each pixel point in the second feature map is convolved through the convolution kernel, and the first pixel value on each channel is processed by convolution.
  • the pixel values after the convolution of the two feature maps are subjected to softmax normalization to obtain the second semantic segmentation result of each pixel. It should be understood that more convolutional layers may be designed to perform semantic segmentation, and this application only takes one convolutional layer as an example for description.
  • the third feature map is semantically segmented through the first convolutional layer to obtain a third semantic segmentation result for each pixel, wherein the The semantic segmentation of the third feature map by a convolutional layer is similar to the semantic segmentation of the second feature map by the second convolutional layer, and will not be described again.
  • the third KL divergence can be represented by formula (4):
  • KL 3 is the third KL divergence.
  • the target loss can be determined according to the first KL divergence, the third KL divergence, the sum of the information entropy of each pixel point, and a preset parameter. Then, domain adaptation is performed on this second segmentation network according to the target loss.
  • the decoding network and the second convolutional layer are deleted to obtain a third segmentation network, and the second segmentation network with the decoding network and the second convolutional layer deleted (ie The third segmentation network) performs semantic segmentation on images.
  • the loss between the encoding network and the decoding network (the third KL divergence) is determined during the domain adaptation of the second segmentation network, that is, the encoding network and the decoding network are trained against each other, so that the encoding network has the ability to decode Then, without reducing the accuracy of semantic segmentation, the decoding network is deleted, which reduces the model scale of the second segmentation network, which is more conducive to the migration of the second segmentation network and improves the efficiency of the second segmentation network for semantic segmentation.
  • the first segmentation network can be used as the supervision network of the second segmentation network. Therefore, in order to ensure the accuracy of the semantic segmentation of each pixel, after the first segmentation network is trained, it is not necessary to delete the first segmentation.
  • the decoding network in the network and the convolutional layers connected with the decoding network are used as the supervision network of the second segmentation network.
  • the field adaptation method of the present application can be applied to the medical field. That is to say, if the first segmentation network and the second segmentation network are networks for lesion segmentation, the probability that each pixel belongs to k categories, that is, the probability that each pixel belongs to k lesions.
  • the first segmentation network can be trained using an existing source domain image data (for example, tumor-related medical images in an open source database, with labels).
  • the second segmentation network is adapted based on the trained first segmentation network and the lack of annotations, so that the second segmentation network has the segmentation effect of the first segmentation network, so that the image knowledge of the source domain is transferred to the target domain, and the first segmentation network is improved.
  • the segmentation accuracy of the binary segmentation network can improve the accuracy of lesion segmentation, thereby providing data reference for doctors' diagnosis and promoting the progress of medical technology.
  • the domain adaptation method of the present application can also be applied to the blockchain domain, for example, the images of the source domain and/or the target domain can be stored in the blockchain, so that the source domain and/or the image of the target domain can be stored in the blockchain. or security during image access for the target domain.
  • FIG. 3 is a schematic flowchart of training a first segmentation network according to an embodiment of the present application. The method includes the following steps:
  • the fourth KL divergence is used as the loss result of the first segmentation network, and then, according to the loss result, the network parameters of the neural network are adjusted until the first segmentation network converges, and the first segmentation network is completed. training.
  • FIG. 4 is a block diagram of functional units of a domain adaptation apparatus provided by an embodiment of the present application.
  • the domain adaptation apparatus 400 includes: an acquisition unit 401 and a processing unit 402, wherein:
  • Obtaining unit 401 used to obtain the image to be recognized from the target domain
  • a processing unit 402 configured to input the to-be-recognized image into a first segmentation network to obtain a first category ratio, where the first segmentation network is obtained by training with images of the source domain;
  • Domain adaptation is performed on the second segmentation network based on the first class scale, the second class scale, and the entropy map.
  • the processing unit 402 is specifically configured to:
  • the first semantic segmentation result of the pixel represents the probability that each pixel belongs to k categories, where k is an integer from 1 to N, and N is an integer greater than 1;
  • the first category ratio is obtained according to the first semantic segmentation result of the to-be-recognized image.
  • the processing unit 402 is specifically configured to:
  • Input the image to be recognized into the second segmentation network perform semantic segmentation on each pixel in the image to be recognized, and obtain the second semantic segmentation result of each pixel, the
  • the second semantic segmentation result is used to represent the probability that each pixel belongs to k categories, where k is an integer from 1 to N, and N is an integer greater than 1;
  • the information entropy of each pixel point is determined, and the information entropy of each pixel point is formed into the entropy map.
  • the processing unit 402 in terms of performing domain adaptation on the second segmentation network according to the first class ratio, the second class ratio and the entropy map, is specifically configured to:
  • the network parameters of the second segmentation network are adjusted according to the target loss to perform domain adaptation on the second segmentation network.
  • the second segmentation network further includes a first convolutional layer, the first convolutional layer is connected to the encoding network; and the first feature map is processed by the decoding network. Sampling processing, before obtaining the second feature map, the processing unit 402 is further used for:
  • Semantic segmentation is performed on the third feature map through the first convolution layer to obtain a third semantic segmentation result of each pixel;
  • the processing unit 402 is specifically used for:
  • the target loss is determined according to the first KL divergence, the third KL divergence, the sum of the information entropy of each pixel point, and a preset parameter.
  • the processing unit 402 is further configured to delete the decoding network and the second convolution layer after completing the domain adaptation to the second segmentation network to obtain a third segmentation network; using the The third segmentation network described above performs semantic segmentation on images.
  • FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the electronic device includes: a processor and a memory.
  • the electronic device may further include a transceiver.
  • the electronic device 500 includes a transceiver 501 , a processor 502 and a memory 503 . They are connected through a bus 504 .
  • the memory 503 is used to store computer programs and data, and can transmit the data stored by the memory 503 to the processor 502 .
  • the processor 502 is used to read the computer program in the memory 503 to perform the following operations:
  • Domain adaptation is performed on the second segmentation network based on the first class scale, the second class scale, and the entropy map.
  • the processor 502 in terms of inputting the to-be-recognized image into the first segmentation network to obtain the first category ratio, the processor 502 is configured to perform the following steps:
  • the first semantic segmentation result of the pixel represents the probability that each pixel belongs to k categories, where k is an integer from 1 to N, and N is an integer greater than 1;
  • the first category ratio is obtained according to the first semantic segmentation result of the to-be-recognized image.
  • the processor 502 is configured to perform the following steps in inputting the to-be-recognized image into the second segmentation network to obtain the second category scale and the entropy map:
  • Input the image to be recognized into the second segmentation network perform semantic segmentation on each pixel in the image to be recognized, and obtain the second semantic segmentation result of each pixel, the
  • the second semantic segmentation result is used to represent the probability that each pixel belongs to k categories, where k is an integer from 1 to N, and N is an integer greater than 1;
  • the information entropy of each pixel point is determined, and the information entropy of each pixel point is formed into the entropy map.
  • processor 502 is configured to perform the following steps in performing domain adaptation on the second segmentation network based on the first class scale, the second class scale, and the entropy map:
  • the network parameters of the second segmentation network are adjusted according to the target loss to perform domain adaptation on the second segmentation network.
  • the second segmentation network further includes a first convolutional layer, the first convolutional layer is connected to the encoding network; and the first feature map is processed by the decoding network. Sampling processing, before obtaining the second feature map, the processor 502 is further configured to perform the following steps:
  • Semantic segmentation is performed on the third feature map through the first convolution layer to obtain a third semantic segmentation result of each pixel;
  • the processor 502 is configured to perform the following steps:
  • the target loss is determined according to the first KL divergence, the third KL divergence, the sum of information entropy of each pixel point, and a preset parameter.
  • the processor 502 is further configured to perform the following steps:
  • the decoding network and the second convolutional layer are deleted to obtain a third segmentation network; the third segmentation network is used to perform semantic segmentation on the image.
  • the transceiver 501 may be the transceiver unit 401 of the domain adaptation apparatus 400 of the embodiment described in FIG. 4
  • the processor 502 may be the processing unit 402 of the domain adaptation apparatus 400 of the embodiment described in FIG. 4 .
  • the field adaptation device in this application may include smart phones (such as Android mobile phones, iOS mobile phones, Windows Phone mobile phones, etc.), tablet computers, palmtop computers, notebook computers, and mobile Internet devices MID (Mobile Internet Devices, referred to as: MID) or wearable devices, etc.
  • MID Mobile Internet Devices, referred to as: MID
  • the above field adaptation devices are only examples, not exhaustive, including but not limited to the above field adaptation devices.
  • the above-mentioned field adaptation apparatus may further include: an intelligent vehicle-mounted terminal, a computer device, and the like.
  • Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement any one of the field adaptation methods described in the foregoing method embodiments some or all of the steps.
  • the computer program can implement the following methods when executed by a processor:
  • Domain adaptation is performed on the second segmentation network based on the first class scale, the second class scale, and the entropy map.
  • the storage medium involved in the present application such as a computer-readable storage medium, may be non-volatile or volatile.
  • the above-mentioned computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area Data etc. created according to the usage of blockchain nodes can be stored.
  • 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.
  • the embodiments of the present application further provide a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the methods described in the foregoing method embodiments. Some or all of the steps of any domain adaptation method.
  • the disclosed apparatus may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units 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 units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit 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, and can also be implemented in the form of software program modules.
  • the integrated unit if implemented in the form of a software program module and sold or used as a stand-alone product, may be stored in a computer readable memory.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art, or all or part of the technical solution, and the computer software product is stored in a memory.
  • a computer device which may be a personal computer, a server, or a network device, etc.
  • the aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

Landscapes

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

Abstract

本申请实施例涉及人工智能技术领域,具体涉及一种领域适应方法、装置、设备及存储介质。该方法包括:从目标域获取待识别图像;将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。本申请有利于提高领域适应的效率。

Description

领域适应方法、装置、电子设备及存储介质
本申请要求于2020年12月23日提交中国专利局、申请号为202011543313.3,发明名称为“领域适应方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像识别技术领域,具体涉及一种领域适应方法、装置、电子设备及存储介质。
背景技术
语义分割,已经成为了众多现代科技应用中的关键步骤。自从深度学习时代来到后,各种问题中的自动语义分割方法都获得了长足的进步。但是,发明人研究过程中发现,用于语义分割的语义分割网络,在样本具有不同分布的不同领域中性能会大幅下降。因此,这些语义分割网络需要逐像素标注的图像作为训练样本。而标注样本,是一个既耗费时间,又耗费金钱的工作。
为了克服这个问题,出现了领域自适应方法,领域自适应指的是将一个在有标注的源领域训练好的模型,迁移到一个没有或者只有极少标注的目标领域的过程。对抗学习策略成为了领域自适应方法中流行的常用技术,而对抗学习技术的一个主要的限制是,其需要在适应阶段同时获取源域以及目标域的图像数据来进行适应。而发明人意识到,有些时候,出于隐私考虑,或者是数据丢失等原因,源领的图像数据并不能够被获取。因此,由于源域图像数据获取的限制,导致领域适应效率低,亟需提供一种高效的领域适应方法。
发明内容
本申请实施例提供了一种领域适应方法,无需使用源域的图像数据完成领域适应,使通过目标域训练出的网络具有源域的特性,提高领域适应效率。
第一方面,本申请实施例提供一种领域适应方法,包括:
从目标域获取待识别图像;
将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
第二方面,本申请实施例提供一种领域适应装置,包括:
获取单元,用于从目标域获取待识别图像;
处理单元,用于将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
第三方面,本申请实施例提供一种电子设备,包括:处理器,所述处理器与存储器相连,所述存储器用于存储计算机程序,所述处理器用于执行所述存储器中存储的计算机程序,以使得所述电子设备执行以下方法:
从目标域获取待识别图像;
将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
第四方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序使得计算机执行以下方法:
从目标域获取待识别图像;
将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
第五方面,本申请实施例提供一种计算机程序产品,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机可操作来使计算机执行如第一方面所述的方法。
实施本申请实施例,可以直接使用目标域的待识别图像,对目标域的第二分割网络进行领域适应,不需要使用源域的图像,进而解决了源域中的图像获取困难的问题,提高了领域适应的效率。此外,在进行适应的过程中,还统计了每个像素点的信息熵,这样可以使适应后的第二分割网络可以准确的对每个像素点进行分类,提高语义分割精度。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种领域适应方法的流程示意图;
图2为本申请实施例提供的一种第二分割网络的结构示意图;
图3为本申请实施例提供的一种第一分割网络的训练流程示意图;
图4为本申请实施例提供的一种领域适应装置的功能单元组成框图;
图5为本申请实施例提供的一种领域适应装置的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结果或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
本申请的技术方案涉及人工智能技术领域,如可应用于智慧医疗等场景中,以实现数 字医疗,推动智慧城市的建设。可选的,本申请涉及的数据如样源域和/或目标域的图像等可存储于数据库中,或者可以存储于区块链中,比如通过区块链分布式存储,本申请不做限定。
参阅图1,图1为本申请实施例提供的一种领域适应方法的流程示意图。该方法应用于领域适应装置。该方法包括以下步骤:
101:领域适应装置从目标域获取待识别图像。
其中,待识别图像可以为目标域中的任意一张图像。对于目标域中的图像来说,大部分是不含有标签的,本申请中以待识别图像不含有标签为例进行说明。
102:领域适应装置将待识别图像输入到第一分割网络,得到第一类别比例,第一分割网络为使用源域的图像进行训练得到的。
示例性的,该第一分割网络是使用源域的图像进行训练得到的,后面描述对第一分割网络的训练过程,在此不做过多的描述。
示例性的,将该待识别图像输入到第一图像分割网络,对该待识别图像进行特征图,得到该待识别图像的特征图,并根据该特征图对该待识别图像中的每个像素点进行语义分割,得到每个像素点的第一语义分割结果,其中,每个像素点的语义分割结果表示该像素点属于k个类别的概率,k的取值为从1到N的整数,N为大于1的整数。也就是说,对待识别图像中的每个像素点进行语义分割,得到每个像素点分别落入1个类别、2个类别、…、N个类别的概率。
然后,对每个像素点的第一语义分割结果求平均,得到待识别图像的第一语义分割结果,得到第一类别比例。示例性的,待识别图像的第一语义分割结果可以通过公式(1)表示:
Figure PCTCN2021082603-appb-000001
其中,s为待识别图像,k表示k个类别,τ(s,k)为待识别图像的第一语义分割结果,|{Ω s}|表示待识别图像中像素点的数量,i表示待识别图像中的第i个像素点,
Figure PCTCN2021082603-appb-000002
为待识别图像中的第i个像素点的第一语义分割结果,即属于k个类别的概率。
进一步地,该待识别图像的第一语义分割结果表示了该待识别图像属于k个类别的概率,也就是该待识别图像的类别比例,即将待识别图像属于各个类别的概率,作为各个类别的比例。
103:领域适应装置将待识别图像输入到第二分割网络,得到第二类别比例以及熵图,熵图是由待识别图像中各个像素点的信息熵构成的矩阵。
示例性的,将该待识别图像输入到第二分割网络,对该待识别图像中每个像素点进行语义分割,得到每个像素点的第二语义分割结果,同样,每个像素点的第二语义分割结果用于表示每个像素点属于k个类别的概率;然后,对每个像素点的第二语义分割结果求平均。进一步的,可根据每个像素点的第二语义分割结果,确定每个像素点的信息熵,然后,将每个像素点的信息熵组成熵图,即一个由信息熵组成的矩阵。示例性的,每个像素点的信息熵可以通过公式(2)表示:
Figure PCTCN2021082603-appb-000003
其中,H(i)表示第i个像素点的信息熵,
Figure PCTCN2021082603-appb-000004
表示第i个像素点属于j个类别的概率, j的取值为从1到N的整数。
104:领域适应装置根据第一类别比例、第二类别比例以及熵图,对第二分割网络进行领域适应。
示例性的,确定该第一类别比例和第二类别比例之间的第一KL散度,以及对该熵图中各个像素点的信息上求和;根据该第一KL散度、各个像素点的信息熵之和以及预设参数,确定目标损失;最后,根据该目标损失调整该第二分割网络的网络参数,以对该第二分割网络进行领域适应。示例性的,目标损失可以通过公式(3)表示:
Figure PCTCN2021082603-appb-000005
其中,Loss为目标损失,λ为预设参数,KL为求KL散度操作,
Figure PCTCN2021082603-appb-000006
为待识别图像s的第二语义分割结果,lent为求信息熵操作,
Figure PCTCN2021082603-appb-000007
为待识别图像中第i个像素点的第二语义分割结果。
可以看出,在本申请实施例中,在进行领域的适应过程中,可以直接使用目标域的待识别图像,对目标域的第二分割网络进行领域适应,不需要使用源域的图像,进而解决了源域中的图像获取困难的问题,提高了领域适应的效率。此外,在进行适应的过程中,还统计了每个像素点的信息熵,这样可以使适应后的第二分割网络可以准确的对每个像素点进行分类,提高语义分割精度。
下面结合第二分割网络的网络结构叙述对待识别图像中的像素点进行语义分割的过程。其中,第一分割网络与第二分割网络的网络结构类似,且对待识别图像进行语义分割的方式,与第二网络结构对待识别图像的分割方式类似,不再叙述。
如图2所示,第二分割网络包括编码网络、第一卷积层、解码网络和第二卷积层。因此,通过该编码网络对该待识别图像进行下采样处理,得到第一特征图通过解码网络对第一特征图进行上采样处理,得到第二特征图;通过第二卷积层对该第二特征图进行分割,得到每个像素点的第二语义分割结果。示例性的,该卷积层的卷积核维度为1*1,则通过该卷积核对该第二特征图中每个像素点的像素值进行卷积处理,并将每个通道上的第二特征图卷积处理之后的像素值进行softmax归一化处理,得到每个像素点的第二语义分割结果。应理解,还可设计更多的卷积层进行语义分割,本申请中只是一个卷积层为例进行说明。
此外,在通过该解码网络对该第一特征图进行上采样之前,对该第一特征图进行双线性插值,将该第一特征图进行尺度恢复,得到第三特征图,其中,该第三特征图的维度与该第二特征图的维度相同;然后,通过该第一卷积层对该第三特征图进行语义分割,得到每个像素点的第三语义分割结果,其中,通过第一卷积层对第三特征图进行语义分割,与通过第二卷积层对第二特征图进行语义分割方式类似,不再叙述。然后,确定每个像素点的第二语义分割结果与每个像素点的第三语义分割结果之间的第二KL散度;并获取该待识别图像中各个像素点的第二KL散度的平均值,得到第三KL散度。示例性的,第三KL散度可通过公式(4)表示:
Figure PCTCN2021082603-appb-000008
其中,KL 3为第三KL散度。
进一步的,在确定出第三KL散度之后,则可以根据该第一KL散度、第三KL散度、各个像素点的信息熵之和以及预设参数,确定目标损失。然后,根据该目标损失,对该第 二分割网络进行领域适应。此外,在对该第二分割网络领域适应完成之后,删除该解码网络和第二卷积层,得到第三分割网络,并使用删除了解码网络和第二卷积层的第二分割网络(即第三分割网络)对图像进行语义分割。
可以看出,在对第二分割网络进行领域适应时,确定编码网络和解码网络之间的损失(第三KL散度),也就是将编码网络和解码网络进行对抗训练,使编码网络具备解码网络的功能,然后,在不降低语义分割精度的情况下,删除解码网络,降低了第二分割网络的模型规模,更利于第二分割网络的迁移和提高第二分割网络进行语义分割的效率。
应理解,对于第一分割网络来说,可以作为第二分割网络的监督网络,因此,为了保证对每个像素点语义分割的精度,在对第一分割网络完成训练之后,不用删除第一分割网络中的解码网络以及与解码网络连接的卷积层。
在一些可能的实施方式中,本申请的领域适应方法可以应用到医疗领域。也就是说,该第一分割网络和第二分割网络为用于病灶分割的网络,则每个像素点属于k个类别的概率,也就是每个像素点属于k个病灶的概率。对于医疗领域来说,医学图像的标注成本比较高,所以,可以使用一个已有的源域的图像数据(比如,开源数据库中与肿瘤相关的医学图像,带有标签)训练第一分割网络,然后,基于训练好的第一分割网络以及未提供标注对第二分割网络进行适应,使第二分割网络具有第一分割网络的分割效果,从而将源域的图像知识迁移到目标域,提高第二分割网络的分割精度,进而提高病灶分割的精度,从而为医生诊断提供数据参考,推动医学科技的进步。
在一些可能的实施方式中,本申请的领域适应方法还可以应用到区块链领域,比如,可以将源域和/或目标域的图像存储到区块链中,这样可以保证源域和/或目标域的图像存取过程中的安全性。
参阅图3,图3为本申请实施例提供的一种训练第一分割网络的流程示意图。该方法包括以下步骤:
301:从源域获取训练图像。
302:将该训练图像输入到第一分割网络,预测训练图像中每个像素点的第四语义分割结果,每个像素点的第四语义分割结果用于表示该像素点属于k个类别的概率。
303:根据每个像素点的第四语义分割结果以及每个像素点的标签,确定第四KL散度,其中,每个像素点的标签用于表征该像素点属于k个类别的真实概率。
304:根据第四KL散度调整第一分割网络的网络参数。
示例性的,将该第四KL散度作为该第一分割网络的损失结果,然后,根据该损失结果调整该神经网络的网络参数,直至该第一分割网络收敛,完成对该第一分割网络的训练。
参阅图4,图4本申请实施例提供的一种领域适应装置的功能单元组成框图。领域适应装置400包括:获取单元401和处理单元402,其中:
获取单元401,用于从目标域获取待识别图像;
处理单元402,用于将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
在一些可能的实施方式中,在将所述待识别图像输入到第一分割网络,得到第一类别比例方面,处理单元402,具体用于:
将所述待识别图像输入到所述第一分割网络,对所述待识别图像中每个像素点进行语义分割,得到所述每个像素点的第一语义分割结果,其中,所述每个像素点的第一语义分 割结果表示所述每个像素点属于k个类别的概率,k的取值为从1到N的整数,N为大于1的整数;
对所述每个像素点的第一语义分割结果求平均,得到所述待识别图像的第一语义分割结果;
根据所述待识别图像的第一语义分割结果,得到所述第一类别比例。
在一些可能的实施方式中,在将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图方面,处理单元402,具体用于:
将所述待识别图像输入到第二分割网络,对所述待识别图像中每个像素点进行语义分割,得到所述每个像素点的第二语义分割结果,所述每个像素点的第二语义分割结果用于表示所述每个像素点属于k个类别的概率,k的取值为1到N的整数,N为大于1的整数;
对所述每个像素点的第二语义分割结果求平均,得到所述待识别图像的第二语义分割结果;
根据所述每个像素点的第二语义分割结果以及信息熵计算公式,确定所述每个像素点的信息熵,并将所述每个像素点的信息熵组成所述熵图。
在一些可能的实施方式中,在根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应方面,处理单元402,具体用于:
确定所述第一类别比例和所述第二类别比例之间的第一KL散度;
确定所述熵图中各个像素点的信息熵之和;
根据所述第一KL散度、各个像素点的信息熵之和以及预设参数,确定目标损失;
根据所述目标损失调整所述第二分割网络的网络参数,以对所述第二分割网络进行领域适应。
在一些可能的实施方式中,所述第二分割网络还包括第一卷积层,所述第一卷积层与所述编码网络连接;通过所述解码网络对所述第一特征图进行上采样处理,得到第二特征图之前,处理单元402,还用于:
对所述第一特征图进行双线性插值,得到第三特征图,其中,所述第三特征图的维度与所述第二特征图的维度相同;
通过所述第一卷积层对所述第三特征图进行语义分割,得到所述每个像素点的第三语义分割结果;
确定所述每个第二像素点的第二语义分割结果和所述每个像素点的第三语义分割结果之间的第二KL散度,并获取所述待识别图像中各个像素点的第二KL散度的平均值,得到第三KL散度;
在根据所述第一KL散度、各个像素点的信息熵之和以及预设参数,确定目标损失方面,处理单元402,具体用于:
根据所述第一KL散度、所述第三KL散度、各个像素点的信息熵之和以及预设参数,确定目标损失。
在一些可能的实施方式中,处理单元402,还用于在对所述第二分割网络完成领域适应之后,删除所述解码网络和所述第二卷积层,得到第三分割网络;使用所述第三分割网络对图像进行语义分割。
参阅图5,图5为本申请实施例提供的一种电子设备的结构示意图。该电子设备包括:处理器和存储器。可选的,该电子设备还可包括收发器。如图5所示,电子设备500包括收发器501、处理器502和存储器503。它们之间通过总线504连接。存储器503用于存储计算机程序和数据,并可以将存储503存储的数据传输给处理器502。
处理器502用于读取存储器503中的计算机程序执行以下操作:
从目标域获取待识别图像;
将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
在一些可能的实施方式中,在将所述待识别图像输入到第一分割网络,得到第一类别比例方面,处理器502用于执行以下步骤:
将所述待识别图像输入到所述第一分割网络,对所述待识别图像中每个像素点进行语义分割,得到所述每个像素点的第一语义分割结果,其中,所述每个像素点的第一语义分割结果表示所述每个像素点属于k个类别的概率,k的取值为从1到N的整数,N为大于1的整数;
对所述每个像素点的第一语义分割结果求平均,得到所述待识别图像的第一语义分割结果;
根据所述待识别图像的第一语义分割结果,得到所述第一类别比例。
在一些可能的实施方式中,在将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图方面,处理器502用于执行以下步骤:
将所述待识别图像输入到第二分割网络,对所述待识别图像中每个像素点进行语义分割,得到所述每个像素点的第二语义分割结果,所述每个像素点的第二语义分割结果用于表示所述每个像素点属于k个类别的概率,k的取值为1到N的整数,N为大于1的整数;
对所述每个像素点的第二语义分割结果求平均,得到所述待识别图像的第二语义分割结果;
根据所述每个像素点的第二语义分割结果以及信息熵计算公式,确定所述每个像素点的信息熵,并将所述每个像素点的信息熵组成所述熵图。
在一些可能的实施方式中,在根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应方面处理器502用于执行以下步骤:
确定所述第一类别比例和所述第二类别比例之间的第一KL散度;
确定所述熵图中各个像素点的信息熵之和;
根据所述第一KL散度、各个像素点的信息熵之和以及预设参数,确定目标损失;
根据所述目标损失调整所述第二分割网络的网络参数,以对所述第二分割网络进行领域适应。
在一些可能的实施方式中,所述第二分割网络还包括第一卷积层,所述第一卷积层与所述编码网络连接;通过所述解码网络对所述第一特征图进行上采样处理,得到第二特征图之前,处理器502还用于执行以下步骤:
对所述第一特征图进行双线性插值,得到第三特征图,其中,所述第三特征图的维度与所述第二特征图的维度相同;
通过所述第一卷积层对所述第三特征图进行语义分割,得到所述每个像素点的第三语义分割结果;
确定所述每个第二像素点的第二语义分割结果和所述每个像素点的第三语义分割结果之间的第二KL散度,并获取所述待识别图像中各个像素点的第二KL散度的平均值,得到第三KL散度;
在根据所述第一KL散度、各个像素点的信息熵之和以及预设参数,确定目标损失方面,处理器502用于执行以下步骤:
根据所述第一KL散度、所述第三KL散度、各个像素点的信息熵之和以及预设参数, 确定目标损失。
在一些可能的实施方式中,处理器502还用于执行以下步骤:
在对所述第二分割网络完成领域适应之后,删除所述解码网络和所述第二卷积层,得到第三分割网络;使用所述第三分割网络对图像进行语义分割。
具体地,上述收发器501可为图4所述的实施例的领域适应装置400的收发单元401,上述处理器502可以为图4所述的实施例的领域适应装置400的处理单元402。
应理解,本申请中的领域适应装置可以包括智能手机(如Android手机、iOS手机、Windows Phone手机等)、平板电脑、掌上电脑、笔记本电脑、移动互联网设备MID(Mobile Internet Devices,简称:MID)或穿戴式设备等。上述领域适应装置仅是举例,而非穷举,包含但不限于上述领域适应装置。在实际应用中,上述领域适应装置还可以包括:智能车载终端、计算机设备等等。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现如上述方法实施例中记载的任何一种领域适应方法的部分或全部步骤。例如,所述计算机程序被处理器执行时可以实现以下方法:
从目标域获取待识别图像;
将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
可选的,该计算机程序被处理器执行时还可实现上述实施例中方法的其他步骤,这里不再赘述。进一步可选的,本申请涉及的存储介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。
在本申请的一个实施方式中,上述的计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
其中,本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
本申请实施例还提供一种计算机程序产品,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计算机执行如上述方法实施例中记载的任何一种领域适应方法的部分或全部步骤。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作和模块并不一定是本申请所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种 逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件程序模块的形式实现。
所述集成的单元如果以软件程序模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种领域适应方法,包括:
    从目标域获取待识别图像;
    将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
    将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
    根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
  2. 根据权利要求1所述的方法,其中,所述将所述待识别图像输入到第一分割网络,得到第一类别比例,包括:
    将所述待识别图像输入到所述第一分割网络,对所述待识别图像中每个像素点进行语义分割,得到所述每个像素点的第一语义分割结果,其中,所述每个像素点的第一语义分割结果表示所述每个像素点属于k个类别的概率,k的取值为从1到N的整数,N为大于1的整数;
    对所述每个像素点的第一语义分割结果求平均,得到所述待识别图像的第一语义分割结果;
    根据所述待识别图像的第一语义分割结果,得到所述第一类别比例。
  3. 根据权利要求1或2所述的方法,其中,所述将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,包括:
    将所述待识别图像输入到第二分割网络,对所述待识别图像中每个像素点进行语义分割,得到所述每个像素点的第二语义分割结果,所述每个像素点的第二语义分割结果用于表示所述每个像素点属于k个类别的概率,k的取值为1到N的整数,N为大于1的整数;
    对所述每个像素点的第二语义分割结果求平均,得到所述待识别图像的第二语义分割结果;
    根据所述每个像素点的第二语义分割结果以及信息熵计算公式,确定所述每个像素点的信息熵,并将所述每个像素点的信息熵组成所述熵图。
  4. 根据权利要求3所述的方法,其中,所述根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应,包括:
    确定所述第一类别比例和所述第二类别比例之间的第一KL散度;
    确定所述熵图中各个像素点的信息熵之和;
    根据所述第一KL散度、各个像素点的信息熵之和、以及预设参数,确定目标损失;
    根据所述目标损失调整所述第二分割网络的网络参数,以对所述第二分割网络进行领域适应。
  5. 根据权利要求4所述的方法,其中,所述第二分割网络包括编码网络、解码网络、第二卷积层,其中,所述第二卷积层与所述解码网络连接,所述将所述待识别图像输入到第二分割网络,对所述待识别图像中每个像素点进行分割,得到所述每个像素点的第二语义分割结果,包括:
    通过所述编码网络对所述待识别图像进行下采样处理,得到第一特征图;
    通过所述解码网络对所述第一特征图进行上采样处理,得到第二特征图;
    通过所述第二卷积层对所述第二特征图进行语义分割,得到所述每个像素点的第二语义分割结果。
  6. 根据权利要求5所述的方法,其中,所述第二分割网络还包括第一卷积层,所述第一卷积层与所述编码网络连接;通过所述解码网络对所述第一特征图进行上采样处理,得 到第二特征图之前,所述方法还包括:
    对所述第一特征图进行双线性插值,得到第三特征图,其中,所述第三特征图的维度与所述第二特征图的维度相同;
    通过所述第一卷积层对所述第三特征图进行语义分割,得到所述每个像素点的第三语义分割结果;
    确定所述每个第二像素点的第二语义分割结果和所述每个像素点的第三语义分割结果之间的第二KL散度,并获取所述待识别图像中各个像素点的第二KL散度的平均值,得到第三KL散度;
    所述根据所述第一KL散度、各个像素点的信息熵之和、以及预设参数,确定目标损失,包括:
    根据所述第一KL散度、所述第三KL散度、各个像素点的信息熵之和、以及预设参数,确定目标损失。
  7. 根据权利要求5或6所述的方法,其中,所述方法还包括:
    在对所述第二分割网络完成领域适应之后,删除所述解码网络和所述第二卷积层,得到第三分割网络;
    使用所述第三分割网络对图像进行语义分割。
  8. 一种领域适应装置,包括:
    获取单元,用于从目标域获取待识别图像;
    处理单元,用于将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
    将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
    根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
  9. 一种电子设备,包括:处理器和存储器,所述处理器与所述存储器相连,所述存储器用于存储计算机程序,所述处理器用于执行所述存储器中存储的计算机程序,以使得所述电子设备执行以下方法:
    从目标域获取待识别图像;
    将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
    将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
    根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
  10. 根据权利要求9所述的电子设备,其中,执行所述将所述待识别图像输入到第一分割网络,得到第一类别比例,包括:
    将所述待识别图像输入到所述第一分割网络,对所述待识别图像中每个像素点进行语义分割,得到所述每个像素点的第一语义分割结果,其中,所述每个像素点的第一语义分割结果表示所述每个像素点属于k个类别的概率,k的取值为从1到N的整数,N为大于1的整数;
    对所述每个像素点的第一语义分割结果求平均,得到所述待识别图像的第一语义分割结果;
    根据所述待识别图像的第一语义分割结果,得到所述第一类别比例。
  11. 根据权利要求9或10所述的电子设备,其中,执行所述将所述待识别图像输入到 第二分割网络,得到第二类别比例以及熵图,包括:
    将所述待识别图像输入到第二分割网络,对所述待识别图像中每个像素点进行语义分割,得到所述每个像素点的第二语义分割结果,所述每个像素点的第二语义分割结果用于表示所述每个像素点属于k个类别的概率,k的取值为1到N的整数,N为大于1的整数;
    对所述每个像素点的第二语义分割结果求平均,得到所述待识别图像的第二语义分割结果;
    根据所述每个像素点的第二语义分割结果以及信息熵计算公式,确定所述每个像素点的信息熵,并将所述每个像素点的信息熵组成所述熵图。
  12. 根据权利要求11所述的电子设备,其中,执行所述根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应,包括:
    确定所述第一类别比例和所述第二类别比例之间的第一KL散度;
    确定所述熵图中各个像素点的信息熵之和;
    根据所述第一KL散度、各个像素点的信息熵之和、以及预设参数,确定目标损失;
    根据所述目标损失调整所述第二分割网络的网络参数,以对所述第二分割网络进行领域适应。
  13. 根据权利要求12所述的电子设备,其中,所述第二分割网络包括编码网络、解码网络、第二卷积层,其中,所述第二卷积层与所述解码网络连接,执行所述将所述待识别图像输入到第二分割网络,对所述待识别图像中每个像素点进行分割,得到所述每个像素点的第二语义分割结果,包括:
    通过所述编码网络对所述待识别图像进行下采样处理,得到第一特征图;
    通过所述解码网络对所述第一特征图进行上采样处理,得到第二特征图;
    通过所述第二卷积层对所述第二特征图进行语义分割,得到所述每个像素点的第二语义分割结果。
  14. 根据权利要求13所述的电子设备,其中,所述第二分割网络还包括第一卷积层,所述第一卷积层与所述编码网络连接;通过所述解码网络对所述第一特征图进行上采样处理,得到第二特征图之前,还用于执行:
    对所述第一特征图进行双线性插值,得到第三特征图,其中,所述第三特征图的维度与所述第二特征图的维度相同;
    通过所述第一卷积层对所述第三特征图进行语义分割,得到所述每个像素点的第三语义分割结果;
    确定所述每个第二像素点的第二语义分割结果和所述每个像素点的第三语义分割结果之间的第二KL散度,并获取所述待识别图像中各个像素点的第二KL散度的平均值,得到第三KL散度;
    执行所述根据所述第一KL散度、各个像素点的信息熵之和、以及预设参数,确定目标损失,包括:
    根据所述第一KL散度、所述第三KL散度、各个像素点的信息熵之和、以及预设参数,确定目标损失。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现以下方法:
    从目标域获取待识别图像;
    将所述待识别图像输入到第一分割网络,得到第一类别比例,所述第一分割网络为使用源域的图像进行训练得到的;
    将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,所述熵图是由所述待识别图像中各个像素点的信息熵构成的矩阵;
    根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应。
  16. 根据权利要求15所述的计算机可读存储介质,其中,执行所述将所述待识别图像输入到第一分割网络,得到第一类别比例,包括:
    将所述待识别图像输入到所述第一分割网络,对所述待识别图像中每个像素点进行语义分割,得到所述每个像素点的第一语义分割结果,其中,所述每个像素点的第一语义分割结果表示所述每个像素点属于k个类别的概率,k的取值为从1到N的整数,N为大于1的整数;
    对所述每个像素点的第一语义分割结果求平均,得到所述待识别图像的第一语义分割结果;
    根据所述待识别图像的第一语义分割结果,得到所述第一类别比例。
  17. 根据权利要求15或16所述的计算机可读存储介质,其中,执行所述将所述待识别图像输入到第二分割网络,得到第二类别比例以及熵图,包括:
    将所述待识别图像输入到第二分割网络,对所述待识别图像中每个像素点进行语义分割,得到所述每个像素点的第二语义分割结果,所述每个像素点的第二语义分割结果用于表示所述每个像素点属于k个类别的概率,k的取值为1到N的整数,N为大于1的整数;
    对所述每个像素点的第二语义分割结果求平均,得到所述待识别图像的第二语义分割结果;
    根据所述每个像素点的第二语义分割结果以及信息熵计算公式,确定所述每个像素点的信息熵,并将所述每个像素点的信息熵组成所述熵图。
  18. 根据权利要求17所述的计算机可读存储介质,其中,执行所述根据所述第一类别比例、所述第二类别比例以及所述熵图,对所述第二分割网络进行领域适应,包括:
    确定所述第一类别比例和所述第二类别比例之间的第一KL散度;
    确定所述熵图中各个像素点的信息熵之和;
    根据所述第一KL散度、各个像素点的信息熵之和、以及预设参数,确定目标损失;
    根据所述目标损失调整所述第二分割网络的网络参数,以对所述第二分割网络进行领域适应。
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述第二分割网络包括编码网络、解码网络、第二卷积层,其中,所述第二卷积层与所述解码网络连接,执行所述将所述待识别图像输入到第二分割网络,对所述待识别图像中每个像素点进行分割,得到所述每个像素点的第二语义分割结果,包括:
    通过所述编码网络对所述待识别图像进行下采样处理,得到第一特征图;
    通过所述解码网络对所述第一特征图进行上采样处理,得到第二特征图;
    通过所述第二卷积层对所述第二特征图进行语义分割,得到所述每个像素点的第二语义分割结果。
  20. 根据权利要求19所述的计算机可读存储介质,其中,所述第二分割网络还包括第一卷积层,所述第一卷积层与所述编码网络连接;通过所述解码网络对所述第一特征图进行上采样处理,得到第二特征图之前,所述计算机程序被处理器执行时还用于实现:
    对所述第一特征图进行双线性插值,得到第三特征图,其中,所述第三特征图的维度与所述第二特征图的维度相同;
    通过所述第一卷积层对所述第三特征图进行语义分割,得到所述每个像素点的第三语义分割结果;
    确定所述每个第二像素点的第二语义分割结果和所述每个像素点的第三语义分割结果之间的第二KL散度,并获取所述待识别图像中各个像素点的第二KL散度的平均值,得到 第三KL散度;
    执行所述根据所述第一KL散度、各个像素点的信息熵之和、以及预设参数,确定目标损失,包括:
    根据所述第一KL散度、所述第三KL散度、各个像素点的信息熵之和、以及预设参数,确定目标损失。
PCT/CN2021/082603 2020-12-23 2021-03-24 领域适应方法、装置、电子设备及存储介质 WO2022134338A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011543313.3A CN112633285B (zh) 2020-12-23 2020-12-23 领域适应方法、装置、电子设备及存储介质
CN202011543313.3 2020-12-23

Publications (1)

Publication Number Publication Date
WO2022134338A1 true WO2022134338A1 (zh) 2022-06-30

Family

ID=75322072

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/082603 WO2022134338A1 (zh) 2020-12-23 2021-03-24 领域适应方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN112633285B (zh)
WO (1) WO2022134338A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114024726B (zh) * 2021-10-26 2022-09-02 清华大学 在线检测网络流量的方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018126213A1 (en) * 2016-12-30 2018-07-05 Google Llc Multi-task learning using knowledge distillation
CN111062951A (zh) * 2019-12-11 2020-04-24 华中科技大学 一种基于语义分割类内特征差异性的知识蒸馏方法
CN111401406A (zh) * 2020-02-21 2020-07-10 华为技术有限公司 一种神经网络训练方法、视频帧处理方法以及相关设备
CN111489365A (zh) * 2020-04-10 2020-08-04 上海商汤临港智能科技有限公司 神经网络的训练方法、图像处理方法及装置
CN112200889A (zh) * 2020-10-30 2021-01-08 上海商汤智能科技有限公司 样本图像生成、图像处理、智能行驶控制方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190130220A1 (en) * 2017-10-27 2019-05-02 GM Global Technology Operations LLC Domain adaptation via class-balanced self-training with spatial priors
CN110135510B (zh) * 2019-05-22 2023-08-01 电子科技大学中山学院 一种动态领域自适应方法、设备及计算机可读存储介质
CN110750665A (zh) * 2019-10-12 2020-02-04 南京邮电大学 基于熵最小化的开集域适应方法及系统
CN111199550B (zh) * 2020-04-09 2020-08-11 腾讯科技(深圳)有限公司 图像分割网络的训练方法、分割方法、装置和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018126213A1 (en) * 2016-12-30 2018-07-05 Google Llc Multi-task learning using knowledge distillation
CN111062951A (zh) * 2019-12-11 2020-04-24 华中科技大学 一种基于语义分割类内特征差异性的知识蒸馏方法
CN111401406A (zh) * 2020-02-21 2020-07-10 华为技术有限公司 一种神经网络训练方法、视频帧处理方法以及相关设备
CN111489365A (zh) * 2020-04-10 2020-08-04 上海商汤临港智能科技有限公司 神经网络的训练方法、图像处理方法及装置
CN112200889A (zh) * 2020-10-30 2021-01-08 上海商汤智能科技有限公司 样本图像生成、图像处理、智能行驶控制方法及装置

Also Published As

Publication number Publication date
CN112633285B (zh) 2024-07-23
CN112633285A (zh) 2021-04-09

Similar Documents

Publication Publication Date Title
WO2022142014A1 (zh) 基于多模态信息融合的文本分类方法、及其相关设备
WO2021114832A1 (zh) 样本图像数据增强方法、装置、电子设备及存储介质
WO2022105125A1 (zh) 图像分割方法、装置、计算机设备及存储介质
CN114066902A (zh) 一种基于卷积和transformer融合的医学图像分割方法、系统、装置
CN111275107A (zh) 一种基于迁移学习的多标签场景图像分类方法及装置
WO2020215974A1 (zh) 用于人体检测的方法和装置
EP3869385B1 (en) Method for extracting structural data from image, apparatus and device
CN108229591B (zh) 神经网络自适应训练方法和装置、设备、程序和存储介质
WO2021051867A1 (zh) 资产信息识别方法、装置、计算机设备及存储介质
WO2022105117A1 (zh) 一种图像质量评价的方法、装置、计算机设备及存储介质
US7831111B2 (en) Method and mechanism for retrieving images
CN113032580B (zh) 关联档案推荐方法、系统及电子设备
CN112668588A (zh) 车位信息生成方法、装置、设备和计算机可读介质
CN113408660B (zh) 图书聚类方法、装置、设备和存储介质
WO2021114634A1 (zh) 文本标注方法、设备及存储介质
CN112418249A (zh) 掩膜图像生成方法、装置、电子设备和计算机可读介质
WO2024179575A1 (zh) 一种数据处理方法、设备以及计算机可读存储介质
WO2022134338A1 (zh) 领域适应方法、装置、电子设备及存储介质
CN114241411B (zh) 基于目标检测的计数模型处理方法、装置及计算机设备
CN113408507B (zh) 基于履历文件的命名实体识别方法、装置和电子设备
CN110717405A (zh) 人脸特征点定位方法、装置、介质及电子设备
CN117786058A (zh) 一种多模态大模型知识迁移框架的构建方法
CN112434746A (zh) 基于层次化迁移学习的预标注方法及其相关设备
CN112053287A (zh) 图像超分辨率方法、装置及设备
Ni et al. SFA‐Net: Scale and Feature Aggregate Network for Retinal Vessel Segmentation

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21908350

Country of ref document: EP

Kind code of ref document: A1