Image deblurring method based on motion perception event data representation driving
Through the image deblurring method based on motion perception event data representation, using the deviation accumulation method and cyclic motion extraction module, combined with the feature alignment fusion module, the problem of poor deblurring effect in complex motion scenes is solved, and more accurate motion information is achieved Extraction and image clarity enhancement.
Patent Information
- Application Number
- CN202411082285.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-08
AI Technical Summary
Existing image deblurring technology easily introduces edge artifacts in complex motion scenes, and methods based on event data cannot effectively distinguish different motion modes, resulting in poor deblurring effects.
An image deblurring method based on motion perception event data representation is adopted. Through the deviation accumulation method and cyclic motion extraction module, combined with the feature alignment fusion module, an image deblurring network is constructed to process event representations of different time spans and extract global and local motion features. Improved deblurring.
Significantly improves image deblurring performance in a variety of motion scenes, reduces artifacts, provides more accurate motion information, and improves image clarity.
Smart Images

Figure CN118864310A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image deblurring, and in particular to an image deblurring method driven by motion perception event data representation. Background Art
[0002] Due to the limitation of exposure time, frame-based cameras usually produce blurred images due to factors such as camera shake or object motion. This blur is a common form of image degradation that occurs in various scenes. Not only do photographers usually pursue clear and focused photos, but for many computer vision tasks, clear input is also crucial. Therefore, image deblurring is a fundamental task in the field of computer vision, which not only enhances image quality but also provides support for the normal operation of various algorithms.
[0003] Traditional image-based techniques usually try to derive a sharp image from a single blurry image. They achieve this by exploiting prior knowledge of natural images or making assumptions about the blur operation. However, when capturing a single blurry image, a lot of motion information is lost. The lack of motion information during exposure can lead to undesirable artifacts in the deblurring results, especially in complex motion scenes.
[0004] Unlike frame-based cameras, event cameras inspired by biological systems provide a promising solution to this problem. Event cameras have microsecond temporal resolution and asynchronous output architecture, which can record fast motion. This capability enables event streams to store pixel intensity changes and provide accurate motion information to deblur the corresponding frames. However, these methods mainly utilize event streams through polarity accumulation. In essence, they only consider the final accumulation result of relative intensity changes between adjacent events, ignoring the absolute intensity changes caused by historical events. Therefore, this method cannot distinguish different motion patterns, introduces unnecessary ambiguity in the deblurring process, and leads to the appearance of edge artifacts, which limits the development of image deblurring research based on event data. Summary of the invention
[0005] In order to overcome the shortcomings of the existing methods, the present invention provides an image deblurring method driven by motion perception event data representation, so as to achieve better deblurring performance in image deblurring tasks in various motion scenes, thereby effectively improving the deblurring effect.
[0006] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:
[0007] The image deblurring method based on motion perception event data characterization driving of the present invention is characterized in that it is performed according to the following steps:
[0008] Step 1: Get the training image dataset and the event data within its corresponding exposure time:
[0009] Step 1.1, obtain a real blurred image dataset, denoted as X={x1,x2,…,x i ,…,x N}, where x i represents the i-th blurred image, i=1,2,…,N, N is the number of blurred images;
[0010] Get a real clear image dataset, denoted as Y={y1,y2,…,y i ,…,y N}, where y i represents the i-th clear image; let I={X,Y} represent the training image dataset;
[0011] Step 1.2: Generate a synthetic event data set E = {e1, e2, …, e i ,…,e N}, where e i Represents the i-th blurred image x i During its exposure time [t start ,t end ], and , where x i,j ,y i,j ,t i,j ,p i,j Respectively represent the i-th synthetic event data e i The horizontal coordinate, vertical coordinate, timestamp and polarity of the j-th event in Q i Represents the i-th synthetic event data e i The total number of events included in ;
[0012] Step 2: Blurred image x i The exposure time [t start ,t end ] is divided into 2×A segments, and the time span of each segment is , using the deviation accumulation method to calculate the timestamps in [ ( a − 1 ) t e n d − t s t a r t 2 A + t s t a r t , t e n d − t s t a r t 2 ] and [ t e n d − t s t a r t 2 , t e n d − ( a − 1 ) t e n d − t s t a r t 2 A ] Process the events within the range and get x i The a-th event represents c i a ;
[0013] Step 3: Construct an image deblurring network driven by motion perception event representation, including: S cyclic motion extraction modules, encoding network, feature alignment fusion module, decoding network:
[0014] Step 3.1: S cyclic motion extraction modules are sequentially applied to x i Processing, get x i A event features {g i,s a |a=1,2,…,A}; among them, g i,s a represents the ath event feature output by the sth cyclic motion extraction module;
[0015] Step 3.2: The encoding network is used to i and the Ath event feature g i,s A Processing, get x i The encoding feature F i,ST ;
[0016] Step 3.3: The decoding network is used to decode F i,ST Processing, get x i Predicted clear image ;
[0017] Step 4: Use equations (9) and (10) to construct the back propagation loss function :
[0018] (9)
[0019] (10)
[0020] In formula (9), K is The number of pixels in for The kth pixel in y i k for y i The kth pixel in ; MSE means mean square error;
[0021] Step 5 Based on the real blurred image dataset X and its corresponding synthetic event dataset E and the real clear image dataset Y, the image deblurring network is trained and the loss function L is calculated. The network parameters and weights are updated using the back propagation algorithm. The training is terminated when the number of training iterations reaches the set number, thereby obtaining the optimal image deblurring model, which is used to deblur the blurred image to obtain the corresponding clear image.
[0022] The image deblurring method based on motion perception event data characterization drive described in the present invention is also characterized in that the step 2 is performed according to the following steps:
[0023] Step 2.1: Count x iAt any pixel with coordinates (p,q) in [ ( a − 1 ) t e n d − t s t a r t 2 A + t s t a r t , t e n d − t s t a r t 2 ] The number of events in M;
[0024] Step 2.2, initialize m=1;
[0025] will occur in [ ( a − 1 ) t e n d − t s t a r t 2 A + t s t a r t , t e n d − t s t a r t 2 ] The mth event in the initial time The deviation value between them is recorded as D, the cumulative deviation value is recorded as R, and both D and R are initialized to 0;
[0026] Step 2.3: Set the polarity p of the mth event i,m After superimposing with the deviation value D of the mth event, the updated deviation value D is obtained. ’ ; Update the deviation value D ’ After being superimposed with the cumulative deviation value R of the mth event, the updated cumulative deviation value R is obtained. ’ ;
[0027] Step 2.4: Update the deviation value D ’ As the deviation value of the m+1th event, the updated deviation value accumulation amount R ’ As the cumulative deviation value of the m+1th event, assign m+1 to m, and return to step 2.3 to execute sequentially until m>M, so as to obtain the final updated deviation value D * and the cumulative deviation R * ;
[0028] Step 2.5: Calculate x i The event representation value V=R at any pixel with coordinates (p,q) on * / M;
[0029] Step 2.6: Follow the process from step 2.1 to step 2.5 to calculate x i After processing each pixel, we get x i The a-th forward event representation c i a- ;
[0030] Step 2.7: Follow the process from step 2.1 to step 2.6 to check the timestamp in [ t e n d − t s t a r t 2 , t e n d − ( a − 1 ) t e n d − t s t a r t 2 A ] After processing the events within the range, we get x i The a-th backward event representation c i a+ ;
[0031] Step 2.8, for c i a- Take the opposite of the elements at each position in ci a+ After splicing, we get x i The a-th event represents c i a .
[0032] The step 3.1 is carried out as follows:
[0033] When s=1, the sth cyclic motion extraction module uses formula (1) to obtain x i A event features {g i,s a |a=1,2,…,A}:
[0034] (1)
[0035] In formula (1), f ex and f re Respectively represent two basic convolution modules in the cyclic motion extraction module, is the weight parameter to be trained; g i,s a-1 represents the a-1th event feature output by the sth cyclic motion extraction module; g i,s a represents the ath event feature output by the sth cyclic motion extraction module;
[0036] For g i,s a After downsampling, we get x i The event features after the ath downsampling ;
[0037] When s=2,3,…,S, Input into the sth cyclic motion extraction module, and use formula (2) to get x i A event features {g i,s a |a=1,2,…,A}:
[0038] (2)
[0039] In formula (2), represents the a-th downsampled event feature output by the s-1-th cyclic motion extraction module.
[0040] The encoding network in step 3.2 has a total of S layers of encoding structures, wherein the first S-1 layers of encoding structures are sequentially composed of K basic convolution modules, 1 feature alignment fusion module, and 1 downsampling layer; the Sth layer of encoding structures are sequentially composed of K basic convolution modules, 1 feature alignment fusion module, 1 downsampling layer, and T basic convolution modules;
[0041] When s=1, the i-th blurred image x i After being processed by the K basic convolution modules of the s-th layer encoding structure, the image feature u of the s-th layer structure is obtained. i,s ;
[0042] The feature alignment fusion module of the s-th layer encoding structure uses equations (3), (4) and (5) to derive u i,s and the Ath event feature g output by the sth cyclic motion extraction module i,s A After processing, the fusion feature F of the s-th layer coding structure is obtained i,s :
[0043] (3)
[0044] (4)
[0045] F i , s = C o n v 3 ( C o n c a t ( [ A t t e n t i o n ( Q u ′ i , s , K g ′ i , s A , V g ′ i , s A ) , A t t e n t i o n ( Q g ′ i , s A , K u ′ i , s , V u ′ i , s ) ] ) ) (5)
[0046] In formula (3), formula (4) and formula (5), u i,s ’ and g i,s ’A are the aligned image features and event features of the s-th layer encoding structure, and Indicated by u i,s ’ and g i,s ’A The query matrix generated is and Indicated by u i,s ’ and g i,s ’A The resulting bond matrix, and Indicated by u i,s ’ and g i,s ’A The generated value matrix, Attention represents the multi-head attention operation, Concat represents the concatenation operation along the channel dimension; Conv1, Conv2, and Conv3 represent three convolution operations respectively;
[0047] The downsampling layer of the s-th encoding structure is F i,s After downsampling, the downsampled fusion features of the s-th layer coding structure are obtained. ;
[0048] When s=2,3,…,S, the fusion features of the downsampled encoding structure of the s-1th layer are The input is processed by K basic convolution modules and the compressed feature Z of the s-th layer coding structure is obtained. i,s ;
[0049] The feature alignment fusion module of the s-th layer coding structure uses equations (6), (7) and (8) to obtain the fusion feature F of the s-th layer coding structure: i,s :
[0050] (6)
[0051] (7)
[0052] F i , s = C o n v 3 ( C o n c a t ( [ A t t e n t i o n ( Q Z ′ i , s , K g ′ i , s A , V g ′ i , s A ) , A t t e n t i o n ( Q g ′ i , s A , K Z ′ i , s , V Z ′ i , s ) ] ) ) (8)
[0053] In formula (6), formula (7) and formula (8), Z i,s ’ is the aligned compressed feature of the s-th layer encoding structure, , and Respectively represented by Z i,s ’ The generated query matrix, key matrix and value matrix;
[0054] The downsampling layer of the s-th encoding structure is F i,s After downsampling, the downsampled fusion features of the s-th layer coding structure are obtained. ; Thus, the down-sampling layer of the S-th encoding structure outputs the down-sampled fusion feature ;
[0055] When s=S, the T basic convolution modules of the S-th layer coding structure sequentially fused the downsampled features of the S-th layer coding structure. After processing, we get x i The encoding feature F i,ST .
[0056] The decoding network in step 3.3 has a total of S layers, and each decoding structure consists of 1 upsampling layer and K basic convolution modules;
[0057] When s=1, F i,ST After being processed by the upsampling layer of the s-th decoding structure, the upsampled encoding features output by the s-th decoding structure are obtained. ;
[0058] The fusion feature F output by the S+1-s layer encoding structurei,S+1-s After addition, the K basic convolution modules of the s-th layer decoding structure are processed in turn to obtain the restored feature H output by the s-th layer decoding structure. i,s ;
[0059] When s=2,3,…,S, the restored feature H output by the s-1th layer decoding structure i,s-1 After being processed by the upsampling layer of the s-th decoding structure, the upsampled restored features output by the s-th decoding structure are obtained. ;
[0060] The fusion feature F output by the S+1-s layer encoding structure i,S+1-s After addition, the K basic convolution modules of the s-th layer decoding structure are processed in turn to obtain the restored feature H output by the s-th layer decoding structure. i,s , so that the final restored feature H is output by the S-th layer decoding structure i,S , and after a convolutional layer operation, generate x i Predicted clear image .
[0061] An electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the image deblurring method, and the processor is configured to execute the program stored in the memory.
[0062] The present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the image deblurring method when the computer program is executed by a processor.
[0063] Compared with the prior art, the present invention has the following beneficial effects:
[0064] 1. The intensity deviation relative to the initial exposure moment carries information about the order in which events occur. Therefore, the present invention introduces a deviation accumulation method specifically designed for the deblurring problem. This method can respond differently to various motion modes, thereby supplementing accurate motion information for the image deblurring task.
[0065] 2. Since event representations with longer time spans can capture global motion, while event representations with shorter time spans are better at depicting local rapid motion, the present invention designs a network with a cyclic motion extraction module, which processes event representations with time spans from long to short through the cyclic motion extraction module, and can better extract motion features on local and global time scales. This design enables the network to effectively handle a variety of complex motion scenes.
[0066] 3. Although the information captured by the event camera is highly correlated with the information captured by the frame camera during the equivalent exposure period, there are still inevitable differences due to the modal differences between them. Therefore, the present invention proposes a feature alignment fusion module, which aligns the two modalities to a more consistent space by injecting the information of another modality during the feature transformation process, thereby ensuring that the motion information provided by the event representation more effectively guides the image deblurring process. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 is a flow chart of the method of the present invention;
[0068] Figure 2 This is a structural diagram of the image deblurring method based on motion-aware temporal representation driven by the present invention;
[0069] Figure 3 It is a structural diagram of the cyclic motion extraction module of the present invention;
[0070] Figure 4 It is a structural diagram of the basic convolution module of the present invention;
[0071] Figure 5 This is a structural diagram of the feature alignment and fusion module of the present invention. Specific implementation methods
[0073] In this embodiment, an image deblurring method based on motion perception event representation is provided. For the specific process, see Figure 1 , the deviation accumulation method is used to make different responses to the time series generated by different motion modes, and the motion information is extracted by cyclic motion extraction to assist the deblurring process. The algorithm structure diagram of the whole method can be found in Figure 2 Specifically, the method is performed according to the following steps:
[0074] Step 1: Get the training image dataset and the event data within its corresponding exposure time:
[0075] Step 1.1, obtain a real blurred image dataset, denoted as X={x1,x2,…,x i ,…,x N}, where x i represents the i-th blurred image, i=1,2,…,N, N is the number of blurred images;
[0076] Get a real clear image dataset, denoted as Y={y1,y2,…,y i ,…,y N}, where y i represents the i-th clear image; let I={X,Y} represent the training image dataset;
[0077] Step 1.2: Generate a synthetic event data set E = {e1, e2, …, e i ,…,e N}, where e i Represents the i-th blurred image x i During its exposure time [t start ,t end ], and , where x i,j ,y i,j ,t i,j ,p i,j Respectively represent the i-th synthetic event data e i The horizontal coordinate, vertical coordinate, timestamp and polarity of the j-th event in Q i Represents the i-th synthetic event data e i The total number of events contained in .
[0078] Step 2: The i-th blurred image x i The exposure time [t start ,t end ] is divided into 2×A segments. In this embodiment, A is 3, and the time span of each segment is , using the deviation accumulation method to calculate the timestamps in [ ( a − 1 ) t e n d − t s t a r t 2 A + t s t a r t , t e n d − t s t a r t 2 ] and [ t e n d − t s t a r t 2 , t e n d − ( a − 1 ) t e n d − t s t a r t 2 A ] Process the events within the range and get the ath event representation c i a :
[0079] Step 2.1: Count x i At any pixel with coordinates (p,q) in [ ( a − 1 ) t e n d − t s t a r t 2 A + t s t a r t , t e n d − t s t a r t 2 ] The number of events in M;
[0080] Step 2.2, initialize m=1;
[0081] will occur in [ ( a − 1 ) t e n d − t s t a r t 2 A + t s t a r t , t e n d − t s t a r t 2 ] The mth event in the initial time The deviation value between them is recorded as D, the cumulative deviation value is recorded as R, and both D and R are initialized to 0;
[0082] Step 2.3: Set the polarity p of the mth event i,m After superimposing with the deviation value D of the mth event, the updated deviation value D is obtained. ’ ; Update the deviation value D ’ After being superimposed with the cumulative deviation value R of the mth event, the updated cumulative deviation value R is obtained. ’ .
[0083] Step 2.4: Update the deviation value D ’ As the deviation value of the m+1th event, the updated deviation value accumulation amount R ’ As the cumulative deviation value of the m+1th event, assign m+1 to m, and return to step 2.3 to execute sequentially until m>M, so as to obtain the final updated deviation value D * And the cumulative deviation R * ;
[0084] Step 2.5: Calculate x i The event representation value V=R at any pixel with coordinates (p,q) on * / M;
[0085] Step 2.6: Follow the process from step 2.1 to step 2.5 to calculate x i After processing each pixel, we get x i The ath forward event representation c i a- ;
[0086] Step 2.7: Follow the process from step 2.1 to step 2.6 to check the timestamp in [ t e n d − t s t a r t 2 , t e n d − ( a − 1 ) t e n d − t s t a r t 2 A ] After processing the events within the range, we get x i The a-th backward event representation c i a+ ;
[0087] Step 2.8, for c i a- Take the opposite of the elements at each position in c i a+ After splicing, we get x i The a-th event represents c i a .
[0088] The advantage of selecting events of multiple time spans to process into event representations is that event representations of different time spans have different abilities to capture motions of different scales, which can better characterize global and local motions. In this embodiment, the GoPro dataset is used to train and evaluate the model, including video sequences of 33 different scenes, 22 of which are selected for training the model, and the rest are used for evaluating the model.
[0089] Step 3: Construct an image deblurring network driven by motion perception event representation, including: S cyclic motion extraction modules, encoding network, feature alignment fusion module, decoding network:
[0090] Step 3.1: When s=1, the sth cyclic motion extraction module uses formula (1) to obtain xi A event features {g i,s a |a=1,2,…,A}:
[0091] (1)
[0092] In formula (1), f ex and f re They represent the two basic convolution modules in the cyclic motion extraction module, is the weight parameter to be trained; g i,s a-1 represents the a-1th event feature output by the sth cyclic motion extraction module; g i,s a represents the ath event feature output by the sth cyclic motion extraction module; the specific structures of the cyclic motion extraction module and the basic convolution module are as follows: Figure 3 and Figure 4 shown.
[0093] For g i,s a After downsampling, we get x i The event features after the ath downsampling ;
[0094] When s=2,3,…,S, Input into the sth cyclic motion extraction module, and use formula (2) to get x i A event features {g i,s a |a=1,2,…,A}:
[0095] (2)
[0096] In formula (2), It represents the a-th down-sampled event feature output by the s-1-th cyclic motion extraction module; there are 3 cyclic motion extraction modules in total in this embodiment.
[0097] Step 3.2 The coding network has a total of S layers of coding structure, wherein the first S-1 layer coding structure is sequentially composed of K basic convolution modules, 1 feature alignment fusion module and 1 downsampling layer; the S-th layer coding structure is sequentially composed of K basic convolution modules, 1 feature alignment fusion module, 1 downsampling layer and T basic convolution modules; in this embodiment, Figure 2 As shown, S is 3, K is 1, T is 3, the number of input channels of the basic convolution module of each layer of encoding structure is 64, 128, and 256, and the specific structure of the feature alignment fusion module is as follows Figure 5 shown.
[0098] When s=1, the i-th blurred image x i After being processed by the K basic convolution modules of the s-th layer encoding structure, the image feature u of the s-th layer structure is obtained. i,s ;
[0099] The feature alignment fusion module of the s-th layer encoding structure uses equations (3), (4) and (5) to derive u i,s and the Ath event feature g output by the sth cyclic motion extraction module i,s A After processing, the fusion feature F of the s-th layer coding structure is obtained i,s :
[0100] (3)
[0101] (4)
[0102] F i , s = C o n v 3 ( C o n c a t ( [ A t t e n t i o n ( Q u ′ i , s , K g ′ i , s A , V g ′ i , s A ) , A t t e n t i o n ( Q g ′ i , s A , K u ′ i , s , V u ′ i , s ) ] ) ) (5)
[0103] In formula (3), formula (4) and formula (5), u i,s ’ and g i,s ’A are the aligned image features and event features of the s-th layer encoding structure, and Indicated by u i,s ’ and g i,s ’A The query matrix generated is and Indicated by u i,s ’ and g i,s ’A The resulting bond matrix, and Indicated by u i,s ’ and g i,s ’A The generated value matrix, Attention represents the multi-head attention operation, Concat represents the concatenation operation along the channel dimension; Conv1, Conv2, and Conv3 represent three convolution operations respectively.
[0104] The downsampling layer of the s-th encoding structure is F i,s After downsampling, the downsampled fusion features of the s-th layer coding structure are obtained. ;
[0105] When s=2,3,…,S, the fusion features of the downsampled encoding structure of the s-1th layer are The input is processed by K basic convolution modules and the compressed feature Z of the s-th layer coding structure is obtained. i,s ;
[0106] The feature alignment fusion module of the s-th layer coding structure uses equations (6), (7) and (8) to obtain the fusion feature F of the s-th layer coding structure: i,s :
[0107] (6)
[0108] (7)
[0109] F i , s = C o n v 3 ( C o n c a t ( [ A t t e n t i o n ( Q Z ′ i , s , K g ′ i , s A , V g ′ i , s A ) , A t t e n t i o n ( Q g ′ i , s A , K Z ′ i , s , V Z ′ i , s ) ] ) ) (8)
[0110] In formula (6), formula (7) and formula (8), Z i,s ’ is the aligned compressed feature of the s-th layer encoding structure, , and Respectively represented by Z i,s ’ The resulting query matrix, key matrix, and value matrix.
[0111] The downsampling layer of the s-th encoding structure is F i,s After downsampling, the downsampled fusion features of the s-th layer coding structure are obtained. ; Thus, the down-sampling layer of the S-th encoding structure outputs the down-sampled fusion feature ;
[0112] When s=S, the T basic convolution modules of the S-th layer coding structure sequentially fused the downsampled features of the S-th layer coding structure. After processing, we get x i The encoding feature F i,ST .
[0113] Step 3.3 The decoding network has a total of S layers, and each decoding structure consists of 1 upsampling layer and K basic convolution modules. In this embodiment, S is 3, K is 1, and the number of input channels of the basic convolution module of each decoding structure is 256, 128, and 64, respectively.
[0114] When s=1, F i,ST After being processed by the upsampling layer of the s-th decoding structure, the upsampled encoding features output by the s-th decoding structure are obtained. ;
[0115] The fusion feature F output by the S+1-s layer encoding structurei,S+1-s After addition, the K basic convolution modules of the s-th layer decoding structure are processed in turn to obtain the restored feature H output by the s-th layer decoding structure. i,s ; By sharing the features corresponding to the encoding structure with the decoding structure, the details in the original features are retained.
[0116] When s=2,3,…,S, the restored feature H output by the s-1th layer decoding structure i,s-1 After being processed by the upsampling layer of the s-th decoding structure, the upsampled restored features output by the s-th decoding structure are obtained. ;
[0117] The fusion feature F output by the S+1-s layer encoding structure i,S+1-s After addition, the K basic convolution modules of the s-th layer decoding structure are processed in turn to obtain the restored feature H output by the s-th layer decoding structure. i,s , so that the final restored feature H is output by the S-th layer decoding structure i,S , and after a convolutional layer operation, generate x i Predicted clear image ; The convolution kernel size of the convolution operation is , with a step size of 1.
[0118] Step 4: Use equations (9) and (10) to construct the back propagation loss function: :
[0119] (9)
[0120] (10)
[0121] In formula (9), K is The number of pixels in for The kth pixel in y i k for y i The kth pixel in ; MSE means mean square error.
[0122] Step 5 Based on the real blurred image dataset X and its corresponding synthetic event dataset E and the real clear image dataset Y, the image deblurring network is trained and the loss function L is calculated. The network parameters and weights are updated using the back propagation algorithm. The learning rate is adjusted using the cosine annealing strategy. In this example, the initial learning rate is 0.0001. The training is terminated when the number of training iterations reaches the set number, thereby obtaining the optimal image deblurring model, which is used to deblur the blurred image to obtain the corresponding clear image.
[0123] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the above method, and the processor is configured to execute the program stored in the memory.
[0124] In this embodiment, a computer-readable storage medium stores a computer program on the computer-readable storage medium, and the computer program executes the steps of the above method when executed by a processor. Example
[0125] In order to verify the effectiveness of the method of the present invention in various scenarios, the GoPro dataset, HS-ERGB dataset and REBlur dataset were selected for training and testing in this embodiment.
[0126] The method is trained on the GoPro dataset, which includes 2059 blurry and clear image pairs from 22 scenes, and the test set includes 1089 blurry-clear image pairs from 11 scenes. In order to obtain event data, the ESIM event simulator is used to generate the corresponding event sequence. For the evaluation of real event data, the HS-ERGB dataset and the REBlur dataset are used, which contain event data captured by event cameras in real scenes.
[0127] The present invention adopts peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) as evaluation indicators.
[0128] In this embodiment, ten methods are selected to compare with the proposed method, and the selected methods are LEVS (see paper: Learning to extract a video sequence from a single motion-blurred image.), EDI (see paper: Bringing a blurry frame alive at high frame-rate with an event camera.), SRN (see paper: Scale-recurrent network for deep image deblurring.), EVDI (see paper: Unifying motion deblurring and frame interpolation with events.), HINet (see paper: Half instance normalization network for image restoration.), Restormer (see paper: Efficient transformer for high-resolution image restoration.), MSDI-Net (see paper: Learning degradation representations for image deblurring.), NAFNet (see paper: Simple baselines for image restoration.), UFPNet (see paper: Self-supervised non-uniform kernel estimation with flow-based motion prior for blind image deblurring.), EFNet (see paper: Event-based fusion for motion deblurring with cross-modal The experimental results are shown in Table 1, where Ours represents the method of the present invention:
[0129]
[0130] The experimental results show that the proposed method has better effects than the other 10 methods on three different data sets, thus proving the feasibility of the proposed method. The experiment shows that the proposed method has a strong ability to capture different motion patterns, can effectively extract motion information, and assist in completing the image deblurring task.
Claims
1. An image deblurring method driven by motion perception event data representation, It is characterized in that The steps are as follows: Step 1: Get the training image dataset and the event data within its corresponding exposure time: Step 1.1: Get a real blurred image dataset, denoted as X={x 1 ,x 2 ,…,x i ,…,x N }, where x i represents the i-th blurred image, i=1,2,…,N, N is the number of blurred images; Get a real clear image dataset, denoted as Y={y 1 ,y 2 ,…,y i ,…,y N }, where y i represents the i-th clear image; let I={X,Y} represent the training image dataset; Step 1.2: Generate a synthetic event data set E={e 1 ,e 2 ,…,e i ,…,e N }, where e i Represents the i-th blurred image x i During its exposure time [t start ,t end ], and , where x i,j ,y i,j ,t i,j ,p i,j Respectively represent the i-th synthetic event data e i The horizontal coordinate, vertical coordinate, timestamp and polarity of the j-th event in Q i Represents the i-th synthetic event data e i The total number of events included in ; Step 2: Blurred image x i The exposure time [t start ,t end ] is divided into 2×A segments, and the time span of each segment is , using the deviation accumulation method to calculate the timestamps in and Process the events within the range and get x i The a-th event represents c i a ; Step 3: Construct an image deblurring network driven by motion perception event representation, including: S cyclic motion extraction modules, encoding network, feature alignment fusion module, decoding network: Step 3.1: S cyclic motion extraction modules are sequentially applied to x i Processing, get x i A event features {g i,s a |a=1,2,…,A}; among them, g i,s a represents the ath event feature output by the sth cyclic motion extraction module; Step 3.2: The encoding network is used to i and the Ath event feature g i,s A Processing, get x i The encoding feature F i,ST ; Step 3.3: The decoding network is used to decode F i,ST Processing, get x i Predicted clear image ; Step 4: Use equations (9) and (10) to construct the back propagation loss function: : (9) (10) In formula (9), K is The number of pixels in for The kth pixel in y i k for y i The kth pixel in ; MSE means mean square error; Step 5 Based on the real blurred image dataset X and its corresponding synthetic event dataset E and the real clear image dataset Y, the image deblurring network is trained and the loss function L is calculated. The network parameters and weights are updated using the back propagation algorithm. The training is terminated when the number of training iterations reaches the set number, thereby obtaining the optimal image deblurring model, which is used to deblur the blurred image to obtain the corresponding clear image.
2. The image deblurring method based on motion perception event data characterization drive according to claim 1, It is characterized in that Described step 2 is carried out as follows: Step 2.1: Count x i At any pixel with coordinates (p,q) in The number of events in M; Step 2.2, initialize m=1; will occur in The mth event in the initial time The deviation value between them is recorded as D, the cumulative deviation value is recorded as R, and both D and R are initialized to 0; Step 2.3: Set the polarity p of the mth event i,m After superimposing with the deviation value D of the mth event, the updated deviation value D is obtained. ’ ; Update the deviation value D ’ After being superimposed with the cumulative deviation value R of the mth event, the updated cumulative deviation value R is obtained. ’ ; Step 2.4: Update the deviation value D ’ As the deviation value of the m+1th event, the updated deviation value accumulation amount R ’ As the cumulative deviation value of the m+1th event, assign m+1 to m, and return to step 2.3 to execute sequentially until m>M, so as to obtain the final updated deviation value D * and the cumulative deviation R * ; Step 2.5: Calculate x i The event representation value V=R at any pixel with coordinates (p,q) on * / M; Step 2.6: Follow the process from step 2.1 to step 2.5 to calculate x i After processing each pixel, we get x i The a-th forward event representation c i a- ; Step 2.7: Follow the process from step 2.1 to step 2.6 to check the timestamp in After processing the events within the range, we get x i The a-th backward event representation c i a+ ; Step 2.8, for c i a- Take the opposite of the elements at each position in c i a+ After splicing, we get x i The a-th event represents c i a .
3. The image deblurring method based on motion perception event data characterization drive according to claim 2, It is characterized in that The step 3.1 is carried out as follows: When s=1, the sth cyclic motion extraction module uses formula (1) to obtain x i A event features {g i,s a |a=1,2,…,A}: (1) In formula (1), f ex and f re Respectively represent two basic convolution modules in the cyclic motion extraction module, is the weight parameter to be trained; g i,s a-1 represents the a-1th event feature output by the sth cyclic motion extraction module; g i,s a represents the ath event feature output by the sth cyclic motion extraction module; For g i,s a After downsampling, we get x i The event features after the ath downsampling ; When s=2,3,…,S, Input into the sth cyclic motion extraction module, and use formula (2) to get x i A event features {g i,s a |a=1,2,…,A}: (2) In formula (2), represents the a-th downsampled event feature output by the s-1-th cyclic motion extraction module.
4. The image deblurring method based on motion perception event data characterization drive according to claim 3, It is characterized in that The encoding network in step 3.2 has a total of S layers of encoding structures, wherein the first S-1 layers of encoding structures are sequentially composed of K basic convolution modules, 1 feature alignment fusion module, and 1 downsampling layer; the Sth layer of encoding structures are sequentially composed of K basic convolution modules, 1 feature alignment fusion module, 1 downsampling layer, and T basic convolution modules; When s=1, the i-th blurred image x i After being processed by the K basic convolution modules of the s-th layer encoding structure, the image feature u of the s-th layer structure is obtained. i,s ; The feature alignment fusion module of the s-th layer encoding structure uses equations (3), (4) and (5) to derive u i,s and the Ath event feature g output by the sth cyclic motion extraction module i,s A After processing, the fusion feature F of the s-th layer coding structure is obtained i,s : (3) (4) (5) In formula (3), formula (4) and formula (5), u i,s ’ and g i,s ’A are the aligned image features and event features of the s-th layer encoding structure, and Indicated by u i,s ’ and g i,s ’A The query matrix generated is and Indicated by u i,s ’ and g i,s ’A The resulting bond matrix, and Indicated by u i,s ’ and g i,s ’A The generated value matrix, Attention represents the multi-head attention operation, Concat represents the concatenation operation along the channel dimension; Conv 1 、Conv 2 、Conv 3 Represent three convolution operations respectively; The downsampling layer of the s-th encoding structure is F i,s After downsampling, the downsampled fusion features of the s-th layer coding structure are obtained. ; When s=2,3,…,S, the fusion features of the downsampled encoding structure of the s-1th layer are The input is processed by K basic convolution modules and the compressed feature Z of the s-th layer coding structure is obtained. i,s ; The feature alignment fusion module of the s-th layer coding structure uses equations (6), (7) and (8) to obtain the fusion feature F of the s-th layer coding structure: i,s : (6) (7) (8) In formula (6), formula (7) and formula (8), Z i,s ’ is the aligned compressed feature of the s-th layer encoding structure, , and Respectively represented by Z i,s ’ The generated query matrix, key matrix and value matrix; The downsampling layer of the s-th encoding structure is F i,s After downsampling, the downsampled fusion features of the s-th layer coding structure are obtained. ; Thus, the down-sampling layer of the S-th encoding structure outputs the down-sampled fusion feature ; When s=S, the T basic convolution modules of the S-th layer coding structure sequentially fused the downsampled features of the S-th layer coding structure. After processing, we get x i The encoding feature F i,ST .
5. The image deblurring method based on motion perception event data characterization drive according to claim 3, It is characterized in that The decoding network in step 3.3 has a total of S layers, and each decoding structure consists of 1 upsampling layer and K basic convolution modules; When s=1, F i,ST After being processed by the upsampling layer of the s-th decoding structure, the upsampled encoding features output by the s-th decoding structure are obtained. ; The fusion feature F output by the S+1-s layer encoding structure i,S+1-s After addition, the K basic convolution modules of the s-th layer decoding structure are processed in turn to obtain the restored feature H output by the s-th layer decoding structure. i,s ; When s=2,3,…,S, the restored feature H output by the s-1th layer decoding structure i,s-1 After being processed by the upsampling layer of the s-th decoding structure, the upsampled restored features output by the s-th decoding structure are obtained. ; The fusion feature F output by the S+1-s layer encoding structure i,S+1-s After addition, the K basic convolution modules of the s-th layer decoding structure are processed in turn to obtain the restored feature H output by the s-th layer decoding structure. i,s , so that the final restored feature H is output by the S-th layer decoding structure i,S , and after a convolutional layer operation, generate x i Predicted clear image .
6. An electronic device comprising a memory and a processor, It is characterized in that The memory is used to store a program that supports the processor to execute the image deblurring method according to any one of claims 1 to 5, and the processor is configured to execute the program stored in the memory.
7. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the image deblurring method according to any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
Video deblurring method based on event data driving
CN114463218A
Image deblurring method based on multi-scale cross attention and related device
CN116309104A
Event-image deblurring method based on LSTM
CN117058043A
Event camera guided high-dynamic high-speed scene imaging method and system
CN117830126A
Image processing method and device, storage medium and electronic device
WO2019192338A1
