Image reconstruction model training method, image reconstruction method and device
By introducing self-consistency, brightness consistency and smoothness constraints into the image reconstruction model, the problem of low image reconstruction quality in low-light environments in the existing technology is solved, and a more efficient blurred image reconstruction effect is achieved.
Patent Information
- Application Number
- CN202110237930.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-04
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-03-04
AI Technical Summary
In the existing technology, the method of reconstructing a video sequence based on a single motion blur image has low image reconstruction quality and high computational complexity in low-light environments, especially in lightweight mobile devices, making it difficult to effectively improve the reconstruction of blurred images. quality.
An image reconstruction model training method is proposed. By obtaining the blurred image and event data to be trained, the parameters of the image reconstruction model are updated using self-consistency constraints, including re-blurring the reconstructed high-definition image and comparing it with the original blurred image. , to improve the reconstruction quality. This method also introduces brightness consistency and smoothing constraints to further optimize the image reconstruction effect.
It significantly improves the reconstruction quality of blurred images, reduces the computational complexity, and improves the reconstruction effect, making the reconstructed high-definition image frame sequence closer to the original input real data.
Smart Images

Figure CN113076685B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision in artificial intelligence, and specifically to a training method for an image reconstruction model, an image reconstruction method and a device thereof. Background Art
[0002] Motion blur generally occurs in scenes with significant motion during the exposure time, especially in low-light environments for lightweight mobile devices such as mobile phones and car cameras. Although motion blur causes undesirable image degradation, making the visual content difficult to interpret, motion-blurred images also encode rich information about the relative motion between the camera and the observed scene. Therefore, recovering (reconstructing) a clear frame sequence (photo-sequencing) from a single motion-blurred image helps to understand the dynamics of the scene and has wide applications in image reconstruction, autonomous driving, and video surveillance. A motion-blurred image can be viewed as the average of high-definition frames during the exposure time. Since averaging destroys the temporal order of the frames, it is very inappropriate to recover a set of clear frame sequences from a single motion-blurred image, that is, the sequence to be recovered is not unique, and there may be sequences of different high-definition frames that constitute the same motion-blurred image.
[0003] In order to solve the non-uniqueness of the sequence to be restored, an event camera is introduced, which can provide the changes between frames of the time series to guide the recovery of the sequence. The event camera is a bio-inspired, event-driven, time-based neuromorphic visual sensor that perceives the world in a completely different principle from traditional cameras. It measures brightness changes by working asynchronously, and triggers an event once the change exceeds a threshold. The event camera abandons the concepts of exposure time and frames in traditional intensity cameras, and can capture almost continuous motion in a frameless mode (microsecond time resolution), so it does not encounter problems such as blur. Using event cameras will be very helpful in recovering clear frames from blurry images.
[0004] In the prior art, the method of reconstructing a video sequence based on a single motion blurred image introduces event camera data, and by associating event data with clear images, the motion blur generation process is modeled (i.e., an image reconstruction model is obtained). However, since the event data has a lot of noise and the threshold of event triggering is not constant, noise accumulation is prone to occur during the image restoration process, making it difficult to improve the performance of the image reconstruction model, and the quality of the reconstructed high-definition image is low. In addition, the calculation process of the existing image reconstruction model is highly complex and inefficient.
[0005] Therefore, how to improve the reconstruction quality of blurred images is a technical problem that needs to be solved urgently. Summary of the invention
[0006] The present application provides an image reconstruction model training method, an image reconstruction method and a device thereof, which can effectively improve the reconstruction quality of blurred images.
[0007] In a first aspect, a training method for an image reconstruction model is provided, the training method comprising: obtaining a blurred image to be trained and event data to be trained, the blurred image to be trained being an average value of multiple frames of first high-definition images, and the event data to be trained comprising event points within a time period corresponding to the blurred image to be trained; training the image reconstruction model using the blurred image to be trained and the event data to be trained to obtain a target image reconstruction model, during the training process, updating the parameters of the image reconstruction model according to constraints to obtain the target image reconstruction model, the constraints comprising minimizing the difference between the blurred image to be trained and the re-blurred image, the re-blurred image being obtained by processing multiple frames of second high-definition images, and the multiple frames of second high-definition images being obtained by processing the blurred image to be trained and the event data to be trained using the image reconstruction model.
[0008] In the technical solution of the present application, the image reconstruction model is mainly enabled to re-blur the reconstructed high-definition image (second high-definition image), and then the image obtained after blurring (re-blurred image) is compared with the original input blurred image (fuzzy image to be trained), which is equivalent to adding this constraint condition, so that the high-definition image frame sequence reconstructed by the trained image reconstruction model is closer to the real data of the original input blurred image, improving the reconstruction quality and reconstruction effect. It is equivalent to mining more features from event data and blurred images, thereby improving the reconstruction quality. This constraint condition can be called a self-consistency constraint.
[0009] There are many methods for re-blurring the multiple frames of the second high-definition image. For example, the multiple frames of the second high-definition image may be directly processed, or the optical flow estimation result and the second high-definition image may be combined for processing.
[0010] Directly processing the multiple frames of the second high-definition image may be averaging the multiple frames of the second high-definition image. In conjunction with the first aspect, in some implementations of the first aspect, the re-blurred image is obtained by averaging the multiple frames of the second high-definition image.
[0011] Combining the optical flow estimation result and the second high-definition image for processing is equivalent to processing both of them. In combination with the first aspect, in some implementations of the first aspect, the re-blurred image is obtained by processing the optical flow estimation result and multiple frames of the second high-definition image, the optical flow estimation result is obtained by processing the blurred image to be trained and the event data to be trained using the optical flow estimation network, and the optical flow estimation result includes motion information of the blurred image to be trained.
[0012] In combination with the first aspect, in certain implementations of the first aspect, the re-blurred image is obtained by inserting an interpolated frame between at least two adjacent frames of multiple frames of the second high-definition image using an optical flow estimation result, and then averaging the interpolated frame and the multiple frames of the second high-definition image.
[0013] In combination with the first aspect, in certain implementations of the first aspect, the above-mentioned constraint condition also includes minimizing the difference between the i-th frame optical flow estimation image in the multi-frame optical flow estimation image and the i-th frame second high-definition image in the multi-frame second high-definition image, and the multi-frame optical flow estimation image is obtained by distorting the multi-frame second high-definition image using the optical flow estimation result, wherein the i-th frame optical flow estimation image in the multi-frame optical flow estimation image is obtained by distorting the i+1-th frame second high-definition image in the multi-frame second high-definition image, and i is an integer greater than or equal to 0 and less than the number of frames of the multi-frame first high-definition image. This method is equivalent to adding another constraint condition, which can be called a brightness consistency constraint, that is, the brightness between adjacent frames should be consistent. Therefore, it can be regarded as further making the reconstructed image retain the information of the original blurred image as much as possible from the time dimension, thereby further improving the quality and effect of image reconstruction. Specifically, motion is continuous and has a sequence. In the prior art, it is not considered that multiple frames of images should be kept consistent in time sequence, so it is easy to cause the clarity and quality of the reconstructed high-definition image to be still low. In the scheme of the embodiment of the present application, the introduction of the constraint condition can mine the information of the time dimension, so that the image processing effect is better and the image reconstruction quality is higher.
[0014] In combination with the first aspect, in some implementations of the first aspect, the difference between the i-th frame of the optical flow estimation image in the multiple frames of the optical flow estimation image and the i-th frame of the second high-definition image in the multiple frames of the second high-definition image may satisfy the following formula:
[0015]
[0016] Among them, L warp is the difference, τ represents the number of frames of the first high-definition image, I i (x) represents the second high-definition image of the i-th frame, Represents the i-th frame optical flow estimation image.
[0017] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned constraint condition also includes minimizing the distance between adjacent pixels in each optical flow estimation image in the multi-frame optical flow estimation image. This method is equivalent to adding a constraint condition, which can be called a smoothing constraint, which considers the change in the distance between adjacent pixels in a single frame image, that is, the pixels in a single frame image will not change suddenly, thereby improving the quality of image reconstruction.
[0018] In combination with the first aspect, in some implementations of the first aspect, the constraint condition further includes minimizing the difference between the multiple frames of the second high-definition image and the multiple frames of the first high-definition image. This method is equivalent to adding a constraint condition, which can be called a reconstruction loss constraint. The reconstruction loss can be understood as the difference between the output of the reconstruction network and the true value corresponding to the blurred image. The true value can be the first high-definition image.
[0019] In a second aspect, an image reconstruction method is provided, the method comprising acquiring a first blurred image and first event data, the first event data comprising event points within a time period corresponding to the first blurred image; inputting the first blurred image and the first event data into a target image reconstruction model to obtain a plurality of frames of target high-definition images, the target image reconstruction model being obtained using a training method according to any one of the implementation methods of the first aspect; and outputting one or more frames of the plurality of frames of target high-definition images.
[0020] Since the second aspect mainly reconstructs the image by adopting the target reconstruction model obtained by the first aspect and any one of its implementation methods, the above-mentioned image reconstruction method can achieve the technical effect of improving the reconstruction quality. The technical effect of the first aspect is fully applicable to the second aspect and will not be repeated.
[0021] Since the target image reconstruction model is fixed, the number of frames of the high-definition image that can be reconstructed from a single blurred image is fixed, so the first event data can be segmented according to this number of frames. For example, assuming that the number of frames of the above-mentioned multi-frame target high-definition image obtained by the target image reconstruction model is 5, that is, the target image reconstruction model can reconstruct 5 frames of high-definition images from a blurred image. Then the first event data can be divided into 5 segments, and the length of the time period corresponding to each segment can be the same. Of course, the time period can also be divided into 10 segments that are integer multiples of 5, and then the event points of every two adjacent time periods are taken to form a segment, and the first event data can still be divided into 5 segments. The above numerical values are only for example and ease of understanding, and there is no limitation.
[0022] In a third aspect, a training device for an image reconstruction model is provided, the training device comprising a unit capable of implementing the training method of the first aspect and any one of its implementations. For example, the training device may comprise an acquisition unit and a training unit, the acquisition unit being used to acquire a fuzzy image to be trained and event data to be trained, and the training unit being used to train the image reconstruction model using the fuzzy image to be trained and the event data to be trained to obtain a target image reconstruction model.
[0023] In a fourth aspect, an image reconstruction device is provided, the device comprising a unit capable of implementing the method of the second aspect and any one of its implementations. For example, the device may include an acquisition unit, a processing unit, and an output unit, the acquisition unit being used to acquire a first blurred image and first event data; the processing unit being used to input the first blurred image and the first event data into a target image reconstruction model to obtain multiple frames of target high-definition images; and the output unit being used to output one or more frames of the multiple frames of target high-definition images.
[0024] In a fifth aspect, a training device for an image reconstruction model is provided, the training device comprising a processor and a memory, the memory being used to store program instructions, the processor being used to call the program instructions to implement the training method of the first aspect and any one of its implementation methods.
[0025] In a sixth aspect, an image reconstruction device is provided, comprising a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to implement the method of the second aspect and any one of its implementation methods.
[0026] In the seventh aspect, a computer-readable storage medium is provided, characterized in that the computer-readable medium stores program code for device execution, and the program code includes instructions for implementing the training method of the first aspect and any one of its implementations or for implementing the method of the second aspect and any one of its implementations.
[0027] In an eighth aspect, a chip system is provided, characterized in that the chip system includes a processor and a data interface, and the processor reads instructions stored in a memory through the data interface to implement the training method of the first aspect and any one of its implementation methods or to implement the method of the second aspect and any one of its implementation methods.
[0028] In a ninth aspect, a computer program product is provided. When the computer program is executed on a computer, the computer executes the training method of the first aspect and any one of its implementations or executes the method of the second aspect and any one of its implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a structural diagram of a system architecture of an embodiment of the present application.
[0030] Figure 2 It is a schematic diagram of a convolutional neural network according to an embodiment of the present application.
[0031] Figure 3 It is a schematic diagram of a chip hardware structure of an embodiment of the present application.
[0032] Figure 4It is a schematic diagram of an application scenario of an embodiment of the present application.
[0033] Figure 5 It is a schematic flowchart of the training method of the image reconstruction model of an embodiment of the present application.
[0034] Figure 6 It is a schematic flowchart of the training process of the image reconstruction model of an embodiment of the present application.
[0035] Figure 7 It is a schematic structural diagram of the training architecture of the image reconstruction model of an embodiment of the present application.
[0036] Figure 8 It is a schematic diagram of the image reconstruction method of an embodiment of the present application.
[0037] Fig. 9 It is a schematic flowchart of the training process of the image reconstruction model of an embodiment of the present application.
[0038] Fig.10 It is a schematic diagram of an image reconstruction device according to an embodiment of the present application.
[0039] Fig.11 It is a schematic diagram of a training device for an image reconstruction model according to an embodiment of the present application.
[0040] Fig.12 It is a schematic diagram of the hardware structure of the image reconstruction device according to an embodiment of the present application.
[0041] Fig.13 It is a schematic diagram of the hardware structure of the image reconstruction model training device of the embodiment of the present application. DETAILED DESCRIPTION
[0042] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0043] The image reconstruction solution provided in the embodiments of the present application can be applied to photography, video recording, smart cities, human-computer interaction, and other scenarios that require image restoration or so-called image reconstruction.
[0044] It should be understood that the image in the embodiments of the present application may be a static image (or a static picture) or a dynamic image (or a dynamic picture). For example, the image in the present application may be a video or a dynamic picture, or the image in the present application may be a static picture or a photo. For ease of description, the present application will uniformly refer to static images or dynamic images as images in the following embodiments.
[0045] The following is a brief introduction to two scenarios to which the image reconstruction method according to the embodiment of the present application can be specifically applied.
[0046] Scenario 1: Autonomous Driving
[0047] With the development of the times and the pursuit of high-quality life by human beings, autonomous driving has gradually become a cutting-edge trend in the current development of automobiles. To realize autonomous driving, it is necessary to carry sensors for scene perception in order to drive safely, among which visual sensors are responsible for the visual perception and understanding of the scene. However, when the car is driving at high speed, the image data acquired by the visual sensor mostly contains motion blur, which is not conducive to the understanding of the scene and may even cause traffic accidents. Because the event camera perceives the world based on a completely different principle from the traditional intensity camera and has the characteristic of perceiving brightness changes with high temporal resolution, the image reconstruction scheme of the embodiment of the present application can be used to reconstruct (restore) a high-quality high-definition video sequence, thereby improving the understanding ability of the control unit in the autonomous driving scene.
[0048] Scenario 2: Security Monitoring
[0049] Similar to scene 1, in security monitoring scenes, there is a large coverage of image blur caused by high-speed motion, such as fast-moving cars, running pedestrians, etc. These image blurs are not conducive to the human eye's judgment of image content, especially in scenes such as case frame breakage. Therefore, in conjunction with event camera information, the image reconstruction solution of the embodiment of the present application is adopted to reconstruct a high-quality high-definition video sequence in the monitoring scene, thereby improving the image quality of the monitoring scene.
[0050] The embodiments of the present application involve a large number of neural network-related applications. In order to better understand the solutions of the embodiments of the present application, the relevant terms and concepts of the neural network that may be involved in the embodiments of the present application are first introduced below.
[0051] (1) Neural Network
[0052] A neural network can be composed of neural units. A neural unit can be a s The output of the operation unit can be shown as formula (1):
[0053]
[0054] Where, s = 1, 2, ... n, n is a natural number greater than 1, W s For x s, b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function. A neural network is a network formed by connecting multiple single neural units mentioned above, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.
[0055] (2) Convolutional Neural Network
[0056] Convolutional neural network (CNN) is a deep neural network with a convolutional structure. Convolutional neural network contains a feature extractor consisting of a convolution layer and a subsampling layer, which can be regarded as a filter. Convolutional layer refers to the neuron layer in the convolutional neural network that performs convolution processing on the input signal. In the convolutional layer of the convolutional neural network, a neuron can only be connected to some neurons in the adjacent layers. A convolutional layer usually contains several feature planes, each of which can be composed of some rectangularly arranged neural units. The neural units in the same feature plane share weights, and the shared weights here are convolution kernels. Shared weights can be understood as the way to extract image information is independent of position. The convolution kernel can be initialized in the form of a matrix of random size, and the convolution kernel can obtain reasonable weights through learning during the training process of the convolutional neural network. In addition, the direct benefit of shared weights is to reduce the connection between the layers of the convolutional neural network, while reducing the risk of overfitting.
[0057] (3) Deep Neural Networks
[0058] A deep neural network (DNN), also known as a multi-layer neural network, can be understood as a neural network with multiple hidden layers. According to the position of different layers, the neural network inside the DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer.
[0059] Although DNN looks complicated, the work of each layer is not complicated. In simple terms, it can be expressed as the following linear relationship: in, is the input vector, is the output vector, is the offset vector, W is the weight matrix (also called coefficient), and α() is the activation function. Each layer is just an input vector After such a simple operation, the output vector Since DNN has many layers, the coefficient W and the offset vector The number of these parameters is also relatively large. The definitions of these parameters in DNN are as follows: Take the coefficient W as an example: Assume that in a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as The superscript 3 represents the layer number of the coefficient W, while the subscripts correspond to the third layer index 2 of the output and the second layer index 4 of the input.
[0060] In summary, the coefficients from the kth neuron in the L-1th layer to the jth neuron in the Lth layer are defined as
[0061] It should be noted that the input layer does not have a W parameter. In a deep neural network, more hidden layers allow the network to better describe complex situations in the real world. Theoretically, the more parameters a model has, the higher its complexity and the greater its "capacity", which means it can complete more complex learning tasks. Training a deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by many layers of vector W).
[0062] (4) Loss Function
[0063] In the process of training a deep neural network, because we hope that the output of the deep neural network is as close as possible to the value we really want to predict, we can compare the predicted value of the current network with the target value we really want, and then update the weight vector of each layer of the neural network according to the difference between the two (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the deep neural network). For example, if the predicted value of the network is high, adjust the weight vector to make it predict a lower value, and keep adjusting until the deep neural network can predict the target value we really want or a value very close to the target value we really want. Therefore, it is necessary to pre-define "how to compare the difference between the predicted value and the target value", which is the loss function or objective function, which are important equations used to measure the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference, so the training of the deep neural network becomes a process of minimizing this loss as much as possible.
[0064] (5) Back propagation algorithm
[0065] Neural networks can use the error back propagation (BP) algorithm to correct the size of the parameters in the initial neural network model during the training process, so that the reconstruction error loss of the neural network model becomes smaller and smaller. Specifically, the forward transmission of the input signal to the output will generate error loss, and the parameters in the initial neural network model are updated by back propagating the error loss information, so that the error loss converges. The back propagation algorithm is a back propagation movement dominated by error loss, which aims to obtain the optimal parameters of the neural network model, such as the weight matrix.
[0066] Figure 1 It is a schematic diagram of the structure of a system architecture of an embodiment of the present application. Figure 1 In the embodiment, the data acquisition device 160 is used to acquire training data. For the image reconstruction method of the embodiment of the present application, the training data may include a blurred image and event data corresponding to the blurred image.
[0067] After collecting the training data, the data collection device 160 stores the training data in the database 130 , and the training device 120 obtains the target model / rule 101 through training based on the training data maintained in the database 130 .
[0068] The following describes how the training device 120 obtains the target model / rule 101 based on the training data. The training device 120 processes the input image until the clarity of the image output by the training device 120 is less than a certain threshold, thereby completing the training of the target model / rule 101.
[0069] The above-mentioned target model / rule 101 can be used to implement the image reconstruction method of the embodiment of the present application, that is, the image to be processed is input into the target model / rule 101 after relevant preprocessing, and the output image after image reconstruction can be obtained. The target model / rule 101 in the embodiment of the present application can specifically be an image reconstruction device in the embodiment of the present application. It should be noted that in actual applications, the training data maintained in the database 130 does not necessarily all come from the collection of the data acquisition device 160, and may also be received from other devices. It should also be noted that the training device 120 does not necessarily train the target model / rule 101 completely based on the training data maintained by the database 130, and it is also possible to obtain training data from the cloud or other places for model training. The above description should not be used as a limitation on the embodiments of the present application.
[0070] The target model / rule 101 obtained by training the training device 120 can be applied to different systems or devices, such as Figure 1 The execution device 110 shown in the figure may be a terminal, such as a mobile phone terminal, a tablet computer, a laptop computer, an augmented reality (AR) / virtual reality (VR), a vehicle terminal, etc., or a server or a cloud device, etc. Figure 1 In the embodiment, the execution device 110 is configured with an input / output (I / O) interface 112 for data interaction with an external device. A user may input data to the I / O interface 112 through a client device 140. The input data may include an image to be processed input by the client device in the embodiment of the present application.
[0071] Preprocessing module 113 and preprocessing module 114 are used to perform preprocessing according to the input data (such as the image to be processed) received by I / O interface 112. In the embodiment of the present application, preprocessing module 113 and preprocessing module 114 may be omitted (or only one of the preprocessing modules may be present), and the computing module 111 may be directly used to process the input data.
[0072] When the execution device 110 preprocesses the input data, or when the computing module 111 of the execution device 110 performs calculations and other related processing, the execution device 110 can call the data, code, etc. in the data storage system 150 for corresponding processing, and can also store the data, instructions, etc. obtained from the corresponding processing into the data storage system 150.
[0073] Finally, the I / O interface 112 returns the processing result, such as the output image after the image reconstruction obtained above, to the client device 140 to provide it to the user.
[0074] It is worth noting that the training device 120 can generate corresponding target models / rules 101 based on different training data for different goals or different tasks. The corresponding target models / rules 101 can be used to achieve the above goals or complete the above tasks, thereby providing users with the desired results.
[0075] exist Figure 1In the case shown, the user can manually give input data, and the manual giving can be operated through the interface provided by the I / O interface 112. In another case, the client device 140 can automatically send input data to the I / O interface 112. If the client device 140 is required to automatically send input data and needs to obtain the user's authorization, the user can set the corresponding authority in the client device 140. The user can view the results output by the execution device 110 on the client device 140, and the specific presentation form can be a specific method such as display, sound, action, etc. The client device 140 can also be used as a data acquisition terminal to collect the input data of the input I / O interface 112 and the output results of the output I / O interface 112 as shown in the figure as new sample data, and store them in the database 130. Of course, it is also possible not to collect through the client device 140, but the I / O interface 112 directly stores the input data of the input I / O interface 112 and the output results of the output I / O interface 112 as new sample data in the database 130.
[0076] It is worth noting that Figure 1 This is only a schematic diagram of a system architecture provided by an embodiment of the present application. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. For example, in Figure 1 In the embodiment, the data storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 may also be placed in the execution device 110.
[0077] like Figure 1 As shown, the target model / rule 101 is obtained by training according to the training device 120. The target model / rule 101 in the embodiment of the present application can be the image reconstruction device in the present application. Specifically, the image reconstruction device provided in the embodiment of the present application can include one or more neural networks, and the one or more neural networks can include CNN, deep convolutional neural networks (deep convolutional neural networks, DCNN), etc.
[0078] Since CNN is a very common neural network, Figure 2 The focus is on a detailed introduction to the structure of CNN. As mentioned in the basic concept introduction above, a convolutional neural network is a deep neural network with a convolutional structure and a deep learning architecture. A deep learning architecture refers to multiple levels of learning at different levels of abstraction through machine learning algorithms. As a deep learning architecture, CNN is a feed-forward artificial neural network in which each neuron can respond to the image input into it.
[0079] like Figure 2 As shown, the convolutional neural network (CNN) 200 may include an input layer 210, a convolutional layer / pooling layer 220 (wherein the pooling layer is optional), and a neural network layer 230. The relevant contents of these layers are described in detail below.
[0080] Convolutional layer / pooling layer 220:
[0081] Convolutional Layer:
[0082] like Figure 2 The convolution layer / pooling layer 220 shown may include layers 221-226, for example: in one implementation, layer 221 is a convolution layer, layer 222 is a pooling layer, layer 223 is a convolution layer, layer 224 is a pooling layer, layer 225 is a convolution layer, and layer 226 is a pooling layer; in another implementation, layers 221 and 222 are convolution layers, layer 223 is a pooling layer, layer 224 and 225 are convolution layers, and layer 226 is a pooling layer. That is, the output of a convolution layer can be used as the input of a subsequent pooling layer, or as the input of another convolution layer to continue the convolution operation.
[0083] The following will take the convolution layer 221 as an example to introduce the internal working principle of a convolution layer.
[0084] The convolution layer 221 may include a plurality of convolution operators, which are also called kernels. The convolution operator is equivalent to a filter that extracts specific information from the input image matrix in image processing. The convolution operator may be essentially a weight matrix, which is usually predefined. In the process of performing convolution operations on the image, the weight matrix is usually processed one pixel after another (or two pixels after two pixels... depending on the value of the stride) in the horizontal direction on the input image, thereby completing the work of extracting specific features from the image. The size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix is the same as the depth dimension of the input image. In the process of performing convolution operations, the weight matrix will extend to the entire depth of the input image. Therefore, convolution with a single weight matrix will produce a convolution output with a single depth dimension, but in most cases, a single weight matrix is not used, but multiple weight matrices of the same size (row × column), that is, multiple isotype matrices, are applied. The output of each weight matrix is stacked to form the depth dimension of the convolution image, and the dimension here can be understood as being determined by the "multiple" mentioned above. Different weight matrices can be used to extract different features in the image, for example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to blur unwanted noise in the image, etc. The multiple weight matrices have the same size (rows × columns), and the feature maps extracted by the multiple weight matrices of the same size are also the same size. The extracted multiple feature maps of the same size are then merged to form the output of the convolution operation.
[0085] The weight values in these weight matrices need to be obtained through a lot of training in practical applications. The weight matrices formed by the weight values obtained through training can be used to extract information from the input image, so that the convolutional neural network 200 can make correct predictions.
[0086] When the convolutional neural network 200 has multiple convolutional layers, the initial convolutional layer (for example, 221) often extracts more general features, which can also be called low-level features. As the depth of the convolutional neural network 200 increases, the features extracted by the later convolutional layers (for example, 226) become more and more complex, such as high-level semantic features. Features with higher semantics are more suitable for the problem to be solved.
[0087] Pooling layer / Pooling layer 220:
[0088] Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolution layer. Figure 2Each layer 221-226 illustrated in 220 may be a convolution layer followed by a pooling layer, or may be multiple convolution layers followed by one or more pooling layers. In the image processing process, the only purpose of the pooling layer is to reduce the spatial size of the image. The pooling layer may include an average pooling operator and / or a maximum pooling operator for sampling the input image to obtain an image of smaller size. The average pooling operator may calculate the pixel values in the image within a specific range to generate an average value as the result of average pooling. The maximum pooling operator may take the pixel with the largest value in the range within a specific range as the result of maximum pooling. In addition, just as the size of the weight matrix used in the convolution layer should be related to the image size, the operator in the pooling layer should also be related to the image size. The size of the image output after processing by the pooling layer may be smaller than the size of the image input to the pooling layer, and each pixel in the image output by the pooling layer represents the average value or maximum value of the corresponding sub-region of the image input to the pooling layer.
[0089] Neural Network Layer 230:
[0090] After being processed by the convolution layer / pooling layer 220, the convolution neural network 200 is not sufficient to output the required output information. As mentioned above, the convolution layer / pooling layer 220 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (the required class information or other related information), the convolution neural network 200 needs to use the neural network layer 230 to generate one or a group of outputs of the required number of classes. Therefore, the neural network layer 230 may include multiple hidden layers (such as Figure 2 231, 232 to 23n) and the output layer 240 shown, the parameters contained in the multi-layer hidden layer can be pre-trained according to relevant training data of a specific task type, for example, the task type may include image reconstruction, etc.
[0091] After the multiple hidden layers in the neural network layer 230, that is, the last layer of the entire convolutional neural network 200 is the output layer 240, which has a loss function similar to the classification cross entropy, specifically used to calculate the prediction error. Once the forward propagation of the entire convolutional neural network 200 (such as Figure 2 The propagation from 210 to 240 is forward propagation), and the reverse propagation (such as Figure 2 The propagation from 240 to 210 is called back propagation) and then starts to update the weight values and biases of the aforementioned layers to reduce the loss of the convolutional neural network 200 and the error between the result output by the convolutional neural network 200 through the output layer and the ideal result.
[0092] It should be noted that if Figure 2The convolutional neural network 200 shown is only an example of a convolutional neural network. In specific applications, the convolutional neural network may also exist in the form of other network models.
[0093] In this application, the image reconstruction model may include Figure 2 The convolutional neural network 200 shown in the figure can perform image reconstruction processing on the image to be processed to obtain a reconstructed image.
[0094] Figure 3 A chip hardware structure of an embodiment of the present application includes a neural network processor 30. The chip can be arranged as follows: Figure 1 The execution device 110 shown in FIG. 1 is used to complete the calculation work of the calculation module 111. The chip can also be set in Figure 1 The training device 120 shown in FIG. 1 is used to complete the training work of the training device 120 and output the target model / rule 101. Figure 2 The algorithms of each layer in the convolutional neural network shown in the figure can be used in Figure 3 is implemented in the chip shown.
[0095] The neural network processor NPU 30 is mounted on the host CPU as a coprocessor, and the host CPU assigns tasks. The core part of the NPU is the operation circuit 303, and the controller 304 controls the operation circuit 303 to extract data from the memory (weight memory or input memory) and perform operations.
[0096] In some implementations, the operation circuit 303 includes multiple processing units (process engines, PEs) inside. In some implementations, the operation circuit 303 is a two-dimensional systolic array. The operation circuit 303 can also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the operation circuit 303 is a general-purpose matrix processor.
[0097] For example, assume there is an input matrix A, a weight matrix B, and an output matrix C. The operation circuit 303 takes the corresponding data of the matrix B from the weight memory 302 and caches it on each PE in the operation circuit 303. The operation circuit 303 takes the matrix A data from the input memory 301 and performs a matrix operation with the matrix B, and the partial result or the final result of the matrix is stored in the accumulator 308.
[0098] The vector calculation unit 307 can further process the output of the operation circuit 303, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. For example, the vector calculation unit 307 can be used for network calculations of non-convolutional / non-FC layers in a neural network, such as pooling, batch normalization, local response normalization, etc.
[0099] In some implementations, the vector calculation unit 307 can store the processed output vector to the unified buffer 306. For example, the vector calculation unit 307 can apply a nonlinear function to the output of the operation circuit 303, such as a vector of accumulated values, to generate an activation value. In some implementations, the vector calculation unit 307 generates a normalized value, a merged value, or both. In some implementations, the processed output vector can be used as an activation input to the operation circuit 303, for example, for use in a subsequent layer in a neural network.
[0100] The unified memory 306 is used to store input data and output data.
[0101] The weight data is directly transferred from the external memory to the input memory 301 and / or the unified memory 306 through the direct memory access controller 305 (DMAC), the weight data in the external memory is stored in the weight memory 302, and the data in the unified memory 306 is stored in the external memory.
[0102] The bus interface unit (BIU) 310 is used to implement the interaction between the main CPU, DMAC and instruction fetch memory 309 through the bus.
[0103] An instruction fetch buffer 309 connected to the controller 304 and used to store instructions used by the controller 304;
[0104] The controller 304 is used to call the instructions cached in the memory 309 to control the working process of the computing accelerator.
[0105] Generally, the unified memory 306, the input memory 301, the weight memory 302 and the instruction fetch memory 309 are all on-chip memories, and the external memory is a memory outside the NPU, which can be a double data rate synchronous dynamic random access memory (DDR SDRAM for short), a high bandwidth memory (HBM) or other readable and writable memory.
[0106] in, Figure 2 The operations of each layer in the convolutional neural network shown can be performed by the operation circuit 303 or the vector calculation unit 307.
[0107] Introduced above Figure 1 The execution device 110 in the embodiment of the present application can execute each step of the image reconstruction method. Figure 2 The CNN model shown and Figure 3 The chip shown can also be used to execute each step of the image reconstruction method of the embodiment of the present application. The image reconstruction method of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.
[0108] The image reconstruction method provided in the embodiment of the present application can be executed on a server, on a cloud, or on a terminal device. Figure 4 As shown, the technical solution of the embodiment of the present application can be applied to a terminal device, and the image reconstruction method in the embodiment of the present application can perform image reconstruction processing on an input image to obtain an output image after the input image is reconstructed. Figure 4 As shown, after the blurred image and event data are input, at least one frame of target reconstructed image (target high-definition image) can be output after processing by the terminal device. The terminal device can be mobile or fixed, for example, the terminal device can be a mobile phone with image reconstruction function, a tablet personal computer (TPC), a media player, a smart TV, a laptop computer (LC), a personal digital assistant (PDA), a personal computer (PC), a camera, a camcorder, a smart watch, a wearable device (WD) or an autonomous driving vehicle, etc., which is not limited in the embodiments of the present application.
[0109] In the prior art, when reconstructing an image, the event data and the blurred image are combined, and a model is built based on the motion blur process. The most common model is the EDI (event-based double integral) model. The prior art only uses event data to reconstruct multiple frames of high-definition images from blurred images. If there are many event points within the exposure time, it is necessary to restore high-definition images of the number of frames corresponding to the number of event points. This will bring about a problem. Since the time data has a lot of noise and the threshold of event triggering is not constant, noise accumulation will occur when using the EDI model. It can be understood that as the images are reconstructed frame by frame, the relatively small errors at the beginning are increasingly accumulated and amplified, causing the restored high-definition image frame sequence to deviate more and more from the real data of the original blurred image. In addition, the EDI model itself also has the problems of high computational complexity and low computational efficiency.
[0110] In view of the above problems, the embodiment of the present application proposes an image reconstruction method, which performs a re-blurring process on the restored high-definition image, and then compares the image obtained after the blurring process with the original input blurred image, which is equivalent to adding a constraint condition, so that the reconstructed high-definition image frame sequence is closer to the real data of the original input blurred image, and the reconstruction quality and reconstruction effect are improved. It is equivalent to mining more features from the event data and the blurred image, thereby improving the reconstruction quality.
[0111] Figure 5 It is a schematic flowchart of the training method of the image reconstruction model of an embodiment of the present application. The training method can be executed by an apparatus or device capable of training the image reconstruction model. For example, the method can be executed by a server or cloud device with greater computing power.
[0112] 501. Obtain a fuzzy image to be trained and event data to be trained.
[0113] The fuzzy image to be trained is an average value of multiple frames of first high-definition images, and the event data to be trained includes event points within a time period corresponding to the fuzzy image to be trained.
[0114] That is to say, the blurred image to be trained can be obtained by averaging the existing multiple consecutive frames of high-definition images to obtain a frame of synthetic blurred image. In this way, during the training process, the image reconstruction model can be trained by comparing the reconstructed high-definition image with the real high-definition image.
[0115] The time period corresponding to the above-mentioned blurred image to be trained can be determined by the time corresponding to the above-mentioned existing continuous multi-frame high-definition image (first high-definition image). This time period simulates the exposure time of the camera or camera during actual shooting, that is, the time period simulates the exposure time, which causes blurring due to the action of the subject, resulting in a frame of blurred image, and this frame of blurred image corresponds to a sequence of high-definition image frames. For example, assuming that the average value of the 6 frames of continuous high-definition images between T0-T1 is taken to obtain a blurred image B1, then the time period corresponding to the blurred image B1 is T0-T1, and these 6 frames of continuous high-definition images are the above-mentioned multiple frames of the first high-definition image.
[0116] An event point can also be called an event. The most basic principle of an event camera is to output an event point when the accumulated brightness change of a pixel reaches the trigger condition (the change reaches a certain degree). Therefore, an event point can be understood as the expression of an event: at what time (timestamp) and at which pixel (pixel coordinates), the brightness increases or decreases (brightness change).
[0117] 502. Train the image reconstruction model using the blurred image to be trained and the event data to be trained.
[0118] The image reconstruction model can be understood as a reconstruction network. When training the image reconstruction model, the above data can be used directly to train the model, or some other parameters can be introduced to train the model.
[0119] During the training process, the parameters of the image reconstruction model can be updated according to the constraints to obtain the target image reconstruction model. The constraints include minimizing the difference between the blurred image to be trained and the re-blurred image. The re-blurred image can be obtained by processing multiple frames of second high-definition images. The multiple frames of second high-definition images are obtained by processing the blurred image to be trained and the event data to be trained using the image reconstruction model.
[0120] In other words, the image reconstruction model is mainly enabled to re-blur the reconstructed high-definition image (second high-definition image), and then the image obtained after blurring (re-blurred image) is compared with the original input blurred image (fuzzy image to be trained), which is equivalent to adding this constraint condition, so that the high-definition image frame sequence reconstructed by the trained image reconstruction model is closer to the real data of the original input blurred image, improving the reconstruction quality and reconstruction effect. It is equivalent to mining more features from event data and blurred images, thereby improving the reconstruction quality. This constraint condition can be called a self-consistency constraint.
[0121] There are many methods for re-blurring multiple frames of second HD images (ie, methods for obtaining re-blurred images), such as directly processing multiple frames of second HD images, or combining optical flow estimation results with the second HD images for processing.
[0122] Directly processing multiple frames of the second high-definition image may be averaging the multiple frames of the second high-definition image, that is, the above-mentioned re-blurred image is obtained by averaging the multiple frames of the second high-definition image. That is, the second high-definition image is directly averaged without considering the optical flow estimation result. This method can obtain a re-blurred image, but compared with the case of applying the optical flow estimation result, the accuracy of the obtained re-blurred image is slightly lower.
[0123] Combining the optical flow estimation result and the second high-definition image for processing is equivalent to processing the two, that is, the above-mentioned re-blurred image is obtained by processing the optical flow estimation result and multiple frames of the second high-definition image, the optical flow estimation result is obtained by processing the training blurred image and the event data to be trained using the optical flow estimation network, and the optical flow estimation result includes the motion information of the training blurred image. For example, the above-mentioned re-blurred image can be obtained by inserting interpolated frames between at least two adjacent frames of the multiple frames of the second high-definition image using the optical flow estimation result, and then averaging these interpolated frames and the multiple frames of the second high-definition image. Interpolated frames can be inserted between every two adjacent frames, or interpolated frames can be inserted only between some of the adjacent frames, but the accuracy of the re-blurred image obtained by the former is higher. The role of interpolation can be understood as being able to make the interval between two adjacent frames of the second high-definition image more refined. This implementation method can make the optical flow estimation result more accurately simulate the actual motion trajectory, thereby obtaining a re-blurred image that is closer to the actual motion trajectory, but the number of interpolated frames can be set as needed.
[0124] The embodiment of the present application mainly improves the reconstruction quality of the trained model by adding constraints. The above is mainly achieved by adding self-consistency constraints. In order to achieve better results, other constraints can be further introduced.
[0125] In some implementations, other constraints such as brightness consistency constraints may be further introduced.
[0126] Optionally, the above-mentioned constraint condition also includes minimizing the difference between the multi-frame optical flow estimation image and the multi-frame second high-definition image, and the multi-frame optical flow estimation image is obtained by distorting the multi-frame second high-definition image using the optical flow estimation result, wherein the i-th frame optical flow estimation image in the multi-frame optical flow estimation image is obtained by distorting the i+1-th frame second high-definition image in the multi-frame second high-definition image, and i is an integer greater than or equal to 0 and less than the number of frames of the multi-frame first high-definition image. This method is equivalent to adding another constraint condition, which can be called a brightness consistency constraint, that is, the brightness between adjacent frames should be consistent. Therefore, it can be regarded as further making the reconstructed image retain the information of the original blurred image as much as possible from the time dimension, so that the quality and effect of image reconstruction can be further improved. Specifically, the motion is continuous and has a sequence. In the prior art, it is not considered that the multi-frame images are kept consistent in the time sequence, so it is easy to cause the clarity of the reconstructed high-definition image to be still low and the quality is poor. In the scheme of the embodiment of the present application, the introduction of the constraint condition can mine the information of the time dimension, so that the image processing effect is better and the image reconstruction quality is higher.
[0127] It should be noted that the difference between multiple frames of optical flow estimation images and multiple frames of second high-definition images can be the difference between the i-th frame of optical flow estimation image in the multiple frames of optical flow estimation images and the i-th frame of second high-definition image in the multiple frames of second high-definition images, or the difference between the average value of multiple frames of optical flow estimation images and the average value of multiple frames of second high-definition images, or the difference between the cumulative value of multiple frames of optical flow estimation images and the cumulative value of multiple frames of second high-definition images. The embodiment of the present application mainly adopts the first method, which can optimize each frame of the second high-definition image separately, and the latter two methods can only be the overall optimization of all second high-definition images.
[0128] For another example, the more common constraints in the prior art, reconstruction loss constraint and smoothness constraint, can also be introduced. The reconstruction loss can be understood as the difference between the output of the reconstruction network and the true value corresponding to the blurred image. The true value can be the first high-definition image mentioned above. The smoothness constraint considers the distance change between adjacent pixels in a single-frame image, that is, the pixels in a single-frame image will not change suddenly, thereby improving the quality of image reconstruction.
[0129] Figure 6 is a schematic flow chart of the training process of the image reconstruction model of the embodiment of the present application, Figure 6 It mainly introduces the actions performed by each module in the image reconstruction model during a training process, which can be regarded as Figure 5 A description of another perspective of the training method shown.
[0130] 601. Obtain a fuzzy image to be trained and event data to be trained, where the event data to be trained includes event points within a time period corresponding to the fuzzy image to be trained.
[0131] In some implementations, the fuzzy image to be trained and the event data to be trained can both come from an event camera. The event camera includes two outputs, one output is a high-definition image, and the other is the event data to be trained. Therefore, the event camera can be used to collect the high-definition image and the event data to be trained, and then the high-definition image is synthesized into the fuzzy image to be trained.
[0132] In other implementations, the fuzzy image to be trained and the event data to be trained can also be obtained in the following manner, that is, using a traditional camera or a camera to obtain high-definition images, and then inputting these high-definition images into the simulation software to obtain the corresponding simulation event data, so that the above-mentioned high-definition images and the above-mentioned event data to be trained can also be obtained at the same time. Then, these high-definition images are averaged and synthesized into the fuzzy image to be trained. The simulation software can be understood as a virtual event camera.
[0133] In addition, the above-mentioned fuzzy images to be trained and event data to be trained can be acquired in real time or read from a storage device.
[0134] 602. Input the blurred image to be trained and the event data to be trained into an optical flow estimation network to obtain an optical flow estimation result, wherein the optical flow estimation result includes motion information of multiple frames of first high-definition images corresponding to the blurred image to be trained.
[0135] Optical flow refers to the apparent motion of the brightness pattern of an image. Optical flow expresses the changes in an image. Since it contains information about the motion of a target, it can be used by an observer to determine the motion of the target. The definition of optical flow can be used to derive an optical flow field, which refers to a two-dimensional instantaneous velocity field composed of all pixels in an image, in which a two-dimensional velocity vector is the projection of a three-dimensional velocity vector of a visible point in the scene on the imaging surface. Therefore, the optical flow not only contains the motion information of the observed object, but also contains rich information about the three-dimensional structure of the scene. In an embodiment of the present application, optical flow is used to mine the motion information of a blurred image. Combining the blurred images seen in real life, it can be understood that in a blurred image, for example, if the arm rotates a certain angle, the imaging of the arm part is several blurred images of the arm. If it is separated into several frames of images, the motion trajectory of the arm can be decomposed, and the optical flow is the relative position change of the arm coordinates between every two frames of these images as the motion trajectory changes.
[0136] It should be noted that the first high-definition image refers to a frame sequence of high-definition images corresponding to the blurred image to be trained, so it may correspond to one or more first high-definition images. As mentioned above, the blurred image to be trained is the average value of the high-definition frames within the exposure time, and here it can be regarded as the first high-definition image is the high-definition image used to obtain the blurred image to be trained.
[0137] The optical flow estimation network may be a neural network for performing optical flow estimation, for example, an Ev-FlowNet network may be used.
[0138] 603. Input the blurred image to be trained and the event data to be trained into a reconstruction network to obtain multiple frames of second high-definition images.
[0139] Step 603 is similar to the operation in the prior art, that is, the blurred image is reconstructed using the event data to be trained to obtain multiple frames of high-definition images. It should be understood that step 603 and step 602 can be executed simultaneously or not, and there is no limitation on the order of execution.
[0140] Step 603 may be performed using a reconstruction network, which refers to a neural network that can reconstruct a blurred image into a high-definition image.
[0141] 604. Obtain a re-blurred image by using motion information of the multiple frames of the first high-definition image and the multiple frames of the second high-definition image.
[0142] Step 604 and step 605 are equivalent to adding a constraint condition on the basis of the prior art, that is, the reconstructed high-definition image can be kept consistent with the information of the original blurred image as much as possible. This constraint condition has constraints on the above-mentioned motion information and the reconstructed second high-definition image, that is, whether it is the error in the motion information or the error in the reconstruction network, the error influence of the two can be minimized through steps 604 and 605. This is the self-consistency constraint mentioned above.
[0143] The optical flow estimation result (i.e., the motion information of the multiple frames of the first high-definition image) and the multiple frames of the second high-definition image may be processed to obtain a re-blurred image; or when multiple frames of the third high-definition image are obtained (i.e., when steps 606 and 607 are executed), the optical flow estimation result and the multiple frames of the third high-definition image may be processed to obtain a re-blurred image.
[0144] 605. Minimize the difference between the blurred image to be trained and the re-blurred image to obtain multiple frames of target high-definition images.
[0145] Optionally, a norm of the blurred image to be trained and the re-blurred image can be constructed as a loss function, and the target high-definition image can be obtained by minimizing the loss function.
[0146] Step 604 and step 605 may be performed by a constraint module (unit).
[0147] Constraints can be implemented by setting loss functions.
[0148] Figure 6 The training method is used to obtain the target image reconstruction model, which can make the reconstructed high-definition image consistent with the information of the original blurred image as much as possible, thereby effectively improving the image reconstruction quality and image reconstruction effect.
[0149] As described above, step 604 and step 605 are equivalent to adding a constraint condition. Other constraints can also be added based on similar logic. Figure 6 The training method may further include operations of step 606 and step 607.
[0150] 606. Use the optical flow estimation result to perform a distortion transformation on the multiple frames of the second high-definition image to obtain the multiple frames of optical flow estimation images, wherein the i-th frame of the optical flow estimation image of the multiple frames of the optical flow estimation image is obtained by performing a distortion transformation on the i+1-th frame of the second high-definition image in the multiple frames of the second high-definition image, and i is an integer greater than or equal to 0 and less than the number of frames of the multiple frames of the first high-definition image.
[0151] Warping transformation (warp) can also be called affine transformation, or it can be understood as shifting the position of objects in the image. For example, assuming there are 5 frames of second HD images, warping the first frame of the second HD image can be regarded as adding the motion information corresponding to the optical flow between the first frame of the first HD image and the second frame of the first HD image contained in the optical flow to the image of the first frame, thereby obtaining the optical flow warped image of the first frame of the second HD image, that is, the optical flow estimated image of the first frame.
[0152] 607 . Minimize the difference between the i th frame optical flow estimation image and the i th frame second high-definition image.
[0153] Step 606 and step 607 are equivalent to adding a constraint condition, that is, the brightness between adjacent frames should be consistent. Therefore, step 606 and step 607 can be regarded as further making the reconstructed image retain the information of the original blurred image as much as possible from the time dimension, thereby further improving the quality and effect of image reconstruction. Specifically, the motion is continuous and has a sequence. In the prior art, it is not considered that multiple frames of images are kept consistent in time sequence, so it is easy to cause the clarity of the reconstructed high-definition image to be still low and the quality is poor. In the scheme of the embodiment of the present application, the introduction of step 606 and step 607 can mine the information of the time dimension, so that the image processing effect is better and the image reconstruction quality is higher. That is, the brightness consistency constraint mentioned above.
[0154] Step 606 and step 607 may be executed during, before or after the execution of step 604 and step 605, and step 606 and step 607 may not be executed. However, when step 606 and step 607 are executed, constraints on the time dimension may be added, and the reconstruction quality will be better.
[0155] For example, assuming that step 606 and step 607 are executed during the execution of step 604 and step 605, step 606 and step 607 can be executed first to obtain multiple frames of third high-definition images, so that when executing step 604, the above-mentioned re-blurred image can be obtained based on the optical flow estimation result and the multiple frames of third high-definition images.
[0156] For another example, assuming that step 606 and step 607 are executed after step 604 and step 605, the second high-definition image of step 606 and step 607 can be replaced by the target high-definition image, which is equivalent to further processing the obtained target high-definition image.
[0157] Similarly, the target high-definition image can be obtained by constructing a norm of the brightness values of the above two frames of images as a loss function and minimizing the loss function.
[0158] The two constraints mentioned above are not considered in the prior art. Adding the above constraints can effectively improve the reconstruction quality, but it should be understood that in the implementation process, other constraints that already exist in the prior art can also be added, such as the reconstruction loss constraint and smoothness constraint mentioned above, which will not be repeated. In addition, since these two loss functions are already available, those skilled in the art can refer to the information and use them by themselves, so they will not be described in detail.
[0159] An example of adding a smooth constraint is given. For example, when executing step 605, the distance between adjacent pixels in each optical flow estimation image of the multiple frames of optical flow estimation images is first minimized to obtain the multiple frames of processed optical flow estimation images. This step is the corresponding step of the smooth constraint, that is, by obtaining the processed optical flow estimation image through the smooth constraint, the difference between the processed optical flow estimation image of the i-th frame and the second high-definition image of the i-th frame can be minimized.
[0160] Optionally, the above constraints may be weighted, that is, while using the above multiple constraints, a weight may be set for each constraint, thereby further improving the quality of image reconstruction.
[0161] Figure 7 is a schematic structural diagram of the training architecture of the image reconstruction model of the embodiment of the present application. Figure 7As shown, the training architecture 700 includes an optical flow estimation network 710, a reconstruction network 720 and a constraint module 730. The blurred image to be trained and the event data to be trained can be input into the training architecture 700. After training, a trained reconstruction network 720' can be obtained. The trained reconstruction network 720' is the target image reconstruction model mentioned above. Figure 7 The training architecture shown can be used to perform Figure 5 or Figure 6 The training method shown, Figure 7 The reconstruction network 720 obtained by the training architecture shown can be used to perform Figure 8 The image reconstruction method shown.
[0162] When the trained reconstruction network 720' is used for image reconstruction, for example, Figure 8 The first blurred image and the first event data are input into the trained reconstruction network 720', so as to obtain multiple frames of target high-definition images.
[0163] The optical flow estimation network 710 is a neural network that can process blurred images to obtain optical flow estimation results, for example, the above-mentioned Ev-FlowNet network.
[0164] The reconstruction network 720 is a neural network that can process the blurred image to obtain a reconstructed high-definition image. It can be seen that the reconstruction network 720 is the image reconstruction model mentioned above, that is, Figure 7 The function of the training architecture shown is to update the reconstruction network 720 through training, thereby obtaining a trained reconstruction network 720' (ie, a target image reconstruction model), which may also be referred to as a target reconstruction network.
[0165] The constraint module 730 can be understood as a module that updates the parameters of the image reconstruction model according to the constraint conditions so as to ensure the quality of the reconstructed image. The constraint module 730 can use the output of the optical flow estimation network 710 and / or the output of the reconstruction network 720 to perform parameter constraints, thereby obtaining a better trained reconstruction network 720'.
[0166] The above constraints may include self-consistency constraints, brightness consistency constraints, and in addition, reconstruction loss constraints and smoothness constraints.
[0167] As known from the above, the image reconstruction model is the reconstruction network 720, and Figure 7The other components of the training architecture can only be used to obtain a better target image reconstruction model in the training phase. However, when the target reconstruction model is applied to the image reconstruction process (which can be understood as the reasoning phase), the optical flow estimation network 710 and the constraint module 730 are no longer used. In short, the optical flow estimation network 710 and the constraint module 730 only participate in the execution of some steps in the training phase, and do not participate in the execution of steps in the reasoning phase.
[0168] It should be noted that Figure 7 Only an example is given in which the training architecture 700 includes the above three parts at the same time, but it should be understood that the training architecture 700 may also have other structural forms. For example, the training architecture 700 may only include the reconstruction network 720, that is, the reconstruction network 720 is directly trained using the blurred image to be trained and the event data to be trained to obtain the trained reconstruction network 720'; for another example, the training architecture 700 may include the reconstruction network 720 and the constraint module 730, and the constraint module 730 is used to update the parameters of the reconstruction network 720; for another example, the optical flow estimation result is directly read from the storage device. In this case, the optical flow estimation network 710 is no longer needed, but a module for reading the optical flow estimation result from the storage device is needed, and so on, which will not be introduced one by one here.
[0169] Figure 8 is a schematic flow chart of the image reconstruction method of the embodiment of the present application. Figure 8 The various steps are introduced below.
[0170] 801. Acquire a first blurred image and first event data, where the first event data includes event points within a time period corresponding to the first blurred image.
[0171] The first blurred image can be understood as a blurred image to be processed, and the time period corresponding to the first blurred image can be the time period between the blurred image and the next frame of the image, or the exposure time of the first blurred image. It can be understood that there are several blurred images in a video, which affects the viewing experience, so when processing, the time period between two blurred images can be used as the above exposure time to make the overall video smoother. If there is only one independent blurred image, and the adjacent frames are all high-definition images, the time period between the blurred image and the next high-definition image can be used as the above corresponding time period.
[0172] 802. Input the first blurred image and the first event data into a target image reconstruction model to obtain multiple frames of target high-definition images.
[0173] The target image reconstruction model is obtained by using any one of the image reconstruction model training methods in the embodiments of the present application. The structure of the target image reconstruction model can refer to the above introduction, so it will not be repeated for the sake of brevity.
[0174] 803. Output one or more frames of the multiple-frame target high-definition image.
[0175] That is to say, the output reconstructed image may be one or more frames taken from the above-mentioned multiple-frame target high-definition images, for example, the middle frame, the last frame, or the odd-numbered frames, the even-numbered frames, etc. may be output.
[0176] Since the number of frames of the target high-definition image that can be reconstructed by the target reconstruction model after training is fixed, in order to make the first event data better match each frame of the output image, the first event data can be segmented, and the number of segments of the first event data can correspond to the number of frames of the multiple frames of the target high-definition image.
[0177] For example, assuming that the number of frames of the above-mentioned multi-frame target high-definition image obtained by the target image reconstruction model is 5, that is, the target image reconstruction model can reconstruct 5 frames of high-definition images from a blurred image. Then the first event data can be divided into 5 segments, and the length of the time period corresponding to each segment can be the same. Of course, the time period can also be divided into 10 segments or integer multiples of 5, and then the event points of every two adjacent time periods are taken to form a segment, and the first event data can still be divided into 5 segments. The above numerical values are only for example and ease of understanding, and there is no limitation.
[0178] Fig. 9 It is a schematic flowchart of the training process of the image reconstruction model of an embodiment of the present application. Fig. 9 It can be seen as Figure 5 or Figure 6 A specific example of the training method shown below. Fig. 9 Make an introduction.
[0179] like Fig. 9 As shown, the original input image B can be regarded as an example of the above-mentioned blurred image to be trained, E0-E5 can be regarded as an example of the above-mentioned event data to be trained, E0-E5 are represented by cubes, each cube includes many points, and these points can be regarded as the above-mentioned event points.
[0180] Fig. 9 The optical flow estimation network and reconstruction network are represented by trapezoids. Fig. 9 The multiple trapezoids represented by Optical Flow in is an example of an optical flow estimation network, and Fig. 9The trapezoid represented by Reconstruction in is an example of a reconstruction network. The optical flow estimation network processes the input image B and event data E0-E5 to obtain flow u 0-1 、flow u 1-2 、flow u 2-3 、flow u 3-4 、flow u 4-5 and flow u 5-6 , which is an example of the above optical flow estimation results. The reconstruction network processes the input image B and event data E0-E5 to obtain I0-I6, which is an example of the above multi-frame second high-definition image.
[0181] Fig. 9 The corner-cut rectangle denoted by warp in is an example of the part of the constraint module that performs the warp transformation. Fig. 9 As shown, using flow u 0-1 Warping I1 yields This is an example of the optical flow estimation image of the 0th frame above, using flow u 1-2 Warping I2 yields This is an example of the optical flow estimation image of the first frame above. Similarly, using flow u 5-6 The result of warping I6 is This is an example of the optical flow estimation image for the fifth frame above.
[0182] Fig. 9 It also shows the use of flow u 0-1 To flow u 5-6 Re-blurring with I0-I6 gives This is an example of the re-blurred image mentioned above.
[0183] like Fig. 9 As shown, the self-consistency constraint is imposed on image B and the reblurred image The brightness consistency constraint is for I0 and Between I1 and Between...I5 and The reconstruction loss constraint operates on the true values G0-G6 and I0-I6 respectively. The smoothness constraint operates on a single image. Fig. 9 Not shown in FIG.
[0184] First, traditional cameras need a certain exposure time to accumulate the light in the scene to render the image of the objects in the scene. Motion blur occurs when the objects move quickly during the exposure time. The blurring process can satisfy the following formula (2), that is, the blurred image B(x) is the integral result of all high-definition images during the exposure time.
[0185]
[0186] Where, T represents the exposure time; t0 represents the start time of the exposure time; it can be understood as the moment when the photo is triggered, I t (x) represents all high-definition images within the exposure time, which can be understood as the first high-definition image of the above multiple frames.
[0187] Using the physical process of motion blur, the multi-frame second high-definition images I0-I6 generated by the reconstruction network and the optical flow estimation result flow u generated by the optical flow estimation network are 0-1 To flow u 5-6 , the optical flow estimation result and the multiple frames of the second high-definition image can be processed, or only the multiple frames of the second high-definition image can be processed to obtain the re-blurred image.
[0188] In one implementation, the re-blurred image is obtained by averaging multiple frames of the second high-definition image. That is, the second high-definition image is directly averaged without considering the optical flow estimation result. This method can obtain a re-blurred image, but the accuracy of the re-blurred image is slightly lower than that of the case where the optical flow estimation result is applied.
[0189] In another implementation, the re-blurred image is obtained by inserting interpolated frames between every two adjacent frames of the multiple second high-definition images using the optical flow estimation results, and then averaging these interpolated frames and the multiple second high-definition images. However, it should be understood that in this implementation, interpolated frames can be inserted between every two adjacent frames, or interpolated frames can be inserted only between some of the adjacent frames, but the accuracy of the re-blurred image obtained by the former is higher. The role of interpolation can be understood as being able to make the interval between two adjacent second high-definition images more refined. This implementation allows the optical flow estimation results to more accurately simulate the actual motion trajectory, thereby obtaining a re-blurred image that is closer to the actual motion trajectory, but the number of interpolated frames can be set as needed.
[0190] In this implementation, the process of obtaining the re-blurred image using the optical flow estimation result and multiple frames of the second high-definition image can satisfy the following formula (3).
[0191]
[0192]
[0193] Among them, I i,j (x) is the jth interpolated frame between two adjacent reconstructed frames. The interpolated frame can be understood as the image data corresponding to the optical flow estimation result between the two first high-definition images. n-1 is the number of interpolated frames, and τ is the number of frames of the above-mentioned multiple first high-definition images.
[0194] That is, a parameter n is introduced, where n-1 is the number of frames that can be inserted between two frames of the second high-definition image. The number of frames can be determined according to actual conditions, for example, 10 frames can be inserted, that is, the value range of j can be an integer from 1 to 10, and n = 11. 10 (n-1) interpolated frames are obtained using the optical flow estimation result, and then these interpolated frames and multiple frames of the second high-definition image are averaged to obtain the re-blurred image.
[0195] After obtaining the re-blurred image, the blurred image B(x) and The self-consistency constraint of , which can satisfy the following formula (5).
[0196]
[0197] L self It can be understood as a self-consistency constraint loss function.
[0198] In order to ensure that the reconstructed high-definition image sequence has order in the time dimension, the optical flow estimation result can be used to distort the multiple frames of the second high-definition image to obtain multiple frames of optical flow estimation images. i-i+1 To warp the second HD image I of the i-th frame i Frame image, the second high-definition image I of the i-th frame i Frame image and optical flow estimation of the i-th frame The relationship between the images can satisfy the following formula (6).
[0199]
[0200] Therefore, based on the brightness consistency assumption, the i-th frame optical flow estimation image It should be the same as the second high-definition image I of the i-th frame i There is brightness consistency between them, and the brightness consistency constraint can satisfy the following formula (7).
[0201]
[0202] L warp That is, it is the difference in the brightness values, which can be understood as a brightness consistency constraint loss function.
[0203] Optionally, the above constraints may be used to construct an overall loss function of the image reconstruction model, and the overall loss function may satisfy the following formula (8).
[0204] L=αL recon +βL self +γL warp +δL smooth , (8)
[0205] Where L recon To reconstruct the loss function of the loss constraint, L smooth is the loss function of the smoothness constraint, and α, β, γ, and δ are weight coefficients.
[0206] In order to verify the solution of the embodiment of the present application, two common test sets of GoPro and Adobe240 were selected, and the image reconstruction method using the EDI model in the prior art (referred to as "the prior method") and the image reconstruction method provided by the embodiment of the present application (referred to as "the present method") were used for testing, and the results are shown in Table 1. The peak signal to noise ratio (PSNR) and the structural similarity index measurement (SSIM) in Table 1 are two common parameters for comparing the performance of image processing results. It can be seen from Table 1 that in the two data sets, whether for the reconstruction results of the intermediate frames or for the reconstruction results of the entire frame sequence, the performance of the present method is better than that of the prior method.
[0207] Table 1 Comparison of image reconstruction results between existing methods and this method
[0208]
[0209] Fig.10 Schematic diagram of an image reconstruction device according to an embodiment of the present application. Fig.10 As shown, the device 1000 includes an acquisition unit 1001, a processing unit 1002 and an output unit 1003, and can be used to execute the image reconstruction method of the embodiment of the present application.
[0210] For example, the acquisition unit 1001 may perform the above step 801, the processing unit 1002 may perform the above step 802, and the output unit 1003 is used to perform step 803. The processing unit 1002 may include the above target image reconstruction model, and the target image reconstruction model is used to perform step 802.
[0211] Fig.11 Schematic diagram of a training device for an image reconstruction model according to an embodiment of the present application. Fig.11As shown, the device 2000 includes an acquisition unit 2001 and a training unit 2002, which can be used to perform the training method of the image reconstruction model of the embodiment of the present application. For example, the acquisition unit 2001 can perform the above step 501, and the training unit 2002 can perform the above step 502. For another example, the acquisition unit 2001 can perform the above step 601, and the training unit 1002 can perform the above steps 602-605, and the training unit can also be used to perform the above steps 606-607.
[0212] Fig.12 It is a schematic diagram of the hardware structure of the image reconstruction device according to an embodiment of the present application. Fig.12 The image reconstruction device 3000 shown includes a memory 3001 , a processor 3002 , a communication interface 3003 and a bus 3004 . The memory 3001 , the processor 3002 , and the communication interface 3003 are connected to each other through the bus 3004 .
[0213] The memory 3001 may be a read only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 3001 may store a program. When the program stored in the memory 3001 is executed by the processor 3002, the processor 3002 and the communication interface 3003 are used to execute the various steps of the image reconstruction device of the embodiment of the present application.
[0214] The processor 3002 can adopt a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the functions required to be performed by the units in the image reconstruction device of the embodiment of the present application, or to execute the image reconstruction method of the method embodiment of the present application.
[0215] The processor 3002 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the image reconstruction method of the embodiment of the present application may be completed by an integrated logic circuit of hardware in the processor 3002 or by instructions in the form of software.
[0216] The processor 3002 may also be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 3001, and the processor 3002 reads the information in the memory 3001, and completes the functions required to be performed by the units included in the image reconstruction device of the embodiment of the present application in combination with its hardware, or executes the image reconstruction method of the method embodiment of the present application.
[0217] The communication interface 3003 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the device 3000 and other devices or a communication network. For example, the image to be processed can be obtained through the communication interface 3003.
[0218] The bus 3004 may include a path for transmitting information between various components of the device 3000 (eg, the memory 3001 , the processor 3002 , and the communication interface 3003 ).
[0219] Fig.13 3000 is a schematic diagram of the hardware structure of the training device of the image reconstruction model of the embodiment of the present application. Fig.13 The training device 4000 shown includes a memory 4001, a processor 4002, a communication interface 4003 and a bus 4004. The memory 4001, the processor 4002 and the communication interface 4003 are connected to each other through the bus 4004.
[0220] The memory 4001 can store programs. When the program stored in the memory 4001 is executed by the processor 4002, the processor 4002 is used to execute the various steps of the training method for training the image reconstruction model of the embodiment of the present application.
[0221] The processor 4002 can adopt a general-purpose CPU, microprocessor, ASIC, GPU or one or more integrated circuits to execute relevant programs to implement the training method of the image reconstruction model of the embodiment of the present application.
[0222] The processor 4002 may also be an integrated circuit chip with signal processing capability. In the training process, each step of the training method of the image reconstruction model of the embodiment of the present application may be completed by an integrated logic circuit of hardware in the processor 4002 or by instructions in the form of software.
[0223] It should be understood that through Fig.13 The training device 4000 shown trains the image reconstruction model, and the trained image reconstruction model can be used to execute the image reconstruction method of the embodiment of the present application.
[0224] Specifically, Fig.13 The device shown can obtain training data and the image reconstruction model to be trained from the outside through the communication interface 4003, and then the processor trains the image reconstruction model to be trained according to the training data.
[0225] It should be noted that although the above-mentioned apparatus 3000 and apparatus 4000 only show a memory, a processor, and a communication interface, in the specific implementation process, those skilled in the art should understand that the apparatus 3000 and apparatus 4000 may also include other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the apparatus 3000 and apparatus 4000 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the apparatus 3000 and apparatus 4000 may also only include the devices necessary for implementing the embodiments of the present application, and do not necessarily include Fig.12 and Fig.13 All devices shown in .
[0226] It should be understood that the processor in the embodiment of the present application may be a central processing unit (CPU), and the processor may also be 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. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0227] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0228] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0229] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0230] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0231] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0232] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0233] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0234] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0235] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0236] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0237] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0238] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A training method for an image reconstruction model, characterized in that: include: Acquire a fuzzy image to be trained and event data to be trained, wherein the fuzzy image to be trained is an average value of multiple frames of first high-definition images, and the event data to be trained includes event points within a time period corresponding to the fuzzy image to be trained; The image reconstruction model is trained using the blurred image to be trained and the event data to be trained to obtain a target image reconstruction model. During the training process, the parameters of the image reconstruction model are updated according to constraints to obtain the target image reconstruction model. The constraints include minimizing the difference between the blurred image to be trained and the re-blurred image. The re-blurred image is obtained by processing multiple frames of second high-definition images. The multiple frames of second high-definition images are obtained by processing the blurred image to be trained and the event data to be trained using the image reconstruction model.
2. The method according to claim 1, characterized in that The re-blurred image is obtained by averaging the multiple frames of the second high-definition image.
3. The method according to claim 1, characterized in that The re-blurred image is obtained by processing an optical flow estimation result and the multiple frames of second high-definition images, wherein the optical flow estimation result is obtained by processing the blurred image to be trained and the event data to be trained using an optical flow estimation network, and the optical flow estimation result includes motion information of the blurred image to be trained.
4. The method according to claim 3, characterized in that The re-blurred image is obtained by inserting an interpolation frame between at least two adjacent frames of the multiple frames of the second high-definition image using the optical flow estimation result, and then averaging the interpolation frame and the multiple frames of the second high-definition image.
5. The method according to claim 3 or 4, characterized in that The constraint conditions also include minimizing the difference between the i-th optical flow estimation image in the multi-frame optical flow estimation image and the i-th second high-definition image in the multi-frame second high-definition image, wherein the multi-frame optical flow estimation image is obtained by warping the multi-frame second high-definition image using the optical flow estimation results, wherein the i-th optical flow estimation image in the multi-frame optical flow estimation image is obtained by warping the i+1-th second high-definition image in the multi-frame second high-definition image, and i is an integer greater than or equal to 0 and less than the number of frames of the multi-frame first high-definition image.
6. The method according to claim 5, characterized in that The difference between the i-th frame of the optical flow estimation image in the multiple frames of optical flow estimation images and the i-th frame of the second high-definition image in the multiple frames of the second high-definition image satisfies the following formula: Among them, L warp is the difference, τ represents the number of frames of the first high-definition image, I i (x) represents the second high-definition image of the i-th frame, Represents the i-th frame optical flow estimation image.
7. The method according to claim 5, characterized in that The constraint condition also includes minimizing the distance between adjacent pixels in each frame of the optical flow estimation image in the multiple frames of optical flow estimation images.
8. The method according to claim 1, characterized in that The constraint condition also includes minimizing the difference between the multiple frames of second high-definition images and the multiple frames of first high-definition images.
9. An image reconstruction method, characterized in that: include: Acquire a first blurred image and first event data, where the first event data includes event points within a time period corresponding to the first blurred image; Inputting the first blurred image and the first event data into a target image reconstruction model to obtain multiple frames of target high-definition images, wherein the target image reconstruction model is obtained by using the method described in any one of claims 1 to 8; Output one or more frames of the multiple frames of target high-definition images.
10. The method according to claim 9, characterized in that The method further comprises: The first event data is segmented, and the number of segments of the first event data corresponds to the number of frames of the multi-frame target high-definition images.
11. A training device for an image reconstruction model, characterized in that: include: An acquisition unit, used for acquiring a fuzzy image to be trained and event data to be trained, wherein the fuzzy image to be trained is an average value of multiple frames of first high-definition images, and the event data includes event points within a time period corresponding to the fuzzy image to be trained; A training unit is used to train an image reconstruction model using the blurred image to be trained and the event data to be trained to obtain a target image reconstruction model. During the training process, the training unit is used to update the parameters of the image reconstruction model according to constraints to obtain the target image reconstruction model. The constraints include minimizing the difference between the blurred image to be trained and the re-blurred image. The re-blurred image is obtained by processing multiple frames of second high-definition images. The multiple frames of second high-definition images are obtained by processing the blurred image to be trained and the event data to be trained using the image reconstruction model.
12. The device according to claim 11, characterized in that The re-blurred image is obtained by averaging the multiple frames of the second high-definition image.
13. The device according to claim 11, characterized in that The re-blurred image is obtained by processing an optical flow estimation result and the multiple frames of second high-definition images, wherein the optical flow estimation result is obtained by processing the blurred image to be trained and the event data to be trained using an optical flow estimation network, and the optical flow estimation result includes motion information of the blurred image to be trained.
14. The device according to claim 13, characterized in that The re-blurred image is obtained by inserting an interpolation frame between at least two adjacent frames of the multiple frames of the second high-definition image using the optical flow estimation result, and then averaging the interpolation frame and the multiple frames of the second high-definition image.
15. The device according to claim 13 or 14, characterized in that The constraint conditions also include minimizing the difference between the i-th optical flow estimation image in the multi-frame optical flow estimation image and the i-th second high-definition image in the multi-frame second high-definition image, wherein the multi-frame optical flow estimation image is obtained by warping the multi-frame second high-definition image using the optical flow estimation results, wherein the i-th optical flow estimation image in the multi-frame optical flow estimation image is obtained by warping the i+1-th second high-definition image in the multi-frame second high-definition image, and i is an integer greater than or equal to 0 and less than the number of frames of the multi-frame first high-definition image.
16. The device according to claim 15, characterized in that The difference between the i-th frame of the optical flow estimation image in the multiple frames of optical flow estimation images and the i-th frame of the second high-definition image in the multiple frames of the second high-definition image satisfies the following formula: Among them, L warp is the difference, τ represents the number of frames of the first high-definition image, I i (x) represents the second high-definition image of the i-th frame, Represents the i-th frame optical flow estimation image.
17. The device according to claim 15, characterized in that The constraint condition also includes minimizing the distance between adjacent pixels in each frame of the optical flow estimation image in the multiple frames of optical flow estimation images.
18. The device according to claim 11, characterized in that The constraint condition also includes minimizing the difference between the multiple frames of second high-definition images and the multiple frames of first high-definition images.
19. An image reconstruction device, characterized in that: include: an acquisition unit, configured to acquire a first blurred image and first event data, wherein the first event data includes event points within a time period corresponding to the first blurred image; a processing unit, configured to input the first blurred image and the first event data into a target image reconstruction model to obtain a plurality of frames of target high-definition images, wherein the target image reconstruction model is obtained by using the device according to any one of claims 11 to 18; An output unit is used to output one or more frames of the multiple frames of target high-definition images.
20. The device according to claim 19, characterized in that The processing unit is also used for: The first event data is segmented, and the number of segments of the first event data corresponds to the number of frames of the multi-frame target high-definition images.
21. A training device for an image reconstruction model, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to execute the method according to any one of claims 1 to 8.
22. An image reconstruction device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to execute the method according to claim 9 or 10.
23. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code for execution by a device, the program code including instructions for executing the method according to any one of claims 1 to 8 or claims 9 or 10.
24. A chip system, characterized in that: The chip system includes a processor and a data interface, and the processor reads instructions stored in a memory through the data interface to execute the method according to any one of claims 1 to 8 or claim 9 or 10.
25. A computer program product, characterized in that When the computer program is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 8 or claim 9 or 10.
