CN116030365A - Model training method, apparatus, computer device, storage medium, and program product - Google Patents
Model training method, apparatus, computer device, storage medium, and program product Download PDFInfo
- Publication number
- CN116030365A CN116030365A CN202211724958.6A CN202211724958A CN116030365A CN 116030365 A CN116030365 A CN 116030365A CN 202211724958 A CN202211724958 A CN 202211724958A CN 116030365 A CN116030365 A CN 116030365A
- Authority
- CN
- China
- Prior art keywords
- image
- pseudo
- sample
- resolution image
- low
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012549 training Methods 0.000 title claims abstract description 82
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000003860 storage Methods 0.000 title claims abstract description 15
- 238000006243 chemical reaction Methods 0.000 claims abstract description 52
- 238000004590 computer program Methods 0.000 claims description 39
- 230000006870 function Effects 0.000 claims description 17
- 230000008485 antagonism Effects 0.000 claims 1
- 230000004927 fusion Effects 0.000 description 7
- 238000001514 detection method Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000009826 distribution Methods 0.000 description 5
- 230000008859 change Effects 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 3
- 238000005457 optimization Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000003331 infrared imaging Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 208000037170 Delayed Emergence from Anesthesia Diseases 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 229910052799 carbon Inorganic materials 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 230000008034 disappearance Effects 0.000 description 1
- 229910021389 graphene Inorganic materials 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Image Analysis (AREA)
Abstract
本申请涉及一种模型训练方法、装置、计算机设备、存储介质和程序产品,所述方法包括:获取样本低分率图像、样本可见光图像和样本高分辨图像;将所述样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像;将所述伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像;采用所述伪可见光图像、所述第一伪低分辨图像、所述样本低分辨图像和所述样本可见光图像,对所述第一对抗网络进行训练;采用所述样本低分辨图像、所述伪可见光图像和所述样本高分辨图像,对所述图像转换模型中第二对抗网络进行训练。经过这种方法所训练的图像转换模型能够将低分辨图像转换为清晰的高分辨图像。
The present application relates to a model training method, device, computer equipment, storage medium and program product. The method includes: acquiring a sample low-resolution image, a sample visible light image, and a sample high-resolution image; inputting the sample low-resolution image to The first adversarial generator of the first adversarial network in the image conversion model generates a pseudo visible light image; the pseudo visible light image is input to the first auxiliary generator to obtain a first pseudo low resolution image; using the pseudo visible light image, the The first pseudo low-resolution image, the sample low-resolution image and the sample visible light image are used to train the first confrontation network; the sample low-resolution image, the pseudo visible light image and the sample high-resolution image, and train the second confrontation network in the image conversion model. The image conversion model trained by this method can convert low-resolution images into clear high-resolution images.
Description
技术领域technical field
本申请涉及人工智能技术领域,特别是涉及一种模型训练方法、装置、计算机设备、存储介质和程序产品。The present application relates to the technical field of artificial intelligence, in particular to a model training method, device, computer equipment, storage medium and program product.
背景技术Background technique
电力系统在社会生产与日常生活中占据着至关重要的地位。对电力系统进行多视角、多时段的巡检有助于我们对电力设备的运行状态实现监控,帮助我们准确地了解电力系统各环节的运维情况,方便运维人员及时检修。对电力系统进行巡检,除了白天需要采用无人机上的图像采集设备对电力系统进行拍照来获取图像,夜间也需要采用红外成像仪通过红外成像技术获取电力系统的图像。Power systems play a vital role in social production and daily life. Multi-angle and multi-period inspections of the power system help us monitor the operating status of power equipment, help us accurately understand the operation and maintenance of each link of the power system, and facilitate timely maintenance by operation and maintenance personnel. To inspect the power system, in addition to using the image acquisition equipment on the drone to take pictures of the power system to obtain images during the day, it is also necessary to use infrared imagers to obtain images of the power system through infrared imaging technology at night.
经过无人机拍照或红外成像技术所得的图像为低分辨图像,分辨率较低,需要经过处理。采用传统的模型对低分辨图像进行处理,所得到的高分辨图像,不够清晰,因此亟需改进。The images obtained by drone photography or infrared imaging technology are low-resolution images with low resolution and need to be processed. Using traditional models to process low-resolution images, the resulting high-resolution images are not clear enough, so improvements are urgently needed.
发明内容Contents of the invention
基于此,有必要针对上述技术问题,提供一种模型训练方法、装置、计算机设备、存储介质和程序产品。Based on this, it is necessary to provide a model training method, device, computer equipment, storage medium and program product for the above technical problems.
第一方面,本申请提供了一种模型训练方法。所述方法包括:In a first aspect, the present application provides a model training method. The methods include:
获取样本低分率图像、样本可见光图像和样本高分辨图像;Obtain sample low-resolution images, sample visible light images and sample high-resolution images;
将所述样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像;The sample low-resolution image is input to the first confrontation generator of the first confrontation network in the image conversion model to generate a pseudo visible light image;
将所述伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像;inputting the pseudo visible light image to a first auxiliary generator to obtain a first pseudo low resolution image;
采用所述伪可见光图像、所述第一伪低分辨图像、所述样本低分辨图像和所述样本可见光图像,对所述第一对抗网络进行训练;training the first adversarial network by using the pseudo visible light image, the first pseudo low resolution image, the sample low resolution image and the sample visible light image;
采用所述样本低分辨图像、所述伪可见光图像和所述样本高分辨图像,对所述图像转换模型中第二对抗网络进行训练。The second confrontation network in the image conversion model is trained by using the sample low-resolution image, the pseudo-visible light image, and the sample high-resolution image.
在其中一个实施例中,所述采用所述伪可见光图像、所述第一伪低分辨图像、所述样本低分辨图像和所述样本可见光图像,对所述第一对抗网络进行训练,包括:In one of the embodiments, the training of the first adversarial network by using the pseudo visible light image, the first pseudo low resolution image, the sample low resolution image and the sample visible light image includes:
采用所述伪可见光图像和所述样本可见光图像,对所述第一对抗网络的第一对抗判别器进行训练;training a first adversarial discriminator of the first adversarial network by using the pseudo visible light image and the sample visible light image;
采用所述第一伪低分辨图像和所述样本低分辨图像,对所述第一对抗生成器进行训练。The first adversarial generator is trained by using the first pseudo low-resolution image and the sample low-resolution image.
在其中一个实施例中,所述采用所述第一伪低分辨图像和所述样本低分辨图像,对所述第一对抗生成器进行训练,包括:In one of the embodiments, the training of the first adversarial generator by using the first pseudo low-resolution image and the sample low-resolution image includes:
基于损耗函数,根据所述样本低分率图像,对所述第一对抗生成器进行训练;Training the first adversarial generator according to the sample low-resolution image based on a loss function;
根据所述第一伪低分辨图像和所述样本低分辨图像,确定范数损失;determining a norm loss based on the first pseudo low-resolution image and the sample low-resolution image;
采用所述范数损失,对经训练的第一对抗生成器进行优化。Using the norm loss, the trained first adversarial generator is optimized.
在其中的一个实施例中,所述采用所述样本低分辨图像、所述伪可见光图像和所述样本高分辨图像,对所述图像转换模型中第二对抗网络进行训练,包括:In one of the embodiments, the training of the second confrontation network in the image conversion model by using the sample low-resolution image, the pseudo-visible light image and the sample high-resolution image includes:
将所述样本低分辨图像和所述伪可见光图像进行融合,得到融合图像;Fusing the low-resolution image of the sample with the pseudo-visible light image to obtain a fused image;
将所述融合图像输入至所述图像转换模型中第二对抗网络的第二对抗生成器,生成伪高分辨图像;The fusion image is input to the second confrontation generator of the second confrontation network in the image conversion model to generate a pseudo high-resolution image;
采用所述伪高分辨率图像和所述样本高分辨图像,对所述第二对抗网络进行训练。The second adversarial network is trained by using the pseudo high-resolution image and the sample high-resolution image.
在其中的一个实施例中,所述方法还包括:In one of the embodiments, the method also includes:
将所述伪高分辨图像输入至第二辅助生成器,得到第二伪低分辨图像;Inputting the pseudo high-resolution image to a second auxiliary generator to obtain a second pseudo low-resolution image;
根据所述第二伪低分辨图像和所述样本低分辨图像,验证经训练的第二对抗网络的第二对抗生成器的合理性。Verifying the rationality of the trained second adversarial generator of the second adversarial network according to the second pseudo low-resolution image and the sample low-resolution image.
在其中的一个实施例中,所述第一对抗网络的第一对抗生成器为变分自动编码器;所述第二对抗网络的第二对抗生成器为残差网络。In one of the embodiments, the first adversarial generator of the first adversarial network is a variational autoencoder; the second adversarial generator of the second adversarial network is a residual network.
第二方面,本申请还提供了一种目标检测模型的优化装置。所述装置包括:In a second aspect, the present application also provides a device for optimizing a target detection model. The devices include:
图像获取模块,用于获取样本低分率图像、样本可见光图像和样本高分辨图像;An image acquisition module, configured to acquire a sample low-resolution image, a sample visible light image and a sample high-resolution image;
第一生成模块,用于将所述样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像;The first generation module is used to input the sample low-resolution image to the first confrontation generator of the first confrontation network in the image conversion model to generate a pseudo visible light image;
第二生成模块,用于将所述伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像;The second generating module is configured to input the pseudo-visible light image to the first auxiliary generator to obtain a first pseudo-low-resolution image;
第一训练模块,用于采用所述伪可见光图像、所述第一伪低分辨图像、所述样本低分辨图像和所述样本可见光图像,对所述第一对抗网络进行训练;A first training module, configured to train the first adversarial network by using the pseudo visible light image, the first pseudo low resolution image, the sample low resolution image and the sample visible light image;
第二训练模块,用于采用所述样本低分辨图像、所述伪可见光图像和所述样本高分辨图像,对所述图像转换模型中第二对抗网络进行训练。The second training module is configured to use the sample low-resolution image, the pseudo-visible light image, and the sample high-resolution image to train the second confrontation network in the image conversion model.
第三方面,本申请还提供了一种计算机设备。所述计算机设备包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
获取样本低分率图像、样本可见光图像和样本高分辨图像;Obtain sample low-resolution images, sample visible light images and sample high-resolution images;
将所述样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像;The sample low-resolution image is input to the first confrontation generator of the first confrontation network in the image conversion model to generate a pseudo visible light image;
将所述伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像;inputting the pseudo visible light image to a first auxiliary generator to obtain a first pseudo low resolution image;
采用所述伪可见光图像、所述第一伪低分辨图像、所述样本低分辨图像和所述样本可见光图像,对所述第一对抗网络进行训练;training the first adversarial network by using the pseudo visible light image, the first pseudo low resolution image, the sample low resolution image and the sample visible light image;
采用所述样本低分辨图像、所述伪可见光图像和所述样本高分辨图像,对所述图像转换模型中第二对抗网络进行训练。The second confrontation network in the image conversion model is trained by using the sample low-resolution image, the pseudo-visible light image, and the sample high-resolution image.
第四方面,本申请还提供了一种计算机可读存储介质。所述计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
获取样本低分率图像、样本可见光图像和样本高分辨图像;Obtain sample low-resolution images, sample visible light images and sample high-resolution images;
将所述样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像;The sample low-resolution image is input to the first confrontation generator of the first confrontation network in the image conversion model to generate a pseudo visible light image;
将所述伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像;inputting the pseudo visible light image to a first auxiliary generator to obtain a first pseudo low resolution image;
采用所述伪可见光图像、所述第一伪低分辨图像、所述样本低分辨图像和所述样本可见光图像,对所述第一对抗网络进行训练;training the first adversarial network by using the pseudo visible light image, the first pseudo low resolution image, the sample low resolution image and the sample visible light image;
采用所述样本低分辨图像、所述伪可见光图像和所述样本高分辨图像,对所述图像转换模型中第二对抗网络进行训练。The second confrontation network in the image conversion model is trained by using the sample low-resolution image, the pseudo-visible light image, and the sample high-resolution image.
第五方面,本申请还提供了一种计算机程序产品。所述计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
获取样本低分率图像、样本可见光图像和样本高分辨图像;Obtain sample low-resolution images, sample visible light images and sample high-resolution images;
将所述样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像;The sample low-resolution image is input to the first confrontation generator of the first confrontation network in the image conversion model to generate a pseudo visible light image;
将所述伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像;inputting the pseudo visible light image to a first auxiliary generator to obtain a first pseudo low resolution image;
采用所述伪可见光图像、所述第一伪低分辨图像、所述样本低分辨图像和所述样本可见光图像,对所述第一对抗网络进行训练;training the first adversarial network by using the pseudo visible light image, the first pseudo low resolution image, the sample low resolution image and the sample visible light image;
采用所述样本低分辨图像、所述伪可见光图像和所述样本高分辨图像,对所述图像转换模型中第二对抗网络进行训练。The second confrontation network in the image conversion model is trained by using the sample low-resolution image, the pseudo-visible light image, and the sample high-resolution image.
上述模型训练方法、装置、计算机设备、存储介质和程序产品,通过将样本低分辨图像输入第一对抗网络的第一对抗生成器,生成伪可见光图像,并将伪可见光图像输入第一辅助生成器,得到第一伪分辨图像。采用伪可见光图像,第一伪分辨图像、样本低分辨图像和样本可见光图像,对第一对抗网络进行训练;采用样本低分辨图像、伪可见光图像和样本高分辨图像,对图像转换模型中第二对抗网络进行训练。通过这种训练所训练得到的图像转换模型,能够将低分辨图像转换为清晰的高分辨图像。In the above model training method, device, computer equipment, storage medium and program product, a pseudo-visible light image is generated by inputting the sample low-resolution image into the first confrontation generator of the first confrontation network, and the pseudo-visible light image is input into the first auxiliary generator , to obtain the first pseudo-resolved image. Use the pseudo visible light image, the first pseudo resolution image, the sample low resolution image and the sample visible light image to train the first confrontation network; use the sample low resolution image, pseudo visible light image and sample high resolution image to train the second in the image conversion model The adversarial network is trained. The image conversion model trained through this training can convert low-resolution images into clear high-resolution images.
附图说明Description of drawings
图1为一个实施例中模型训练方法的流程图;Fig. 1 is the flowchart of model training method in an embodiment;
图2为一个实施例中对第一对抗网络进行训练的流程图;Fig. 2 is a flowchart of training the first confrontation network in one embodiment;
图3为一个实施例中对第二对抗网络进行训练的流程图;Fig. 3 is a flowchart of training the second confrontation network in one embodiment;
图4为另一个实施例中模型训练方法的流程图Fig. 4 is the flowchart of model training method in another embodiment
图5为一个实施例中模型训练装置的结构框图;Fig. 5 is a structural block diagram of a model training device in an embodiment;
图6为另一个实施例中模型训练装置的结构框图;Fig. 6 is a structural block diagram of a model training device in another embodiment;
图7为又一个实施例中模型训练装置的结构框图;Fig. 7 is a structural block diagram of a model training device in yet another embodiment;
图8为一个实施例中计算机设备的内部结构图。Figure 8 is a diagram of the internal structure of a computer device in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.
在一个实施例中,如图1所示,提供了一种模型训练方法,该方法可以应用于终端,也可以应用于服务器。其中,终端可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑等。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。以该方法应用于服务器为例进行说明,具体包括以下步骤:In one embodiment, as shown in FIG. 1 , a model training method is provided, which can be applied to a terminal or a server. Wherein, the terminal may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and the like. The server can be implemented by an independent server or a server cluster composed of multiple servers. Taking this method applied to the server as an example to illustrate, it specifically includes the following steps:
S101,获取样本低分率图像、样本可见光图像和样本高分辨图像。S101. Acquire a sample low-resolution image, a sample visible light image, and a sample high-resolution image.
具体的,可通过无人机或者塔基摄像头上的图像采集设备采集样本的图像得到样本图像集。每个样本图像集可包含多个样本组,每一样本组都包含一个样本低分率图像、一个样本可见光图像和一个样本高分辨图像;每一样本组内所包括的三个样本图像对应的场景相同。Specifically, the sample image set can be obtained by collecting the image of the sample through the image acquisition device on the UAV or the tower base camera. Each sample image set can contain multiple sample groups, and each sample group includes a sample low-resolution image, a sample visible light image, and a sample high-resolution image; the three sample images included in each sample group correspond to The scene is the same.
S102,将样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像。S102. Input the sample low-resolution image to the first adversarial generator of the first adversarial network in the image conversion model to generate a pseudo visible light image.
在本实施例中,所谓图像转换模型是一种用于将低分辨图像转换为高分辨模型的模型;可选的,图像转换模型中包括两个对抗网络;其中,第一对抗网络用于将低分辨图像转换为可见光图像。In this embodiment, the so-called image conversion model is a model for converting a low-resolution image into a high-resolution model; optionally, the image conversion model includes two confrontation networks; wherein, the first confrontation network is used to convert Low resolution images are converted to visible light images.
具体的,将样本低分辨图像输入到第一对抗网络的第一对抗生成器,第一对抗生成器会基于样本低分辨图像的像素概率分布,生成伪可见光图像。可选的,每一样本组内的样本低分辨图像对应一个伪可见光图像。Specifically, the sample low-resolution image is input to the first adversarial generator of the first adversarial network, and the first adversarial generator generates a pseudo visible light image based on the pixel probability distribution of the sample low-resolution image. Optionally, the sample low-resolution images in each sample group correspond to a pseudo visible light image.
S103,将伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像。S103. Input the pseudo visible light image to the first auxiliary generator to obtain a first pseudo low-resolution image.
在本实施例中,第一辅助生成器用于辅助训练第一对抗网络,进一步的,用于辅助训练第一对抗网络中的第一对抗生成器。In this embodiment, the first auxiliary generator is used to assist in training the first adversarial network, and further, is used to assist in training the first adversarial generator in the first adversarial network.
具体的,可以采用第一对抗网络的第一对抗判别器对各样本组对应的伪可见光图像与各样本组内的样本可见光辨图像进行判别,获取第一对抗判别器判别出的与样本可见光图像差别较大的伪可见光图像;将所获取的伪可见光图像输入到第一辅助生成器,第一辅助生成器会基于伪可见光图像的像素概率分布,生成第一伪分辨图像。Specifically, the first adversarial discriminator of the first adversarial network can be used to discriminate the pseudo visible light image corresponding to each sample group from the sample visible light discrimination image in each sample group, and obtain the visible light image of the sample identified by the first adversarial discriminator. Pseudo visible light images with large differences; the acquired pseudo visible light images are input to the first auxiliary generator, and the first auxiliary generator generates a first pseudo resolution image based on the pixel probability distribution of the pseudo visible light images.
S104,采用伪可见光图像、第一伪低分辨图像、样本低分辨图像和样本可见光图像,对第一对抗网络进行训练。S104. Train the first adversarial network by using the pseudo visible light image, the first pseudo low resolution image, the sample low resolution image, and the sample visible light image.
具体的,可根据预先设定的损失函数,基于伪可见光图像、第一伪低分辨图像、样本低分辨图像和样本可见光图像,确定训练损失,采用训练损失对第一对抗网络进行训练。Specifically, the training loss can be determined based on the pseudo visible light image, the first pseudo low resolution image, the sample low resolution image and the sample visible light image according to a preset loss function, and the training loss is used to train the first adversarial network.
S105,采用样本低分辨图像、伪可见光图像和样本高分辨图像,对图像转换模型中第二对抗网络进行训练。S105, using the sample low-resolution image, the pseudo-visible light image, and the sample high-resolution image to train the second adversarial network in the image conversion model.
可选的,图像转换模型中的第二对抗网络用于将可见光图像转换为高分辨图像。第二对抗网络包括第二对抗生成器和第二对抗判别器;进一步的,第一对抗生成器和第二对抗生成器不同,可选的,第一对抗网络的第一对抗生成器为变分自动编码器;第二对抗网络的第二对抗生成器为残差网络。变分自动编码器是基于变分贝叶斯推断的生成式网络结构。与传统的自编码器通过数值的方式描述潜在空间不同,它以概率的方式描述对潜在空间的观察。残差网络容易优化,并且能够通过增加相当的深度来提高准确率,其内部的残差块使用了跳跃连接,缓解了在深度神经网络中增加深度带来的梯度消失问题。Optionally, the second confrontation network in the image conversion model is used to convert the visible light image into a high-resolution image. The second confrontation network includes a second confrontation generator and a second confrontation discriminator; further, the first confrontation generator is different from the second confrontation generator, and optionally, the first confrontation generator of the first confrontation network is a variation Autoencoder; Second Adversarial Network The second adversarial generator is a residual network. Variational autoencoders are generative network structures based on variational Bayesian inference. Unlike the traditional autoencoder, which describes the latent space numerically, it describes the observations of the latent space probabilistically. The residual network is easy to optimize, and can increase the accuracy by increasing the depth. The internal residual block uses skip connections, which alleviates the gradient disappearance problem caused by increasing the depth in the deep neural network.
具体的,可根据预先设定的损失函数,基于样本低分辨图像、伪可见光图像和样本高分辨图像,确定训练损失,对图像转换模型中第二对抗网络进行训练。Specifically, according to a preset loss function, the training loss can be determined based on the sample low-resolution image, the pseudo-visible light image and the sample high-resolution image, and the second adversarial network in the image conversion model can be trained.
可以理解的是,在第一对抗网络和第二对抗网络训练好之后,即可得到训练好的图像转换模型。进而,可以将实时采集的目标低分辨图像输入至训练好的图像转换模型中,即可得到清洗的高可分辨图像。It can be understood that after the first adversarial network and the second adversarial network are trained, a trained image conversion model can be obtained. Furthermore, the target low-resolution image collected in real time can be input into the trained image conversion model to obtain a cleaned high-resolution image.
上述模型训练方法,通过将样本低分辨图像输入第一对抗网络的第一对抗生成器,生成伪可见光图像,并将伪可见光图像输入第一辅助生成器,得到第一伪分辨图像。采用伪可见光图像,第一伪分辨图像,样本低分辨图像和样本可见光图像,对第一对抗网络进行训练;采用样本低分辨图像、伪可见光图像和样本高分辨图像,对图像转换模型中第二对抗网络进行训练。通过这种训练所训练得到的图像转换模型,能够将低分辨图像转换为清晰的高分辨图像。In the above model training method, the sample low-resolution image is input into the first adversarial generator of the first adversarial network to generate a pseudo-visible light image, and the pseudo-visible light image is input into the first auxiliary generator to obtain a first pseudo-resolution image. Use the pseudo-visible light image, the first pseudo-resolution image, the sample low-resolution image and the sample visible light image to train the first confrontation network; use the sample low-resolution image, pseudo-visible light image and sample high-resolution image to train the second in the image conversion model The adversarial network is trained. The image conversion model trained through this training can convert low-resolution images into clear high-resolution images.
在其中一个实施例中,对步骤S104进一步细化,具体可包括以下步骤:In one of the embodiments, step S104 is further refined, which may specifically include the following steps:
S201,采用伪可见光图像和样本可见光图像,对第一对抗网络的第一对抗判别器进行训练。S201. Train the first adversarial discriminator of the first adversarial network by using the pseudo visible light image and the sample visible light image.
具体的,基于预先设定的损失函数,根据伪可见光图像以及样本可见光图像,确定训练损失;采用训练损失,对第一对抗判别器进行训练。Specifically, based on a preset loss function, the training loss is determined according to the pseudo visible light image and the sample visible light image; the training loss is used to train the first adversarial discriminator.
其中,损失函数可以为:Among them, the loss function can be:
其中,log1接近于0,x是样本可见光图像,logD1(x)近似于0;在中,代表伪可见光图像,真值接近1,由于1-1=0,无限逼近负数,即第一对抗判别器往loss的方向优化。Among them, log1 is close to 0, x is the sample visible light image, and logD 1 (x) is close to 0; in middle, Represents a pseudo-visible light image, the true value is close to 1, because 1-1=0, Infinitely approaching negative numbers, that is, the first confrontation discriminator is optimized in the direction of loss.
S202,采用第一伪低分辨图像和样本低分辨图像,对第一对抗生成器进行训练。S202. Train the first adversarial generator by using the first pseudo low-resolution image and the sample low-resolution image.
可选的,可以基于损耗函数,根据样本低分率图像,对第一对抗生成器进行训练;根据第一伪低分辨图像和样本低分辨图像,确定范数损失;采用范数损失,对经训练的第一对抗生成器进行优化。其中,损耗函数的定义如下:Optionally, based on the loss function, the first adversarial generator can be trained according to the sample low-resolution image; the norm loss is determined according to the first pseudo low-resolution image and the sample low-resolution image; The trained first adversarial generator is optimized. Among them, the loss function is defined as follows:
其中,KL表示散度,x表示样本低分辨图像,z表示采样,pn是图像的先验分布,qv是用来近似模拟真实情况的参数化分布,一般用正态分布代替,L代表采样点数。Among them, KL represents the divergence, x represents the sample low-resolution image, z represents sampling, pn is the prior distribution of the image, q v is a parameterized distribution used to approximate the real situation, generally replaced by a normal distribution, and L represents sampling points.
具体的,可以将样本低分辨图像代入损耗函数,以损耗函数最小为目的,对第一对抗生成器进行优化;之后,基于范数损失函数(例如L1范数损失函数),根据第一伪低分辨图像和样本低分辨图像,确定范数损失;采用范数损失对经训练的第一对抗生成器的网络参数进行调整。Specifically, the sample low-resolution image can be substituted into the loss function, and the first adversarial generator can be optimized for the purpose of minimizing the loss function; then, based on the norm loss function (such as the L1 norm loss function), according to the first pseudo-low Distinguish the image and the sample low-resolution image, determine the norm loss; use the norm loss to adjust the network parameters of the trained first adversarial generator.
可以理解的是,本实施例中通过引入第一辅助生成器,来对第一对抗生成器进行优化,使得所训练得到的第一对抗生成器输出的图像更贴近输入。It can be understood that, in this embodiment, the first auxiliary generator is introduced to optimize the first adversarial generator, so that the image output by the trained first adversarial generator is closer to the input.
在本实施例中,通过伪可见光图像和样本可见光图像,对第一对抗网络的第一对抗判别器进行训练,并通过用第一伪低分辨图像和样本低分辨图像,对第一对抗生成器进行训练,给出了训练第一对抗网络的具体方法。In this embodiment, the first adversarial discriminator of the first adversarial network is trained by using the pseudo visible light image and the sample visible light image, and the first adversarial generator is trained by using the first pseudo low resolution image and the sample low resolution image For training, a specific method for training the first adversarial network is given.
在其中一个实施例中,对步骤S105进一步细化,如图3所示,具体可包括以下步骤:In one of the embodiments, step S105 is further refined, as shown in FIG. 3 , which may specifically include the following steps:
S301,将样本低分辨图像和伪可见光图像进行融合,得到融合图像。S301. Fusion the sample low-resolution image and the pseudo-visible light image to obtain a fusion image.
具体的,在对样本低分辨图像和伪可见光图像进行融合时,可基于样本低分辨图像调整融合图像的纹理,使融合图像包含更多纹理信息。所得到的融合图像具有与样本低分辨图像相同的亮度,并且具有与伪可见光图像相同的梯度。Specifically, when fusing the sample low-resolution image and the pseudo visible light image, the texture of the fused image can be adjusted based on the sample low-resolution image, so that the fused image contains more texture information. The resulting fused image has the same brightness as the sample low-resolution image and has the same gradient as the pseudo-visible image.
其中,融合后的图像被表述为:Among them, the fused image is expressed as:
其中,代表基础层图像;in, Represents the base layer image;
代表细节层图像。 Represents a detail layer image.
融合后的图像的纹理信息如下:The texture information of the fused image is as follows:
具体的,IV表示伪可见光图像,b表示样本低分辨图像的标签(真实图像为1,无标注的为0),D(Iv)表示IV的识别结果。Specifically, IV represents the pseudo-visible light image, b represents the label of the sample low-resolution image (the real image is 1, and the unlabeled one is 0), and D(I v ) represents the recognition result of IV .
其中,融合后图像的内容损失如下:Among them, the content loss of the fused image is as follows:
其中,其中H和W表示输入图像的高度和宽度,||·||F表示矩阵范数,If是红外图像,Ii是可见光图像,Δ是求导符号,意思是对图像求梯度。Among them, where H and W represent the height and width of the input image, ||·||F represents the matrix norm, If f is the infrared image, I i is the visible light image, Δ is the derivation symbol, which means to calculate the gradient of the image.
S302,将融合图像输入至图像转换模型中第二对抗网络的第二对抗生成器,生成伪高分辨图像。S302. Input the fused image to the second adversarial generator of the second adversarial network in the image conversion model to generate a pseudo high-resolution image.
可选的,第二对抗生成器主要用于对融合图像的分辨率进行重建,进而将给定的低分辨率的融合图像输入至第二对抗生成器中,第二对抗生成器基于相关算法恢复成相应的伪高分辨图像。Optionally, the second adversarial generator is mainly used to reconstruct the resolution of the fused image, and then input the given low-resolution fused image into the second adversarial generator, and the second adversarial generator restores the into corresponding pseudo high-resolution images.
S303,采用伪高分辨率图像和样本高分辨图像,对第二对抗网络进行训练。S303, using the pseudo high-resolution image and the sample high-resolution image to train the second adversarial network.
具体的,可以采用伪高分辨图像和样本高分辨图像,结合下述公式(6)所示的损失函数,对第二对抗网络中的第二对抗判别器进行训练。Specifically, the second adversarial discriminator in the second adversarial network can be trained by using the pseudo high-resolution image and the sample high-resolution image, combined with the loss function shown in the following formula (6).
其中,其中,V,C分别表示特征谱的通道大小和数量,||·||||||F表示Frobenius范数。IHR表示样本高分辨率图像,ISR表示伪高分辨图像。Among them, V and C represent the channel size and quantity of the characteristic spectrum respectively, and ||·||||||F represents the Frobenius norm. I HR represents the sample high-resolution image, and I SR represents the pseudo-high-resolution image.
进一步的,本实施例的第二对抗网络中的第二对抗生成器可以是预先训练好的残差网络,可直接使用。Further, the second adversarial generator in the second adversarial network of this embodiment may be a pre-trained residual network, which can be used directly.
可选的,可以将伪高分辨图像输入至第二辅助生成器,得到第二伪低分辨图像;根据第二伪低分辨图像和样本低分辨图像,验证经训练的第二对抗网络的第二对抗生成器的合理性。其中,第二辅助生成器和第二对抗生成器是网络倒置的关系,网络参数一样,只是梯度更新参数时刻会有所不同。Optionally, the pseudo-high-resolution image can be input to the second auxiliary generator to obtain the second pseudo-low-resolution image; according to the second pseudo-low-resolution image and the sample low-resolution image, verify the second trained adversarial network. Rationality against generators. Among them, the second auxiliary generator and the second adversarial generator have a network inversion relationship, and the network parameters are the same, but the gradient update parameter time will be different.
具体的,可通过比较第二伪低分辨图像和样本低分辨图像的相似度来判断第二对抗生成器的合理性,如果第二伪低分辨图像和样本低分辨图像的相似度大于阈值,则说明第二对抗生成器不合理,如果第二伪低分辨图像和样本低分辨图像的相似度小于阈值,则说明第二对抗生成器合理。进一步的,在第二对抗生成器不合理的情况下,可以重新对第二对抗生成器进行优化。Specifically, the rationality of the second adversarial generator can be judged by comparing the similarity between the second pseudo low-resolution image and the sample low-resolution image. If the similarity between the second pseudo low-resolution image and the sample low-resolution image is greater than a threshold, then It shows that the second adversarial generator is unreasonable. If the similarity between the second pseudo low-resolution image and the sample low-resolution image is less than the threshold, it means that the second adversarial generator is reasonable. Furthermore, when the second adversarial generator is unreasonable, the second adversarial generator can be re-optimized.
在本实施例中,通过将样本低分辨图像和伪可见光图像进行融合,得到融合图像,并将融合图像输入至图像转换模型中第二对抗网络的第二对抗生成器,生成伪高分辨图像,然后采用伪高分辨率图像和样本高分辨图像,对第二对抗网络进行训练,给出了训练第二对抗网络的具体方法。In this embodiment, the fused image is obtained by fusing the sample low-resolution image and the pseudo visible light image, and the fused image is input to the second adversarial generator of the second adversarial network in the image conversion model to generate a pseudo high-resolution image, Then, the pseudo high-resolution image and the sample high-resolution image are used to train the second adversarial network, and the specific method of training the second adversarial network is given.
在一个实施例中,如图4所示,提供了一种模型训练方法的优选实例,具体实现过程可以包括:In one embodiment, as shown in Figure 4, a preferred example of a model training method is provided, and the specific implementation process may include:
S401,获取样本低分率图像、样本可见光图像和样本高分辨图像。S401. Acquire a sample low-resolution image, a sample visible light image, and a sample high-resolution image.
S402,将样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像。S402. Input the sample low-resolution image to the first adversarial generator of the first adversarial network in the image conversion model to generate a pseudo visible light image.
S403,将伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像。S403. Input the pseudo visible light image to the first auxiliary generator to obtain a first pseudo low resolution image.
S404,采用伪可见光图像和样本可见光图像,对第一对抗网络的第一对抗判别器进行训练。S404. Train the first adversarial discriminator of the first adversarial network by using the pseudo visible light image and the sample visible light image.
S405,采用第一伪低分辨图像和样本低分辨图像,对第一对抗生成器进行训练。S405. Train the first adversarial generator by using the first pseudo low-resolution image and the sample low-resolution image.
S406,将样本低分辨图像和伪可见光图像进行融合,得到融合图像。S406. Fusion the sample low-resolution image and the pseudo-visible light image to obtain a fusion image.
S407,将融合图像输入至图像转换模型中第二对抗网络的第二对抗生成器,生成伪高分辨图像。S407. Input the fused image to the second adversarial generator of the second adversarial network in the image conversion model to generate a pseudo high-resolution image.
S408,采用伪高分辨率图像和样本高分辨图像,对第二对抗网络进行训练。S408, using the pseudo high-resolution image and the sample high-resolution image to train the second confrontation network.
应该理解的是,虽然如上的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flow charts involved in the above embodiments are shown sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flow charts involved in the above embodiments may include multiple steps or stages, and these steps or stages are not necessarily executed at the same time, but may be executed at different times, The execution order of these steps or stages is not necessarily performed sequentially, but may be performed in turn or alternately with other steps or at least a part of steps or stages in other steps.
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的目标检测模型的优化方法的目标检测模型的优化装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个目标检测模型的优化装置实施例中的具体限定可以参见上文中对于目标检测模型的优化方法的限定,在此不再赘述。Based on the same inventive concept, an embodiment of the present application further provides an object detection model optimization device for implementing the above-mentioned method for optimizing an object detection model. The solution to the problem provided by the device is similar to the implementation described in the above method, so the specific limitations in the embodiment of the optimization device for one or more target detection models provided below can be referred to above for the target detection model The limitation of the optimization method will not be repeated here.
在一个实施例中,如图所示,提供了一种模型训练装置1,如图5,包括:图像获取模块10、第一生成模块20、第二生成模块30、第一训练模块40、第二训练模块50,其中:In one embodiment, as shown in the figure, a model training device 1 is provided, as shown in Figure 5, comprising: an
图像获取模块10,用于获取样本低分率图像、样本可见光图像和样本高分辨图像;An
第一生成模块20,用于将样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像;The
第二生成模块30,用于将伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像;The
第一训练模块40,用于采用伪可见光图像、第一伪低分辨图像、样本低分辨图像和样本可见光图像,对第一对抗网络进行训练;The
第二训练模块50,用于采用样本低分辨图像、伪可见光图像和样本高分辨图像,对图像转换模型中第二对抗网络进行训练。The
在其中的一个实施例中,如图6所示,上述的第一训练模块40还包括以下单元:In one of the embodiments, as shown in FIG. 6, the above-mentioned
判别器训练单元41,用于采用伪可见光图像和样本可见光图像,对第一对抗网络的第一对抗判别器进行训练;A
生成器训练单元42,用于采用第一伪低分辨图像和样本低分辨图像,对第一对抗生成器进行训练。The
在其中的一个实施例中,上述的生成器训练单元42还用于:In one of the embodiments, the above-mentioned
基于损耗函数,根据样本低分率图像,对第一对抗生成器进行训练;根据第一伪低分辨图像和样本低分辨图像,确定范数损失;Based on the loss function, the first confrontation generator is trained according to the sample low-resolution image; according to the first pseudo low-resolution image and the sample low-resolution image, the norm loss is determined;
在其中的一个实施例中,在图5或图6的基础上,对第二训练模块50进行细化。例如,在图5的基础上对第二训练模块50进行细化,如图7所示,上述的第二训练模块50还包括以下单元:In one of the embodiments, the
图像融合单元51,用于将样本低分辨图像和伪可见光图像进行融合,得到融合图像;An
高分辨生成单元52,用于将融合图像输入至图像转换模型中第二对抗网络的第二对抗生成器,生成伪高分辨图像;The high-
第二训练单元53,用于采用伪高分辨率图像和样本高分辨图像,对第二对抗网络进行训练。The
在其中的一个实施例中,上述的模型训练装置1还包括以下模块:In one of the embodiments, the above-mentioned model training device 1 also includes the following modules:
第三生成模块,用于将伪高分辨图像输入至第二辅助生成器,得到第二伪低分辨图像;The third generation module is used to input the pseudo-high-resolution image to the second auxiliary generator to obtain the second pseudo-low-resolution image;
验证模块,用于根据第二伪低分辨图像和样本低分辨图像,验证经训练的第二对抗网络的第二对抗生成器的合理性。The verification module is used to verify the rationality of the second adversarial generator of the trained second adversarial network according to the second pseudo low-resolution image and the sample low-resolution image.
在其中的一个实施例中,第一对抗网络的第一对抗生成器为变分自动编码器;第二对抗网络的第二对抗生成器为残差网络。In one of the embodiments, the first adversarial generator of the first adversarial network is a variational autoencoder; the second adversarial generator of the second adversarial network is a residual network.
上述的模型训练装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above-mentioned model training device can be fully or partially realized by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图8所示。该计算机设备包括通过系统总线连接的处理器、存储器和网络接口。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储待测波纹管的初始高度以及标准波纹管的高度,温度和性能变化速率等相关数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种模型训练方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure may be as shown in FIG. 8 . The computer device includes a processor, memory and a network interface connected by a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs and databases. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used to store the initial height of the corrugated pipe to be tested and the height, temperature and performance change rate of the standard corrugated pipe and other related data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a model training method is realized.
本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 8 is only a block diagram of a partial structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
获取样本低分率图像、样本可见光图像和样本高分辨图像;Obtain sample low-resolution images, sample visible light images and sample high-resolution images;
将样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像;Inputting the sample low-resolution image to the first confrontation generator of the first confrontation network in the image conversion model to generate a pseudo visible light image;
将伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像;inputting the pseudo-visible light image to the first auxiliary generator to obtain a first pseudo-low-resolution image;
采用伪可见光图像、第一伪低分辨图像、样本低分辨图像和样本可见光图像,对第一对抗网络进行训练;Using the pseudo-visible light image, the first pseudo-low-resolution image, the sample low-resolution image and the sample visible-light image to train the first confrontation network;
采用样本低分辨图像、伪可见光图像和样本高分辨图像,对图像转换模型中第二对抗网络进行训练。The second adversarial network in the image conversion model is trained by using sample low-resolution images, pseudo visible light images and sample high-resolution images.
在一个实施例中,处理器执行计算机程序中采用伪可见光图像、第一伪低分辨图像、样本低分辨图像和样本可见光图像,对第一对抗网络进行训练的逻辑时还实现以下步骤:In one embodiment, when the processor executes the logic of training the first confrontation network by using the pseudo-visible light image, the first pseudo-low-resolution image, the sample low-resolution image and the sample visible-light image in the computer program, the following steps are also implemented:
采用伪可见光图像和样本可见光图像,对第一对抗网络的第一对抗判别器进行训练;采用第一伪低分辨图像和样本低分辨图像,对第一对抗生成器进行训练。The first adversarial discriminator of the first adversarial network is trained by using the pseudo visible light image and the sample visible light image; the first adversarial generator is trained by using the first pseudo low resolution image and the sample low resolution image.
在一个实施例中,处理器执行计算机程序中采用第一伪低分辨图像和样本低分辨图像,对第一对抗生成器进行训练的逻辑时还实现以下步骤:In one embodiment, when the processor executes the logic of training the first adversarial generator using the first pseudo low-resolution image and the sample low-resolution image in the computer program, the following steps are also implemented:
基于损耗函数,根据样本低分率图像,对第一对抗生成器进行训练;根据第一伪低分辨图像和样本低分辨图像,确定范数损失;采用范数损失,对经训练的第一对抗生成器进行优化。Based on the loss function, the first adversarial generator is trained according to the sample low-resolution image; the norm loss is determined according to the first pseudo low-resolution image and the sample low-resolution image; the norm loss is used to train the first adversarial The generator is optimized.
在一个实施例中,计算机程序执行采用样本低分辨图像、伪可见光图像和样本高分辨图像,对图像转换模型中第二对抗网络进行训练的逻辑时还实现以下步骤:In one embodiment, when the computer program executes the logic of training the second confrontation network in the image conversion model by using the sample low-resolution image, the pseudo-visible light image and the sample high-resolution image, the following steps are also implemented:
将样本低分辨图像和伪可见光图像进行融合,得到融合图像;将融合图像输入至图像转换模型中第二对抗网络的第二对抗生成器,生成伪高分辨图像;采用伪高分辨率图像和样本高分辨图像,对第二对抗网络进行训练。The sample low-resolution image is fused with the pseudo-visible light image to obtain a fused image; the fused image is input to the second confrontation generator of the second confrontation network in the image conversion model to generate a pseudo-high-resolution image; the pseudo-high-resolution image and the sample High-resolution images for training the second adversarial network.
在一个实施例中,计算机程序执行逻辑时还实现以下步骤:In one embodiment, the computer program also implements the following steps when executing the logic:
将伪高分辨图像输入至第二辅助生成器,得到第二伪低分辨图像;根据第二伪低分辨图像和样本低分辨图像,验证经训练的第二对抗网络的第二对抗生成器的合理性。Input the pseudo-high-resolution image to the second auxiliary generator to obtain a second pseudo-low-resolution image; verify the rationality of the trained second confrontation network's second confrontation generator according to the second pseudo-low-resolution image and the sample low-resolution image sex.
在一个实施例中,第一对抗网络的第一对抗生成器为变分自动编码器;第二对抗网络的第二对抗生成器为残差网络。In one embodiment, the first adversarial generator of the first adversarial network is a variational autoencoder; the second adversarial generator of the second adversarial network is a residual network.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
获取样本低分率图像、样本可见光图像和样本高分辨图像;Obtain sample low-resolution images, sample visible light images and sample high-resolution images;
将样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像;Inputting the sample low-resolution image to the first confrontation generator of the first confrontation network in the image conversion model to generate a pseudo visible light image;
将伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像;inputting the pseudo-visible light image to the first auxiliary generator to obtain a first pseudo-low-resolution image;
采用伪可见光图像、第一伪低分辨图像、样本低分辨图像和样本可见光图像,对第一对抗网络进行训练;Using the pseudo-visible light image, the first pseudo-low-resolution image, the sample low-resolution image and the sample visible-light image to train the first confrontation network;
采用样本低分辨图像、伪可见光图像和样本高分辨图像,对图像转换模型中第二对抗网络进行训练。The second adversarial network in the image conversion model is trained by using sample low-resolution images, pseudo visible light images and sample high-resolution images.
在一个实施例中,计算机程序中采用伪可见光图像、第一伪低分辨图像、样本低分辨图像和样本可见光图像,对第一对抗网络进行训练的逻辑被处理器执行时还实现以下步骤:In one embodiment, the pseudo visible light image, the first pseudo low resolution image, the sample low resolution image and the sample visible light image are used in the computer program, and the logic for training the first confrontation network is executed by the processor to further implement the following steps:
采用伪可见光图像和样本可见光图像,对第一对抗网络的第一对抗判别器进行训练;采用第一伪低分辨图像和样本低分辨图像,对第一对抗生成器进行训练。The first adversarial discriminator of the first adversarial network is trained by using the pseudo visible light image and the sample visible light image; the first adversarial generator is trained by using the first pseudo low resolution image and the sample low resolution image.
在一个实施例中,计算机程序中采用第一伪低分辨图像和样本低分辨图像,对第一对抗生成器进行训练的逻辑被处理器执行时,还实现以下步骤:In one embodiment, the first pseudo low-resolution image and the sample low-resolution image are used in the computer program, and when the logic for training the first confrontation generator is executed by the processor, the following steps are also implemented:
基于损耗函数,根据样本低分率图像,对第一对抗生成器进行训练;根据第一伪低分辨图像和样本低分辨图像,确定范数损失;采用范数损失,对经训练的第一对抗生成器进行优化。Based on the loss function, the first adversarial generator is trained according to the sample low-resolution image; the norm loss is determined according to the first pseudo low-resolution image and the sample low-resolution image; the norm loss is used to train the first adversarial The generator is optimized.
在一个实施例中,计算机程序中采用样本低分辨图像、伪可见光图像和样本高分辨图像,对图像转换模型中第二对抗网络进行训练的逻辑被处理器执行时还实现以下步骤:In one embodiment, when the logic of training the second confrontation network in the image conversion model is executed by the processor, the following steps are implemented by using the sample low-resolution image, the pseudo-visible light image and the sample high-resolution image in the computer program:
将样本低分辨图像和伪可见光图像进行融合,得到融合图像;将融合图像输入至图像转换模型中第二对抗网络的第二对抗生成器,生成伪高分辨图像;采用伪高分辨率图像和样本高分辨图像,对第二对抗网络进行训练。The sample low-resolution image is fused with the pseudo-visible light image to obtain a fused image; the fused image is input to the second confrontation generator of the second confrontation network in the image conversion model to generate a pseudo-high-resolution image; the pseudo-high-resolution image and the sample High-resolution images for training the second adversarial network.
在一个实施例中,计算机程序中逻辑被处理器执行时还实现以下步骤:In one embodiment, when the logic in the computer program is executed by the processor, the following steps are also implemented:
将伪高分辨图像输入至第二辅助生成器,得到第二伪低分辨图像;根据第二伪低分辨图像和样本低分辨图像,验证经训练的第二对抗网络的第二对抗生成器的合理性。Input the pseudo-high-resolution image to the second auxiliary generator to obtain a second pseudo-low-resolution image; verify the rationality of the trained second confrontation network's second confrontation generator according to the second pseudo-low-resolution image and the sample low-resolution image sex.
在其中一个实施例中,第一对抗网络的第一对抗生成器为变分自动编码器;第二对抗网络的第二对抗生成器为残差网络。In one embodiment, the first adversarial generator of the first adversarial network is a variational autoencoder; the second adversarial generator of the second adversarial network is a residual network.
在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
获取样本低分率图像、样本可见光图像和样本高分辨图像;Obtain sample low-resolution images, sample visible light images and sample high-resolution images;
将样本低分辨图像输入至图像转换模型中第一对抗网络的第一对抗生成器,生成伪可见光图像;Inputting the sample low-resolution image to the first confrontation generator of the first confrontation network in the image conversion model to generate a pseudo visible light image;
将伪可见光图像输入至第一辅助生成器,得到第一伪低分辨图像;inputting the pseudo-visible light image to the first auxiliary generator to obtain a first pseudo-low-resolution image;
采用伪可见光图像、第一伪低分辨图像、样本低分辨图像和样本可见光图像,对第一对抗网络进行训练;Using the pseudo-visible light image, the first pseudo-low-resolution image, the sample low-resolution image and the sample visible-light image to train the first confrontation network;
采用样本低分辨图像、伪可见光图像和样本高分辨图像,对图像转换模型中第二对抗网络进行训练。The second adversarial network in the image conversion model is trained by using sample low-resolution images, pseudo visible light images and sample high-resolution images.
在一个实施例中,计算机程序中采用伪可见光图像、第一伪低分辨图像、样本低分辨图像和样本可见光图像,对第一对抗网络进行训练的逻辑被处理器执行时还实现以下步骤:In one embodiment, the pseudo visible light image, the first pseudo low resolution image, the sample low resolution image and the sample visible light image are used in the computer program, and the logic for training the first confrontation network is executed by the processor to further implement the following steps:
采用伪可见光图像和样本可见光图像,对第一对抗网络的第一对抗判别器进行训练;采用第一伪低分辨图像和样本低分辨图像,对第一对抗生成器进行训练。The first adversarial discriminator of the first adversarial network is trained by using the pseudo visible light image and the sample visible light image; the first adversarial generator is trained by using the first pseudo low resolution image and the sample low resolution image.
在一个实施例中,计算机程序中采用第一伪低分辨图像和样本低分辨图像,对第一对抗生成器进行训练的逻辑被处理器执行时,还实现以下步骤:In one embodiment, the first pseudo low-resolution image and the sample low-resolution image are used in the computer program, and when the logic for training the first confrontation generator is executed by the processor, the following steps are also implemented:
基于损耗函数,根据样本低分率图像,对第一对抗生成器进行训练;根据第一伪低分辨图像和样本低分辨图像,确定范数损失;采用范数损失,对经训练的第一对抗生成器进行优化。Based on the loss function, the first adversarial generator is trained according to the sample low-resolution image; the norm loss is determined according to the first pseudo low-resolution image and the sample low-resolution image; the norm loss is used to train the first adversarial The generator is optimized.
在一个实施例中,计算机程序中采用样本低分辨图像、伪可见光图像和样本高分辨图像,对图像转换模型中第二对抗网络进行训练的逻辑被处理器执行时还实现以下步骤:In one embodiment, when the logic of training the second confrontation network in the image conversion model is executed by the processor, the following steps are implemented by using the sample low-resolution image, the pseudo-visible light image and the sample high-resolution image in the computer program:
将样本低分辨图像和伪可见光图像进行融合,得到融合图像;将融合图像输入至图像转换模型中第二对抗网络的第二对抗生成器,生成伪高分辨图像;采用伪高分辨率图像和样本高分辨图像,对第二对抗网络进行训练。The sample low-resolution image is fused with the pseudo-visible light image to obtain a fused image; the fused image is input to the second confrontation generator of the second confrontation network in the image conversion model to generate a pseudo-high-resolution image; the pseudo-high-resolution image and the sample High-resolution images for training the second adversarial network.
在一个实施例中,计算机程序中逻辑被处理器执行时还实现以下步骤:In one embodiment, when the logic in the computer program is executed by the processor, the following steps are also implemented:
将伪高分辨图像输入至第二辅助生成器,得到第二伪低分辨图像;根据第二伪低分辨图像和样本低分辨图像,验证经训练的第二对抗网络的第二对抗生成器的合理性。Input the pseudo-high-resolution image to the second auxiliary generator to obtain a second pseudo-low-resolution image; verify the rationality of the trained second confrontation network's second confrontation generator according to the second pseudo-low-resolution image and the sample low-resolution image sex.
在其中一个实施例中,第一对抗网络的第一对抗生成器为变分自动编码器;第二对抗网络的第二对抗生成器为残差网络。In one embodiment, the first adversarial generator of the first adversarial network is a variational autoencoder; the second adversarial generator of the second adversarial network is a residual network.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic RandomAccess Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the computer programs can be stored in a non-volatile computer-readable storage medium. , when the computer program is executed, it may include the procedures of the embodiments of the above-mentioned methods. Wherein, any reference to storage, database or other media used in the various embodiments provided in the present application may include at least one of non-volatile and volatile storage. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive variable memory (ReRAM), magnetic variable memory (Magnetoresistive Random Access Memory, MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (Phase Change Memory, PCM), graphene memory, etc. The volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the various embodiments provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a blockchain-based distributed database, etc., but is not limited thereto. The processors involved in the various embodiments provided by this application can be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., and are not limited to this.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be within the range described in this specification.
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above examples only express several implementation modes of the present application, and the description thereof is relatively specific and detailed, but should not be construed as limiting the patent scope of the present application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be determined by the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211724958.6A CN116030365A (en) | 2022-12-30 | 2022-12-30 | Model training method, apparatus, computer device, storage medium, and program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211724958.6A CN116030365A (en) | 2022-12-30 | 2022-12-30 | Model training method, apparatus, computer device, storage medium, and program product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116030365A true CN116030365A (en) | 2023-04-28 |
Family
ID=86080685
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211724958.6A Pending CN116030365A (en) | 2022-12-30 | 2022-12-30 | Model training method, apparatus, computer device, storage medium, and program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116030365A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117291252A (en) * | 2023-11-27 | 2023-12-26 | 浙江华创视讯科技有限公司 | Stable video generation model training method, generation method, equipment and storage medium |
-
2022
- 2022-12-30 CN CN202211724958.6A patent/CN116030365A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117291252A (en) * | 2023-11-27 | 2023-12-26 | 浙江华创视讯科技有限公司 | Stable video generation model training method, generation method, equipment and storage medium |
CN117291252B (en) * | 2023-11-27 | 2024-02-20 | 浙江华创视讯科技有限公司 | Stable video generation model training method, generation method, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112115783B (en) | Depth knowledge migration-based face feature point detection method, device and equipment | |
WO2020049385A1 (en) | Multi-view image clustering techniques using binary compression | |
CN111902826A (en) | Positioning, mapping and network training | |
JP2023533907A (en) | Image processing using self-attention-based neural networks | |
CN109033107A (en) | Image search method and device, computer equipment and storage medium | |
CN114418030B (en) | Image classification method, training method and device for image classification model | |
CN110211046A (en) | A kind of remote sensing image fusion method, system and terminal based on generation confrontation network | |
CN113313176B (en) | A point cloud analysis method based on dynamic graph convolutional neural network | |
CN114862811A (en) | A Defect Detection Method Based on Variational Autoencoder | |
CN114612414A (en) | Image processing method, model training method, device, equipment and storage medium | |
CN116246147A (en) | Cross-species object detection method based on cross-layer feature fusion and linear attention optimization | |
Huang et al. | Learning optical flow with R-CNN for visual odometry | |
CN116030365A (en) | Model training method, apparatus, computer device, storage medium, and program product | |
CN111159450B (en) | Picture classification method, device, computer equipment and storage medium | |
CN116524296A (en) | Training method of equipment defect detection model, device and device defect detection method | |
Hou et al. | Open: Object-wise position embedding for multi-view 3d object detection | |
Wang et al. | Attention-based deep bayesian counting for ai-augmented agriculture | |
CN116778091A (en) | Deep learning multi-view three-dimensional reconstruction algorithm based on path aggregation | |
CN117114983A (en) | A hyperspectral image super-resolution method and device based on joint space-spectrum matching | |
Liu et al. | Image superresolution reconstruction via granular computing clustering | |
CN115937395A (en) | Electric equipment model rendering method, device, computer equipment and storage medium | |
EP4307217A1 (en) | Fault image generation method and apparatus | |
CN116385930A (en) | Abnormal Behavior Detection Method Based on Hyperparameter Optimization Time Difference Network | |
CN116258756A (en) | A self-supervised monocular depth estimation method and system | |
CN115994977A (en) | A 3D Point Cloud Completion Method Based on Bidirectional Pyramid Structure with Hybrid Attention Mechanism |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |