Method, system, device, medium and product for building module and image reconstruction
By combining the Canny operator with the general large convolution kernel module and the window attention mechanism, a deep feature extraction module is constructed, which solves the problem of insufficient global feature extraction in the existing technology, and significantly improves the global consistency of image super-resolution reconstruction and retain the effect of details.
Patent Information
- Application Number
- CN202410911114.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-01
AI Technical Summary
The existing image super-resolution reconstruction methods have significant local feature capture effects in feature extraction, but insufficient global feature and long-distance dependency capture, resulting in poor performance of reconstructed images in terms of global consistency and detail retention.
By combining the Canny operator with the general large convolution kernel module, a deep feature extraction module is built, and multiple convolution kernels and window attention mechanisms with different sizes and parallel sizes can capture the details and global features of the image, and improve the global feature of feature extraction sex.
It significantly improves the global consistency and detail retention capabilities of image reconstruction, and generates clearer super-resolution images.
Smart Images

Figure CN118887091A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, system, device, medium, and product for building a module and reconstructing an image. Background Art
[0002] Image super-resolution reconstruction is an image processing technology used to restore high-resolution images from low-resolution images to improve image details and clarity and image quality. It is widely used in medical treatment, video surveillance, remote sensing satellite imaging and other fields. Because imaging equipment is affected by system noise, imaging environment and other factors during image acquisition, the resolution of the acquired images is low. Therefore, it is necessary to perform super-resolution reconstruction on the acquired images.
[0003] Existing image super-resolution reconstruction methods can be divided into three categories: interpolation method, reconstruction-based method and learning-based method. Interpolation method performs difference calculation based on image prior information and statistical model; reconstruction-based method extracts high-frequency information from multiple frames of low-resolution images of the same scene and fuses them to generate high-resolution images; learning-based method obtains the mapping relationship between low-resolution image blocks and high-resolution image blocks through training of low-resolution image and high-resolution image sample library, and predicts the high-resolution reconstruction result of the input low-resolution image.
[0004] In existing image super-resolution reconstruction methods, feature extraction is a key step that directly affects the quality and effect of the reconstructed image. Existing feature extraction models mainly rely on local convolution operations to extract image features. This method is effective in capturing local features, but is insufficient in capturing global features and long-distance dependencies. This may lead to poor performance of the reconstructed image in terms of global consistency and detail preservation. Summary of the invention
[0005] The embodiments of the present application provide methods, systems, devices, media, and products for constructing modules and image reconstruction, so as to achieve the global effect of improving feature extraction.
[0006] In a first aspect, an embodiment of the present application provides a method for constructing a deep feature extraction module, comprising:
[0007] Acquire multiple sample images;
[0008] Using each of the sample images to train a plurality of preset initial image processing models to obtain a plurality of target image processing models, each of the initial image processing models comprising a plurality of parallel convolution kernels of different sizes;
[0009] Re-parameterizing each of the target image processing models to obtain a plurality of general large convolution kernel modules;
[0010] A deep feature extraction module is constructed based on the general large convolution kernel modules and Canny operators.
[0011] In a possible implementation, a deep feature extraction module is constructed based on each of the general large convolution kernel modules and the Canny operator, including:
[0012] Combining each of the general large convolution kernel modules with the Canny operator respectively to obtain a plurality of first general large convolution kernels;
[0013] Respectively cascading a first preset number of first general large convolution kernels, and setting a window attention mechanism in the cascaded first general large convolution kernels, to obtain a plurality of second general large convolution kernels;
[0014] A deep feature extraction module is constructed according to each of the second general large convolution kernels and a third preset number of small convolution kernels.
[0015] In a possible implementation, a deep feature extraction module is constructed according to each of the second general large convolution kernels and a third preset number of small convolution kernels, including:
[0016] Residually connecting each of the second universal large convolution kernels with each of the small convolution kernels to obtain a plurality of residual universal large convolution kernels;
[0017] The multiple residual universal large convolution kernels and a small convolution kernel are cascaded to obtain a deep feature extraction module.
[0018] In a possible implementation, setting the window attention mechanism in the first universal large convolution kernel of the cascade includes:
[0019] In each first general large convolution kernel of the cascade, a window attention mechanism is set for each set number of first general large convolution kernels.
[0020] In a second aspect, an embodiment of the present application provides a method for image reconstruction, comprising:
[0021] Acquire an image to be reconstructed;
[0022] Inputting the image to be reconstructed into a preset shallow feature extraction module to obtain shallow features of the image to be reconstructed, wherein the shallow feature extraction module includes a convolution layer;
[0023] Inputting the image to be reconstructed into a deep feature extraction module to obtain deep features of the image to be reconstructed; the deep feature extraction module is constructed according to the above method for constructing a deep feature extraction module;
[0024] Image reconstruction is performed according to the shallow features and the deep features.
[0025] In a possible implementation, performing image reconstruction according to the shallow features and the deep features includes:
[0026] Performing feature fusion on the shallow features and the deep features to obtain global features;
[0027] Performing an upsampling operation on the global feature to obtain a high-dimensional feature quantity;
[0028] The high-dimensional feature quantity is reconstructed to obtain a super-resolution image.
[0029] In a third aspect, an embodiment of the present application provides an image reconstruction system, comprising:
[0030] An image acquisition module, used for acquiring an image to be reconstructed;
[0031] A shallow feature extraction module, comprising a convolution layer, wherein the shallow feature extraction module is used to extract shallow features of an image to be reconstructed;
[0032] A deep feature extraction module, used to extract deep features of the image to be reconstructed;
[0033] An image reconstruction module, used for performing image reconstruction according to the shallow features and the deep features;
[0034] Wherein, the deep feature extraction module is constructed based on the above-mentioned method for constructing a deep feature extraction module.
[0035] In a possible implementation, the image reconstruction module includes:
[0036] A feature fusion unit, used for fusing the shallow features and the deep features to obtain global features;
[0037] An upsampling unit, used to perform an upsampling operation on the global feature to obtain a high-dimensional feature quantity;
[0038] The sub-pixel convolution layer is used to reconstruct the high-dimensional feature quantity to obtain a super-resolution image.
[0039] In a fourth aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0040] The memory stores computer-executable instructions;
[0041] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method of the first aspect and / or the second aspect as described above.
[0042] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method of the first aspect and / or the second aspect as described above.
[0043] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements the method of the first aspect and / or the second aspect above when executed by a processor.
[0044] The method, system, device, medium, and product for constructing modules and image reconstruction provided by the embodiments of the present application construct a deep feature extraction module by combining the Canny operator with a general large convolution kernel module. Since the size of the convolution kernel determines how much local area of the input image it can cover, and the general large convolution kernel module is equivalent to multiple convolution kernels of different sizes and in parallel, each general large convolution kernel module can capture both the detail features and global features of the input image. In addition, since the Canny operator can detect high-frequency texture information and make the edge structure information of the input image clearer, the Canny operator is combined with multiple general large convolution kernel modules so that the general large convolution kernel module can more stably capture the structural information in the input image and improve the globality of feature extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0046] Figure 1 A flowchart of a method for constructing a deep feature extraction module provided in this application;
[0047] Figure 2 A schematic diagram of a network architecture for obtaining a general large convolution kernel module by training an initial image processing model provided in this application;
[0048] Figure 3 A flowchart of a method for constructing a deep feature extraction module provided in this application;
[0049] Figure 4 A schematic diagram of the structure of a first general large convolution kernel with a window attention mechanism provided in this application;
[0050] Figure 5 A schematic diagram of the structure of a residual universal large convolution kernel provided in this application;
[0051] Figure 6 A flowchart of a method for image reconstruction provided in the present application;
[0052] Figure 7 A schematic diagram of the structure of an image reconstruction system provided in this application;
[0053] Figure 8 A schematic diagram of the structure of an electronic device provided in this application.
[0054] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0055] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0056] It should be noted that the data involved in this application (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data that have been fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0057] Image super-resolution reconstruction is an image processing technology used to restore high-resolution images from low-resolution images to improve image details and clarity and image quality. It is widely used in medical treatment, video surveillance, remote sensing satellite imaging and other fields. Because imaging equipment is affected by system noise, imaging environment and other factors during image acquisition, the resolution of the acquired images is low. Therefore, it is necessary to perform super-resolution reconstruction on the acquired images.
[0058] In existing image reconstruction methods, feature extraction is a key step that directly affects the quality and effect of the reconstructed image. Existing feature extraction models mainly rely on local convolution operations to extract image features. This method is effective in capturing local features, but is insufficient in capturing global features and long-distance dependencies. This may lead to poor performance of the reconstructed image in terms of global consistency and detail preservation.
[0059] In order to improve the global consistency of the reconstructed image, the first thing to do is to solve the shortcomings of the existing feature extraction model in capturing the global features of the image. The method for constructing a deep feature extraction module provided in the embodiment of the present application combines the Canny operator with a general large convolution kernel module. Since the size of the convolution kernel determines how many local areas of the input image it can cover, and the general large convolution kernel module is equivalent to multiple convolution kernels of different sizes and parallel, the general large convolution kernel module has a receptive field of different sizes, that is, it can cover different sizes of areas of the input image to capture the detail features and global features of the input image at the same time. In addition, since the Canny operator can detect high-frequency texture information and make the edge structure information of the input image clearer, the Canny operator is combined with the general large convolution kernel module so that the general large convolution kernel module can capture the structural information in the input image more stably and improve the globality of feature extraction.
[0060] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0061] Figure 1 A flowchart of a method for constructing a deep feature extraction module provided in this application is shown in FIG. Figure 1 As shown, the method includes:
[0062] Step S101, obtaining a plurality of sample images.
[0063] Specifically, a plurality of first candidate images are obtained from a preset data set, and the first candidate images are preprocessed to obtain second candidate images; sample labels are added to the second candidate images to obtain sample images. The first candidate images include images of different lighting conditions, different viewing angles, and different scenes. The sample labels are used to indicate the category to which each second candidate image belongs. In the disclosed embodiment, the sample labels are, for example, image features of the second candidate images. The initial image processing model predicts the image features of the image to be reconstructed by learning the relationship between the sample labels and the second candidate images.
[0064] The preprocessing of the first candidate image includes: scaling the first candidate image to a set size, performing data enhancement on the scaled first candidate image, and normalizing the data enhanced first candidate image to obtain the second candidate image.
[0065] In some embodiments, the size is set to, for example, 64×64, and by unifying the image size, the trained deep feature extraction module can process multiple images simultaneously.
[0066] Furthermore, data enhancement is performed on the scaled first candidate image, including: rotating and / or flipping the scaled first candidate image at any angle, so that the deep feature extraction module learns rotation invariance during training.
[0067] Furthermore, the first candidate image after data enhancement is normalized, including: normalizing the image pixel values of the first candidate image after data enhancement to [0, 1] or [-1, 1], so as to improve the stability of the training deep feature extraction module.
[0068] Step S102, using each sample image to train multiple preset initial image processing models to obtain multiple target image processing models, each initial image processing model includes multiple parallel convolution kernels of different sizes. Since convolution kernels of different sizes can capture features of different scales, that is, small convolution kernels can capture details and local features, while large convolution kernels may not capture larger global features. Therefore, by training the initial image processing model including multiple parallel convolution kernels of different sizes, it is possible to capture multi-scale features of the image to be reconstructed. In addition, the use of multiple convolution kernels can increase the diversity of the initial image processing model and reduce the risk of model overfitting.
[0069] Specifically, using each sample image to train a plurality of preset initial image processing models to obtain a plurality of target image processing models includes: inputting a plurality of sample images into each initial image processing model for training, until a preset stop condition is reached, and obtaining a plurality of target image processing models. In some embodiments, the preset stop condition is, for example, a preset number of model iterations and a preset training duration.
[0070] Step S103, re-parameterization operation is performed on each target image processing model to obtain multiple universal large convolution kernel modules, wherein the convolution kernel size of the universal large convolution kernel module is less than or equal to 17×17.
[0071] The role of the reparameterization operation is to allow the gradient to propagate through random variables, so that the model can be trained by the gradient descent method. In an embodiment of the present application, the target image processing model is reparameterized in order to reduce the number of parameters of the convolution kernel in the target image processing model, thereby reducing the complexity of the target image processing model. In addition, by reparameterizing the target image processing model, the deformation of the target image processing model can be achieved, that is, the target image processing model including multiple convolution kernels of different sizes and parallel is merged into an equivalent general large convolution kernel module, so that the general large convolution kernel module can capture more complex image features. Among them, image features represent attributes or information extracted from an image that help describe and identify the content of the image. Image features include, for example, color, texture, shape, object, scene, and action.
[0072] For example, Figure 2 The schematic diagram of the network architecture of the general large convolution kernel module obtained by training the initial image processing model provided in this embodiment. Figure 2 As shown, the network architecture 200 for obtaining a general large convolution kernel module by training the initial image processing model includes an initial image processing model 201 and a reparameterization module 202. The initial image processing model 201 is connected to the reparameterization module 202. Among them, the initial image processing model 201 includes 5 parallel convolution branches, each convolution branch includes a convolution kernel and a BN (Batch Normalization) layer connected to the convolution kernel, and the sizes of each convolution kernel are 5×5, 5×5, 9×9, 3×3 and 3×3 respectively. The expansion coefficients of each convolution kernel are 2, 1, 1, 3 and 4 respectively. In the process of training the initial image processing model using sample images, each convolution branch is calculated in parallel and then added to obtain the target image processing model. After the training is completed, the target image processing model is merged into an equivalent general large convolution kernel module through the reparameterization module. The size of the general large convolution kernel module is 9×9 and the expansion coefficient is 1.
[0073] Step S104, constructing a deep feature extraction module based on various general large convolution kernel modules and Canny operators.
[0074] Among them, the Canny operator is an edge detection algorithm used to detect edges in an image.
[0075] The method for constructing a deep feature extraction module provided in the embodiment of the present application is to construct a deep feature extraction module by combining the Canny operator with a general large convolution kernel module. Since the size of the convolution kernel determines how much local area of the input image it can cover, and the general large convolution kernel module is equivalent to multiple convolution kernels of different sizes and in parallel, each general large convolution kernel module can capture the detail features and global features of the input image at the same time. In addition, since the Canny operator can detect high-frequency texture information and make the edge structure information of the input image clearer, the Canny operator is combined with multiple general large convolution kernel modules so that the general large convolution kernel module can capture the structural information in the input image more stably and improve the globality of feature extraction.
[0076] Figure 3 The flowchart of the method for constructing a deep feature extraction module provided in the embodiment of the present application is as follows. Figure 3 As shown, in this embodiment Figure 1 Based on the embodiment, a detailed description is given of constructing a deep feature extraction module based on various general large convolution kernel modules and Canny operators. The method for constructing a deep feature extraction module shown in this embodiment may include the following steps:
[0077] Step S301, combining each general large convolution kernel module with the Canny operator respectively to obtain multiple first general large convolution kernels.
[0078] Optionally, each general large convolution kernel module is combined with the Canny operator, including: inputting the edge detection information detected by the Canny operator and other image channels in parallel to the first layer of the general large convolution kernel module. Among them, the other image channels are used to input the image to be reconstructed, the sample image, and the test image. This enables the general large convolution kernel module to perform feature recognition on the input image in combination with the edge detection information, and assists in learning more complex image features.
[0079] The sample image is an image input into the initial image processing model during the training of the deep feature extraction module, and it has a sample label. The test image is an image input into the deep feature extraction module after the training process of the deep feature extraction module is completed to test the performance of the deep feature extraction module, and it has a sample label. The image to be reconstructed is an image input into the deep feature extraction module after the training process of the deep feature extraction module is completed to perform feature extraction.
[0080] Optionally, each general large convolution kernel module is combined with the Canny operator, including: integrating the edge detection information detected by the Canny operator into one or more intermediate layers of the general large convolution kernel module through a jump connection. When performing feature extraction, the general large convolution kernel module can use the edge detection information as a guide to accurately locate the structural edge of the image input through the image channel.
[0081] Step S302: cascade a first preset number of first general large convolution kernels respectively, and set the window attention mechanism in the cascaded first general large convolution kernels to obtain multiple second general large convolution kernels.
[0082] Among them, the window attention mechanism is a method used in visual and sequence processing tasks to improve the model's attention to local areas of input data. Its core idea is to divide the input image into multiple non-overlapping or slightly overlapping windows, and calculate the attention weight independently in each window, rather than globally calculating it on the entire input image.
[0083] Furthermore, the window attention mechanism is, for example, an offset window attention mechanism, which enables the window to be dynamically moved on the input image, can more accurately locate key features, and improve the adaptability of the deep feature extraction module to complex and changing data.
[0084] Optionally, the window attention mechanism is set in the first universal large convolution kernel of the cascade, including: a window attention mechanism is set in each first universal large convolution kernel of the cascade. This can improve the first universal large convolution kernel's ability to screen and express image features.
[0085] Optionally, the window attention mechanism is set in the first general large convolution kernel of the cascade, including: in each first general large convolution kernel of the cascade, a window attention mechanism is set for each interval of a set number of first general large convolution kernels. The set number is a positive integer greater than or equal to 1. In this way, different first general large convolution kernels can pay attention to different details. Compared with the method of setting a window attention mechanism in each general large convolution kernel, the interval setting can reduce the amount of calculation and memory consumption while maintaining the performance of the model, making the deep feature extraction module easier to train and deploy in a resource-constrained environment.
[0086] Exemplarily, this embodiment provides a schematic diagram of the structure of a first general large convolution kernel with a window attention mechanism. Figure 4As shown, the first general large convolution kernel 400 includes: a general large convolution kernel module 404, a Canny operator 403, a window attention mechanism 402, a first layer normalization module 401, a second layer normalization module 406, a first feature integration module 405, a second feature integration module 408 and a multi-layer perceptron module 407. Among them, one end of the first layer normalization module is used to receive data X, and the other end of the first layer normalization module is respectively connected to one end of the window attention mechanism and one end of the Canny operator. The other end of the window attention mechanism is connected to one end of the first feature integration module. The other end of the Canny operator is connected to one end of the general large convolution kernel module, and the other end of the general large convolution kernel module is connected to one end of the first feature integration module. One end of the first feature integration module is also used to receive data X. The first feature integration module is used to add the features output by the Canny operator, the features output by the general large convolution kernel module and the data X, and transmit the feature quantity obtained by the addition to the second layer normalization module and the second feature integration module. The other end of the first feature integration module is connected to one end of the second layer normalization module and the second feature integration module respectively. The other end of the second layer normalization module is connected to one end of the multilayer perceptron module, and the other end of the multilayer perceptron module is connected to one end of the second feature integration module. The second feature integration module is used to perform addition processing on the feature quantity output by the multilayer perceptron module and the feature quantity obtained by adding the first feature integration module.
[0087] Among them, the first-layer normalization module and the second-layer normalization module are used to standardize the input data, making the data distribution more stable and reducing the problem of internal covariate shift, thereby accelerating the convergence of the network, and being able to obtain the deep feature extraction module more quickly and increase the generalization ability of the deep feature extraction module.
[0088] The multi-layer perceptron module is a feed-forward artificial neural network used to simulate the nonlinear relationship between input data and output data. By using the multi-layer perceptron module to construct the first universal large convolution kernel, the first universal large convolution kernel can capture the abstract and high-level features of the input data, which helps to improve the generalization ability of the first universal large convolution kernel.
[0089] In some embodiments, data X is obtained after the first layer normalization module LN =LayerNorm(X). X LN After the window attention mechanism, the data M is obtained (S)W-MSA (X LN ). LN After the Canny operator, the data Canny(X LN ). Canny(X LN ) After the general large convolution kernel module, the data M is obtained URepLK(Canny(X LN )). The first feature integration module adds the features output by the general large convolution kernel module, the features output by the window attention mechanism, and the data X to obtain data X Attention =βM URepLK (Canny(X LN ))+M (S)W-MSA (X LN )+X. β is a hyperparameter and can be set to 0.1. Data X Attention After the second layer normalization module is operated, the data LayerNorm(X Attention ). Data LayerNorm(X Attention ) After passing through the multi-layer perceptron module, the data MLP(LayerNorm(X Attention )). The second feature integration module adds the feature quantity output by the multi-layer perceptron module and the feature quantity obtained by adding the first feature integration module to obtain data Y=MLP(LayerNorm(X Attention ))+X Attention .
[0090] Step S303, constructing a deep feature extraction module according to each second general large convolution kernel and a third preset number of small convolution kernels.
[0091] Specifically, a deep feature extraction module is constructed according to each second universal large convolution kernel and a third preset number of small convolution kernels, including: performing residual connection on each second universal large convolution kernel and each small convolution kernel respectively to obtain multiple residual universal large convolution kernels. Multiple residual universal large convolution kernels and a small convolution kernel are cascaded to obtain a deep feature extraction module.
[0092] Exemplarily, this embodiment provides a schematic diagram of the structure of a residual universal large convolution kernel, such as Figure 5 As shown, the residual universal large convolution kernel includes six first universal large convolution kernels 501 and one small convolution kernel 502. The six first universal large convolution kernels 501 are cascaded to obtain a second universal large convolution kernel, and the second universal large convolution kernel is residually connected to the small convolution kernel.
[0093] Among them, the convolution kernel with a size less than or equal to 3×3 is a small convolution kernel.
[0094] The method for constructing a deep feature extraction module provided by the embodiment of the present disclosure combines each general large convolution kernel module with the Canny operator to obtain a first general large convolution kernel, then cascades multiple first general large convolution kernels, and sets the window attention mechanism at intervals in the first general large convolution kernel to obtain a second general large convolution kernel, then connects the second general large convolution kernel with the small convolution kernel residual to obtain a residual general large convolution kernel, and finally cascades multiple residual general large convolution kernels with a small convolution kernel to obtain a deep feature extraction module. Since the deep feature extraction module is constructed by using the window attention mechanism and multi-layer convolution kernels, the deep feature extraction module can realize feature extraction from local to global, so as to obtain more comprehensive image features.
[0095] Figure 6 FIG. 1 is a flow chart of a method for image reconstruction provided by the present application. Figure 6 As shown, the method for image reconstruction may include the following steps:
[0096] Step S601, obtaining an image to be reconstructed.
[0097] Specifically, the image to be reconstructed can be obtained from a sensor, an image acquisition device, or an image data set.
[0098] Step S602: input the image to be reconstructed into a preset shallow feature extraction module to obtain shallow features of the image to be reconstructed. The shallow feature extraction module includes a convolution layer.
[0099] The convolution kernel size of the convolution layer of the shallow feature extraction module is, for example, 3×3. Shallow features are usually directly extracted from the image to be reconstructed and have a lower level of abstraction. In this embodiment, shallow features are, for example, image edges, image color histograms, image textures, etc.
[0100] Step S603, inputting the image to be reconstructed into a deep feature extraction module to obtain deep features of the image to be reconstructed; the deep feature extraction module is constructed by the method for constructing a deep feature extraction module in the above-mentioned embodiment 1 or embodiment 3.
[0101] The deep features are gradually extracted by performing multi-layer nonlinear transformation on the image to be reconstructed through the deep feature extraction module, and have a higher level of abstraction. In this embodiment, the deep features are, for example, the shape and physical category of the object in the image.
[0102] Step S604: reconstruct the image according to the shallow features and the deep features.
[0103] Specifically, image reconstruction is performed based on shallow features and deep features, including: fusing shallow features and deep features to obtain global features, upsampling global features to obtain high-dimensional feature quantities, and reconstructing high-dimensional feature quantities to obtain super-resolution images.
[0104] By adopting the method for image reconstruction provided by the embodiment of the present disclosure, a more comprehensive image feature can be obtained by extracting features of the image to be reconstructed using a deep feature extraction module constructed by the method of the above embodiment 1 or 3, and at the same time, a shallow feature extraction module with only one convolution layer is used to extract shallow features of the image to be reconstructed, so that deep features and shallow features of the image to be reconstructed can be extracted. Finally, by using shallow features and more comprehensive deep features to reconstruct the image, a clearer super-resolution image can be obtained.
[0105] Figure 7 Schematic diagram of the structure of an image reconstruction system provided by this application. Figure 7 As shown, the image reconstruction system 700 includes an image acquisition module 701, a shallow feature extraction module 702, a deep feature extraction module 703 and an image reconstruction module 704. Specifically, the image acquisition module 701 is used to obtain the image to be reconstructed. The shallow feature extraction module 702 includes a convolution layer, and the shallow feature extraction module is used to extract shallow features of the image to be reconstructed. The deep feature extraction module 703 is used to extract deep features of the image to be reconstructed. The image reconstruction module 704 is used to reconstruct the image based on the shallow features and the deep features. Among them, the deep feature extraction module 703 is constructed based on the method for constructing the deep feature extraction module of Example 1 or Example 3.
[0106] The image reconstruction system provided in this embodiment can execute the method provided in the above method embodiment 6, and its implementation principle and technical effects are similar, which will not be described in detail in this embodiment.
[0107] Furthermore, the image reconstruction module includes: a feature fusion unit, an upsampling unit and a sub-pixel convolution layer. The feature fusion unit is used to fuse shallow features and deep features to obtain global features. The upsampling unit is used to upsample the global features to obtain high-dimensional feature quantities. The sub-pixel convolution layer is used to reconstruct the high-dimensional feature quantities to obtain a super-resolution image.
[0108] Figure 8 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 8 As shown, the electronic device 800 provided in this embodiment includes: at least one processor 801 and a memory 802. Optionally, the device 800 also includes a communication component 803. The processor 801, the memory 802 and the communication component 803 are connected via a bus.
[0109] In a specific implementation process, at least one processor 801 executes the computer-executable instructions stored in the memory 802, so that at least one processor 801 executes the above method.
[0110] The specific implementation process of the processor 801 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0111] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0112] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0113] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0114] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0115] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0116] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0117] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0118] The division of units is only a logical function division, and there may be other divisions 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 an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0119] 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.
[0120] In addition, each functional unit in each embodiment of the present invention 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.
[0121] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, 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. The computer software product is stored in a storage medium, including 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 of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0122] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0123] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for constructing a deep feature extraction module, characterized in that: include: Acquire multiple sample images; Using each of the sample images to train a plurality of preset initial image processing models to obtain a plurality of target image processing models, each of the initial image processing models comprising a plurality of parallel convolution kernels of different sizes; Re-parameterizing each of the target image processing models to obtain a plurality of general large convolution kernel modules; A deep feature extraction module is constructed based on the general large convolution kernel modules and Canny operators.
2. The method according to claim 1, characterized in that A deep feature extraction module is constructed based on the general large convolution kernel modules and the Canny operator, including: Combining each of the general large convolution kernel modules with the Canny operator respectively to obtain a plurality of first general large convolution kernels; Respectively cascading a first preset number of first general large convolution kernels, and setting a window attention mechanism in the cascaded first general large convolution kernels, to obtain a plurality of second general large convolution kernels; A deep feature extraction module is constructed according to each of the second general large convolution kernels and a third preset number of small convolution kernels.
3. The method according to claim 2, characterized in that A deep feature extraction module is constructed according to each of the second general large convolution kernels and a third preset number of small convolution kernels, including: Residually connecting each of the second universal large convolution kernels with each of the small convolution kernels to obtain a plurality of residual universal large convolution kernels; The multiple residual universal large convolution kernels and a small convolution kernel are cascaded to obtain a deep feature extraction module.
4. The method according to claim 2, characterized in that: The window attention mechanism is set in the first universal large convolution kernel of the cascade, including: In each first general large convolution kernel of the cascade, a window attention mechanism is set for each set number of first general large convolution kernels.
5. A method for image reconstruction, characterized in that: include: Acquire an image to be reconstructed; Inputting the image to be reconstructed into a preset shallow feature extraction module to obtain shallow features of the image to be reconstructed, wherein the shallow feature extraction module includes a convolution layer; Inputting the image to be reconstructed into a deep feature extraction module to obtain deep features of the image to be reconstructed; the deep feature extraction module is constructed according to the method for constructing a deep feature extraction module according to any one of claims 1 to 4; Image reconstruction is performed according to the shallow features and the deep features.
6. The method according to claim 5, characterized in that Performing image reconstruction according to the shallow features and the deep features includes: Performing feature fusion on the shallow features and the deep features to obtain global features; Performing an upsampling operation on the global feature to obtain a high-dimensional feature quantity; The high-dimensional feature quantity is reconstructed to obtain a super-resolution image.
7. An image reconstruction system, characterized in that: include: An image acquisition module, used for acquiring an image to be reconstructed; A shallow feature extraction module, comprising a convolution layer, wherein the shallow feature extraction module is used to extract shallow features of an image to be reconstructed; A deep feature extraction module, used to extract deep features of the image to be reconstructed; An image reconstruction module, used for performing image reconstruction according to the shallow features and the deep features; Wherein, the deep feature extraction module is constructed based on the method for constructing a deep feature extraction module according to any one of claims 1 to 4.
8. The image reconstruction system according to claim 7, characterized in that: The image reconstruction module comprises: A feature fusion unit, used for fusing the shallow features and the deep features to obtain global features; An upsampling unit, used to perform an upsampling operation on the global feature to obtain a high-dimensional feature quantity; The sub-pixel convolution layer is used to reconstruct the high-dimensional feature quantity to obtain a super-resolution image.
9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.
