Dynamic weight prediction-based bicubic interpolation image super-division reconstruction method

Through the combination of improved dynamic weight adjustment mechanism and lightweight convolutional neural network, the problem of limited reconstruction quality and high deep learning calculation cost is solved in traditional interpolation algorithms, efficient image super-resolution reconstruction is achieved, and the reconstruction quality and computing efficiency of edge areas are improved.

CN120510033APending Publication Date: 2025-08-19SOUTHWEAT UNIV OF SCI & TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510589577.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

Existing image super-resolution methods have irreconcilable contradictions in edge blur, texture detail loss and computing resource consumption. The reconstruction quality of traditional interpolation algorithms is limited, while deep learning methods are computationally expensive and difficult to deploy on real-time systems or resource-constrained devices.

Method used

By establishing a dynamic weight adjustment mechanism based on local contrast, improving the bicubital interpolation algorithm, combining lightweight convolutional neural networks, dynamically predicting the interpolation core weights, realizing image super-segment reconstruction, and adaptively adjusting the interpolation strategy to enhance the high contrast contribution of edge areas and suppress noise.

Benefits of technology

It significantly reduces the computational complexity and memory usage, improves image reconstruction quality, greatly reduces execution time and CPU time, while maintaining visual quality, and has better cross-domain generalization capabilities and edge continuity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120510033A_ABST
    Figure CN120510033A_ABST
Patent Text Reader

Abstract

The invention discloses a bicubic interpolation image super-resolution reconstruction method based on dynamic weight prediction, which relates to the technical field of image super-resolution, and is characterized in that a lightweight convolutional neural network is trained through an improved bicubic interpolation algorithm based on dynamic weight parameter adjustment to obtain a dynamic super-resolution model to realize image super-resolution reconstruction; according to the dynamic super-resolution model, a bicubic interpolation algorithm is improved by establishing a dynamic weight adjustment mechanism based on local contrast, so that an optimized prediction global weight matrix is obtained, contribution of a high-contrast direction is enhanced in an original low-resolution marginal region, noise is suppressed in a flat region, and the dynamic super-resolution model is obtained. And keeping the balance smoothness and details of the texture region. The invention provides a bicubic interpolation image super-division reconstruction method based on dynamic weight prediction, which converts a high-dimensional pixel generation task into a low-dimensional weight optimization problem and remarkably compresses the complexity of a model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image super-resolution, and more particularly to a bicubic interpolation image super-resolution reconstruction method based on dynamic weight prediction. Background Art

[0002] Image super-resolution (abbreviated as image super-resolution) technology aims to restore high-resolution details from low-resolution images and has important applications in fields such as medical imaging and satellite remote sensing. However, existing super-resolution methods are mainly divided into two major technical schools, each of which has the following irreconcilable contradictions:

[0003] On the one hand, traditional interpolation-based algorithms (such as bicubic interpolation and Lanczos resampling) rely on fixed mathematical formulas for pixel reconstruction. Although they are computationally efficient and have good hardware compatibility, they cannot adapt to image content, resulting in blurred restored edges and texture details and limited performance in objective indicators such as PSNR and SSIM. Specifically, traditional bicubic interpolation algorithms suffer from low quality after image super-resolution, namely:

[0004] 1. Edge blurring: Although the weight calculation based on the cubic spline function ensures continuity, it will produce an over-smoothing effect in the high-frequency edge area, resulting in loss of image details.

[0005] 2. Ringing artifacts: Because the algorithm uses an interpolation kernel with a fixed parameter (usually a = -0.5), non-physical oscillations may occur near strong-contrast edges. Texture distortion: The interpolation results lack adaptive capabilities for complex texture areas (such as fabrics and hair), resulting in broken texture structures or excessive smoothing.

[0006] On the other hand, deep learning-based end-to-end models (such as ESPCN) directly learn the mapping relationship from low resolution to high resolution through neural networks. Although the reconstruction quality is significantly improved, the huge computational overhead makes it difficult to deploy on real-time systems or resource-constrained edge devices. Specifically, deep learning models have the following problems: high computational overhead and low efficiency in end-to-end image super-resolution, namely:

[0007] 1. Computing resource consumption: A typical ESPCN model, when scaled 4x, requires 3-5GB of video memory for single-image inference. Using an RTX 4060 graphics card to process a 480P image takes over 6000ms, making it difficult to meet real-time requirements. In comparison, traditional interpolation algorithms only take 50-100ms.

[0008] 2. High hardware adaptation cost: Mobile deployment requires quantized compression models, resulting in a quality loss of approximately 15% after 8-bit integer quantization, and different chip platforms require separate optimization.

[0009] In recent years, although some studies have attempted to combine the advantages of traditional algorithms and deep learning, this type of "post-processing" hybrid method has not yet broken through the theoretical bottleneck of traditional interpolation algorithms and has failed to fundamentally solve the trade-off between efficiency and quality. Summary of the Invention

[0010] An object of the present invention is to solve at least the above problems and / or disadvantages and to provide at least the advantages which will be described hereinafter.

[0011] To achieve these objectives and other advantages of the present invention, a bicubic interpolation image super-resolution reconstruction method based on dynamic weight prediction is provided, wherein a lightweight convolutional neural network is trained by an improved bicubic interpolation algorithm based on dynamic weight parameter adjustment to obtain a dynamic super-resolution model to achieve image super-resolution reconstruction;

[0012] Among them, the dynamic super-resolution model improves the bicubic interpolation algorithm by establishing a dynamic weight adjustment mechanism based on local contrast to obtain an optimized prediction global weight matrix, thereby enhancing the contribution of high-contrast directions in the original low-resolution edge areas, suppressing noise in flat areas, and balancing smoothness and detail retention in texture areas.

[0013] Preferably, the process of performing image super-resolution reconstruction on a low-resolution image using the dynamic super-resolution model includes:

[0014] S1. For the collected low-resolution image, a dynamic super-resolution model is used to generate the local contrast optimization parameter σ corresponding to the interpolation kernel in the low-resolution image. 2 ;

[0015] S2, optimize parameter σ based on local contrast 2 Classify the interpolation area;

[0016] S3. Based on the classification results of the interpolation area, the corresponding brightness difference adjustment factor W is obtained. k , to achieve dynamic weight adjustment based on local contrast;

[0017] S4. Analyze the neighborhood pixel features by using a domain weighted approach and introduce a brightness difference adjustment factor W into the bicubic interpolation algorithm. k , realize the adaptive adjustment of the interpolation strategy and obtain the optimized prediction weight W final , and the prediction weight W final is one of the interpolation weights in the predicted global weight matrix Y;

[0018] S5. Complete the image super-resolution reconstruction by normalizing the global weight matrix Y;

[0019] Preferably, in S1, the local contrast optimization parameter σ2 Obtained by the following formula:

[0020]

[0021] In the above formula, i and j are the offsets of the neighborhood traversal, L is the brightness value of the corresponding pixel in the image, (x, y) is the coordinate of the corresponding pixel in the image, μ is the mean brightness, and μ is represented by the following formula:

[0022]

[0023] Preferably, in S2, the interpolation regions are classified as follows:

[0024] If σ 2 <10, the corresponding pixel in the image is determined to be a flat area;

[0025] If σ 2 >50, the corresponding pixel in the image is determined to be the edge area;

[0026] If 50>σ 2 >10, the corresponding pixel in the image is determined to be a texture area.

[0027] Preferably, in S3, the brightness difference adjustment factor W k The way to obtain is:

[0028] When σ 2 >50,

[0029] When σ 2 <10 o'clock,

[0030] When 50>σ 2 >10 o'clock,

[0031] In the above formula, when σ 2 When the value is >50, edge protection weight enhancement is required, where L c is the brightness of the center pixel, the brightness value of the currently processed pixel, L n is the neighborhood brightness reference value, which may be the neighborhood brightness mean or the brightness of a specific reference pixel. 2 When L<10, flat area noise suppression is required. c is the brightness value of the currently processed pixel, L n is the brightness value of the neighborhood pixels (or neighborhood mean).

[0032] Preferably, in S4, the prediction weight W final It is obtained by the following formula:

[0033] Wfinal =W base (dx)×W base (dy)×W k

[0034] In the above formula, W base (dx)×W base (dy) is the base weight of bicubic interpolation.

[0035] Preferably, the training set in the dynamic super-resolution model is generated by:

[0036] High-resolution image loading and tensor processing;

[0037] Generate a corresponding low-resolution image based on the high-resolution image;

[0038] Calculate the sub-pixel offset between the high-resolution image and the low-resolution image;

[0039] The basic weights of the bicubic interpolation algorithm are calculated based on the sub-pixel offset, and the optimized prediction weights W are generated based on the dynamic weight adjustment mechanism of local contrast. final ;

[0040] Based on the prediction weight W final The predicted global weight matrix Y is obtained, and the training images are generated and stored in a normalized manner.

[0041] Preferably, the dynamic super-resolution model adopts a dual-input architecture, processes low-resolution images and sub-pixel offsets simultaneously, and predicts 16-channel bicubic weights for image super-resolution reconstruction through a deep convolutional network;

[0042] The dynamic super-resolution model first uses 3×3 convolution to extract 32-channel feature maps from low-resolution images, and enhances feature expression capabilities through residual connections. All convolutional layers are padded to ensure size alignment.

[0043] The dynamic super-resolution model performs a 4x upsampling on the extracted feature map through a transposed convolution with a stride of 4, and uses an attention mechanism to generate a spatial weight map. The spatial weight map is multiplied with the upsampled feature map to achieve adaptive enhancement and obtain image features.

[0044] The dynamic super-resolution model projects the offset input into 16 channels through 1×1 convolution and concatenates it with the image features. Finally, it outputs 16-channel weights through 3×3 convolution and tanh activation.

[0045] Preferably, the dynamic super-resolution model is trained using the Adam optimizer, and the initial learning rate is set to 3e -4 ;

[0046] The gradient norm of the Adam optimizer is limited to 10, and the batch size is set to 16;

[0047] When training with the Adam optimizer, a learning rate warm-up mechanism is used to ensure stability in the initial stage of training. The learning rate warm-up mechanism means maintaining a constant learning rate in the first 5 epochs, and then gradually reducing the learning rate to 1e using a cosine annealing strategy. -3 ;

[0048] During Adam optimizer training, the loss function and MAE indicators are monitored. When the MAE of the validation set decreases by less than 0.1% for five consecutive epochs, the early stopping mechanism is triggered and the model automatically rolls back to the weight checkpoint with the optimal validation indicator.

[0049] The present invention has at least the following beneficial effects: Compared with the prior art, the present invention has the following effects in terms of workflow, performance advantages, and quality advantages:

[0050] First, from a process perspective, the present invention transforms the high-dimensional pixel generation task into a low-dimensional weight optimization problem through parameter decoupling design, significantly compressing the model complexity. At the same time, it uses the geometric constraints of the interpolation algorithm to maintain the stability of the reconstruction process. While maintaining visual quality comparable to that of traditional deep learning models, it achieves a step-by-step improvement in inference efficiency and exhibits better cross-domain generalization capabilities and edge continuity preservation characteristics.

[0051] Second, in terms of performance advantages, the execution time of the proposed method is 82% lower than that of the ESPCN model (82,112ms), and the memory usage is 78% lower than that of the VGG-16 hybrid solution (356MB). The CPU time is reduced by 21.8% compared with Lanczos interpolation.

[0052] Third, in terms of quality advantages, the PSNR index of the proposed method is 2.56dB higher than that of the traditional bicubic interpolation (26.03dB); the SSIM index is better than all traditional methods (bicubic 0.9874 / Lanczos 0.9891) and close to ESPCN (0.9993); the mean square error index is reduced by 83.5% compared with bicubic interpolation (MSE 1,024.6).

[0053] Other advantages, objectives and features of the present invention will be reflected in part from the following description and will be understood by those skilled in the art through study and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 Schematic diagram comparing the workflow of the present invention and the prior art;

[0055] Figure 2A schematic diagram of the training set weight features and bias generation of the present invention;

[0056] Figure 3 A comparison chart of memory usage between the present invention and the prior art;

[0057] Figure 4 This is a comparison chart of CPU time consumption between the present invention and the prior art;

[0058] Figure 5 A comparison chart of execution time indicators of the present invention and the prior art;

[0059] Figure 6 This is a comparison chart of PSNR indicators between the present invention and the prior art;

[0060] Figure 7 This is a comparison chart of the SSIM indicators of the present invention and the prior art;

[0061] Figure 8 This is a comparison chart of the MSE mean square error between the present invention and the prior art;

[0062] Figure 9 This is a model architecture diagram of the present invention;

[0063] Figure 10 This is a comparison chart of super-resolved image details in different scenarios and different schemes using the method of the present invention. DETAILED DESCRIPTION

[0064] The present invention will be described in further detail below in conjunction with the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.

[0065] In the present invention, the bicubic interpolation image super-resolution reconstruction method based on dynamic weight prediction mainly involves: optimization of the traditional bicubic interpolation algorithm, lightweight neural network design and super-resolution image reconstruction technology, which is used to solve the contradiction between the limited reconstruction quality of the traditional interpolation algorithm and the high computational cost of the deep learning method in the existing super-resolution method. Specifically, through an improved adaptive bicubic interpolation method based on dynamic weight prediction, a lightweight convolutional neural network is used to learn the nonlinear mapping relationship between the local features of the image and the interpolation weights, and a lightweight convolutional neural network is used to dynamically predict the adaptive correction amount of the interpolation kernel function, so as to deeply integrate the deep learning method with the traditional interpolation algorithm. This improved method has significant advantages in scenarios with high real-time requirements and low-end devices.

[0066] Specifically, the technical route of the bicubic interpolation image super-resolution reconstruction method based on dynamic weight prediction of the present invention mainly includes: an improved bicubic interpolation algorithm scheme based on dynamic weight adjustment of pixel contrast and an indirect processing scheme through model prediction weight;

[0067] Among them, the improved bicubic interpolation algorithm scheme that dynamically adjusts weights based on pixel contrast is aimed at the problems of blurred edges, loss of texture details, and artifacts in image reconstruction caused by the traditional bicubic interpolation algorithm. This patent proposes an improved algorithm that dynamically adjusts bicubic interpolation weights based on pixel contrast to solve the problems of blurred edges and artifacts in the traditional bicubic interpolation algorithm.

[0068] 1. The core idea of the improved bicubic interpolation algorithm is: Compared with the traditional bicubic interpolation algorithm, the core improvement of this solution lies in establishing a dynamic weight adjustment mechanism based on local contrast. By analyzing the characteristics of pixel neighborhoods, the interpolation strategy can be adaptively adjusted. Specifically, it includes three key technologies:

[0069] ① Region type discrimination: Based on the calculation of the brightness variance of pixels in a 5×5 neighborhood, the interpolation area is divided into three categories: edge (high variance), flat (low variance) and texture (medium variance).

[0070] ② Dynamic weight adjustment: Based on the traditional bicubic interpolation weights, the weights are dynamically modified by the brightness difference factor, enhancing the contribution of high-contrast directions in edge areas, suppressing noise in flat areas, and balancing smoothness and detail preservation in textured areas.

[0071] ③Calculation process optimization: Brightness pre-calculation, weight cache reuse and boundary constraint technology are used to reduce calculation complexity while ensuring interpolation accuracy, achieving efficient real-time processing.

[0072] 2. Improved bicubic interpolation steps include:

[0073] ① Coordinate mapping: Establish a floating-point coordinate mapping relationship from output pixels to input images

[0074] ② Region classification: edge / flat / texture region detection through 5x5 neighborhood variance analysis

[0075] ③ Dynamic weight adjustment:

[0076] 1) Edge area: Strengthen the weight of high contrast direction

[0077] 2) Flat area: suppressing noise interference

[0078] 3) Textured area: balancing smoothness and detail

[0079] ④Computational optimization:

[0080] 1) Precalculate brightness data to avoid repeated conversion

[0081] 2) Cubic spline weight cache reduces repeated calculations

[0082] 3) Boundary constraints (clamp) prevent out-of-bounds access

[0083] 3. The core formulas of the improved bicubic interpolation algorithm include:

[0084] ① Local contrast analysis formula:

[0085]

[0086] In the above formula, L is the brightness value of the corresponding pixel in the image, i and j are the offsets of the field traversal, L is the brightness value of the corresponding pixel in the image, (x, y) is the coordinate of the corresponding pixel in the image, μ is the mean brightness, and if σ 2 <10, the corresponding pixel in the image is determined to be a flat area; if σ 2 >50, the corresponding pixel in the image is determined to be the edge area; if 50>σ 2 >10, the corresponding pixel in the image is determined to be a texture area.

[0087] ②Dynamic weight adjustment formula

[0088] It should be noted that the traditional bicubic interpolation formula is:

[0089]

[0090] W final =W base (dx)×W base (dy)

[0091] The improved dynamic bicubic interpolation formula proposed in the present invention is:

[0092]

[0093] In the above formula, when σ 2 When the value is greater than 50, edge protection weight enhancement is required, where L c is the brightness of the center pixel, the brightness value of the currently processed pixel, L n is the neighborhood brightness reference value, which may be the neighborhood brightness mean or the brightness of a specific reference pixel. 2 When L<10, flat area noise suppression is required. c is the brightness value of the currently processed pixel, L n is the brightness value of the neighborhood pixels or the neighborhood mean.

[0094] Furthermore, an indirect processing scheme using model prediction weights is as follows: the traditional deep learning super-resolution scheme directly converts low-resolution images into high-resolution images end-to-end. Although the quality of the generated images is high, the high computational cost is caused by the complex network structure. This patent abandons the traditional end-to-end direct super-resolution processing scheme and adopts a compromise solution, which combines the improved bicubic interpolation algorithm with the model. The model only generates the intermediate weights corresponding to the improved bicubic interpolation algorithm, rather than directly generating the super-resolution image. The super-resolution image is reconstructed after the weights are obtained.

[0095] 1. Specific principles of weight prediction through model: This solution innovatively combines traditional interpolation algorithms with deep learning to construct a two-stage architecture of weight prediction and interpolation reconstruction.

[0096] ① First, a lightweight convolutional neural network is trained to learn and improve the dynamic weight parameters (including regional classification thresholds, brightness difference adjustment factors, etc.) in the bicubic interpolation algorithm. After inputting a low-resolution image, the model outputs the local contrast optimization parameters of the interpolation kernel (rather than directly generating pixels).

[0097] ② Then in the reconstruction stage, the predicted weights are substituted into the improved bicubic interpolation algorithm to complete super-resolution reconstruction.

[0098] This principle simplifies the tens of millions of pixels generated by traditional end-to-end models into a thousand-dimensional parameter prediction problem through weight parameterized dimensionality reduction. It uses the geometric constraints of the interpolation algorithm itself to reduce the complexity of model learning, while maintaining the quality of super-resolution and reducing the amount of computation to 50% of traditional deep learning.

[0099] 2. To illustrate the difference between the present invention and the existing technology (i.e., the traditional end-to-end model solution), the differences between the present invention and the existing technology are explained from three aspects: workflow, performance advantages, and quality advantages:

[0100] 1. Comparison between the traditional model and the patented model process: Figure 1As shown in the figure, traditional end-to-end super-resolution models directly generate high-resolution pixels through end-to-end mapping. Although they pursue lightweight parameter design, they still need to build a complete feature calculation graph, which has inherent bottlenecks such as high video memory usage and large computational redundancy. This paper innovatively proposes a "weight learning-physical reconstruction" collaborative framework, focusing the representational power of deep learning on optimizing the core parameter space of traditional interpolation algorithms. Through a lightweight network, it dynamically predicts the adaptive correction amount of the interpolation kernel function. On the basis of inheriting the efficient computational flow of traditional algorithms, it introduces data-driven spatial adaptation features. Through parameter decoupling design, this method transforms the high-dimensional pixel generation task into a low-dimensional weight optimization problem, significantly compressing the model complexity. At the same time, it uses the geometric constraints of the interpolation algorithm to maintain the stability of the reconstruction process. While maintaining visual quality comparable to traditional deep learning models, it achieves a step-by-step improvement in inference efficiency and exhibits superior cross-domain generalization capabilities and edge continuity preservation characteristics.

[0101] 2. Performance advantages

[0102] (1) From the comparison of execution time: Figure 3 As shown in the figure, the average execution time for a single image on an Intel Core i5-13400k CPU is 14,782ms, an 82% reduction from the ESPCN model (82,112ms), significantly outperforming deep learning solutions. Its processing time is between that of traditional bicubic interpolation (9,345ms) and the Lanczos algorithm (18,902ms). By leveraging a dynamic weight prediction mechanism, it maintains the efficiency of traditional algorithms while ensuring quality, demonstrating the effectiveness of lightweight networks in optimizing computational efficiency. Execution time comparison:

[0103] (2) From the perspective of memory comparison: Figure 4 As shown, the model memory usage is only 77.41MB, which is 30% of ESPCN (259.32MB) and 78% lower than the VGG-16 hybrid solution (356MB). By streamlining the network structure (lightweight CNN + residual connections) and parameter sharing design, the model size is compressed to one-third of traditional deep learning while maintaining 16-dimensional weight prediction capabilities, meeting the deployment requirements of edge devices.

[0104] (3) From the comparison of CPU time consumption: Figure 5 As shown, CPU-side inference time is 82% lower than ESPCN (14,782ms vs 82,112ms) and 21.8% lower than Lanczos interpolation. Its core optimization eliminates computational redundancy in end-to-end pixel reconstruction, requiring only a single 4x4 neighborhood weighted calculation. This reduces FLOPs by 95% compared to ESPCN, validating the engineering effectiveness of the algorithm framework's fusion strategy.

[0105] 3. Quality advantage

[0106] (1) From the perspective of PSNR comparison: Figure 6 As shown in Figure 2, on the DIV2K test set, this method achieves a PSNR of 28.59dB, approaching ESPCN (30.6dB) and 2.56dB higher than traditional bicubic interpolation (26.03dB). Its dynamic weight prediction mechanism effectively captures local texture features, improving PSNR by up to 6.2dB in edge regions (such as building outlines), surpassing the theoretical performance limit of fixed-weight interpolation.

[0107] (2) From the perspective of SSIM comparison: Figure 7 As shown in the figure, the SSIM index is 0.999, which is better than all traditional methods (Bicubic 0.9874 / Lanczos 0.9891) and close to ESPCN (0.9991). The improvement in structural similarity is mainly reflected in the ability to preserve high-frequency details, such as the continuity of text strokes (SSIM local peak 0.9997) and the consistency of natural textures (SSIM>0.998 in vegetation areas).

[0108] (3) Comparison from mean square error: Figure 8 As shown, the reconstructed image has an MSE of 169.18, an 83.5% reduction compared to bicubic interpolation (MSE 1,024.6) and close to ESPCN (MSE 152.3). Error distribution analysis shows that the improvement is concentrated in high-frequency regions (edge / texture MSE reduction of 89%), verifying the dynamic weights' ability to adaptively correct interpolation errors in a spatial manner.

[0109] Example:

[0110] This paper uses node and tensoflow.js for code writing and is tested on i5-13400f and RTX40608G devices. Its specific implementation can be described from six aspects: improved bicubic interpolation implementation, training set generation, training set verification, model architecture design, model parameter tuning, and model testing.

[0111] 1. Improved bicubic interpolation implementation

[0112] (1) Loading the input image

[0113] ① Load the input image

[0114] 1) Use the sharp library to read the low-resolution image specified by LR_IMAGEPATH.

[0115] 2) Get the original image data (data) and meta information (info), including width, height and number of channels (RGBA four channels).

[0116] ② Brightness data pre-calculation

[0117] 1) Convert RGB pixels to brightness values (lumaData array) using the following formula: luma = R*0.2126+G*0.7152+B*0.0722.

[0118] 2) Pre-generate brightness data of the entire image for subsequent contrast analysis.

[0119] ③ Weight function initialization

[0120] 1) Define a buffered cubicWeight function to calculate the cubic spline weight based on the distance.

[0121] 2) Use parameter a=-0.5 to cache the calculation results to optimize performance.

[0122] (2) Spatial adaptive interpolation core logic

[0123] ① Local contrast analysis

[0124] 1) For each center pixel (centerX, centerY), analyze the brightness variance within the 5x5 neighborhood.

[0125] 2) Calculate statistics

[0126] a.sum: total brightness;

[0127] b.sumSq: sum of squares of brightness;

[0128] c.Count: the total number of pixels in the neighborhood;

[0129] d.variance: variance = (sumSq-sum 2 / count) / count;

[0130] 3) Classification area type

[0131] a. Flat area (variance < 10);

[0132] b. Marginal area (variance>50);

[0133] c. Normal texture area;

[0134] ②Dynamic weight adjustment

[0135] 1) Flat area: Suppress noise through the noiseSuppress coefficient (coefficient range [0.5, 1]);

[0136] 2) Edge area: Enhance edge sharpness through edgePreserveFactor (coefficient range [1.0, 1.5]);

[0137] 3) Ordinary area: Calculate the similarity coefficient (exp(-lumaDiff / 20)) based on the brightness difference lumaDiff;

[0138] ③4×4 domain weighted calculation

[0139] 1) Traverse each high-resolution pixel and calculate its mapping position (ox,oy) in the low-resolution image;

[0140] 2) Locate the 4x4 neighborhood;

[0141] 3) For 16 pixels in the neighborhood:

[0142] a. Calculate the basic weight:

[0143] weight=cubicWeight(dx)*cubicWeight(dy)

[0144] b. Dynamically adjust the weight according to the region type (getAdaptiveWeight method);

[0145] c. Accumulate the weighted values of the RGBA channels and calculate the total weight weightSum;

[0146] (3) Result generation and post-processing

[0147] ① Normalized output

[0148] Perform weighted averaging of the RGBA channel values of each high-resolution pixel:

[0149] 1) channel=∑(channel*weight) / weightSum;

[0150] 2) Round off to get the final pixel value (Math.round);

[0151] ②Image saving

[0152] 1) Use the canvas library to convert the processed ImageData into PNG format;

[0153] 2) Write the path specified by REBUILD_HR_IMAGEPATH through the sharp library and set the PNG quality to 100;

[0154] ③Performance monitoring

[0155] 1) Use console.time to record the time taken during the interpolation phase;

[0156] 2) Comparing the performance of calling the pc() function with ESPCN and other methods;

[0157] 2. Training set generation

[0158] (1) High-resolution image loading and alignment

[0159] ①Size alignment processing

[0160] 1) Use the sharp library to load the HR image and force it to convert to RGBA four-channel format;

[0161] 2) Align the image size to an integer multiple of the scaling factor (e.g. 1024x1024 → 1024x1024);

[0162] 3) Crop excess pixels on the edge to ensure divisibility;

[0163] ②Tensor quantization

[0164] 1) If Figure 2 As shown, the pixel data is converted into a TensorFlow.js tensor ([H_hr, W_hr, 4]);

[0165] 2) Normalize pixel values to the range [0,1] (suffix .div(255.0));

[0166] (2) Low-resolution image generation

[0167] ① Bicubic downsampling

[0168] 1) Use sharp's kernel.cubic for accurate downsampling;

[0169] 2) The output size is [H_hr / SCALE_FACTOR, W_hr / SCALE_FACTOR];

[0170] ② Luminance map pre-calculation

[0171] ③ As shown in the following formula, the brightness image is calculated based on the BT.709 standard:

[0172] 0.2126*R+0.7152*G+0.0722*B

[0173] (3) Sub-pixel offset calculation

[0174] ① Coordinate mapping formula:

[0175]

[0176] In the above formula, x lr is the floating point column coordinate (including sub-pixel offset) in the corresponding low-resolution image, xhr is the column coordinate in the high-resolution image, y lr is the floating-point row coordinate (including sub-pixel offset) in the corresponding low-resolution image, y hr is the row coordinate in the high-resolution image, SCALE F ACTOR is the super-resolution scaling factor;

[0177] ②Offset calculation:

[0178]

[0179] In the above formula, dx is the sub-pixel offset in the column direction, and dy is the sub-pixel offset in the row direction, which is used for the weight calculation of bicubic interpolation;

[0180] ③Data storage: such as Figure 2 As shown, the 16-bit weight pixel distribution (red dot) is determined according to the sub-pixel offset position dx and dy, and the [H_sr, W_sr, 2] tensor is generated to store (dx, dy).

[0181] (4) Weight generation

[0182] ① Basic bicubic weights

[0183] 1) Calculate the 4x4 neighborhood weight using a cubic spline function with parameter a = -0.5

[0184] 2) Normalize to ensure the weights sum to 1 (fill with zeros if the sum is 0)

[0185] ②Adaptive weight adjustment

[0186] 1) Edge area: Enhance similar pixel weight (1.0+0.5*(1-lumaDiff / 0.3))

[0187] 2) Flat area: Suppress noise (max(0.7,1-lumaDiff / 0.2))

[0188] 3) Texture area: medium enhancement (0.8+0.4*exp(-lumaDiff / 0.15))

[0189] ③ Final weight synthesis: basic weight × adaptive factor → normalization

[0190] 3. Training set verification. After obtaining the training set, it is also necessary to verify the training set. The verification process is as follows:

[0191] (1) Loading data and metadata

[0192] ① Read header information (height, width, number of channels) and floating-point data from a binary file (.bin) and convert them into TensorFlow.js tensors.

[0193] ② Load the sample shape information (such as H_lr, W_sr, etc.) pre-stored in metadata.json.

[0194] (2) Shape matching verification

[0195] ① Check whether the actual shape of X (low-resolution image), offset (offset), and Y (weight) is consistent with the metadata.

[0196] ② Ensure that the number of channels meets the expected value (X is 4-channel RGBA, offset is 2-channel, and Y is 16-channel).

[0197] (3) Numerical range verification

[0198] ①Offset: Check whether the values of dx and dy are within a reasonable range (usually [-0.5, 0.5]).

[0199] ②Weight (Y): Verify whether the weight value is within the reasonable range of bicubic interpolation (such as [-0.75, 2.0]).

[0200] (4) Machine sampling verification: Randomly select an image position and check whether the offset (dx, dy) at that position complies with the sub-pixel offset logic and whether the sum of the 16 weights is close to 1 (error < 0.01), ensuring that the bicubic interpolation weights are normalized.

[0201] 4. Model architecture design: Figure 9 As shown in the figure, our dynamic super-resolution model adopts a dual-input architecture, processing both a low-resolution image (4-channel RGBA) and a sub-pixel offset (2-channel). A deep convolutional network predicts 16-channel bicubic weights for image reconstruction. The model first extracts 32-channel features using 3×3 convolutions and enhances feature representation through residual connections. All convolutional layers use "same" padding to ensure size alignment. The feature map is upsampled by a factor of 4 using a transposed convolution with a stride of 4. An attention mechanism (1×1 convolution + sigmoid activation) is used to generate a spatial weight map, which is multiplied with the upsampled features for adaptive enhancement. The offset input is projected to 16 channels via a 1×1 convolution and concatenated with the image features. Finally, a 3×3 convolution and tanh activation are performed to output 16-channel weights.

[0202] The key to model design is:

[0203] (1) Strictly keep the spatial dimensions of each layer aligned;

[0204] (2) Transposed convolution accurately achieves 4x upsampling;

[0205] (3) Deep fusion of features and offsets;

[0206] (4) Glorot initialization ensures training stability.

[0207] This architecture not only retains the theoretical basis of traditional bicubic interpolation, but also automatically learns the weight distribution of complex textures through deep learning. It can adapt to super-resolution tasks under different scaling factors, improve reconstruction quality while maintaining computational efficiency, and is particularly suitable for dealing with non-integer super-resolution problems.

[0208] 5. Model parameter tuning: During the model training process, we designed a complete set of parameter optimization strategies to ensure that the model can converge efficiently and stably. The model training uses the Adam optimizer, and the initial learning rate is set to 3e -4 , this value has been verified by grid search to achieve the best balance between convergence speed and final accuracy. To avoid instability in the early stages of training, we implemented a learning rate warm-up mechanism, maintaining a constant learning rate in the first 5 epochs, and then gradually reducing the learning rate to 1e using a cosine annealing strategy. -3 This scheduling method can effectively prevent the model from falling into local optimality. Taking into account hardware resource limitations, the batch size is set to 16. This value ensures that the GPU memory utilization rate reaches more than 90% while also providing sufficient gradient diversity. During the training process, the loss function and MAE indicators are monitored. When the MAE of the validation set decreases by less than 0.1% for 5 consecutive epochs, the early stopping mechanism is triggered and the model automatically rolls back to the weight checkpoint with the optimal validation indicator. We have also implemented dynamic gradient clipping technology to limit the gradient norm to within 10, effectively preventing the gradient explosion problem during training. All training indicators are recorded and visualized in real time, including key data such as the loss value, MAE and time consumption of each batch, providing a complete basis for subsequent tuning analysis.

[0209] 6. Model Testing: The trained model was then tested to verify its ability to generate bicubic interpolation weights sufficient for super-resolution reconstruction. As shown in Table 1, by sampling the 16-bit predicted weights corresponding to the center point and comparing them with the true weights, it was found that the average difference between the model and the true weights at non-zero locations was only 0.86%.

[0210] Table 1

[0211]

[0212]

[0213] Verification Example

[0214] In order to prove the feasibility of this solution, we conducted a super-resolution experiment based on this solution. In terms of data set preparation, we extracted 10 pictures from DIV2K_valid. These 10 pictures cover natural scenes, man-made objects, and complex textures, and are widely representative. The following 4 pictures are examples. It can be seen that the traditional interpolation algorithms in the first group of pictures have edge blurring and obvious jagged problems, and the traditional interpolation algorithms in the second group of pictures have artifact problems. Our solution perfectly solves the problems of bicubic interpolation artifacts and obvious jaggedness. The comparison of super-resolution image details in different scenes and different solutions is as follows: Figure 10 As shown ( Figure 10 In the figure, the blue boxes are the local contrast areas selected for each image, the black boxes represent the obvious jagged areas that appear in the super-resolution images using traditional algorithms (such as the nearest neighbor interpolation algorithm, bilinear interpolation algorithm, and bicubic interpolation algorithm), and the orange boxes represent the obvious artifact areas that appear in the super-resolution images using traditional algorithms). Figure 10 It can be seen that this solution effectively solves the problems of obvious aliasing and regional artifacts in traditional algorithms.

[0215] The above solution is only an illustration of a preferred embodiment, but is not limited thereto. When implementing the present invention, appropriate replacements and / or modifications can be made according to user needs.

[0216] Although the embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and exemplary embodiments. They can be applied to a variety of fields suitable for the present invention. Further modifications will be readily apparent to those skilled in the art. Therefore, the present invention is not limited to the specific details and illustrations shown and described herein without departing from the general concept defined by the claims and their equivalents.

Claims

1. A bicubic interpolation image super-resolution reconstruction method based on dynamic weight prediction, characterized in that: The lightweight convolutional neural network is trained by an improved bicubic interpolation algorithm based on dynamic weight parameter adjustment to obtain a dynamic super-resolution model to achieve image super-resolution reconstruction; Among them, the dynamic super-resolution model improves the bicubic interpolation algorithm by establishing a dynamic weight adjustment mechanism based on local contrast to obtain an optimized prediction global weight matrix, thereby enhancing the contribution of high-contrast directions in the original low-resolution edge areas, suppressing noise in flat areas, and balancing smoothness and detail retention in texture areas.

2. The method for super-resolution image reconstruction based on bicubic interpolation and dynamic weight prediction according to claim 1, wherein: The process of using the dynamic super-resolution model to perform image super-resolution reconstruction on a low-resolution image includes: S1. For the collected low-resolution image, a dynamic super-resolution model is used to generate the local contrast optimization parameter σ corresponding to the interpolation kernel in the low-resolution image. 2 ; S2, optimize parameter σ based on local contrast 2 Classify the interpolation area; S3. Based on the classification results of the interpolation area, the corresponding brightness difference adjustment factor W is obtained. k , to achieve dynamic weight adjustment based on local contrast; S4. Analyze the neighborhood pixel features by using a domain weighted approach and introduce a brightness difference adjustment factor W into the bicubic interpolation algorithm. k , realize the adaptive adjustment of the interpolation strategy and obtain the optimized prediction weight W final , and the prediction weight W final is one of the interpolation weights in the predicted global weight matrix Y; S5. Complete the image super-resolution reconstruction by normalizing the global weight matrix Y.

3. The method for super-resolution image reconstruction based on bicubic interpolation and dynamic weight prediction according to claim 2, wherein: In S1, the local contrast optimization parameter σ 2 Obtained by the following formula: In the above formula, i and j are the offsets of the neighborhood traversal, L is the brightness value of the corresponding pixel in the image, (x, y) is the coordinate of the corresponding pixel in the image, μ is the mean brightness, and μ is represented by the following formula:

4. The method for super-resolution image reconstruction based on bicubic interpolation and dynamic weight prediction according to claim 3, wherein: In S2, the interpolation area is classified as follows: If σ 2 <10, the corresponding pixel in the image is determined to be a flat area; If σ 2 >50, the corresponding pixel in the image is determined to be the edge area; If 50>σ 2 >10, the corresponding pixel in the image is determined to be a texture area.

5. The method for super-resolution image reconstruction based on bicubic interpolation and dynamic weight prediction according to claim 3, wherein: In S3, the brightness difference adjustment factor W k The way to obtain is: When σ 2 >50, When σ 2 <10 o'clock, When 50>σ 2 >10 o'clock, In the above formula, when σ 2 When the value is >50, edge protection weight enhancement is required. c is the center pixel brightness, L n is the neighborhood brightness reference value, when σ 2 When L<10, noise suppression in the flat area is required. c is the brightness value of the currently processed pixel, L n is the brightness value of the neighboring pixels.

6. The method for super-resolution image reconstruction based on bicubic interpolation and dynamic weight prediction according to claim 1, wherein: In S4, the prediction weight W final It is obtained by the following formula: W final =W base (dx)×W base (dy)×W k In the above formula, W base (dx)×W base (dy) is the base weight of bicubic interpolation.

7. The method for super-resolution image reconstruction based on bicubic interpolation and dynamic weight prediction according to claim 1, wherein: The generation method of the training set in the dynamic super-resolution model includes: High-resolution image loading and tensor processing; Generate a corresponding low-resolution image based on the high-resolution image; Calculate the sub-pixel offset between the high-resolution image and the low-resolution image; The basic weights of the bicubic interpolation algorithm are calculated based on the sub-pixel offset, and the optimized prediction weights W are generated based on the dynamic weight adjustment mechanism of local contrast. final ; Based on the prediction weight W final The predicted global weight matrix Y is obtained, and the training images are generated and stored in a normalized manner.

8. The method for super-resolution image reconstruction based on bicubic interpolation and dynamic weight prediction according to claim 1, wherein: The dynamic super-resolution model adopts a dual-input architecture to process low-resolution images and sub-pixel offsets simultaneously, and predicts 16-channel bicubic weights for image super-resolution reconstruction through a deep convolutional network; The dynamic super-resolution model first uses 3×3 convolution to extract 32-channel feature maps from low-resolution images, and enhances feature expression capabilities through residual connections. All convolutional layers are padded to ensure size alignment. The dynamic super-resolution model performs a 4x upsampling on the extracted feature map through a transposed convolution with a stride of 4, and uses an attention mechanism to generate a spatial weight map. The spatial weight map is multiplied with the upsampled feature map to achieve adaptive enhancement and obtain image features. The dynamic super-resolution model projects the offset input into 16 channels through 1×1 convolution and concatenates it with the image features. Finally, it outputs 16-channel weights through 3×3 convolution and tanh activation.

9. The method for super-resolution image reconstruction based on bicubic interpolation and dynamic weight prediction according to claim 1, wherein: The dynamic super-resolution model is trained using the Adam optimizer, and the initial learning rate is set to 3e -4 ; The gradient norm of the Adam optimizer is limited to 10, and the batch size is set to 16; When training with the Adam optimizer, a learning rate warm-up mechanism is used to ensure stability in the initial stage of training. The learning rate warm-up mechanism means maintaining a constant learning rate in the first 5 epochs, and then gradually reducing the learning rate to 1e using a cosine annealing strategy. -3 ; During Adam optimizer training, the loss function and MAE indicators are monitored. When the MAE of the validation set decreases by less than 0.1% for five consecutive epochs, the early stopping mechanism is triggered and the model automatically rolls back to the weight checkpoint with the optimal validation indicator.

Citation Information

Cited By

  • Root increasing container seedling culture state monitoring method and system

    CN121458810A