A fast event image filling method and system based on lightweight generative adversarial network

By using a method based on lightweight generative adversarial networks and utilizing the sparse characteristics of event images, combined with L1 loss and style loss, the problem of insufficient structural authenticity and precision in event image filling is solved, and efficient event image filling is achieved, which is suitable for Highly dynamic response scenes.

CN112396674BActive Publication Date: 2024-10-18ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011133015.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-21
Publication Date
2024-10-18
Estimated Expiration
2040-10-21

AI Technical Summary

Technical Problem

When the existing technology uses a generative adversarial network to fill event images, the fast response characteristics of the event camera are buried, and the sparsity of the event stream is not fully utilized, resulting in insufficient authenticity and precision of the image filling structure.

Method used

A fast event image filling method based on a lightweight generative adversarial network is adopted. By constructing a shallow 3D generator and event sequence discriminator, combined with L1 loss, perceptual loss and style loss, the network parameters are optimized to make full use of the sparse characteristics of event images. Improve the temporal consistency and structural refinement of filling results.

Benefits of technology

It achieves improved authenticity and precision of image filling while maintaining the high dynamic response characteristics of event cameras. The inference speed can reach 500FPS, which is suitable for capturing fast-moving objects and high frame rate scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112396674B_ABST
    Figure CN112396674B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for filling rapid event images based on a lightweight generative adversarial network, wherein the method and system for filling rapid event images based on a lightweight generative adversarial network include: constructing a lightweight generative adversarial network; obtaining training data, wherein the training data includes multiple pairs of matching loss event images and non-loss event images; optimizing the lightweight generative adversarial network using the training data to obtain the optimal network parameters; obtaining the loss event image to be filled, inputting it into the lightweight generative adversarial network based on the optimal network parameters, and obtaining the filled event image output by the lightweight generative adversarial network. The method and system for filling rapid event images based on a lightweight generative adversarial network of the present invention make full use of the sparse characteristics of event images, and improve the authenticity and fineness of the image filling structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and specifically relates to a method and system for filling in fast event images based on a lightweight generative adversarial network. Background Art

[0002] Event-based Camera (or simply called Event Camera, abbreviated as EB. Sometimes also called DVS (Dynamic Vision Sensor)) is a new type of sensor. Unlike traditional cameras that capture a complete image, event cameras capture "events", which can be simply understood as "changes in pixel brightness", that is, the output of event cameras is changes in pixel brightness.

[0003] Currently, event cameras are able to generate sparse event streams and capture high-speed motion information. However, as the temporal resolution increases, the spatial resolution decreases dramatically. Although generative adversarial networks have achieved remarkable results in traditional image restoration, directly using them for event filling will bury the fast response characteristics of event cameras, and the sparsity of event streams is not fully utilized. Summary of the invention

[0004] The purpose of this application is to provide a fast event image filling method and system based on a lightweight generative adversarial network, which fully utilizes the sparse characteristics of event images and improves the authenticity and fineness of the image filling structure.

[0005] In order to achieve the above purpose, the technical solution adopted by this application is:

[0006] A method for filling in a fast event image based on a lightweight generative adversarial network, the method for filling in a fast event image based on a lightweight generative adversarial network comprising:

[0007] Build lightweight generative adversarial networks;

[0008] Acquire training data, wherein the training data includes a plurality of pairs of matching loss event images and non-loss event images;

[0009] Optimizing the lightweight generative adversarial network using the training data to obtain optimal network parameters;

[0010] Obtain the loss event image to be filled, input it into the lightweight generative adversarial network based on the optimal network parameters, and obtain the filled event image output by the lightweight generative adversarial network;

[0011] Among them, the lightweight generative adversarial network includes a generator and a discriminator, the generator includes an encoder, a decoder, and two residual blocks connected between the encoder and the decoder, the encoder includes three 3D convolutions, the encoder downsamples the image twice, the decoder includes three 3D transposed convolutions, and the decoder upsamples the image twice; the discriminator includes an event frame discriminator and an event sequence discriminator, the event frame discriminator is a PatchGAN structure, and the convolution in the event frame discriminator is a 2D convolution, the event sequence discriminator is a PatchGAN structure, and the convolution in the event sequence discriminator is a 3D convolution.

[0012] Several optional methods are also provided below, but they are not intended to be additional limitations on the above-mentioned overall solution, but are merely further supplements or preferences. Under the premise that there are no technical or logical contradictions, each optional method can be combined with the above-mentioned overall solution separately, and multiple optional methods can also be combined.

[0013] Preferably, the convolution in the residual block adopts a dilated convolution with a dilation factor of 2.

[0014] Preferably, the step of optimizing the lightweight generative adversarial network using the training data to obtain optimal network parameters includes:

[0015] Take P pairs of matching loss event images and non-loss event images based on the training data;

[0016] Inputting P loss event images as a loss event image sequence into the generator, obtaining a filling event image sequence output by the generator, wherein each filling event image in the filling event image sequence corresponds to each loss event image in the loss event image sequence as input;

[0017] Taking P undamaged event images as an undamaged event image sequence, firstly performing back propagation of the discriminator based on the total loss function of the discriminator and then performing back propagation of the generator based on the total loss function of the generator according to the undamaged event image sequence and the padded event image sequence;

[0018] The training is repeated until the optimal network parameters of the lightweight generative adversarial network are obtained.

[0019] Preferably, the total loss function of the discriminator comprises:

[0020]

[0021] Among them, L D is the total loss function of the discriminator, is the loss function of the event sequence discriminator, is the loss function of the event frame discriminator, is the weight parameter of the event sequence discriminator, is the weight parameter of the event frame discriminator;

[0022] The loss function of the event sequence discriminator and the loss function of the event frame discriminator as follows:

[0023]

[0024]

[0025] Among them, I gt represents the lossless event image sequence, P data (I gt ) represents the distribution of the unloss event image sequence, E[*] represents the expected value of the distribution function, logD s (I gt ) represents the probability that the event sequence discriminator identifies the image as an undamaged event, logD f (I gt ) represents the probability that the event frame discriminator identifies the image as an undamaged event image, I in represents the loss event image sequence, P data (I in ) represents the distribution of loss event image sequence, log(1-D s (G(I in ))) represents the probability that the event sequence discriminator identifies the filled event image output by the generator, log(1-D f (G(I in ))) represents the probability that the event frame discriminator determines it to be the padded event image output by the generator.

[0026] Preferably, the total loss function of the generator includes:

[0027] L G =λ1L1+λ p L perc +λ s L style +λ g L g

[0028] Among them, L G is the total loss function of the generator, L1 is the L1 loss function, λ1 is the weight parameter of the L1 loss function, L perc is the perceptual loss function, λ p is the weight parameter of the perceptual loss function, L style is the style loss function, λ s is the weight parameter of the style loss function, Lg is the generator adversarial loss function, λ g The weight parameter of the generator adversarial loss function;

[0029] The generator adversarial loss function L g as follows:

[0030]

[0031] Among them, G represents the generator, D represents the discriminator, and I in represents the loss event image sequence, P data (I in ) represents the distribution of the loss event image sequence, E[*] represents the expected value of the distribution function, G(I in ) represents the padded event image sequence output by the generator, logD s (G(I in )) represents the probability that the event sequence discriminator will identify the padded event image as an unlost event image, logD f (G(I in )) represents the probability that the event frame discriminator will discriminate the padded event image as an unlost event image;

[0032] The L1 loss function L1 is as follows:

[0033]

[0034] Among them, I gt represents the lossless event image sequence, I pred represents the sequence of padded event images output by the generator;

[0035] The perceptual loss function L perc as follows:

[0036]

[0037] Among them, φ j is the activation map of the jth layer of the pre-trained VGG-19 network, φ j (I gt ) represents the corresponding activation map sequence obtained after the unlossed event image sequence is input into the jth layer of the VGG-19 network, φ j (I pred ) represents the corresponding activation map sequence obtained after the padded event image sequence is input into the jth layer of the VGG-19 network; N j Represents the number of feature channels of the j-th layer network in the VGG-19 network;

[0038] The style loss function L style as follows:

[0039]

[0040] in, According to the activation map φ j Constructed C j ×C j Gram matrix, represents multiple Gram matrices constructed based on the activation map sequences corresponding to the unloss event image sequences, Represents multiple Gram matrices constructed according to the activation map sequence corresponding to the filled event image sequence.

[0041] The present application also provides a rapid event image filling system based on a lightweight generative adversarial network, the rapid event image filling system based on a lightweight generative adversarial network comprising:

[0042] The first module is used to build a lightweight generative adversarial network;

[0043] The second module is used to obtain training data, wherein the training data includes a plurality of pairs of matching loss event images and non-loss event images;

[0044] The third module is used to optimize the lightweight generative adversarial network using the training data to obtain the optimal network parameters;

[0045] The fourth module is used to obtain the loss event image to be filled, input it into the lightweight generative adversarial network based on the optimal network parameters, and obtain the filled event image output by the lightweight generative adversarial network;

[0046] Among them, the lightweight generative adversarial network includes a generator and a discriminator, the generator includes an encoder, a decoder, and two residual blocks connected between the encoder and the decoder, the encoder includes three 3D convolutions, the encoder downsamples the image twice, the decoder includes three 3D transposed convolutions, and the decoder upsamples the image twice; the discriminator includes an event frame discriminator and an event sequence discriminator, the event frame discriminator is a PatchGAN structure, and the convolution in the event frame discriminator is a 2D convolution, the event sequence discriminator is a PatchGAN structure, and the convolution in the event sequence discriminator is a 3D convolution.

[0047] Preferably, the convolution in the residual block adopts a dilated convolution with a dilation factor of 2.

[0048] Preferably, the third module optimizes the lightweight generative adversarial network using the training data to obtain optimal network parameters, and performs the following operations:

[0049] Take P pairs of matching loss event images and non-loss event images based on the training data;

[0050] Inputting P loss event images as a loss event image sequence into the generator, obtaining a filling event image sequence output by the generator, wherein each filling event image in the filling event image sequence corresponds to each loss event image in the loss event image sequence as input;

[0051] Taking P undamaged event images as an undamaged event image sequence, firstly performing back propagation of the discriminator based on the total loss function of the discriminator and then performing back propagation of the generator based on the total loss function of the generator according to the undamaged event image sequence and the padded event image sequence;

[0052] The training is repeated until the optimal network parameters of the lightweight generative adversarial network are obtained.

[0053] Preferably, the total loss function of the discriminator comprises:

[0054]

[0055] Among them, L D is the total loss function of the discriminator, is the loss function of the event sequence discriminator, is the loss function of the event frame discriminator, is the weight parameter of the event sequence discriminator, is the weight parameter of the event frame discriminator;

[0056] The loss function of the event sequence discriminator and the loss function of the event frame discriminator as follows:

[0057]

[0058]

[0059] Among them, I gt represents the lossless event image sequence, P data (I gt ) represents the distribution of the unloss event image sequence, E[*] represents the expected value of the distribution function, logD s (I gt ) represents the probability that the event sequence discriminator identifies the image as an undamaged event, logD f (I gt ) represents the probability that the event frame discriminator identifies the image as an undamaged event image, I in represents the loss event image sequence, P data (I in ) represents the distribution of loss event image sequence, log(1-Ds (G(I in ))) represents the probability that the event sequence discriminator identifies the filled event image output by the generator, log(1-D f (G(I in ))) represents the probability that the event frame discriminator determines it to be the padded event image output by the generator.

[0060] Preferably, the total loss function of the generator includes:

[0061] L G =λ1L1+λ p L perc +λ s L style +λ g L g

[0062] Among them, L G is the total loss function of the generator, L1 is the L1 loss function, λ1 is the weight parameter of the L1 loss function, L perc is the perceptual loss function, λ p is the weight parameter of the perceptual loss function, L style is the style loss function, λ s is the weight parameter of the style loss function, L g is the generator adversarial loss function, λ g The weight parameter of the generator adversarial loss function;

[0063] The generator adversarial loss function L g as follows:

[0064]

[0065] Among them, G represents the generator, D represents the discriminator, and I in represents the loss event image sequence, P data (I in ) represents the distribution of the loss event image sequence, E[*] represents the expected value of the distribution function, G(I in ) represents the padded event image sequence output by the generator, logD s (G(I in )) represents the probability that the event sequence discriminator will identify the padded event image as an unlost event image, logD f (G(I in )) represents the probability that the event frame discriminator will discriminate the padded event image as an unlost event image;

[0066] The L1 loss function L1 is as follows:

[0067]

[0068] Among them, I gt represents the lossless event image sequence, I pred represents the sequence of padded event images output by the generator;

[0069] The perceptual loss function L perc as follows:

[0070]

[0071] Among them, φ j is the activation map of the jth layer of the pre-trained VGG-19 network, φ j (I gt ) represents the corresponding activation map sequence obtained after the unlossed event image sequence is input into the jth layer of the VGG-19 network, φ j (I pred ) represents the corresponding activation map sequence obtained after the padded event image sequence is input into the jth layer of the VGG-19 network; N j Represents the number of feature channels of the j-th layer network in the VGG-19 network;

[0072] The style loss function L style as follows:

[0073]

[0074] in, According to the activation map φ j Constructed C j ×C j Gram matrix, represents multiple Gram matrices constructed based on the activation map sequences corresponding to the unloss event image sequences, Represents multiple Gram matrices constructed according to the activation map sequence corresponding to the filled event image sequence.

[0075] In order to overcome the shortcomings of the traditional image restoration model, such as large size, redundant parameters, slow inference speed, and the problem of reduced temporal consistency of the results caused by 2D convolution, the fast event image filling method and system based on lightweight generative adversarial network provided in this application builds a shallow 3D generator to make full use of the sparse characteristics of event images. At the same time, in order to ensure the authenticity of the filled event results and the fineness of the structure, L1 loss, perceptual loss and style loss are added to the original adversarial loss. Finally, an event sequence discriminator is proposed to improve the temporal consistency of the results. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 A flowchart of a fast event image filling method based on a lightweight generative adversarial network of the present application;

[0077] Figure 2 A schematic diagram of the structure of the lightweight generative adversarial network built for this application;

[0078] Figure 3 This is an example diagram of an embodiment of the loss event image of the present application;

[0079] Figure 4 For this application, lightweight generative adversarial networks are used Figure 3 Output padded event image. DETAILED DESCRIPTION

[0080] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0081] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0082] In one of the embodiments, a fast event image filling method based on a lightweight generative adversarial network is provided, which is used in the field of image processing, especially for filling event camera images with impaired spatial resolution.

[0083] like Figure 1 The method for filling in a fast event image based on a lightweight generative adversarial network comprises the following steps:

[0084] Step S1: construct a lightweight generative adversarial network.

[0085] Since directly applying a generative adversarial network to fill in event images will bury the fast response characteristics of the event camera, and the sparsity of the event stream cannot be fully utilized, this embodiment constructs a lightweight generative adversarial network to facilitate the application of high dynamic response scenarios.

[0086] like Figure 2 As shown, the lightweight generative adversarial network constructed in this embodiment includes a generator and a discriminator. The generator includes an encoder and a decoder, and two residual blocks connected between the encoder and the decoder.

[0087] The network of traditional image restoration is too deep for event images, which leads to slow inference speed. Therefore, the encoder of the present invention includes three 3D convolutions, which only downsample the image twice, and the feature channel is expanded to twice the previous layer after each downsampling. The corresponding decoder includes three 3D transposed convolutions, which also only upsample the image twice, and the feature channel is reduced to twice the previous layer after each upsampling.

[0088] At the same time, due to the sparsity of event images, the shallow network does not make the generation quality of event images too low, so this embodiment uses only two residual blocks between the encoder and the decoder. In order to increase the receptive field, the dilated convolution with a dilation factor of 2 is used to replace the regular convolution in the residual layer. At the same time, in order to improve the generalization ability and retain more spatiotemporal information, 3D dilated convolution is used to replace 2D dilated convolution. This embodiment uses instance normalization on all layers of the network.

[0089] In order to improve the temporal consistency and quality of the filled event image, the discriminator constructed in this embodiment includes an event frame discriminator and an event sequence discriminator. The event frame discriminator is a PatchGAN structure, and the convolution in the event frame discriminator is a 2D convolution. The event sequence discriminator is a PatchGAN structure, and the convolution in the event sequence discriminator is a 3D convolution.

[0090] The discriminator uses a 70×70PatchGAN structure, which is used to determine whether overlapping image blocks of size 70×70 are real. The event frame discriminator uses 2D convolution, which aims to focus on the consistency of spatial features of event frames. Although the use of 3D convolution in the generator can retain more spatiotemporal information, it also makes the image edges blurred. For this reason, an event sequence discriminator is introduced, that is, 3D convolution is used to improve the quality of the generated image. The event sequence discriminator focuses on the temporal dependence and correlation of pixel changes. Finally, in order to enhance training stability, spectral normalization is applied to the discriminator.

[0091] This embodiment uses conventional convolution, dilated convolution and transposed convolution. Taking a 5×5 input feature map as an example, a 3×3 convolution kernel with a step size of 1 is used. Conventional convolution will output a 3×3 feature map, which is then used as the input of the dilated convolution. When the number of intervals between the convolution kernel points is 1 (0 is filled between the convolution kernel points, the kernel size becomes 5×5, the parameter amount remains unchanged, and the receptive field becomes larger), the edge filling number of the feature map (filling 0) is set to 2, and the step size is 1. At this time, the size of the feature map output by the dilated convolution is 3×3; for transposed convolution, only the edge filling number of the feature map needs to be set to 2, and the other parameters are the same as conventional convolution, and the 3×3 feature map can be restored to a size of 5×5.

[0092] Step S2: Acquire training data, wherein the training data includes a plurality of pairs of matching loss event images and non-loss event images.

[0093] This embodiment mainly fills the image of the event camera, so this embodiment takes the event camera as an example for explanation. For the event camera, its output can be regarded as the event {e i}∈N. Each event e i It can be expressed in the following form:

[0094] e i =(x i ,y i ,t i ,p i ) (1)

[0095] Where (x i ,y i ) represents the spatial position of the pixel generating the event, t i The time coordinate representing the brightness change, p i ∈{-1, 1} represents the positive or negative change in intensity at the pixel causing the event, and i is the event index number.

[0096] Within the exposure time interval Δt=t+τ, the event frame F is obtained by adding all events between time t and t+τ at the pixel level. τ (t), so the event frame can be expressed as:

[0097]

[0098] Where E t,τ ={e i |t i ∈[t,t+τ]}. In this way, the event frame can be represented as a grayscale image of size 1×w×h, which integrates all events occurring within a specific time interval into a single channel. Based on the event frame accumulation method, when generating matching loss event images and non-loss event images, this embodiment accumulates M1 events into one event frame as a loss event image, and accumulates M2 events into one event frame as a non-loss event image, where M2 is at least 80 times of M1 to ensure the validity of the non-loss event image.

[0099] For example, in this embodiment, the loss event image is accumulated with 100 events as one frame, while the non-loss event image is accumulated with 7500 events as one frame. Figure 3 The loss event image is accumulated with 100 events as one frame, thereby obtaining a low-resolution event image with a frame rate of about 2000 FPS.

[0100] Step S3: Optimize the lightweight generative adversarial network using training data to obtain optimal network parameters.

[0101] In the training of the lightweight generative adversarial network, in order to avoid insufficient video memory or low video memory utilization, this embodiment uses multiple event frames as a sequence segment input for training.

[0102] Specifically, this embodiment takes P (P>1, for example, a value of 8) pairs of matching loss event images and non-loss event images based on training data.

[0103] Input P loss event images as a loss event image sequence into the generator to obtain a filling event image sequence output by the generator, wherein each filling event image in the filling event image sequence corresponds to each loss event image in the loss event image sequence used as input.

[0104] Take P unlossed event images as an unlossed event image sequence, and according to the unlossed event image sequence and the padded event image sequence, first perform backpropagation of the discriminator based on the total loss function of the discriminator, and then perform backpropagation of the generator based on the total loss function of the generator.

[0105] The training is repeated until the optimal network parameters of the lightweight generative adversarial network are obtained.

[0106] In this embodiment, there are two types of discriminators. In order to strengthen the correlation between the two discriminators, this embodiment jointly trains the two discriminators. When updating the discriminator loss, the losses of the two discriminators are first summed and then back-propagated, rather than updating the losses separately. Therefore, the total loss function of the discriminator includes:

[0107]

[0108] Among them, L D is the total loss function of the discriminator, is the loss function of the event sequence discriminator, is the loss function of the event frame discriminator, is the weight parameter of the event sequence discriminator, is the weight parameter of the event frame discriminator.

[0109] The loss function of the event sequence discriminator and the loss function of the event frame discriminator as follows:

[0110]

[0111]

[0112] Among them, I gt represents the lossless event image sequence, P data (Igt ) represents the distribution of the unloss event image sequence, E[*] represents the expected value of the distribution function, logD s (I gt ) represents the probability that the event sequence discriminator identifies the image as an undamaged event, logD f (I gt ) represents the probability that the event frame discriminator identifies the image as an undamaged event image, I in represents the loss event image sequence, P data (I in ) represents the distribution of loss event image sequence, log(1-D s (G(I in ))) represents the probability that the event sequence discriminator identifies the filled event image output by the generator, log(1-D f (G(I in ))) represents the probability that the event frame discriminator determines it to be the padded event image output by the generator.

[0113] In order to ensure the authenticity and quality of the filled event image sequence, this embodiment comprehensively considers various losses of the generator, and the total loss function of the generator used includes:

[0114] L G =λ1L1+λ p L perc +λ s L style +λ g L g (6)

[0115] Among them, L D is the total loss function of the discriminator, L1 is the L1 loss function, λ1 is the weight parameter of the L1 loss function, L perc is the perceptual loss function, λ p is the weight parameter of the perceptual loss function, L style is the style loss function, λ s is the weight parameter of the style loss function, L g is the generator adversarial loss function, λ g is the weight parameter of the generator's adversarial loss function. In this embodiment, λ1=1, λ g =λ p =0.1,λ s =250.

[0116] The lightweight generative adversarial network fills each image in the input image sequence and outputs it, and uses BCELoss (binary cross entropy loss) to make the distribution of the filled event image sequence close to the distribution of the true label. Therefore, the generator adversarial loss function L is used. g as follows:

[0117]

[0118] Among them, G represents the generator, D represents the discriminator, and I in represents the loss event image sequence, P data (I in ) represents the distribution of the loss event image sequence, E[*] represents the expected value of the distribution function, G(I in ) represents the padded event image sequence output by the generator, logD s (G(I in )) represents the probability that the event sequence discriminator will identify the padded event image as an unlost event image, logD f (G(I in )) represents the probability that the event frame discriminator will discriminate the padded event image as an unlost event image;

[0119] In order to make full use of the sparse characteristics of event images, L1 loss is added to the original generator loss function. L1 loss focuses on pixel-level features. The L1 loss function L1 used in this embodiment is as follows:

[0120]

[0121] Among them, I gt represents the lossless event image sequence, I pred Represents the sequence of padded event images output by the generator.

[0122] The L1 loss function will cause blurring of the result while ensuring the pixel-level features of the generator. Therefore, this embodiment introduces perceptual loss and style loss to preserve the image content. pred Normalized to be closer to the true label I in the VGG subspace gt , the perceptual loss function L perc as follows:

[0123]

[0124] Among them, φ j is the activation map of the jth layer of the pre-trained VGG-19 network, φ j (I gt ) represents the corresponding activation map sequence obtained after the unlossed event image sequence is input into the jth layer of the VGG-19 network, φ j (I pred ) represents the corresponding activation map sequence obtained after the padded event image sequence is input into the jth layer of the VGG-19 network; N j Represents the number of feature channels of the j-th layer network in the VGG-19 network.

[0125] Unlike perceptual loss, style loss first applies autocorrelation (Gram matrix) to features in order to better recover detailed textures. Style loss measures the difference between activation map covariances and is also calculated using VGG. Given a size of C j ×H j ×W j The activation map of , the style loss can be calculated as follows:

[0126]

[0127] in, According to the activation map φ j Constructed C j ×C j Gram matrix, represents multiple Gram matrices constructed based on the activation map sequences corresponding to the unloss event image sequences, Represents multiple Gram matrices constructed according to the activation map sequence corresponding to the filled event image sequence.

[0128] This embodiment mainly implements the filling of event image sequences with high temporal resolution and low spatial resolution, or event image sequences with normal temporal resolution but impaired spatial resolution. First, the events are accumulated under high temporal resolution conditions to obtain event frames, and the event sequence images are sent to the generator. After passing through the generator, the filled event image sequence is output. Subsequently, the filled event image sequence and the true label are sent to two discriminators together. The discriminators distinguish the authenticity and feed the results back to the generator, thereby ensuring the temporal consistency and image quality of the filled event image sequence.

[0129] Step S4: obtain the loss event image to be filled, input it into a lightweight generative adversarial network based on the optimal network parameters, and obtain the filled event image output by the lightweight generative adversarial network.

[0130] In order to maximize the use of the trained lightweight generative adversarial network, when filling in the loss event images, this embodiment also inputs P loss event images as a loss event image sequence into the lightweight generative adversarial network for filling, and the corresponding output is the filling event image sequence. Figure 4 As shown, the lightweight generative adversarial network of this embodiment is targeted at Figure 3 The loss event image and the event image output after filling are shown. It can be seen from the figure that the authenticity and fineness of the filled structure of the image output by the lightweight generative adversarial network of this application are high, and the image can be restored to a large extent.

[0131] This application uses a lightweight generative adversarial network to fill in event images. It is smaller than the adversarial network model used in traditional image restoration and has a faster inference speed. The use of 3D convolution and event sequence discriminator can effectively improve the temporal consistency and quality of the filling results. It is suitable for capturing fast-moving objects and fully retains the high dynamic response characteristics of event cameras. For example, it can be applied to ultra-high-speed human motion capture and high frame rate scenes.

[0132] This embodiment uses a shallow 3D generator to make full use of the sparse characteristics of event images. At the same time, in order to ensure the authenticity of the filled event results and the fineness of the structure, L1 loss, perceptual loss and style loss are added to the original adversarial loss. Finally, an event frame discriminator and an event sequence discriminator are used to improve the temporal consistency of the results. The model of the present invention is small, and the inference speed can reach 500FPS, which can basically meet the needs of event cameras to capture high-speed moving objects, and can also be used in high dynamic response scenes.

[0133] In another embodiment, a rapid event image filling system based on a lightweight generative adversarial network is also provided, and the rapid event image filling system based on a lightweight generative adversarial network includes:

[0134] The first module is used to build a lightweight generative adversarial network;

[0135] The second module is used to obtain training data, wherein the training data includes a plurality of pairs of matching loss event images and non-loss event images;

[0136] The third module is used to optimize the lightweight generative adversarial network using the training data to obtain the optimal network parameters;

[0137] The fourth module is used to obtain the loss event image to be filled, input it into the lightweight generative adversarial network based on the optimal network parameters, and obtain the filled event image output by the lightweight generative adversarial network;

[0138] Among them, the lightweight generative adversarial network includes a generator and a discriminator, the generator includes an encoder, a decoder, and two residual blocks connected between the encoder and the decoder, the encoder includes three 3D convolutions, the encoder downsamples the image twice, the decoder includes three 3D transposed convolutions, and the decoder upsamples the image twice; the discriminator includes an event frame discriminator and an event sequence discriminator, the event frame discriminator is a PatchGAN structure, and the convolution in the event frame discriminator is a 2D convolution, the event sequence discriminator is a PatchGAN structure, and the convolution in the event sequence discriminator is a 3D convolution.

[0139] For the specific definition of the rapid event image filling system based on lightweight generative adversarial network, please refer to the definition of the rapid event image filling method based on lightweight generative adversarial network in the above text, which will not be repeated here. The above modules can be implemented in whole or in part by software, hardware and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0140] In another embodiment, the convolution in the residual block adopts a dilated convolution with a dilation factor of 2.

[0141] In another embodiment, the third module optimizes the lightweight generative adversarial network using the training data to obtain optimal network parameters, and performs the following operations:

[0142] Take P pairs of matching loss event images and non-loss event images based on the training data;

[0143] Inputting P loss event images as a loss event image sequence into the generator, obtaining a filling event image sequence output by the generator, wherein each filling event image in the filling event image sequence corresponds to each loss event image in the loss event image sequence as input;

[0144] Taking P undamaged event images as an undamaged event image sequence, firstly performing back propagation of the discriminator based on the total loss function of the discriminator and then performing back propagation of the generator based on the total loss function of the generator according to the undamaged event image sequence and the padded event image sequence;

[0145] The training is repeated until the optimal network parameters of the lightweight generative adversarial network are obtained.

[0146] In another embodiment, the total loss function of the discriminator includes:

[0147]

[0148] Among them, L D is the total loss function of the discriminator, is the loss function of the event sequence discriminator, is the loss function of the event frame discriminator, is the weight parameter of the event sequence discriminator, is the weight parameter of the event frame discriminator;

[0149] The loss function of the event sequence discriminator and the loss function of the event frame discriminator as follows:

[0150]

[0151]

[0152] Among them, I gt represents the lossless event image sequence, P data (I gt ) represents the distribution of the unloss event image sequence, E[*] represents the expected value of the distribution function, logD s (I gt ) represents the probability that the event sequence discriminator identifies the image as an undamaged event, logD f (I gt ) represents the probability that the event frame discriminator identifies the image as an undamaged event image, I in represents the loss event image sequence, P data (I in ) represents the distribution of loss event image sequence, log(1-D s (G(I in ))) represents the probability that the event sequence discriminator identifies the filled event image output by the generator, log(1-D f (G(I in ))) represents the probability that the event frame discriminator determines it to be the padded event image output by the generator.

[0153] In another embodiment, the total loss function of the generator includes:

[0154] L G =λ1L1+λ p L perc +λ s L style +λ g L g

[0155] Among them, L G is the total loss function of the generator, L1 is the L1 loss function, λ1 is the weight parameter of the L1 loss function, L perc is the perceptual loss function, λ p is the weight parameter of the perceptual loss function, L style is the style loss function, λ s is the weight parameter of the style loss function, L g is the generator adversarial loss function, λ g The weight parameter of the generator adversarial loss function;

[0156] The generator adversarial loss function L g as follows:

[0157]

[0158] Among them, G represents the generator, D represents the discriminator, and I in represents the loss event image sequence, P data (I in ) represents the distribution of the loss event image sequence, E[*] represents the expected value of the distribution function, G(I in ) represents the padded event image sequence output by the generator, logD s (G(I in )) represents the probability that the event sequence discriminator will identify the padded event image as an unlost event image, logD f (G(I in )) represents the probability that the event frame discriminator will discriminate the padded event image as an unlost event image;

[0159] The L1 loss function L1 is as follows:

[0160]

[0161] Among them, I gt represents the lossless event image sequence, I pred represents the sequence of padded event images output by the generator;

[0162] The perceptual loss function L perc as follows:

[0163]

[0164] Among them, φ j is the activation map of the jth layer of the pre-trained VGG-19 network, φ j (I gt ) represents the corresponding activation map sequence obtained after the unlossed event image sequence is input into the jth layer of the VGG-19 network, φ j (I pred ) represents the corresponding activation map sequence obtained after the padded event image sequence is input into the jth layer of the VGG-19 network; N j Represents the number of feature channels of the j-th layer network in the VGG-19 network;

[0165] The style loss function L style as follows:

[0166]

[0167] in, According to the activation map φ j Constructed C j ×C j Gram matrix, represents multiple Gram matrices constructed based on the activation map sequences corresponding to the unloss event image sequences, Represents multiple Gram matrices constructed according to the activation map sequence corresponding to the filled event image sequence.

[0168] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0169] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0170] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made 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 patent of the present application shall be subject to the attached claims.

Claims

1. A fast event image filling method based on lightweight generative adversarial network, characterized in that: The fast event image filling method based on lightweight generative adversarial network includes: Build lightweight generative adversarial networks; Acquire training data, wherein the training data includes a plurality of pairs of matching loss event images and non-loss event images; Optimizing the lightweight generative adversarial network using the training data to obtain optimal network parameters; Obtain the loss event image to be filled, input it into the lightweight generative adversarial network based on the optimal network parameters, and obtain the filled event image output by the lightweight generative adversarial network; The lightweight generative adversarial network includes a generator and a discriminator, the generator includes an encoder, a decoder, and two residual blocks connected between the encoder and the decoder, the encoder includes three 3D convolutions, the encoder downsamples the image twice, the decoder includes three 3D transposed convolutions, and the decoder upsamples the image twice; the discriminator includes an event frame discriminator and an event sequence discriminator, the event frame discriminator is a PatchGAN structure, and the convolution in the event frame discriminator is a 2D convolution, the event sequence discriminator is a PatchGAN structure, and the convolution in the event sequence discriminator is a 3D convolution; Wherein, the step of optimizing the lightweight generative adversarial network using the training data to obtain optimal network parameters includes: Take P pairs of matching loss event images and non-loss event images based on the training data; Inputting P loss event images as a loss event image sequence into the generator, obtaining a filling event image sequence output by the generator, wherein each filling event image in the filling event image sequence corresponds to each loss event image in the loss event image sequence as input; Taking P undamaged event images as an undamaged event image sequence, firstly performing back propagation of the discriminator based on the total loss function of the discriminator and then performing back propagation of the generator based on the total loss function of the generator according to the undamaged event image sequence and the padded event image sequence; The training is repeated until the optimal network parameters of the lightweight generative adversarial network are obtained.

2. The method for filling in fast event images based on lightweight generative adversarial networks according to claim 1, characterized in that: The convolution in the residual block adopts a dilated convolution with a dilation factor of 2.

3. The method for filling in fast event images based on lightweight generative adversarial networks according to claim 1, characterized in that: The total loss function of the discriminator includes: Among them, L D is the total loss function of the discriminator, is the loss function of the event sequence discriminator, is the loss function of the event frame discriminator, is the weight parameter of the event sequence discriminator, is the weight parameter of the event frame discriminator; The loss function of the event sequence discriminator and the loss function of the event frame discriminator as follows: Among them, I gt represents the lossless event image sequence, P data (I gt ) represents the distribution of the unloss event image sequence, E[*] represents the expected value of the distribution function, logD s (I gt ) represents the probability that the event sequence discriminator identifies the image as an undamaged event, logD f (I gt ) represents the probability that the event frame discriminator identifies the image as an undamaged event image, I in represents the loss event image sequence, P data (I in ) represents the distribution of loss event image sequence, log(1-D s (G(I in ))) represents the probability that the event sequence discriminator identifies the filled event image output by the generator, log(1-D f (G(I in ))) represents the probability that the event frame discriminator determines it to be the padded event image output by the generator.

4. The method for filling in fast event images based on lightweight generative adversarial networks according to claim 1, characterized in that: The total loss function of the generator includes: L G =λ1L1+λ p L perc +λ s L style +λ g L g Among them, L G is the total loss function of the generator, L1 is the L1 loss function, λ1 is the weight parameter of the L1 loss function, L perc is the perceptual loss function, λ p is the weight parameter of the perceptual loss function, L style is the style loss function, λ s is the weight parameter of the style loss function, L g is the generator adversarial loss function, λ g The weight parameter of the generator adversarial loss function; The generator adversarial loss function L g as follows: Among them, G represents the generator, D represents the discriminator, and I in represents the loss event image sequence, P data (I in ) represents the distribution of the loss event image sequence, E[*] represents the expected value of the distribution function, G(I in ) represents the padded event image sequence output by the generator, logD s (G(I in )) represents the probability that the event sequence discriminator will identify the padded event image as an unlost event image, logD f (G(I in )) represents the probability that the event frame discriminator will discriminate the padded event image as an unlost event image; The L1 loss function L1 is as follows: Among them, I gt represents the lossless event image sequence, I pred represents the sequence of padded event images output by the generator; The perceptual loss function L perc as follows: Among them, φ j is the activation map of the jth layer of the pre-trained VGG-19 network, φ j (I gt ) represents the corresponding activation map sequence obtained after the unlossed event image sequence is input into the jth layer of the VGG-19 network, φ j (I pred ) represents the corresponding activation map sequence obtained after the padded event image sequence is input into the jth layer of the VGG-19 network; N j Represents the number of feature channels of the j-th layer network in the VGG-19 network; The style loss function L style as follows: in, According to the activation map φ j Constructed C j ×C j Gram matrix, represents multiple Gram matrices constructed based on the activation map sequences corresponding to the unloss event image sequences, Represents multiple Gram matrices constructed according to the activation map sequence corresponding to the filled event image sequence.

5. A fast event image filling system based on lightweight generative adversarial network, characterized in that: The fast event image filling system based on lightweight generative adversarial network includes: The first module is used to construct a lightweight generative adversarial network; wherein the lightweight generative adversarial network includes a generator and a discriminator, the generator includes an encoder, a decoder, and two residual blocks connected between the encoder and the decoder, the encoder includes three 3D convolutions, the encoder downsamples the image twice, the decoder includes three 3D transposed convolutions, and the decoder upsamples the image twice; the discriminator includes an event frame discriminator and an event sequence discriminator, the event frame discriminator is a PatchGAN structure, and the convolution in the event frame discriminator is a 2D convolution, the event sequence discriminator is a PatchGAN structure, and the convolution in the event sequence discriminator is a 3D convolution; The second module is used to obtain training data, wherein the training data includes a plurality of pairs of matching loss event images and non-loss event images; The third module is used to optimize the lightweight generative adversarial network using the training data to obtain the optimal network parameters, and performs the following operations: Take P pairs of matching loss event images and non-loss event images based on the training data; Inputting P loss event images as a loss event image sequence into the generator, obtaining a filling event image sequence output by the generator, wherein each filling event image in the filling event image sequence corresponds to each loss event image in the loss event image sequence as input; Taking P undamaged event images as an undamaged event image sequence, firstly performing back propagation of the discriminator based on the total loss function of the discriminator and then performing back propagation of the generator based on the total loss function of the generator according to the undamaged event image sequence and the padded event image sequence; Repeat the training until the optimal network parameters of the lightweight generative adversarial network are obtained; The fourth module is used to obtain the loss event image to be filled, input it into the lightweight generative adversarial network based on the optimal network parameters, and obtain the filled event image output by the lightweight generative adversarial network.

6. The rapid event image filling system based on lightweight generative adversarial network as claimed in claim 5, characterized in that: The convolution in the residual block adopts a dilated convolution with a dilation factor of 2.

7. The rapid event image filling system based on lightweight generative adversarial network as claimed in claim 5, characterized in that: The total loss function of the discriminator includes: Among them, L D is the total loss function of the discriminator, is the loss function of the event sequence discriminator, is the loss function of the event frame discriminator, is the weight parameter of the event sequence discriminator, is the weight parameter of the event frame discriminator; The loss function of the event sequence discriminator and the loss function of the event frame discriminator as follows: Among them, I gt represents the lossless event image sequence, P data (I gt ) represents the distribution of the unloss event image sequence, E[*] represents the expected value of the distribution function, logD s (I gt ) represents the probability that the event sequence discriminator identifies the image as an undamaged event, logD f (I gt ) represents the probability that the event frame discriminator identifies the image as an undamaged event image, I in represents the loss event image sequence, P data (I in ) represents the distribution of loss event image sequence, log(1-D s (G(I in ))) represents the probability that the event sequence discriminator identifies the filled event image output by the generator, log(1-D f (G(I in ))) represents the probability that the event frame discriminator determines it to be the padded event image output by the generator.

8. The rapid event image filling system based on lightweight generative adversarial network as claimed in claim 5, characterized in that: The total loss function of the generator includes: L G =λ1L1+λ p L perc +λ s L style +λ g L g Among them, L G is the total loss function of the generator, L1 is the L1 loss function, λ1 is the weight parameter of the L1 loss function, L perc is the perceptual loss function, λ p is the weight parameter of the perceptual loss function, L style is the style loss function, λ s is the weight parameter of the style loss function, L g is the generator adversarial loss function, λ g The weight parameter of the generator adversarial loss function; The generator adversarial loss function L g as follows: Among them, G represents the generator, D represents the discriminator, and I in represents the loss event image sequence, P data (I in ) represents the distribution of the loss event image sequence, E[*] represents the expected value of the distribution function, G(I in ) represents the padded event image sequence output by the generator, logD s (G(I in )) represents the probability that the event sequence discriminator will identify the padded event image as an unlost event image, logD f (G(I in )) represents the probability that the event frame discriminator will discriminate the padded event image as an unlost event image; The L1 loss function L1 is as follows: Among them, I gt represents the lossless event image sequence, I pred represents the sequence of padded event images output by the generator; The perceptual loss function L perc as follows: Among them, φ j is the activation map of the jth layer of the pre-trained VGG-19 network, φ j (I gt ) represents the corresponding activation map sequence obtained after the unlossed event image sequence is input into the jth layer of the VGG-19 network, φ j (I pred ) represents the corresponding activation map sequence obtained after the padded event image sequence is input into the jth layer of the VGG-19 network; N j Represents the number of feature channels of the j-th layer network in the VGG-19 network; The style loss function L style as follows: in, According to the activation map φ j Constructed C j ×C j Gram matrix, represents multiple Gram matrices constructed based on the activation map sequences corresponding to the unloss event image sequences, Represents multiple Gram matrices constructed according to the activation map sequence corresponding to the filled event image sequence.

Citation Information

Patent Citations

  • Image synthesis method and system combining adversarial auto-encoder and generative adversarial network

    CN111402179A