Chinese character image super-resolution reconstruction method and system based on diffusion model
Through the super-resolution reconstruction method of Chinese character images based on diffusion model, the conditional denoising diffusion model and multi-scale large-core attention mechanism are used to solve the problem of blurred details and insufficient generalization capabilities in super-resolution reconstruction of Chinese character images, high-quality Chinese character image restoration is achieved, and the reliability of steganography technology and cultural heritage reconstruction support is improved.
Patent Information
- Application Number
- CN202510642750.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-19
AI Technical Summary
The prior art has problems such as blurred details, insufficient generalization ability and insufficient semantic information utilization in super-resolution reconstruction of Chinese characters. Especially under low resolution conditions, the subpixel-level deformation characteristics of Chinese characters' strokes are easily lost, resulting in a decrease in the accuracy of steganographic information extraction, and structural distortions such as stroke adhesion and fracture in the reconstruction image.
The super-resolution reconstruction method of Chinese character images based on diffusion model is adopted. By constructing a Chinese steganographic image dataset, combining a multi-scale large-core attention mechanism and a staged sampling strategy, a conditional denoising diffusion model is designed, and high-resolution images are gradually restored from low-resolution images. The noise injection and residual connection architecture are used to optimize the noise prediction network and multi-scale feature extraction to improve the reconstruction effect.
It significantly improves the quality of super-resolution reconstruction of Chinese character images, enhances the reliability and practicality of steganography technology, can effectively repair low-resolution Chinese character images, and supports the digitization of cultural heritage such as oracle bone restoration and calligraphy inheritance.
Smart Images

Figure CN120510034A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing and deep learning technology, and in particular relates to a Chinese character image super-resolution reconstruction method and system based on a diffusion model, which is applied to the field of information hiding. Background Art
[0002] Steganography, based on fine-tuning the structure of Chinese characters, is a widely used digital watermarking technique in the field of information hiding, primarily used in information security scenarios such as leak tracing. Information hiding is a key research area in information security. Text steganography, a key branch of steganography that uses text as a carrier of information, plays a key role in copyright protection, data tracing, and covert communication.
[0003] Techniques based on Chinese character stroke fine-tuning embed steganographic information into text by finely controlling the geometric features of the strokes, achieving high-capacity information embedding while maintaining visual consistency. However, as text displays face issues such as reduced resolution, anti-aliasing, and sensor noise, the sub-pixel deformation features of Chinese character strokes are easily lost, significantly reducing the accuracy of steganographic information extraction and severely limiting the practicality of this technique in low-quality text scenarios.
[0004] Traditional algorithms use a global homogenization processing strategy, which fails to effectively decouple the frequency domain coupling relationship between the deformation characteristics of Chinese characters and the degradation noise. The sub-pixel displacement effect generated by the anti-aliasing algorithm when smoothing the edges, and the random superposition of sensor noise in the stroke turning area, together lead to the destruction of the spectral characteristics of key geometric features (such as the stroke intersection angle and the curvature of the pen tip). This interference is particularly significant in steganographic scenarios. The micro-deformation signal introduced by the stego coding and the degradation noise form a composite degradation pattern under low-resolution conditions. Traditional models, due to the lack of prior knowledge of the Chinese character structure, often misjudge effective deformation features as noise and suppress them. For example, the global interpolation algorithm will blur the topological constraint relationship between components, and the statistical-based texture synthesis strategy is difficult to maintain the coherence of strokes, which ultimately leads to structural distortion such as stroke adhesion and fracture in the reconstructed image, which seriously deviates from the original deformation setting of the stego coding.
[0005] Although deep learning frameworks have made breakthroughs in feature decoupling capabilities, their architecture design still has inherent defects that are not compatible with the characteristics of Chinese characters. The current mainstream convolutional neural network (CNN) is limited by the local receptive field mechanism and is difficult to model the long-range dependence relationship between strokes, resulting in spatial relationship misalignment in the reconstruction of complex components (such as the multiple nested structure of the character "Xin"). While generative adversarial networks (GANs) improve visual quality through adversarial training, the high-frequency detail reconstruction process is easily affected by homogenization processing, causing the micro-angle offset features in the stroke intersection area to be over-smoothed. Existing encoder-decoder architectures generally adopt a single-scale feature extraction strategy, but they fail to implement differential processing for different structural levels of Chinese characters (strokes, components, whole characters): in areas with noise interference, the model has insufficient confidence in estimating the stroke edges, and may incorrectly complete the stroke breaks deliberately created by steganographic encoding; in areas with low signal-to-noise ratio, it is easy to misjudge subtle deformations as noise and suppress them. This contradiction is further intensified in the cross-font reconstruction task. Due to the lack of a dedicated dataset covering multiple writing styles, the model is difficult to establish an elastic mapping mechanism for component proportion relationships, resulting in systematic errors such as component size mismatch and center of gravity offset in the reconstruction results.
[0006] Due to the complex stroke structure and rich detail features of Chinese character images, extremely high requirements are imposed on the restoration process. However, when conventional methods process such images, they often struggle to fully retain these features, resulting in unsatisfactory detail performance in the restored images.
[0007] In summary, the problems existing in the prior art in the field of text steganography of Chinese character image super-resolution urgently need to be solved. Summary of the Invention
[0008] To solve the problems of blurred details, insufficient generalization ability, and insufficient utilization of semantic information in the super-resolution reconstruction of Chinese character images in the prior art, the present invention provides a method and system for super-resolution reconstruction of Chinese character images based on a diffusion model.
[0009] The present invention adopts the following technical solutions:
[0010] A method for super-resolution reconstruction of Chinese character images based on a diffusion model (Text-DM) includes the following steps:
[0011] S1. Construct a Chinese steganographic image dataset (CCSID) that reflects the characteristics of Chinese character text steganography and is suitable for the image super-resolution task. High- and low-resolution image pairs can be generated by simulating the low-resolution degradation process in the actual scene, and the data is divided into a training set and a validation set;
[0012] S2. Using the conditional denoising diffusion model as a framework, the Chinese stego image dataset constructed in step S1 is used as the conditional input of the diffusion model to guide the diffusion model to learn the mapping from low resolution to high resolution;
[0013] During the forward diffusion training process, Gaussian noise is gradually added to the high-resolution image to simulate image degradation. During the backward inference process, the model iteratively recovers the high-resolution image from the noisy image through a neural network, continuously adjusting parameters to achieve optimal image reconstruction within a limited number of inference steps. Throughout the training process, a sampling method combining noise injection, residual connections, and lightweight multi-scale up- and down-sampling is designed to balance detail and efficiency. Furthermore, an efficient multi-scale large-kernel attention mechanism is introduced to dynamically capture local details and long-range dependencies in Chinese character images, improving reconstruction results.
[0014] S3. Use the conditional denoising diffusion model of step S2 to reconstruct the resolution of the low-resolution Chinese character image to be processed, and output a high-resolution Chinese character image.
[0015] In the present invention, a text steganographic Chinese character image super-resolution method (Text-DM) is designed based on the diffusion model, combining the multi-scale large-core attention mechanism and the staged sampling strategy to achieve the coordinated optimization of local details and global structure; the noise prediction network and multi-scale feature extraction parameters are optimized through a joint training strategy (when training the diffusion model, the parameters of both are updated simultaneously in each iteration through an end-to-end training method to minimize the loss function and improve the model's ability to generate complex Chinese character images), thereby improving the model's ability to generate complex Chinese character images.
[0016] Preferably, in step S1, constructing a Chinese steganographic image dataset (CCSID) includes: loading font objects based on TrueType Font (TTF) format font files, setting the pixel size of Chinese characters to simulate actual application scenarios; defining the layout parameters of the text image, including resolution (DPI), number of rows and columns, and position of Chinese characters; generating a high-resolution text image through glyph extraction and rendering, and performing grayscale conversion and cutting processing on it to extract single-character images; constructing low-resolution samples through pixel magnification technology to form a training set and a validation set. The details are as follows:
[0017] S1.1: Initialization and font loading; Use the FreeType library to load a TrueType Font (TTF) format font file and create a font object (face); Set the pixel width (W) and height (H) of each Chinese character, simulate the font size in actual application based on the set size, and set the width and height to specific values;
[0018] S1.2: Define the text layout; determine the overall size and resolution (DPI) of the generated text image; set the layout of each row (n) and each column (m) based on the preset number of Chinese characters, and calculate the number of Chinese characters in each row and column to reasonably arrange their positions in the image;
[0019] S1.3: Glyph extraction and rendering: traverse each Chinese character in the font library and extract its glyph bitmap data; render the glyph to the specified position in the image based on the bitmap information of each Chinese character; draw the glyph according to the preset row and column positions (n, m), ensuring that each Chinese character is drawn into the image according to the calculated coordinates; after rendering is completed, all Chinese characters in the image are arranged according to the preset layout to form a preliminary text image;
[0020] S1.4: Image Saving and Conversion: After each image containing a specified number of Chinese characters is completed, it is saved in high-resolution (HR) format. The saved image is then iterated on the remaining glyphs until all glyphs are converted into images. Each time the image is saved, ensure that the format and resolution required are met. Repeat this process until all Chinese character images are generated.
[0021] S1.5: Chinese character image segmentation; preprocess the generated text image by first converting the image into a grayscale image; then, use Sobel to calculate the gradient of the image to obtain gradient images in the horizontal and vertical directions; perform projection analysis based on the gradient image, calculate the sum of pixels in each row and column, and obtain a projection histogram; based on the projection histogram, analyze the position of the segmentation line to divide the boundary of each Chinese character; finally, segment the image according to the segmentation line, extract the image of a single Chinese character, and complete the segmentation operation; after segmenting the image of the same character in different font sizes, form an image pair.
[0022] S1.6: Image resolution conversion processing; use a font larger than the set value for high-resolution images; use a font smaller than the set value for low-resolution images to ensure clarity; use pixel magnification technology to gradually convert low-resolution images into high-resolution versions; construct training and validation sets through random sampling to evaluate the super-resolution reconstruction effect.
[0023] Preferably, in step S1.4, the image conversion method is as follows: a pixel-based magnification technique is employed to replace individual pixels in each original 16×16 low-resolution image with an 8×8 pixel matrix, thereby achieving image size enlargement from 16×16 to 128×128. To ensure consistency with existing super-resolution algorithms and to accurately evaluate image reconstruction effects at different magnification factors, the present invention follows regulations and defines the magnification ratio required for restoring the low-resolution to high-resolution image of this dataset, covering a range from ×2 to ×8.
[0024] Preferably, in step S2, the core of the iterative refinement process is to use a conditional denoising diffusion model as the core framework to gradually convert the low-resolution (LR) image into a high-resolution (HR) image through an iterative refinement process. The super-resolution framework based on the diffusion model is as follows:
[0025] Gaussian diffusion process, the goal of the Gaussian diffusion process is to learn the parameters of the conditional distribution p(y|x) through an iterative refinement process, thereby mapping the source image x to the target image y∈R d This is a one-to-many mapping, where multiple target images correspond to a single source image. To achieve this goal, the present invention addresses the conditional image generation problem by adapting a denoising diffusion probability model. The model processing includes a forward diffusion process and a backward inference process.
[0026] During the denoising process, the model takes a low-resolution image as input and generates a high-resolution image through iterative denoising. Specifically, the forward diffusion process gradually adds Gaussian noise to the high-resolution image, constructing a mapping from the true data distribution to the noise distribution. Gradient descent is then used to optimize the model parameters, enabling the model to predict the original target image as accurately as possible based on the source image, the noisy target image, and the noise level.
[0027] The gradient descent method optimizes the model parameters as follows:
[0028]
[0029] Where x represents the source image. y0 represents the target image. γ represents the noise level parameter, also known as the noise intensity or mixing coefficient. It is randomly drawn from the noise level distribution p(γ). ε represents a noise vector randomly drawn from the standard normal distribution N(0,I), which usually represents the noise perturbation.
[0030] The reverse inference process starts with a purely noisy image and gradually restores the target image based on the learned conditional transfer distribution. Specifically, each step of the reverse process dynamically adjusts the balance between the noise residual and the random perturbation, achieving a progressive optimization of the noisy image.
[0031] During the iterative refinement phase, the model performs key calculations based on the inference update formula: first, the current noisy image is scaled by the coefficients, then the noise component predicted by the denoising network is subtracted, and the source image information is injected into the calculation process through the multi-scale feature fusion channel of the neural network.
[0032] The inference update image calculation process can be expressed as follows:
[0033]
[0034] Among them, y t-1 Represents the updated image at the current iteration step t, representing the image updated from the noise image y t The derived result is closer to the real image. t Represents the noise image at the current time t. t represents the hyperparameters at time step t. t represents the noise level at time step t.
[0035] Preferably, the sampling method in step S2 is combined with a multi-level feature extraction system. The present invention designs a noise injection mechanism and a residual connection architecture to retain contextual information through downsampling and upsampling. In this process, upsampling: the input features are first processed through a batch normalization layer to ensure the stability of the training and reduce internal covariate shift. Then, the activation function is used to introduce nonlinearity so that the model can capture more complex features. After the upsampling operation of the convolutional layer, noise is added to the feature map, and then the process is repeated (starting from the activation function being used to introduce nonlinearity), and finally the input (that is, the initial features received by the upsampling module) is convolved through the residual connection to gradually increase the resolution of the image, and finally a high-resolution image is output.
[0036] Downsampling: The input features are first processed through an activation function to introduce nonlinearity, then through a convolutional layer to extract features and add noise. Next, the spatial size of the feature map is reduced using average pooling. This method averages the elements of the windowed area at each position to produce an output feature map. A residual connection is used to add the input features to the pooled feature map, ultimately producing a low-resolution output image.
[0037] Preferably, in step S2, feature processing and fusion as well as feature decoupling are integrated into the multi-scale feature fusion channel of the iterative refinement stage to improve the reconstruction performance, as follows:
[0038] During the feature processing and fusion phase, the model's perception of Chinese character images is first enhanced through a designed multi-scale large-kernel attention mechanism. This phase's processing flow includes a staged convolution strategy and multi-level feature processing to optimize the representation of image features. The input Chinese character image passes through a depthwise separable convolution layer to extract local spatial features. Dilated convolutions are then used to expand the receptive field, and finally, point-wise convolutions are used to fuse cross-channel information. The kernel size is gradually increased with each convolution operation.
[0039] After the convolution process, the model further decouples features through a multi-scale processing module. This module uses a channel grouping mechanism to divide features into several subgroups and configures convolution kernels of different scales and dilation rates for each subgroup. In this way, the first set of convolution kernels is used to capture the stroke details of Chinese characters, the second set is used to model larger component-level structures, and the third set uses even larger convolution kernels to constrain the structural information of the entire character.
[0040] As features are gradually processed and extracted, a gated adjustment mechanism is introduced to dynamically adjust the contribution of each subgroup during the multi-scale fusion process. Under this mechanism, the features of each subgroup are converted into spatial modulation coefficients through lightweight convolution.
[0041] During the entire feature processing process, first, large-scale convolution kernels are decomposed into multiple separable convolution operations, significantly reducing the number of parameters required for calculation. Secondly, a parallel processing strategy based on channel grouping is adopted. Finally, a gating mechanism is introduced to replace the traditional fully connected layer.
[0042] By decomposing the convolution operations, the computational cost of dilated convolution, depthwise separable convolution, and pointwise convolution is effectively controlled. Features are divided into smaller groups and flexible kernel combinations are used to reduce computational cost.
[0043] The computational cost calculation process can be expressed as follows:
[0044]
[0045] Among them, n is the number of channel groups, C is the number of channels, H and W are the height and width of the feature map respectively, Corresponding to dilated convolution, (2d i -1) 2 Corresponds to depthwise separable convolution, and C corresponds to the pointwise convolution operation on each channel. The total computational cost is also affected by the kernel size K and the dilation rate d i The addition in brackets represents the additional computation caused by gated aggregation and projection.
[0046] The present invention also provides a Chinese character image super-resolution reconstruction system based on a diffusion model, which is used to execute the above method and includes the following modules:
[0047] A Chinese steganographic image dataset construction module is used to construct a Chinese steganographic image dataset, generate high-resolution image and low-resolution image pairs, and divide the data into training sets and validation sets; preferably, the TTF font library is loaded through the FreeType library and high-resolution Chinese character images are rendered, low-resolution and high-resolution image pairs are generated through pixel magnification technology, and training sets and validation sets covering multiple magnification ratios are constructed;
[0048] The conditional denoising diffusion model training module uses the conditional denoising diffusion model as a framework and uses the constructed Chinese steganographic image dataset as the conditional input of the diffusion model to guide the diffusion model to learn the mapping from low resolution to high resolution;
[0049] The resolution reconstruction module uses the trained conditional denoising diffusion model to reconstruct the resolution of the low-resolution Chinese character image to be processed, and finally outputs a high-resolution Chinese character image.
[0050] The advantages and beneficial effects of the present invention are:
[0051] The present invention proposes a method and system for super-resolution reconstruction of Chinese character images based on a diffusion module. The Chinese Steganographic Image Dataset (CCSID) is constructed, and in order to cope with the characteristics of Chinese characters being more complex and detailed than Latin letters, the present invention designs a method for super-resolution reconstruction of Chinese character images based on a diffusion model. By using a unique mechanism of gradually adding noise to the data and then learning the denoising process, it provides a novel and effective framework to solve various low-level visual problems, especially showing good results in Chinese character restoration. Taking into account the problem that existing methods fail to fully consider the unique structural characteristics and semantic relationships of Chinese characters, the present invention proposes an efficient multi-scale attention mechanism. By integrating global and local information, capturing local continuity and reducing unnecessary nonlinear layers, the mechanism effectively avoids block artifacts and significantly improves the quality of super-resolution reconstruction of Chinese character images. By solving the existing problem of transcribing low-resolution Chinese characters into high-resolution clear Chinese characters, the present invention can not only significantly improve the reliability and practicality of steganographic technology for fine-tuning the structure of Chinese characters, but also provide reconstruction support for the digitization of cultural heritage such as oracle bone restoration and calligraphy inheritance. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a flow chart of a method for super-resolution reconstruction of Chinese character images based on a diffusion model according to a preferred embodiment of the present invention;
[0053] Figure 2 This is a structural diagram of a Chinese character image super-resolution reconstruction system based on a diffusion model according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0054] The present invention is further described in detail below with reference to the embodiments, but the protection scope of the present invention is not limited thereto.
[0055] This paper proposes a method for super-resolution reconstruction of Chinese character images based on a diffusion model, referred to as Text-DM. By introducing innovative data processing methods and algorithmic design, this method can effectively address the complexity of Chinese character images and significantly improve the restoration effect. The core of the Text-DM method lies in utilizing a conditional denoising diffusion model to gradually convert low-resolution images into high-resolution images through an iterative refinement process, while ensuring the integrity of the text's steganographic information. Compared with existing technologies, this method achieves significant improvements in detail preservation, generalization capability, and training efficiency.
[0056] like Figure 1 As shown, in the process of implementing the Text-DM method, step S1 of this embodiment designs a dataset specially customized for Chinese text steganographic repair, which is called the Chinese Steganographic Image Dataset (CCSID). The construction of this dataset is intended to simulate a real text image environment and provide rich basic data for the training and evaluation of the diffusion model. Taking into account that in actual applications, text images come from different channels such as printing, scanning or screenshots, in order to accurately reproduce the image features in these processes, the CCSID dataset selects the FreeType library as a font rendering tool. FreeType is a high-quality, open source font engine that is widely used in Linux systems and multiple other platforms. It is well-known for its excellent font processing capabilities and cross-platform compatibility. By using the FreeType library, the present invention can generate Chinese character images that are highly similar to the printing or screen display effects in the real world, thereby ensuring the practicality and effectiveness of the dataset.
[0057] The primary task in constructing the CCSID dataset is to simulate the size and distribution of Chinese characters in a real text environment to generate realistic text images. This example introduces a method that simulates the size of Chinese characters in text by fixing the font pixel size and then uniformly draws these characters onto a blank image. The specific steps and pseudocode algorithm for this process are as follows:
[0058] a) Initialization settings and font loading: Use the FreeType library to load the font file in TTF (TrueType Font) format, create a face object, and set the pixel width and height of each Chinese character.
[0059] b) Define text layout: Determine the overall size and resolution (DPI) of the generated text image, and set the number of text rows and columns based on the expected number of Chinese characters so as to reasonably arrange the position of Chinese characters in the image.
[0060] c) Extract and render glyphs: traverse the face object, read the glyph attributes of each Chinese character, especially its bitmap data, and then accurately draw the glyph to the specified position of the image according to the preset row and column positions.
[0061] d) Image Saving and Iteration: After completing an image containing a predetermined number of Chinese characters, it is saved. The remaining glyphs are then processed until all glyphs are converted into image form.
[0062]
[0063]
[0064] The algorithm renders all Chinese character glyphs into a unified image, and the size of the glyphs is calculated based on the font size in Word to simulate the font size in actual applications.
[0065] e) Chinese Character Image Segmentation: Chinese character segmentation is a crucial second step in the construction of the CCSID dataset. To separate individual Chinese characters from a text image containing multiple characters for subsequent resolution processing, this example proposes a systematic image processing method that not only ensures that each Chinese character can be accurately extracted but also provides high-quality data input for subsequent character recognition tasks. The details are as follows:
[0066] 1) Image preprocessing: Convert the color text image to a grayscale image to reduce computational complexity. Apply the Sobel operator to calculate the horizontal and vertical gradient images to obtain the gradient information of each pixel, which facilitates subsequent edge detection and feature extraction.
[0067] 2) Projection Analysis: Calculate the histogram of the gradient image and project the pixels in each row and column. Projection is achieved by summing the gradient values of each row and column and plotting them onto a new image. The resulting projected image can intuitively show the distribution of the characters.
[0068] 3) Segmentation line detection: Analyze the extreme points in the projection histogram to determine the location of segmentation lines. These segmentation lines are used to define the boundaries of each Chinese character in the text image, so that the text table can be accurately segmented into multiple small blocks.
[0069] 4) Image Segmentation: Based on the previously determined segmentation line positions, the text image is segmented to generate small images containing individual Chinese characters. The segmented small images are sorted and merged to ensure that they are output in the order of the original text.
[0070]
[0071]
[0072] Through this method, the present invention produced high-resolution (HR) images of the CCSID dataset of two fonts, Fangsong and Kaiti. Both are derived from traditional Chinese calligraphy. The former is suitable for formal texts with its uniform strokes and elegant appearance, while the latter is commonly seen in calligraphy works and printed materials that need to be clear and easy to read with its standardized and rigorous structure. It is representative in the field of Chinese character steganography.
[0073] f) Image Resolution Conversion: In image processing research, especially for processing images of varying resolutions, this paper focuses on methods for converting high-resolution (HR) and low-resolution (LR) images. To ensure image clarity and visual quality, this paper employs appropriate font size settings for images of varying resolutions. HR images maintain font detail while also taking into account visual quality and contrast. LR images, on the other hand, utilize font settings adapted to the lower resolution, ensuring readability despite resolution constraints.
[0074] For image magnification, a pixel-based magnification technique was employed. This technique, by introducing a finer pixel matrix structure, successfully scales low-resolution images up to a higher-resolution version. During the conversion process, special attention was paid to preserving detail and improving image quality, avoiding blurring and jagged edges common during magnification. Multiple super-resolution algorithms were evaluated for different magnification scenarios to ensure that the image quality at each resolution met practical application requirements.
[0075] A strict random sampling method was used to divide the generated image samples into a training set and a validation set. This division ensured that the model training covered more scenes and details, thereby improving the model's generalization ability. The diversity of the dataset and the appropriate segmentation strategy also enabled this study to more comprehensively reflect the image restoration capabilities at different magnifications when evaluating the reconstruction results of different images.
[0076] In the research of the present invention, for high-resolution (HR) and low-resolution (LR) images in the field of image processing, the present invention adopts a specific text font size setting to enhance the visual effect and contrast. In keeping with the existing super-resolution algorithm and being able to accurately evaluate the image reconstruction effect at different magnifications, the present invention follows the regulations and defines the magnification ratio required for restoring this dataset from low resolution to high resolution images. The present invention covers a range from ×2 to ×8 to cover a wide range of application scenarios. In terms of dataset division, this paper follows a strict random sampling principle and divides the obtained images into a training set and a validation set to ensure the effectiveness of model training and the reliability of the results.
[0077] After establishing the dataset partitioning and magnification ratios, we will further explore the Text-DM method and the model training process. Through careful design of the training and validation sets, we ensure that the model can effectively learn and evaluate at different magnifications. The following sections will detail the model training strategy, hyperparameter settings, and analysis of experimental results, demonstrating the superior performance of Text-DM in the Chinese character image super-resolution task.
[0078] Step S2, the Conditional Denoising Diffusion Model, is the core of the Text-DM method. It converts low-resolution images (e.g., resolutions below 16×16) into high-resolution images (e.g., resolutions above 128×128) through iterative refinement. This model, based on a denoising diffusion probability model and adapted for conditional image generation, includes Gaussian diffusion, denoising, and inference processes. It also proposes a new sampling method and introduces an efficient multi-scale large-kernel attention mechanism.
[0079] The goal of the Gaussian diffusion process is to learn the parameters of the conditional distribution p(y|x) through an iterative refinement process, thereby mapping the source image x to the target image y∈R d This is a one-to-many mapping, where multiple target images correspond to a single source image. To achieve this goal, the present invention addresses the conditional image generation problem by adapting a denoising diffusion probability model. The model includes a forward diffusion process and a backward inference process.
[0080] The algorithm for training the denoising model during forward diffusion uses an iterative process to allow the model to learn to recover a clean target image from a noisy image, while using the source image and the noise level as auxiliary information.
[0081] Specifically, the algorithm randomly extracts source images (such as low-resolution images) and target images (such as high-resolution images) (x, y0) from the data distribution, then randomly selects a noise level γ and adds noise from a standard normal distribution to generate a target image with noise ε. Then, the model parameters are optimized by the following gradient descent method:
[0082]
[0083] Where x represents the source image. y0 represents the target image. γ represents the noise level parameter, which represents the noise intensity or mixing coefficient. It is randomly drawn from the noise level distribution p(γ). ε represents a noise vector randomly drawn from the standard normal distribution N(0,I), which usually represents the noise perturbation.
[0084] The model is trained to predict the original target image as accurately as possible based on the source image, the noisy target image, and the noise level. This process is repeated until the model's loss function stabilizes. This method is widely used in image super-resolution and denoising tasks and has strong adaptability and practicality.
[0085] In the reverse reasoning process, from the pure noise image y t Starting from ~N(0,I), the model transfers the distribution p according to the learned condition θ (y t-1 |y t ,x) iteratively refines the image (y T-1 ,y T-1 ,y T-2 ,…,y0), so that y0~p(y|x). The model gradually transforms the random noise distribution into a high-quality image that conforms to the characteristics of the target data by constructing an inverse Markov chain that is symmetrical to the forward diffusion process. The core of this process lies in the design of a learnable conditional transfer operator, whose parameterized form strictly follows the noise distribution law of forward diffusion. Specifically, each step of the inverse process achieves progressive optimization of the noisy image by dynamically adjusting the balance between the noise residual and the random perturbation. In the iterative refinement stage, the model performs key calculations based on the above relationship. First, the current noisy image is coefficient-scaled, and then the noise component predicted by the denoising network is subtracted. The generation diversity is maintained by introducing a controllable random perturbation term. Among them, the design of the scaling coefficient ensures the stable transmission of signal energy. The calculation of the denoising term relies on the accurate modeling of the noise pattern by the trained conditional denoising network, and the introduction of the random perturbation term effectively avoids the pattern collapse problem of the generated result. It can be formalized as:
[0086]
[0087] Among them, y t-1 Represents the updated image at the current iteration step t, representing the image updated from the noise image y t The derived result is closer to the real image. t Represents the noise image at the current time t. t represents the hyperparameters at time step t. γ t represents the noise level at time step t.
[0088] In particular, the source image information is injected into the computational process through the multi-scale feature fusion channel of the neural network, so that the inverse diffusion can both maintain the detail authenticity of the target image and strictly follow the structural constraints of the source image.
[0089] To meet the requirements of multi-scale generation, this method adopts a hierarchical and progressive architecture: the initial stage focuses on global semantic reconstruction, while subsequent stages gradually enhance local texture details. Each layer is equipped with an independent noise scheduling module, which achieves resolution-dependent generation control by adaptively adjusting the time step parameter. This design enables the system to dynamically balance generation efficiency and quality based on the target resolution, significantly reducing the computational load while ensuring cross-scale feature consistency.
[0090] In terms of noise scheduling optimization, this method proposes an improved strategy based on dynamic path planning. By constructing a learnable nonlinear modulation function, the system can automatically adjust the noise attenuation rate at different time steps, focusing on strengthening the denoising performance in key stages. This strategy can effectively optimize the generation quality while maintaining the stability of the generation process under the constraint of a limited number of inference steps. To further enhance its practical value, the solution also designs an end-to-end hyperparameter optimization mechanism, which automatically selects the optimal scheduling parameters through perception-driven quality assessment indicators. With the help of the above method, the developed model is not only capable of high-resolution image generation tasks, but also ensures a small number of inference steps, thereby ensuring the quality of the generated images.
[0091] When exploring the optimization strategy of the reverse reasoning process in depth, special attention should be paid to the inherent defects of traditional sampling methods in the super-resolution task of Chinese character images. Existing sampling methods usually lead to the loss of important spatial information, especially the boundary sharpness and texture details unique to Chinese characters, which are precisely the key features that need to be strictly preserved in the super-resolution reconstruction task of pixel-level accuracy. To address this problem, the present invention constructs a multi-level feature extraction system through a noise injection mechanism and a residual connection architecture, and designs a downsampling and upsampling module that preserves contextual information as much as possible. Its segmented lightweight feature processing unit is used to extract multi-scale feature maps into the diffusion model.
[0092] In the upsampling method, the input feature x in First, a batch normalization layer is used to stabilize the training process and reduce internal covariate shift. An activation function is used to introduce nonlinearity, enabling the model to learn more complex feature representations. After upsampling through the convolutional layer, noise is added to the input image. This process is then repeated, and finally, through a residual connection, the module directly passes the input through a convolutional layer to the output, which helps gradient propagation, solves the gradient vanishing problem in deep networks, and generates the final high-resolution image x. out .
[0093] The downsampling method aims to efficiently handle image super-resolution and super-resolution tasks. By combining noise injection, feature extraction, downsampling and residual connection techniques, it achieves effective restoration and enhancement of image details. In the downsampling method, the input feature x inAfter the activation function (Activation) introduces nonlinearity, the convolution layer (Conv) is used to extract the features of the input image, and noise is added to the input image and the process is repeated. Finally, the average pooling method is used to reduce the spatial size of the feature map. For each position, all elements in the area covered by the window are averaged and the average value is placed in the cell corresponding to the output feature map. At the same time, in order to avoid the common gradient disappearance problem in deep networks, the residual connection method is used to convert the input feature x in The features obtained by the convolution kernel average pooling are added to the downsampled feature map to obtain the low-resolution image x. out .
[0094] Based on a multi-level feature extraction system, this paper proposes an innovative attention architecture—a multi-scale large-kernel attention mechanism—to further enhance the model's ability to perceive key features of Chinese character images. This mechanism uses a staged convolution strategy to optimize the feature processing flow: first, local spatial features are extracted through depthwise separable convolution, then dilated convolution is used to expand the receptive field coverage, and finally, point convolution is used to achieve cross-channel information fusion. This step-by-step approach effectively balances computational efficiency and feature expression, reducing parameter size while maintaining a large perceptual range.
[0095] The multi-scale processing module achieves feature decoupling through a channel grouping mechanism, with each subgroup configured with convolution kernels of different scales and dilation rate parameters. The first group uses a medium-sized kernel to capture stroke details, the second group uses a larger kernel to model component-level associations, and the third group uses the largest kernel to establish overall character structure constraints. This hierarchical processing strategy enables the model to adapt to the learning requirements of features at different spatial scales, improving its ability to represent the complex structures of Chinese characters.
[0096] The gated adjustment mechanism dynamically adjusts the contribution strength of each subgroup's attention map by introducing a spatially adaptive weight matrix. This design effectively suppresses edge discontinuities that may arise during multi-scale fusion, ensuring accurate reconstruction of local details while maintaining the advantages of modeling long-range dependencies. In practice, the feature stream of each subgroup undergoes lightweight convolution to generate spatial modulation coefficients, which are then calibrated through element-by-element multiplication.
[0097] In terms of computational complexity control, this architecture achieves efficiency optimization through three key technologies: 1) decomposing large convolution kernels into multiple separable operations, significantly reducing the number of parameters; 2) employing a channel grouping and parallel processing strategy to reduce the computational load on a single channel; and 3) introducing a gating mechanism to replace traditional fully connected layers to avoid the computational overhead caused by dimensionality expansion. These optimization measures enable the model to maintain reasonable computational resource consumption when processing high-resolution images, making it feasible for practical deployment.
[0098] In terms of computational complexity optimization, given the parameter set {K i ,d i The computational cost of the multi-scale large kernel attention mechanism (MLKA) significantly reduces the resource consumption of traditional large convolution kernels through a decomposition strategy, which can be quantified as:
[0099]
[0100] in, Corresponding to dilated convolution, (2d i -1) 2 Corresponds to depthwise separable convolution, and C corresponds to the pointwise convolution operation on each channel. The total computational cost is also affected by the kernel size K and the dilation rate d i , and grows quadratically with the increase of these parameters. The addition in brackets represents the additional computation incurred by gated aggregation and projection. Because features are partitioned into smaller groups (via n-division), MLKA can flexibly use different kernels to capture local and global information while controlling computational cost.
[0101] The core advantages of this attention mechanism are reflected in three aspects: first, multi-scale collaborative modeling enhances the understanding of the hierarchical structure of Chinese characters; second, the dynamic gating design effectively alleviates information distortion during feature fusion; and finally, the staged convolution strategy strikes a good balance between computational efficiency and feature expression. These features collectively enhance the system's applicability and robustness in complex text image super-resolution tasks.
[0102] Step S3: Use the conditional denoising diffusion model of step S2 to reconstruct the resolution of the low-resolution Chinese character image to be processed, and output a high-resolution Chinese character image.
[0103] The following experiments compare the present invention with existing technologies. Because Text-DM training requires significant computing power and video memory, the experimental environment configuration is shown in Table 1. This table details the basic hardware and software required to support the development and training of image super-resolution algorithms.
[0104] This paper is based on the powerful Python programming language environment, leveraging its rich scientific computing libraries and efficient code organization capabilities to ensure flexibility and scalability in algorithm implementation. The deep learning framework chosen is PyTorch, which leverages its dynamic graph mechanism and ease of use to easily build, train, and optimize complex neural network models.
[0105] Table 1 Experimental environment configuration
[0106]
[0107] Compared with current mainstream methods, our method (Text-DM) demonstrates superior performance. The following two tables show the performance comparison of Text-DM and other mainstream super-resolution methods at magnifications of ×8 and ×4, respectively.
[0108] Table 2 Comparison between current mainstream super-resolution methods and the method proposed in this paper (×8)
[0109]
[0110]
[0111] Table 3 Comparison of current mainstream super-resolution methods and the method proposed in this paper (×4)
[0112]
[0113] When magnified to ×8, Text-DM achieves significant advantages on both the KT (Kaiti) and FS (Fangsong) datasets. Specifically, on the KT dataset, Text-DM achieves a PSNR of 20.9dB and an SSIM of 0.908; on the FS dataset, the PSNR is 20.7dB and the SSIM is as high as 0.935.
[0114] In contrast, other methods such as RMSResNet-GAN, DPSR, Dr-UNet, SRMD, and FdnCNN, although some of them have fewer model parameters (such as FdnCNN with only 0.67M), are far inferior to Text-DM in terms of PSNR and SSIM indicators. This shows that Text-DM effectively restores the quality of high-resolution images while maintaining a relatively reasonable model complexity (7.9M).
[0115] When the magnification is ×4, Text-DM's advantage is further expanded. In the KT dataset, the PSNR reached 40.6dB and the SSIM was 0.971; in the FS dataset, the PSNR was as high as 42.7dB and the SSIM reached 0.979. This performance significantly surpassed all comparison methods, including Dr-UNet. It is worth noting that even in the face of Dr-UNet with a parameter volume of up to 32.64M, Text-DM still achieved better image quality restoration effects with its better design, while maintaining a smaller model size (7.9M), proving its good balance between efficiency and performance.
[0116] like Figure 2 As shown, this embodiment discloses a text steganographic Chinese character image super-resolution reconstruction system based on a diffusion model, which is used to execute the above method and includes the following five modules:
[0117] A Chinese steganographic image dataset construction module is used to load TTF fonts through the FreeType library and render high-resolution Chinese character images. It uses pixel magnification technology to generate low-resolution and high-resolution image pairs, and constructs training and validation sets covering various magnification ratios.
[0118] The conditional denoising diffusion model training module uses the conditional denoising diffusion model as a framework and uses the constructed Chinese steganographic image dataset as the conditional input of the diffusion model to guide the diffusion model to learn the mapping from low resolution to high resolution;
[0119] The resolution reconstruction module uses the trained conditional denoising diffusion model to reconstruct the resolution of the low-resolution Chinese character image to be processed, and finally outputs a high-resolution Chinese character image.
[0120] For other contents of this embodiment, please refer to the above method embodiment.
[0121] For the system embodiment, its technical principles correspond to the method embodiment, so the specific implementation details can refer to the relevant description of the method embodiment. The above system description is only an exemplary explanation, in which the modules described in the form of independent components can be physically separated and deployed or integrated into the same entity; the physical form of each component is not limited to a single device. In actual applications, some or all of the modules can be selectively adopted according to needs to realize the core functions of the present invention. For those skilled in the art, without making creative designs, they can understand and implement the system architecture based on the above description.
[0122] The system of the present invention can be deployed and implemented in hardware or software devices with data processing capabilities, such as, but not limited to, computers or specialized devices. The system can be implemented using a pure software solution, a hardware solution, or a combination of software and hardware. Taking software deployment as an example, the system essentially constitutes a logical device whose operating mechanism is: the device processor reads pre-stored program instructions from a persistent storage medium into the running memory and executes the instruction set to complete the function.
[0123] In summary, the present invention discloses a method and system for super-resolution reconstruction of Chinese character images based on a diffusion model, which aims to improve the clarity and readability of low-resolution Chinese character images, and is particularly suitable for the field of text steganography. The present invention adopts a conditional denoising diffusion model to gradually convert low-resolution images into high-resolution images through an iterative refinement process. The present invention proposes a new sampling method and introduces an efficient multi-scale large-core attention mechanism to better capture the structural characteristics and details of Chinese character images. In order to train and evaluate the model, a Chinese steganographic image dataset customized for Chinese text steganographic repair is constructed to simulate a real text image environment. Compared with the existing technology, the present invention has achieved improvements in detail preservation, generalization ability and training efficiency. By improving the clarity and readability of low-resolution Chinese character images, the present invention provides a reliable super-resolution reconstruction method for Chinese character images based on a diffusion model for the field of text steganography, which improves the reliability and practicality of text steganography.
[0124] The above description specifically illustrates the implementation methods and technical principles of this application. Those skilled in the art should understand that the scope of protection of this invention encompasses not only the explicitly enumerated combinations of technical features, but also other solutions derived through the replacement of equivalent features or the recombination of different technical features, without departing from the core concept of this application. For example, a functionally similar but different technical means may be used to replace the features described in the specification, thereby forming a new technical implementation.
Claims
1. A Chinese character image super-resolution reconstruction method based on a diffusion model, characterized in that: The following steps are involved: S1. Build a Chinese steganographic image dataset and generate high-resolution image and low-resolution image pairs; S2. Using the conditional denoising diffusion model as a framework, the Chinese stego image dataset constructed in step S1 is used as the conditional input of the diffusion model to guide the diffusion model to learn the mapping from low resolution to high resolution; S3. Use the conditional denoising diffusion model of step S2 to reconstruct the resolution of the low-resolution Chinese character image to be processed, and output a high-resolution Chinese character image.
2. The Chinese character image super-resolution reconstruction method based on the diffusion model according to claim 1 is characterized in that: In step S1, the method for constructing the Chinese steganographic image dataset includes the following steps: S1.1: Initialization and font loading; Use the FreeType library to load a TrueType font file and create a font object; Set the pixel width and height of each Chinese character, simulate the actual font size based on the set size, and set the width and height to specific values; S1.2: Define the text layout; determine the overall size and resolution of the generated text image; set the layout of each row and column based on the preset number of Chinese characters, and calculate the number of Chinese characters in each row and column; S1.3: Glyph extraction and rendering: traverse each Chinese character in the font library and extract its glyph bitmap data; render the glyph to the specified position of the image based on the bitmap information of each Chinese character; draw the glyph according to the preset row and column positions; after rendering is completed, all Chinese characters in the image are arranged according to the preset layout to form a preliminary text image; S1.4: Image preservation and conversion; each time an image containing a specified number of Chinese characters is completed, it is saved in a high-resolution format; the saved image is iteratively processed from step S1.3 for the remaining glyphs until all glyphs are converted into image form; S1.5: Chinese character image segmentation: Preprocess the generated text image by first converting it to a grayscale image. Then, use Sobel to calculate the image gradient to obtain horizontal and vertical gradient images. Based on the gradient image, perform projection analysis to calculate the sum of pixels in each row and column to obtain a projection histogram. Based on the projection histogram, analyze the position of the segmentation line to delineate the boundaries of each Chinese character. Finally, segment the image along the segmentation line to extract the image of a single Chinese character. S1.6: Image resolution conversion processing; use a font larger than the set value for high-resolution images; use a font smaller than the set value for low-resolution images; construct training and validation sets through random sampling.
3. The Chinese character image super-resolution reconstruction method based on the diffusion model according to claim 2 is characterized in that: In step S1.4, the image conversion method is specifically as follows: a technique based on pixel magnification is used to replace a single pixel in each original 16×16 low-resolution image with an 8×8 pixel matrix, thereby achieving image size enlargement from 16×16 to 128×128.
4. The Chinese character image super-resolution reconstruction method based on the diffusion model according to claim 1 is characterized in that: In step S2, the conditional denoising diffusion model is introduced, and its processing process includes: Forward diffusion process: By gradually adding Gaussian noise to the high-resolution image, a mapping from the true data distribution to the noise distribution is constructed, and then the model parameters are optimized by the gradient descent method so that the model can be based on the source image, the noisy target image and the noise level; Reverse reasoning process: Each step achieves progressive optimization of the noisy image by dynamically adjusting the balance between noise residual and random perturbation; In the iterative refinement stage, the current noisy image is first scaled by coefficients, then the noise component predicted by the denoising network is subtracted, and the source image information is injected into the calculation process through the multi-scale feature fusion channel of the neural network.
5. The Chinese character image super-resolution reconstruction method based on the diffusion model according to claim 4 is characterized in that: In the forward diffusion process of step S2, the gradient descent method optimizes the model parameters as follows: Where x represents the source image; y0 represents the target image; γ represents the noise level parameter, which is randomly drawn from the noise level distribution p(γ); ε represents the noise vector randomly drawn from the standard normal distribution N(0,I).
6. The Chinese character image super-resolution reconstruction method based on the diffusion model according to claim 4 is characterized in that: In the iterative refinement phase of step S2, the calculation process is expressed as follows: Among them, y t-1 represents the updated image at the current iteration step t; y t represents the noise image at the current time t; α t represents the hyperparameter at time step t; γ t represents the noise level at time step t.
7. The Chinese character image super-resolution reconstruction method based on the diffusion model according to any one of claims 1 to 6, characterized in that: In step S2, a sampling method is introduced, including downsampling and upsampling. The upsampling is as follows: the input features are first processed by a batch normalization layer; then, an activation function is used to introduce nonlinearity. After the upsampling operation of the convolutional layer, noise is added to the feature map, and the process is repeated. When the set number of times is reached or the expected output high resolution is reached, the input features are finally convolved through a residual connection to gradually increase the image resolution and output a high-resolution image. The downsampling is as follows: the input features are first introduced with nonlinearity through the activation function, then the features are extracted through the convolution layer and processed with noise; then, the average pooling method is used to reduce the spatial size of the feature map to obtain the output feature map; using the residual connection, the input features are added to the pooled feature map to obtain a low-resolution image output.
8. The Chinese character image super-resolution reconstruction method based on the diffusion model according to any one of claims 4 to 6, characterized in that: In step S2, feature processing and fusion as well as feature decoupling are integrated into the multi-scale feature fusion pipeline of the iterative refinement phase, as follows: Feature processing and fusion stage, including staged convolution strategy and multi-level processing of features; Feature decoupling stage: A channel grouping mechanism is used to divide the features into several subgroups, and convolution kernels and dilation rates of different scales are configured for each subgroup. Through the decomposition operation, the computational costs of dilated convolution, depthwise separable convolution, and point convolution are effectively controlled.
9. The Chinese character image super-resolution reconstruction method based on the diffusion model according to claim 8, characterized in that: In step S4, the calculation cost is expressed as follows: Among them, n is the number of channel groups, C is the number of channels, H and W are the height and width of the feature map respectively, Corresponding to dilated convolution, (2d i -1) 2 Corresponds to depthwise separable convolution, and C corresponds to the pointwise convolution operation on each channel.
10. A Chinese character image super-resolution reconstruction system based on a diffusion model, used to execute the method according to any one of claims 1 to 9, characterized in that: Includes the following modules: Chinese steganographic image dataset construction module, used to construct a Chinese steganographic image dataset and generate high-resolution image and low-resolution image pairs; The conditional denoising diffusion model training module uses the conditional denoising diffusion model as a framework and uses the constructed Chinese steganographic image dataset as the conditional input of the diffusion model to guide the diffusion model to learn the mapping from low resolution to high resolution; The resolution reconstruction module uses the trained conditional denoising diffusion model to reconstruct the resolution of the low-resolution Chinese character image to be processed and outputs a high-resolution Chinese character image.
Citation Information
Cited By
Image processing-based aeronautical part identification character recognition method and system
CN121259803A
An image processing-based aviation part identification character recognition method and system
CN121259803B
