Image enhancement method, electronic device and storage medium

By converting color images into infrared night vision images through a generative adversarial network, and mixing them with real night vision data to train the generator and discriminator, it solves the problem of robots having difficulty acquiring infrared night vision images at night, achieving automated data acquisition and high efficiency. Night vision image generation.

CN113139924BActive Publication Date: 2024-09-10SHANGHAI YOGO ROBOTICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110041231.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-13
Publication Date
2024-09-10
Estimated Expiration
2041-01-13

AI Technical Summary

Technical Problem

In the night environment, it is difficult for robots to obtain effective infrared night vision image data through color image collection. The existing technology requires artificial scenes or large-scale field collection of infrared data, and the resulting grayscale image does not have the supplementary light and infrared night vision images. The black and white contrast effect cannot meet actual business needs.

Method used

A generative adversarial network is used to convert color images into infrared night vision images, and by mixing them with real infrared night vision images as training data for the environment perception model, the generator and discriminator are trained so that the infrared night vision images generated by the generator are consistent with the real ones. The images are similar, and the discriminator's discrimination effect is accurate, thus achieving automated night vision data acquisition.

Benefits of technology

The generative adversarial network directly generates usable infrared night vision pictures based on color images, which solves the difficult problem of infrared night vision image collection and realizes the automatic acquisition of night vision data. The generation results are real, the discrimination effect is accurate, and artificial scenes are avoided. Collection limitations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113139924B
    Figure CN113139924B
Patent Text Reader

Abstract

The present application relates to an image enhancement method, an electronic device and a storage medium, which generate usable infrared night vision pictures directly based on color images by adopting a generative adversarial network, and then mix them with the existing actually collected night vision data as training data for an environmental perception model, so that the generation result of the generator is very realistic, and the discrimination effect of the discriminator is also very accurate, so that the acquisition of night vision data can be obtained in an automated manner instead of artificially creating scene collection, thereby solving the problem of difficulty in collecting infrared night vision images due to restrictions on collection requirements and actual conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image enhancement method, an electronic device and a storage medium. Background Art

[0002] When the robot is driving, it often needs to have a certain understanding of the surrounding environment, such as pedestrian detection and road segmentation on the collected images, which can assist the normal driving of the robot, such as effective obstacle avoidance and avoidance of non-drivable areas when pedestrians are detected. At the same time, some additional human-machine interaction functions, such as voice prompts, can be added based on pedestrian information. In daytime scenes, color image data can be collected at any time, which is conducive to the training of environmental perception models. However, night vision cameras are needed to capture surrounding environmental information at night, but the collection of night vision images is more difficult. First, there needs to be a completely black or dark light scene, and someone needs to appear. If the scene is simply created by humans, the data obtained often cannot meet the needs of actual business. Large-scale field collection of infrared data is constrained by actual environmental conditions. Although color images can be directly converted into grayscale images, the obtained grayscale images do not have the fill light and black and white contrast effects on infrared night vision images. Such data may have a counterproductive effect. Therefore, there is a need for an effective method to convert existing color images into night vision images. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present application provides an image enhancement method, an electronic device and a storage medium to solve the problem of the difficulty in collecting infrared night vision images.

[0004] The technical solution of the present application to solve the above-mentioned technical problems is as follows: an image enhancement method, comprising the following steps: step 1, performing image acquisition through a first shooting device to obtain a database of a first image; step 2, inputting the database of the first image into a generative adversarial network; step 3, converting the first image into a corresponding second image through the generative adversarial network.

[0005] Preferably, image acquisition is performed through a second shooting device to obtain multiple third pictures; the generative adversarial network includes a generator and a discriminator, the generator is used to generate the second picture, and the discriminator is used to distinguish whether the picture input into the generative adversarial network is the second picture or the third picture.

[0006] Preferably, before converting the first image into the corresponding second image through the generative adversarial network, the following steps are also included: S301, mixing the second image and the third image together to obtain training data of the environmental perception model; S302, fixing the generator unchanged and performing model training on the discriminator; S303, training the discriminator with the training data of the environmental perception model so that the discriminator distinguishes the second image from the third image.

[0007] Preferably, after the discriminator is trained iteratively for K steps, the following steps are also included: S304, fixing the discriminator unchanged and performing model training on the generator; S305, updating the parameters of the generator through a fixed learning frequency so that the generator generates the second image; S306, comparing the second image with the third image to obtain comparison data; S307, when the comparison data reaches a preset value, obtaining a trained generator.

[0008] Preferably, the first image is converted into a corresponding second image through the generative adversarial network, which specifically includes the following steps: S308, inputting the database of the first image into the trained generator; S309, generating the second image through the generator to obtain enhanced data of actual business data.

[0009] Preferably, the optimization function of the generative adversarial network is:

[0010]

[0011] The model of the generator is G(z), the model of the discriminator is D(x), z is the random input noise, x represents the picture, and p data(x) represents the probability distribution of the real image, p z(z) Generate a probability distribution of an image. The generator model G(z) converts the random input noise z into an image x, and D(x) outputs a probability value between 0 and 1, indicating how likely the image x is to be a real image.

[0012] Preferably, the first picture is a color picture, and the second picture is a generated infrared night vision picture.

[0013] Preferably, the third picture is a real infrared night vision picture.

[0014] A second aspect of an embodiment of the present application provides an electronic device, including:

[0015] processor; and one or more processors; one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing the method as described above.

[0016] According to a third aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0017] The present application provides an image enhancement method, an electronic device and a storage medium, which generate usable infrared night vision pictures directly based on color images by adopting a generative adversarial network, and then mix them with the existing actually collected night vision data as training data for an environmental perception model, so that the generation result of the generator is very realistic, and the discrimination effect of the discriminator is also very accurate, so that the acquisition of night vision data can be obtained in an automated manner instead of artificially creating scene collection, thereby solving the problem of difficulty in collecting infrared night vision images due to restrictions on collection requirements and actual conditions.

[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and other objects, features and advantages of the present application will become more apparent through a more detailed description of exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.

[0020] Figure 1 is a flowchart of an image enhancement method shown in an embodiment of the present application;

[0021] Figure 2 is a schematic diagram of a model of a generative adversarial network shown in an embodiment of the present application;

[0022] Figure 3 is another flowchart of the image enhancement method shown in an embodiment of the present application;

[0023] Figure 4 is another flowchart of the image enhancement method shown in an embodiment of the present application;

[0024] Figure 5 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The preferred embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0026] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0027] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0028] Currently, when the robot is driving during the day, it can use the first shooting device to collect images to realize the detection and recognition function, but it cannot obtain effective data in the night scene. Therefore, it is necessary to use a night vision camera for image capture. However, due to the collection requirements and actual conditions, the acquisition of night vision images is much more difficult than color images.

[0029] In view of the above problems, an embodiment of the present application provides an image enhancement method to solve the problem of making the acquisition of infrared night vision images more reasonable and effective.

[0030] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0031] See also Figure 1 , Figure 1 This is a flow chart of an image enhancement method shown in the first embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0032] Step S1, collecting images through a first shooting device to obtain a database of first pictures.

[0033] Specifically, the first shooting device is a color camera (in other embodiments, the first shooting device may be a color camera, a video camera, or other video device that can capture color pictures), the first picture is a color picture, and the color camera can capture images during the day, thereby obtaining a database of multiple color pictures, namely, a database of first pictures.

[0034] Step S2: inputting the database of the first image into a generative adversarial network.

[0035] Please refer to Figure 2 , Figure 2 A schematic diagram of a model of the generative adversarial network;

[0036] like Figure 2 As shown, the generative adversarial network includes a generator and a discriminator. The generator needs to generate a real picture as much as possible, while the discriminator's goal is to determine whether a picture is a real picture or a generated picture. The two compete with each other and improve each other in a game-like manner. Finally, the generator's generation result will be very real, and the discriminator's discrimination effect will be very accurate.

[0037] Step S3: converting the first image into a corresponding second image through the generative adversarial network.

[0038] Specifically, the first picture is a color picture. In this embodiment, the color picture is used as the input of the generative adversarial network. The style conversion characteristics of the generative adversarial network are used to convert the color picture into a corresponding infrared night vision picture, that is, the second picture is an infrared night vision picture generated by the color picture through the generator.

[0039] In this embodiment, a generative adversarial network is used to directly generate usable infrared night vision pictures based on color images, so that night vision data can be acquired in an automated manner instead of manually creating scene collection, thereby solving the problem of difficulty in collecting infrared night vision images due to limitations on collection requirements and actual conditions.

[0040] See also Figure 3 as well as Figure 4 , is another flow chart of the image enhancement method shown in the second embodiment of the present application. This embodiment is based on the above embodiment and adds additional processes. The details are as follows:

[0041] Please refer to Figure 3 , before converting the first image into a corresponding second image through the generative adversarial network, the following steps are also included:

[0042] S301, mixing the second picture and the third picture together to obtain training data for an environment perception model.

[0043] Specifically, the image is captured by a second shooting device to obtain multiple third pictures. In the present embodiment, the second shooting device is an infrared night vision camera, which is used to capture images in a dark scene to obtain multiple infrared night vision pictures, that is, the third pictures are real infrared night vision pictures.

[0044] The generator is used to generate the second picture, and the discriminator is used to distinguish whether the picture input into the generative adversarial network is the second picture or the third picture, that is, the discriminator is used to distinguish whether the picture input into the generative adversarial network is a real infrared night vision picture or a generated infrared night vision picture.

[0045] S302, fixing the generator unchanged and performing model training on the discriminator;

[0046] S303: Train the discriminator using the training data of the environment perception model, so that the discriminator can distinguish the second picture from the third picture.

[0047] In the process of model training of the generative adversarial network, the generator and the discriminator need to be optimized iteratively. First, the fact generator is fixed, and a plurality of real infrared night vision pictures and a plurality of generated infrared pictures are sampled, so that the plurality of real infrared night vision pictures and the plurality of generated infrared pictures are mixed together to form the training data of the environmental perception model, and the discriminator is trained using the training data of the environmental perception model, so that the discriminator can better distinguish between real pictures and generated pictures.

[0048] Specifically, the second image is a new image generated by the generative adversarial network based on the first image. The second image needs to be discriminated by the discriminant network of the discriminator to determine whether it has reached the level of a real image. It should be noted that the discriminant network of the discriminator can actually output the probability distribution that the second image is a real image, and then measure it according to a preset probability threshold (such as 70%, 80%, etc., determined according to actual needs and experience). When the probability that the second image is a real image is greater than the probability threshold, it is determined to be a real image, indicating that the second image generated by the generator is valid, and it is determined as the intermediate image corresponding to the first image.

[0049] On the contrary, when the discriminant network of the discriminator determines that the second picture is not a real image, it means that the second picture generated by the generator is invalid, and the second picture needs to be iterated through the generator, specifically: the second picture is input into the generation network of the generator again to generate a new second picture, and the discriminant network of the discriminator is used to determine whether the new second picture is a real image. When the new second picture is determined to be a real image, the iteration ends and the intermediate image is obtained. When the new second picture is determined to be not a real image, the generated new second picture is input into the generation network again to continue the iteration.

[0050] Please refer to Figure 4 , wherein after the discriminator is trained for K steps, the following steps are also included:

[0051] S304, fixing the discriminator unchanged and performing model training on the generator;

[0052] S305, updating the parameters of the generator through a fixed learning frequency so that the generator generates the second image;

[0053] S306, comparing the second picture with the third picture to obtain comparison data;

[0054] S307, when the comparison data reaches a preset value, a trained generator is obtained.

[0055] Specifically, after iterating K steps, the discriminator is fixed, and the parameters of the generator are updated at a certain learning rate, so that the generator can generate infrared night views that are as close to the real picture as possible, so as to deceive the discriminator. After repeating this cycle many times, a generator that is close to the real picture will be obtained.

[0056] In one embodiment, converting the first image into a corresponding second image by using the generative adversarial network specifically includes the following steps:

[0057] S308, inputting the first picture database into the trained generator;

[0058] S309: Generate the second picture through the generator to obtain enhanced data of actual business data.

[0059] After obtaining the trained generator, the trained generator can be used to generate infrared night vision images with a distribution close to that of real images based on existing color images, as enhanced data for actual business data.

[0060] In one embodiment, the optimization function of the generative adversarial network is:

[0061]

[0062] The model of the generator is G(z), the model of the discriminator is D(x), z is the randomly input noise, x represents the picture, represents the probability distribution of the real image, and generates the probability distribution of the image. The model G(z) of the generator converts the randomly input noise z into the picture x, and D(x) outputs a probability value between 0 and 1, which represents how likely the picture x is to be a real picture.

[0063] The optimization function of the generative adversarial network needs to minimize the generation error of the generator G and maximize the discrimination probability of the discriminator D. In this embodiment, the picture x represents a color picture, the generator needs to convert the color picture into an infrared night vision picture as much as possible, and the discriminator needs to distinguish between the real infrared night vision picture and the generated infrared night vision picture.

[0064] In this embodiment, an optimization function of the generative adversarial network is established, and then the discriminator and the generator are trained respectively, so that the generation error of the generator G is minimized and the discrimination probability of the discriminator D is maximized, thereby obtaining an optimized generative adversarial network, and then a plurality of color images are used as inputs of the generative adversarial network, and the style conversion characteristics of the generative adversarial network are used to convert the color images into corresponding infrared night vision images, so as to obtain a plurality of generated infrared night vision images, and the generated plurality of infrared night vision images are used as enhanced data of actual business data, so that the acquisition of night vision data can be obtained in an automated manner, rather than artificially creating scene collection, thereby solving the problem that the collection of infrared night vision images is difficult due to the limitations of collection requirements and actual conditions.

[0065] Figure 5 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.

[0066] See also Figure 5 , the electronic device 400 includes a memory 410 and a processor 420.

[0067] The processor 420 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0068] The memory 410 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, ROM can store static data or instructions required by the processor 1020 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 410 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 410 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0069] The memory 410 stores executable codes, and when the executable codes are processed by the processor 420 , the processor 420 can execute part or all of the methods described above.

[0070] The scheme of the present application has been described in detail above with reference to the accompanying drawings. In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, refer to the relevant description of other embodiments. Those skilled in the art should also know that the actions and modules involved in the description are not necessarily required for the present application. In addition, it can be understood that the steps in the method of the embodiment of the present application can be adjusted in order, merged and deleted according to actual needs, and the modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0071] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.

[0072] Alternatively, the present application can also be implemented as a non-temporary machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or electronic device, server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.

[0073] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the application herein may be implemented as electronic hardware, computer software, or combinations of both.

[0074] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system and method according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, a program segment or a code, and the part of the module, the program segment or the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or the flow chart, and the combination of the square boxes in the block diagram and / or the flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0075] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. An image enhancement method, characterized in that: The following steps are involved: Step 1, collecting images through a first shooting device to obtain a database of first images; Step 2, inputting the database of the first image into a generative adversarial network; Step 3, converting the first image into a corresponding second image through the generative adversarial network; The first shooting device is a color camera, the first picture is a color picture, and the second picture is a generated infrared night vision picture; Converting the first image into a corresponding second image through the generative adversarial network specifically includes the following steps: S308, inputting the first picture database into the trained generator; S309, generating the second picture by the generator to obtain enhanced data of actual business data; The method further comprises: Capturing images through a second photographing device to obtain a plurality of third images; The generative adversarial network includes a generator and a discriminator, the generator is used to generate the second image, and the discriminator is used to distinguish whether the image input into the generative adversarial network is the second image or the third image; The optimization function of the generative adversarial network is: The model of the generator is G(z), the model of the discriminator is D(x), z is the random input noise, x represents the picture, and p data(x) represents the probability distribution of the real image, p z(z) Generate a probability distribution of an image. The generator model G(z) converts the random input noise z into an image x, and D(x) outputs a probability value between 0 and 1, indicating how likely the image x is to be a real image.

2. The image enhancement method according to claim 1, characterized in that: Before converting the first picture into a corresponding second picture through the generative adversarial network, the method further includes the following steps: S301, mixing the second picture and the third picture together to obtain training data of an environment perception model; S302, fixing the generator unchanged and performing model training on the discriminator; S303: Train the discriminator using the training data of the environment perception model, so that the discriminator can distinguish the second picture from the third picture.

3. The image enhancement method according to claim 2, characterized in that: After the discriminator is trained for K steps, the following steps are also included: S304, fixing the discriminator unchanged and performing model training on the generator; S305, updating the parameters of the generator through a fixed learning frequency so that the generator generates the second image; S306, comparing the second picture with the third picture to obtain comparison data; S307, when the comparison data reaches a preset value, a trained generator is obtained.

4. The image enhancement method according to claim 2, characterized in that: The third picture is a real infrared night vision picture.

5. An electronic device comprising: Memory; one or more processors; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for executing any one of the methods according to claims 1-4.

6. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the image enhancement method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Weak visible light and infrared image fusion identification method based on a generative adversarial network

    CN109614996A

  • Infrared image super-resolution reconstruction method and system and electronic equipment

    CN111047546A

  • Digital Image Layout Training using Wireframe Rendering within a Generative Adversarial Network (GAN) System

    US20200151508A1