A complex power document image adaptive correction enhancement method

CN123015306APending Publication Date: 2026-10-30STATE GRID SHAANXI ELECTRIC POWER CO LTD ECONOMIC & TECHNICAL RESEARCH INSTITUTE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611521129.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-29
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

(2)拍摄角度倾斜导致的几何畸变;

Benefits of technology

(1)本发明在文档增强任务中引入退化分类器与门控退化路由器的联合学习框架,不同于现有方法对所有输入图像采用固定增强策略,DUCE-Net网络结构能够自动识别输入文档图像的退化类型,通过门控退化路由器自适应调制共享特征,并利用二维退化概率向量调整抗反光分支与倾斜校正分支在融合结果中的贡献,显著提升了多退化耦合场景下的鲁棒性;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015306A_ABST
    Figure CN123015306A_ABST
Patent Text Reader

Abstract

The application discloses a kind of complex electric power document image adaptive correction enhancement methods, belong to the technical field of image correction enhancement, the application will degraded image parallel input degradation classifier and with ResNet-18 as the backbone shared feature encoder, respectively obtain two-dimensional degradation probability vector and 256 channel shared feature;Channel level gating weight is generated by gate degradation router, and the shared feature is adaptively modulated, and the gated shared feature is respectively input into anti-reflection branch and tilt correction branch;According to the output characteristics of the two branches are weighted according to the reflection probability and the tilt probability, and are fused with the original shared feature;Enhanced image is generated by four-level upsampling and RGB mapping.The application adopts three-stage progressive training strategy based on degradation intensity progression, which can improve the reconstruction quality and character recognition accuracy of power document image under complex degradation conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of image correction and enhancement, specifically relating to an adaptive correction and enhancement method for complex power document images. Background Technology

[0002] With the deepening of digital transformation in my country's power industry, a massive amount of paper-based approval documents, equipment and material lists, engineering drawings, inspection records, and other documents require digital archiving and structured information extraction. Relevant reviews on the digital transformation of the power industry have pointed out the urgency of this trend. However, document visualization in the power industry typically faces the following complex challenges: (1) The surface of the document is reflective; (2) Geometric distortion caused by tilting the shooting angle; (3) Document degradation issues such as dirt, blurriness, and low contrast.

[0003] General-purpose OCR engines, such as industry benchmarks or PaddleOCR, can achieve character recognition accuracy of over 95% on ideal scanned documents, but their accuracy drops sharply in the complex scenarios mentioned above.

[0004] Currently, there is a lack of integrated correction and enhancement solutions that are tailored to the characteristics of power industry documents and can provide high-quality input for downstream OCR. Power industry documents generally exhibit characteristics such as dense specialized terminology, concentrated table layouts, text covered by seals, and mixed handwritten annotations. Existing image preprocessing methods, including deep learning image enhancement methods and bilateral filtering, can only solve single types of degradation problems, lack adaptive processing capabilities, and perform poorly in scenarios where multiple degradations occur simultaneously.

[0005] Based on the above background, this invention discloses an adaptive correction and enhancement method for complex power document images. Summary of the Invention

[0006] This invention discloses an adaptive correction and enhancement method for complex power document images. It designs a DUCE-Net network structure based on degradation perception. The DUCE-Net network structure integrates image optimization algorithms such as anti-reflection and tilt correction. Through a three-stage progressive training strategy and an adaptive joint correction module, it significantly improves the character recognition accuracy in complex scenes.

[0007] This invention is achieved through the following technical solution: An adaptive correction and enhancement method for complex power document images, implemented based on the DUCE-Net network structure, wherein the DUCE-Net network structure includes a degradation classifier that receives degraded images in parallel and an encoder with a ResNet residual network as its backbone, wherein a gated degradation router and an adaptive joint correction module are set between the encoder and the decoder, characterized by comprising the following steps: Step 1: Input the degraded image into the degradation classifier. The degradation classifier compresses the degraded image to obtain a multidimensional feature vector. The multidimensional feature vector is mapped into a two-dimensional logical value through a fully connected layer. The two-dimensional logical value is then converted into a two-dimensional degradation probability vector through the Sigmoid function. Step 2: Extract shared features from the degraded image. The degraded image is forward propagated through a ResNet residual network structure, and the layer 3 output of the ResNet residual network structure is extracted as the shared features of the degraded image. The number of channels of the shared features is 256. Step 3: Input the two-dimensional degradation probability vector and the shared features into the gated degradation router. The gated degradation router converts the two-dimensional degradation probability vector into a channel-level gating signal. Based on the channel-level gating signal, selectively activate or suppress each channel of the shared features to generate 256-dimensional channel-level gating weights. Then, weight the shared features channel by channel to obtain the gated shared features. Step 4: Input the gated shared features into the anti-reflection branch network for reflection correction to obtain the reflection correction output features; Step 5: Input the gated shared features into the tilt correction branch network for tilt correction to obtain the tilt correction output features; Step 6: Input the reflection correction output feature, tilt correction output feature, and shared feature into the adaptive joint correction module. The adaptive joint correction module weights the reflection correction output feature and tilt correction output feature based on the two-dimensional degradation probability vector, and then fuses the shared feature to obtain the fused feature. Step 7: Perform four-level upsampling on the fused features to restore the spatial size of the fused features to the original input size; use 3×3 convolution to map the 16-channel features output by the four-level upsampling to RGB three-channel output, and use the tanh activation function to constrain the output pixel values ​​of the RGB three-channel output to the (-1, 1) interval to obtain the enhanced image.

[0008] To better realize the present invention, step 1 further includes: Step 1.1: Input the degraded image into the degradation classifier, which includes four stacked unit convolutional blocks. Each unit convolutional block includes a 3×3 convolutional layer with a stride of 2, a batch normalization layer, and a ReLU activation function. Step 1.2: Perform adaptive average pooling on the output feature tensor D(4) of the fourth-level unit convolutional block to compress the spatial dimension of the output feature tensor of the fourth-level unit convolutional block to 1×1, and obtain a 256-dimensional feature vector. Step 1.3: The feature vector is mapped to an intermediate representation vector through the first fully connected layer. The intermediate representation vector is activated by the ReLU activation function and then subjected to Dropout regularization. Step 1.4: The intermediate representation vector is converted into a two-dimensional logical value through the second fully connected layer. The two-dimensional logical value is then converted into reflection probability and tilt probability through the Sigmoid function. The reflection probability and tilt probability constitute a two-dimensional degradation probability vector.

[0009] To better realize the present invention, step 3 further includes: Step 3.1: The gated degradation router performs global average pooling on the shared features to compress the spatial dimension of the shared features to obtain the channel description vector; Step 3.2: Concatenate the channel description vector and the two-dimensional degradation probability vector along the channel dimension to obtain a 258-dimensional joint representation vector; Step 3.3: The gated degradation router includes two fully connected layers. The joint representation vector is input into the first fully connected layer, and the joint representation vector is mapped from 258 dimensions to 64 dimensions before ReLU activation is performed. Step 3.4: After mapping the 64-dimensional intermediate representation vector to 256 dimensions through the second fully connected layer, Sigmoid activation is performed to generate 256-dimensional channel-level gating weights. The shared features are then weighted channel by channel to obtain the gated shared features.

[0010] To better realize the present invention, step 4 further includes: Step 4.1: Input the gated shared features into the anti-reflective branch network to obtain the reflective input features; the anti-reflective branch network includes three parallel deep convolutional branches; Step 4.2: Input the reflective input features into three parallel deep convolutional branches. The kernel sizes of the three deep convolutional branches are 3×3, 7×7 and 15×15, respectively. Each deep convolutional branch has 256 input channels and 256 output channels, and 256 groups. The 256-channel features output by the three deep convolutional branches are concatenated along the channel dimension to form a 768-channel feature tensor. Then, channel fusion is performed by a 1×1 pointwise convolution with 768 input channels and 256 output channels to obtain a 256-channel multi-scale fused feature. Step 4.3: Derive the specular mask from the multi-scale fusion features, apply the specular mask to the multi-scale fusion features for position-by-position weighting, and then perform residual connection with the reflective input features to obtain the reflective correction output features.

[0011] To better realize the present invention, step 5 further includes: Step 5.1: Input the gated shared features into the tilt correction branch network to obtain tilted input features; the tilt correction branch network includes two 3×3 convolutional layers, a first 1×1 convolutional layer and a second 1×1 convolutional layer set in sequence; Step 5.2: The skewed input features are output as 128-channel first-layer output features after passing through the first convolutional layer. The first-layer output features are then output as 64-channel second-layer output features after passing through the second convolutional layer. Step 5.3: Perform a 1×1 convolution on the output features of the second layer to generate a single-channel spatial attention map; Step 5.4: Apply the single-channel spatial attention map to the output features of the second layer and perform position-wise weighting to obtain 64-channel features. Map the weighted 64-channel features to 256 channels through the second 1×1 convolutional layer, and then perform residual connection with the tilted input features to obtain tilt-corrected output features.

[0012] To better realize the present invention, step 6 further includes: Step 6.1: Extract the reflection probability from the two-dimensional degradation probability vector, and weight the reflection correction output feature using the reflection probability; Step 6.2: Extract the tilt probability from the two-dimensional degradation probability vector, and weight the tilt correction output feature using the tilt probability; Step 6.3: Add and fuse the weighted reflection correction output feature, the weighted tilt correction output feature, and the shared feature to obtain the fused feature.

[0013] To better realize the present invention, step 7 further includes: Step 7.1: Input the fused features into a four-level transposed convolution and perform four levels of upsampling to restore the size of the fused features to the original size when inputting into the degenerate classifier; the transposed convolution has a size of 4×4 and a stride of 2; the first-level transposed convolution has 256 input channels and 128 output channels; the second-level transposed convolution has 128 input channels and 64 output channels; the third-level transposed convolution has 64 input channels and 32 output channels; the fourth-level transposed convolution has 32 input channels and 16 output channels. Step 7.2: Use 3×3 convolution to map the 16-channel features output by the fourth-level transposed convolution to RGB three-channel output; Step 7.3: Use the tanh activation function to map the output pixel values ​​of the RGB three channels to the (-1, 1) interval to obtain the enhanced image.

[0014] To better realize this invention, a clean image is further introduced, and the error between each pixel of the enhanced image and the clean image is calculated as the pixel-level loss. The enhanced image and the clean image are respectively input into a pre-trained VGG-19 network, and the enhanced feature map and the clean feature map output by the 36th layer of the VGG-19 network are extracted. The distance between the feature elements on the enhanced feature map and the clean feature map is calculated as the perceptual loss. The mean loss of the two-dimensional degradation probability vector is calculated on both the reflection dimension and the tilt dimension using two-dimensional multi-label binary cross-entropy as the degradation classification loss. The structural similarity index between the enhanced image and the clean image is calculated, and 1 is subtracted from the structural similarity index as the SSIM loss. The total loss of the DUCE-Net network structure is calculated by weighting the pixel-level loss, perceptual loss, degradation classification loss, and SSIM loss.

[0015] To better realize this invention, pixel-level loss, perceptual loss, degenerate classification loss, and SSIM loss are further introduced into the DUCE-Net network structure. A three-stage progressive training method based on progressive degradation intensity is adopted for the DUCE-Net network structure. Each of the three progressive training stages uses a total loss function composed of pixel-level loss, perceptual loss, degenerate classification loss, and SSIM loss. The weights of pixel-level loss, perceptual loss, degenerate classification loss, and SSIM loss remain constant throughout the training process to ensure the consistency of the optimization objective at different stages. Each of the three progressive training stages is set to no degradation and single... Four types of samples—reflection, single tilt, and combined reflection and tilt degradation—are used to cover all combinations of degradation labels, enabling the degradation classifier to obtain complete multi-label supervision signals. The three-stage progressive training gradually increases the degradation simulation parameters to raise the difficulty of the training samples. The first stage uses mild degradation, with a reflection intensity parameter of 0.2–0.5 and a tilt angle range of ±15°. The second stage uses moderate degradation, with a reflection intensity parameter of 0.3–0.8 and a tilt angle range of ±25°. The third stage uses severe degradation, with a reflection intensity parameter of 0.5–1.0 and a tilt angle range of ±35°. Through this progressive degradation intensity approach, the model first learns basic image reconstruction and degradation perception capabilities under mild degradation conditions, then gradually adapts to more severe reflection and tilt degradation, ultimately improving the model's image reconstruction accuracy and robustness under complex combined degradation conditions.

[0016] To better realize the present invention, further, the number of training rounds in the first stage of progressive training is not less than 2 rounds; the number of training rounds in the second stage of progressive training is not less than 3 rounds; and the number of training rounds in the third stage of progressive training is not less than 4 rounds.

[0017] Compared with the prior art, the present invention has the following advantages and beneficial effects: (1) This invention introduces a joint learning framework of degradation classifier and gated degradation router in document enhancement task. Unlike existing methods that use a fixed enhancement strategy for all input images, the DUCE-Net network structure can automatically identify the degradation type of the input document image. It adaptively modulates shared features through gated degradation router and uses two-dimensional degradation probability vector to adjust the contribution of anti-reflection branch and tilt correction branch in the fusion result, which significantly improves the robustness in multi-degradation coupled scenarios. (2) The present invention designs a parallel processing architecture with two branches for reflection suppression and tilt correction. Through an adaptive fusion mechanism of weighted two-dimensional degradation probability vectors, it realizes the collaborative correction of multiple types of degradation. The anti-reflection branch adopts a multi-scale feature extraction and specular mask attention mechanism to locate and suppress specular reflection areas. The tilt correction branch is based on convolutional feature extraction and spatial attention mechanism to perform adaptive feature enhancement and correction on tilt distortion-related areas. The two branches work together to avoid the problem of error accumulation in the traditional serial processing flow. (3) In view of the characteristics of special terminology, table lines, and stamp coverage in power documents, this invention designs a three-stage progressive training strategy based on progressive degradation intensity. By increasing the degradation intensity of the training samples in stages, the progressive optimization from mild degradation to severe degradation is achieved while keeping the joint loss function and the weight of each loss term unchanged. (4) The present invention uses ResNet-18 as the backbone network of the shared feature encoder. The backbone network extracts 256 channels of shared features, providing a unified feature representation for degradation perception gated routing, anti-glare correction, tilt correction and progressive content preservation decoding. At the same time, the model output can be directly connected to the existing OCR pipeline without modifying the back-end recognition module, reducing the integration cost with the existing OCR system.

[0018] Figure 1 This is a schematic diagram of the method flow of the present invention; Figure 2 This is a schematic diagram of the DUCE-Net network structure; Figure 3 A diagram showing the comparison of OCR accuracy of different methods on three datasets; Figure 4 The graph shows the training loss curve for the three-stage DUCE-Net network structure. Figure 5 A graph showing the trend of PSNR changes; Figure 6 This is a schematic diagram of the ablation experiment results; Figure 7 Radar graph for evaluating the degradation resistance of the DUCE-Net network structure. Detailed Implementation

[0019] Example 1: This embodiment discloses an adaptive correction and enhancement method for complex power document images, implemented based on the DUCE-Net network structure. The DUCE-Net network structure includes a degradation classifier that receives degraded images in parallel and an encoder with a ResNet residual network as its backbone. A gated degradation router and an adaptive joint correction module are set between the encoder and the decoder. Figure 1 As shown, it includes the following steps: Step 1: Input the degraded image into the degradation classifier. The degradation classifier compresses the degraded image to obtain a multidimensional feature vector. The multidimensional feature vector is mapped into a two-dimensional logical value through a fully connected layer. The two-dimensional logical value is then converted into a two-dimensional degradation probability vector through the Sigmoid function. Furthermore, step 1 specifically includes: Step 1.1: Input the degraded image into the degradation classifier, which includes four stacked unit convolutional blocks. Each unit convolutional block includes a 3×3 convolutional layer with a stride of 2, a batch normalization layer, and a ReLU activation function. The degraded image is input into a degradation classifier, which includes four stacked unit convolutional blocks. Each unit convolutional block consists of a 3×3 convolutional layer with a stride of 2, a batch normalization layer, and a ReLU activation function. The number of output channels increases sequentially from 32 to 64, 128, and 256. After compression by the four-level unit convolutional blocks, the spatial dimension of the degraded image is compressed to 1×1 by adaptive average pooling, and flattened into a 256-dimensional feature vector. The 256-dimensional feature vector is output through two fully connected layers. The 256-dimensional feature vector is mapped to a 128-dimensional intermediate representation vector by the first fully connected layer, and the 128-dimensional intermediate representation is then mapped to a two-dimensional logical value by the second fully connected layer.

[0020] Step 1.2: The output feature tensor D of the fourth-level unit convolutional block... (4) Adaptive average pooling is performed to compress the spatial dimension of the output feature tensor of the fourth-level unit convolution block to 1×1, resulting in a 256-dimensional feature vector. Step 1.3: The feature vector is mapped to an intermediate representation vector through the first fully connected layer. The intermediate representation vector is activated by the ReLU activation function and then subjected to Dropout regularization. Step 1.4: The intermediate representation vector is converted into a two-dimensional logical value through the second fully connected layer. The two-dimensional logical value is then converted into reflection probability and tilt probability through the Sigmoid function. The reflection probability and tilt probability constitute a two-dimensional degradation probability vector.

[0021] Specifically: The degradation classifier is a lightweight convolutional neural network, whose input is a normalized degradation image. The network parameters of the degradation classifier are independent of those of the shared feature encoder, but under the constraint of the total loss function, they are jointly trained end-to-end with a gated degradation router, a two-branch correction module, and a progressive content preservation decoder. Degraded images are constructed based on a document highlighting dataset, a text detection dataset built using MSRA-TD500, and a synthetic contrast dataset. The document highlighting dataset, text detection dataset, and synthetic contrast dataset correspond to three data construction paradigms: real-world business natural degradation, general scenario natural degradation, and artificially controlled synthetic degradation, respectively. The sample size, degradation source, and construction method of each dataset are as follows: 1. Document highlighting dataset This dataset is a real-world dataset specifically designed for the power industry, covering typical document types such as paper approval documents, equipment and material lists, engineering drawings, and inspection records. The dataset uses clear, distortion-free, and glare-free images obtained through professional high-definition scanning as clean label images. Degraded images are all naturally collected from real-world business scenarios, acquired through conventional digitization methods such as handheld shooting and ordinary office scanning. Various degradation types are naturally introduced during the imaging process, including specular reflections, tilted shooting angles, paper damage and creases, and blurred printed characters; these are genuine degradation samples without human intervention.

[0022] 2. Text Detection Dataset This dataset is a publicly available benchmark dataset for text detection in natural scenes, widely used in academia, covering various text carriers such as street view signs, invoices, public notices, and printed materials. Based on the original MSRA-TD500 images, this invention, after screening, degradation synthesis, and data augmentation, forms 466 training samples and 266 test samples to verify the model's generalization ability in common text scenarios.

[0023] 3. Synthesize the comparison dataset This dataset is a manually controlled, degraded dataset. Standard, clear power industry document templates are selected as clean base maps, covering three typical power industry formats: tabular documents, text documents, and drawing documents. The degraded images in the dataset are quantitatively generated using digital image processing algorithms, allowing for precise control over the type and intensity of degradation. The specific construction methods are divided into three categories: 1. Illumination-related degradation: Simulates specular reflection and low-contrast scenes by overlaying specular masks and compressing the dynamic range of the image; 2. Geometric Degradation: Simulates geometric distortion caused by camera tilt through affine and perspective transformations; 3. Image quality degradation: By adding Gaussian noise and Gaussian blur, character blurring and noise pollution are simulated.

[0024] Each degraded image has a unique corresponding original clean background image as a ground truth label, ensuring that the degradation variable is controllable and the pairing relationships are clear. This dataset is used for quantitative comparison of algorithms under controllable variables, accurately measuring the ability of different methods to repair a single type of degradation.

[0025] The degradation classifier consists of four stacked convolutional units. Each unit contains a 3×3 convolutional layer with a stride of 2, a batch normalization layer, and a ReLU activation function. The output channels of the four units are 32, 64, 128, and 256 respectively, progressively compressing the spatial dimensions of the degradation image to H / 16×W / 16, where H represents the original height of the degradation image and W represents the original width. Subsequently, the output feature tensor D of the fourth-level unit is processed... (4) Adaptive average pooling is performed to compress the spatial dimension of the output feature tensor of the fourth-level convolutional block to 1×1, resulting in a 256-dimensional feature vector. This feature vector is mapped to a 128-dimensional intermediate representation vector via the first fully connected layer. After ReLU activation and Dropout regularization, the intermediate representation vector is passed through a second fully connected layer to output a two-dimensional logistic value z = (z... g , z t ) T The two-dimensional logic value is converted into glare probability and tilt probability using the Sigmoid function, and the glare probability and tilt probability constitute a two-dimensional degradation probability vector. The above process can be formally expressed as: ; ; Where: D (0) The input tensor of the first-level unit convolutional block of the degradation classifier is represented by the normalized degradation image I, which has dimensions of 3×H×W; D (s) Let s be the output tensor of the s-th level unit convolution block, where s iterates through {1, 2, 3, 4}; (...) indicates a convolution operation with a kernel size of 3×3 and a stride of 2; is the output tensor of the (s-1)th level unit convolutional block; BN(...) represents the batch normalization operation; ReLU[...] represents the modified linear unit activation function. The number of output channels of the four levels of unit convolutional blocks are 32, 64, 128, and 256 respectively, and the spatial resolution is compressed to H / 2×W / 2, H / 4×W / 4, H / 8×W / 8, and H / 16×W / 16 respectively.

[0026] Further calculate the channel description vector have: ; Where: GAP(...) represents the global average pooling operation; h=H / 16 and w=W / 16 are the height and width of the 4th level classification feature tensor, respectively; ∈R 256 Channel description vectors generated for the degenerate classifier; D (4) This represents the output tensor of the 4th level unit convolutional block; Let represent the slice of features of all channels of the output tensor of the 4th level unit convolution block at spatial location (i, j), where i∈[1, h] and j∈[1, w].

[0027] ; in: This is the weight matrix of the first fully connected layer in the degenerate classifier. ∈R 128×256 ; This is the weight matrix of the second fully connected layer in the degenerate classifier. ∈R 2×128 ; This is the bias vector corresponding to the first fully connected layer. ∈R 128 ; This is the bias vector corresponding to the second fully connected layer. ∈R 2 z is a two-dimensional logical value vector, z = (z g , z t ) T .

[0028] Further, there are: ; in: This represents the Sigmoid activation function, which non-linearly maps logical values ​​to the interval (0, 1) as a probability output. and Let represent the reflectivity degradation probability and the tilt degradation probability, respectively, both of which take values ​​in the range of (0, 1). Indicates the logic value for reflection; represents the skewed logic value; e represents the base of the natural logarithm; x represents the input value of the Sigmoid activation function.

[0029] A two-dimensional degradation probability vector is constructed based on the reflectivity probability and the tilt probability. for: This design supports the joint recognition of two degradation types in a single image.

[0030] During the training phase, the optimization objective of the degradation classifier is to minimize the two-dimensional multi-label binary cross-entropy loss, enabling the model to autonomously identify the type of degradation suffered by the input image. This classifier allows... and If predicted independently, the same image can be simultaneously classified as both reflection and tilt degradation.

[0031] Step 2: Extract shared features from the degraded image. The degraded image is forward propagated through a ResNet residual network structure, and the layer 3 output of the ResNet residual network structure is extracted as the shared features of the degraded image. The number of channels of the shared features is 256. Specifically: For any input degraded image, its dimension is 3×H×W, and its elements are integer pixel values ​​in the range [0, 255]. First, the pixel values ​​of the degraded image are normalized from [0, 255] to [-1, 1] to obtain a normalized image. The normalized image I is then input sequentially into conv1, maxpool, layer1, layer2, and layer3 of the ResNet-18 backbone network, and the output of layer3 is taken as the shared feature. The shared feature is denoted as F, and its dimension is 256×h×w, where h=H / 16 and w=W / 16. The above process can be formally expressed as: ; Where: f ResNet-18 (…) represents the forward mapping function of the ResNet-18 backbone network, which is composed of conv1, maxpool, layer1, layer2, and layer3 stacked sequentially. conv1 is a 7×7 convolution with a stride of 2; I represents the normalized image; F represents the shared features output by layer3 of the ResNet-18 backbone network, F∈R 256×h×w h=H / 16, w=W / 16. This feature will serve as a shared representation for subsequent gated routing, dual-branch correction, adaptive fusion, and the entire decoding and reconstruction process.

[0032] Step 3: Input the two-dimensional degradation probability vector and the shared features into the gated degradation router. The gated degradation router converts the two-dimensional degradation probability vector into a channel-level gating signal. Based on the channel-level gating signal, selectively activate or suppress each channel of the shared features to generate 256-dimensional channel-level gating weights. Then, weight the shared features channel by channel to obtain the gated shared features. Furthermore, step 3 specifically includes: Step 3.1: The gated degradation router performs global average pooling on the shared features to compress the spatial dimension of the shared features to obtain the channel description vector; Step 3.2: Concatenate the channel description vector and the two-dimensional degradation probability vector along the channel dimension to obtain a 258-dimensional joint representation vector; Step 3.3: The gated degradation router includes two fully connected layers. The joint representation vector is input into the first fully connected layer, and the joint representation vector is mapped from 258 dimensions to 64 dimensions before ReLU activation is performed. Step 3.4: After mapping the 64-dimensional intermediate representation vector to 256 dimensions through the second fully connected layer, Sigmoid activation is performed to generate 256-dimensional channel-level gating weights. The shared features are then weighted channel by channel to obtain the gated shared features.

[0033] Specifically: The core idea of ​​a gated degradation router is to convert the two-dimensional degradation probability vector output by the degradation classifier into a channel-level gating signal, selectively activating or suppressing each channel with shared features, thereby guiding subsequent enhancement branches to focus on the degradation types they are good at.

[0034] Gated degenerate routers first consider the shared features F∈R 256×h×w Perform global average pooling to compress the spatial dimension and obtain the gated channel description vector. ∈R 256 Subsequently, With the two-dimensional degradation probability vector p∈R 2 Concatenate along the feature dimensions to form a 258-dimensional joint representation vector. The joint representation vector passes through two fully connected layers. The first fully connected layer maps the dimension from 258 to 64 and then applies ReLU activation. The second fully connected layer maps the dimension from 64 back to 256 and then applies Sigmoid activation, generating 256-dimensional channel-level gated weights g∈(0,1). 256 The above process can be formally expressed as: ; ; in: ∈R 64×258 , ∈R 256×64 These are the weight matrices of the two fully connected layers in a gated degradation router. ∈R 64 , ∈R 256 These are the bias vectors corresponding to the two fully connected layers; ;p]∈R 258 This represents a joint representation vector, where the first 256 dimensions are the gated channel description vectors, and the last 2 dimensions are the two-dimensional degradation probability vectors, for a total of 258 dimensions. This represents a slice of the feature values ​​of all channels at spatial location (i, j) that represents the shared feature. [...] represents the Sigmoid activation function; ReLU(...) represents the ReLU function.

[0035] The gated feature tensor is then represented as: ; in: This represents the nth channel slice of the gated feature tensor. F represents the gated shared feature after gating. gated ∈R 256×h×w ; n represents the feature channel number, traversing all 256 channels; g n F[n,:,:] represents the nth component of the channel-level gated weight vector g; F[n,:,:] represents the nth channel slice of the shared feature F.

[0036] The shared features after gating serve as inputs to both the anti-reflective branch and the tilt correction branch, denoted as: ; Wherein: F glare F represents the reflective input characteristics of the anti-reflective branch. tilt The tilt input features represent the tilt correction branch, and both have dimensions of 256×h×w.

[0037] The gating mechanism achieves feature selection through channel-by-channel scalar multiplication, when p g When p is high, meaning the image has severe reflection, the router will increase the channel weights related to reflection correction based on the learned mapping relationship; conversely, when p is low... t The gating weights are high, meaning that when the image is severely tilted, the corresponding tilt correction-related channels are significantly activated. The gating weights are generated by a fully connected network, and the entire routing process is continuously differentiable, allowing for joint backpropagation optimization with downstream branches. The Sigmoid algorithm maps the gating coefficients to the (0, 1) interval, achieving adaptive modulation of the characteristic channel responses.

[0038] Step 4: Input the gated shared features into the anti-reflection branch network for reflection correction to obtain the reflection correction output features; Furthermore, step 4 specifically includes: Step 4.1: Input the gated shared features into the anti-reflective branch network to obtain the reflective input features; the anti-reflective branch network includes three parallel deep convolutional branches; Step 4.2: Input the reflective input features into three parallel deep convolutional branches. The kernel sizes of the three deep convolutional branches are 3×3, 7×7 and 15×15, respectively. Each deep convolutional branch has 256 input channels and 256 output channels, and 256 groups. The 256-channel features output by the three deep convolutional branches are concatenated along the channel dimension to form a 768-channel feature tensor. Then, channel fusion is performed by a 1×1 pointwise convolution with 768 input channels and 256 output channels to obtain a 256-channel multi-scale fused feature. Step 4.3: Derive the specular mask from the multi-scale fusion features, apply the specular mask to the multi-scale fusion features for position-by-position weighting, and then perform residual connection with the reflective input features to obtain the reflective correction output features.

[0039] Specifically: The anti-reflective branch network receives gated features, uses multi-scale deep convolution to extract reflective features under different receptive fields, and uses a specular mask attention mechanism to accurately locate and suppress specular reflection areas.

[0040] First, the gated shared feature F gated This is used as the input to the anti-reflective branch network, and is denoted as the reflective input feature F. glare Next, F glare The inputs are fed into three parallel deep convolutional branches with kernel sizes of 3×3, 7×7, and 15×15, respectively. Each convolutional group has 256 input and output channels, and the number of groups equals the number of channels (256). Channel fusion is then achieved through pointwise 1×1 convolutions. The outputs of the three branches are concatenated along the channel dimension to form a 768-channel feature tensor. A 1×1 convolution then compresses the channel number from 768 back to 256, yielding the multi-scale fused feature F. ms : ; Among them: DWconv k (...) represents a depthwise convolution operation with a kernel size of k×k, where k∈{3,7,15}; Concat(...) represents a tensor concatenation operation along the channel dimension, concatenating the 256-channel outputs of each of the three branches into 768 channels; [...] indicates a pointwise convolution that compresses 768 channels into 256 channels; F ms For multi-scale fusion features, F ms ∈R 256×h×w .

[0041] Subsequently, from F ms The specular mask is derived by mapping the 256 channels to a single channel through a 1×1 convolution, and then normalizing it to (0, 1) using the Sigmoid function, as follows: ; in: (...) indicates compressing 256 channels into a single-channel pointwise convolution; (...) is the Sigmoid activation function; M glare For a single-channel specular mask, M glare ∈(0,1) 1×h×w h and w represent the height and width of the feature map, respectively; M glare(i, j) represents the confidence level that there is a specular highlight at spatial location (i, j), and the value ranges from (0, 1). The closer the value is to 1, the higher the probability that there is a specular highlight at that location; the closer the value is to 0, the lower the probability that there is a specular highlight at that location.

[0042] Applying a single-channel specular mask to the multi-scale fusion feature F ms The feature is then weighted position by position, and then restored to 256 dimensions through a 1×1 convolution. Finally, it is combined with the reflected input feature F. glare Residual joins include: ; Where: ⊙ represents element-wise product, i.e., M glare Each spatial location (i, j) and F ms Multiply all 256 channels at the corresponding position (i, j) respectively; (...) represents a pointwise convolution with invariant channels; F agb For the reflection correction output characteristics of the reflection correction branch, F agb ∈R 256×h×w The residual connection design ensures that in normal, non-reflective regions, the branch output degenerates into an identity mapping, avoiding the introduction of additional distortion. Three types of convolutional kernels (3×3, 7×7, and 15×15) are used in parallel to cover a multi-scale receptive field, from local details to the global reflectivity distribution. A single-channel specular mask M... glare Adaptive learning of reflective areas eliminates the need for manual prior labeling.

[0043] Step 5: Input the gated shared features into the tilt correction branch network for tilt correction to obtain the tilt correction output features; Furthermore, step 5 specifically includes: Step 5.1: Input the gated shared features into the tilt correction branch network to obtain tilted input features; the tilt correction branch network includes two 3×3 convolutional layers, a first 1×1 convolutional layer and a second 1×1 convolutional layer set in sequence; Step 5.2: The skewed input features are output as 128-channel first-layer output features after passing through the first convolutional layer. The first-layer output features are then output as 64-channel second-layer output features after passing through the second convolutional layer. Step 5.3: Perform a 1×1 convolution on the output features of the second layer to generate a single-channel spatial attention map; Step 5.4: Apply the single-channel spatial attention map to the output features of the second layer and perform position-wise weighting to obtain 64-channel features. Map the weighted 64-channel features to 256 channels through the second 1×1 convolutional layer, and then perform residual connection with the tilted input features to obtain tilt-corrected output features.

[0044] Specifically: The tilt correction branch network employs lightweight convolution stacking and spatial attention mechanisms to achieve adaptive compensation and enhancement of tilt distortion-related features. First, it shares the same gated feature F. gated This is used as the input to the tilt correction branch network, and is denoted as the tilt input feature F. tilt Subsequently, F tilt The data passes through two convolutional layers: the first is a 3×3 convolution, from 256 to 128 channels, with batch normalization and ReLU activation; the second is a 3×3 convolution, from 128 to 64 channels, also with batch normalization and ReLU activation. The output features of the first layer are then represented as: ; in: (...) indicates a convolution operation with a 3×3 kernel, 256 input channels, and 128 output channels; BN(...) is batch normalization; ReLU(...) is corrected linear unit activation; F1 represents the skewed input features; F1 represents the first layer output features, F1∈R 128×h×w .

[0045] The output features of the first layer, after passing through the second convolutional layer, output 64 channels of the second layer's output features, as shown below: ; in: (...) indicates a convolution operation with a 3×3 kernel, 128 input channels, and 64 output channels; F2 represents the output features of the second layer, F2∈R 64×h×w The number of channels has been further reduced from 128 to 64.

[0046] Based on the output features of the second layer, a single-channel spatial attention map is generated through a 1×1 convolution, and then normalized to (0, 1) by Sigmoid activation. The single-channel spatial attention map is represented as follows: ; in: (...) represents compressing 64 channels into a single-channel pointwise convolution; σ(...) is the Sigmoid activation function; A s For a single-channel spatial attention map, A s ∈(0,1) 1×h×w The value of at each spatial location (i, j) represents the response weight of that location to tilt correction, with a value range of (0, 1). Higher response weights are given to the spatial distortion region caused by tilt.

[0047] A single-channel spatial attention map achieves adaptive correction of spatial dimensions. After applying it to F2, a 1×1 convolution is used to project the 64 channels back to 256 dimensions. Finally, the residual is compared with F2. tiltThe summation yields the tilt-corrected output characteristics as follows: ; Where: ⊙ represents element-wise product, A s Each spatial location (i, j) is multiplied by the 64 channels of the corresponding location (i, j) in F2; (...) represents a pointwise convolution that expands 64 channels to 256 channels; F tcb F represents the tilt correction output characteristic. tcb ∈R 256×h×w The output features of the tilt correction branch are shown. The design of the residual connection also ensures that the output degenerates to an identity mapping in a normal image without tilt. The tilt correction branch does not directly output a corrected image, but generates compensation features related to tilt distortion; these compensation features are weighted and fused by the adaptive joint correction module, and then upsampled and reconstructed by the progressive content-preserving decoder, ultimately correcting the tilt distortion of the output image.

[0048] Step 6: Input the reflection correction output feature, tilt correction output feature, and shared feature into the adaptive joint correction module. The adaptive joint correction module weights the reflection correction output feature and tilt correction output feature based on the two-dimensional degradation probability vector, and then fuses the shared feature to obtain the fused feature. Furthermore, step 6 specifically includes: Step 6.1: Extract the reflection probability from the two-dimensional degradation probability vector, and weight the reflection correction output feature using the reflection probability; Step 6.2: Extract the tilt probability from the two-dimensional degradation probability vector, and weight the tilt correction output feature using the tilt probability; Step 6.3: Add and fuse the weighted reflection correction output feature, the weighted tilt correction output feature, and the shared feature to obtain the fused feature.

[0049] Specifically: The adaptive joint correction module is responsible for integrating the reflection correction output features and the tilt correction output features, and fusing the reflection correction output features and the tilt correction output features back into the original shared features using a residual method weighted by a two-dimensional degradation probability vector, as shown below: ; Wherein: F fused F represents the fusion feature. fused ∈R 256×h×w F represents the fused features output by the adaptive joint correction module; F represents the ungated original shared features; F agb For reflection correction output characteristics; F tcb For tilt correction output characteristics; p g p represents the reflectivity probability. t This represents the tilt probability.

[0050] This weighted fusion mechanism has the following characteristics: In a purely reflective degradation scene, p g Higher, p t At lower values, the contribution of the tilt branch approaches zero, and the fusion result is dominated by the reflection branch; the same applies to pure tilt degradation scenarios, where p g Lower, p t At higher resolutions, the fusion result is dominated by the tilted branch; in mixed degradation scenarios, the dual-branch synergy achieves joint restoration of multiple degradations; in normal images, when p g ≈0, p t When ≈0, the additional contribution of the two branches approaches zero, and the fused feature approximately degenerates into the original shared feature F.

[0051] Step 7: Input the fused features into the fourth-level upsampling module to restore its spatial size to the original input size; use 3×3 convolution to map the 16-channel features of the fourth-level upsampling output into RGB three-channel output, and use the tanh activation function to constrain the output pixel values ​​to the (-1, 1) interval to obtain the enhanced image; Furthermore, step 7 specifically includes: Step 7.1: Input the fused features into a four-level transposed convolution and perform four levels of upsampling to restore the size of the fused features to the original size when inputting into the degenerate classifier; the transposed convolution has a size of 4×4 and a stride of 2; the first-level transposed convolution has 256 input channels and 128 output channels; the second-level transposed convolution has 128 input channels and 64 output channels; the third-level transposed convolution has 64 input channels and 32 output channels; the fourth-level transposed convolution has 32 input channels and 16 output channels. Step 7.2: Use 3×3 convolution to map the 16-channel features output by the fourth-level transposed convolution to RGB three-channel output; Step 7.3: Use the tanh activation function to map the output pixel values ​​of the RGB three channels to the (-1, 1) interval to obtain the enhanced image.

[0052] Specifically: The fused features are fed into a progressive content-preserving decoder, which gradually restores the spatial resolution through four levels of transposed convolutions. Each decoder block contains a 4×4 transposed convolution with a stride of 2, doubling the spatial size, followed by batch normalization and a ReLU activation function. The number of input and output channels at each level is as follows: Level 1 256→128, Level 2 128→64, Level 3 64→32, Level 4 32→16. After four levels of upsampling, the height and width of the feature map are restored to the original input's H×W. Finally, a 3×3 convolution maps the 16 channels to RGB channels, followed by a tanh activation function to map the output pixel values ​​to the (-1, 1) interval, resulting in the enhanced image. The above process can be formally expressed as: ; ; Among them: U (0) This represents the initial input tensor of the progressive content-preserving decoder, i.e., the fused feature F output by the adaptive joint correction module. fused Its dimensions are 256×h×w, where h=H / 16 and w=W / 16; (...) represents a transposed convolution with a 4×4 kernel and a stride of 2, which doubles the spatial size each time; BN(...) is batch normalization; ReLU(...) is corrected linear unit activation; U (r) U represents the feature tensor after upsampling at level r; (r-1) Represents the feature tensor after upsampling at level r-1; ReLU[…] represents the ReLU function.

[0053] The enhanced image can then be obtained as follows: ; in: (...) represents a convolution operation with a 3×3 kernel, 16 input channels, and 3 output channels, mapping the feature map to the RGB three channels; tanh(...) is the hyperbolic tangent activation function, mapping the output pixel value to the (-1, 1) interval; I enhanced Indicates an enhanced image, I enhanced ∈(-1, 1) 3×H×W ; This represents the feature tensor after level 4 upsampling.

[0054] During inference, a standard RGB image can be obtained by linearly mapping it back to [0, 255]. Four-level progressive upsampling better preserves detail and texture compared to a single large-span upsampling; the channel number is compressed step-by-step from 256 to 128 to 64 to 32 to 16, effectively reducing the number of parameters and computational overhead; the tanh activation function maps the output pixel values ​​to the (-1, 1) interval, making the training process numerically stable.

[0055] Example 2: This embodiment discloses an adaptive correction and enhancement method for complex power document images. Based on Embodiment 1, it optimizes the method by introducing a clean image and calculating the error between each pixel of the enhanced image and the clean image as the pixel-level loss. The enhanced image and the clean image are input into a pre-trained VGG-19 network, and the enhanced feature map and clean feature map output from the 36th layer of the VGG-19 network are extracted. The distance between feature elements on the enhanced feature map and the clean feature map is calculated as the perceptual loss. Two-dimensional multi-label binary cross-entropy is used to calculate the mean loss of the two-dimensional degradation probability vector in both the reflection and tilt dimensions as the degradation classification loss. The structural similarity index between the enhanced image and the clean image is calculated, and 1 is subtracted from this structural similarity index as the SSIM loss. The total loss of the DUCE-Net network structure is calculated by weighting the pixel-level loss, perceptual loss, degradation classification loss, and SSIM loss.

[0056] To address the convergence challenge in multi-task joint optimization, a three-stage progressive training approach is employed for the DUCE-Net network architecture. This strategy utilizes the same joint loss function and fixed loss weights across all three stages, achieving progressive optimization by gradually increasing the degradation intensity of the training samples.

[0057] Phase 1, consisting of two rounds: pixel-level loss, perceptual loss, degradation classification loss, and SSIM loss are all enabled, allowing the network to initially learn basic image reconstruction capabilities. This phase enables the network to jointly learn basic image reconstruction, degradation type recognition, and structure preservation capabilities under mild degradation conditions, establishing stable initial parameters for subsequent training under moderate and severe degradation.

[0058] Phase Two, consisting of three rounds: pixel-level loss, perceptual loss, degradation classification loss, and SSIM loss are all enabled to guide the network to further adapt to moderate degradation conditions and enhance degradation type recognition, gated routing, and image reconstruction capabilities.

[0059] Phase 3 consists of 4 rounds: pixel-level loss, perceptual loss, degradation classification loss, and SSIM loss are all enabled. While preserving texture details, the four losses are jointly optimized under severe degradation conditions, and all network parameters are fine-tuned end-to-end.

[0060] The only difference between the three stages is the increasing intensity of degradation. By using degradation data of different intensities, the model learns to smoothly transition from mild degradation to heavy degradation while maintaining robustness.

[0061] The total loss function of the DUCE-Net network structure is a weighted combination of four components, expressed as: ; Where: L total L is the total loss scalar; pixelL perceptual L degradation L SSIM The loss methods are pixel-level loss, perceptual loss, degenerate classification loss, and SSIM loss, respectively; the weights of the pixel-level loss, perceptual loss, degenerate classification loss, and SSIM loss are set as follows: pixel =1.0、 perceptual =0.5、 degradation =0.3、 SSIM =0.3, and the weights remain unchanged throughout the three training phases.

[0062] Pixel-level loss is used to calculate the mean of the absolute error at each pixel location for the enhanced image and the cleaned target image, ensuring pixel-level reconstruction accuracy.

[0063] ; in: I represents the enhanced image output by the network at color channel index c and spatial location (i, j). enhanced ∈(-1, 1) 3×H×W ; I represents a non-degradable clean image at color channel index c and spatial location (i, j). clean ∈[-1, 1] 3×H×W ;c represents the color channel index, c=1, 2, 3, corresponding to the three RGB color channels respectively;i represents the position index in the height direction, i=1,...,H;j represents the position index in the width direction, j=1,...,W;|…| is the absolute value operation. L pixel The value range is [0, 2), and the smaller the value, the higher the pixel-level reconstruction accuracy.

[0064] Perceptual loss is used to input the enhanced image and the clean label into the pre-trained VGG-19 network, extract the feature map of the 36th layer, and calculate the distance between the feature elements on the enhanced feature map and the clean feature map as the perceptual loss to constrain the consistency of high-level semantic representation. The perceptual loss is particularly important for preserving text edges and texture details.

[0065] ; in: This represents the feature map of layer 36 in the VGG-19 network; Indicates an enhanced image; Indicates a clean image; C 36 H 36 W 36 These represent the number of channels, height, and width of the feature map at this layer, respectively; Lperceptual This represents the mean squared difference between enhanced and cleaned image features across all feature map elements in layer 36 of the VGG-19 network.

[0066] The degradation classification loss is used to supervise the training of the degradation classifier, enabling it to accurately determine whether the input image has reflective degradation and / or tilt degradation.

[0067] Using a two-dimensional multi-label binary cross-entropy, after calculating the loss for each of the two degenerate dimensions and then taking the mean, we have: ; Where: q is the degeneracy type index. g represents reflectivity degradation, and t represents tilt degradation; when q takes the value of g, p q y represents the predicted probability of reflective degradation. q This indicates a realistic label with reduced reflectivity; when q equals t, p q y represents the predicted probability of tilt degradation. q Indicates a skewed, degenerate true label; p q The range of values ​​for y is (0, 1). q The value of is 0 or 1, where 1 indicates that the current input image has corresponding degradation, and 0 indicates that there is no corresponding degradation; ln(...) is the natural logarithm function. Since the same image may contain both reflective degradation and tilt degradation, the binary cross-entropy loss for the two degradation dimensions is calculated separately, and the average of the two is taken as the degradation classification loss; This represents the mean after loss.

[0068] SSIM loss is used to constrain the structural similarity between the enhanced and cleaned images, preventing the introduction of geometric distortion or texture warping during enhancement. SSIM loss is denoted as: ; Where: SSIM(…,…) is the structural similarity index, which measures the similarity between two images from three dimensions: brightness, contrast, and structure, and takes values ​​in the range [0, 1], where 1 indicates that the two images have completely identical structures; therefore, L SSIM The 1-SSIM form is used to minimize the target, with a value range of [0, 1]. The smaller the value, the higher the structure fidelity. This indicates SSIM loss.

[0069] The four loss components mentioned above complement each other from different levels of abstraction: pixel loss constrains low-level pixel accuracy, perceptual loss constrains high-level semantic features, degenerative classification loss supervises degenerative perceptual capabilities, and SSIM loss constrains meso-level structure.

[0070] The DUCE-Net network employs a three-stage progressive training strategy based on increasing degradation intensity. Each of the three stages includes four types of training samples: no degradation, single reflection, single tilt, and combined reflection and tilt degradation. A joint loss function consisting of pixel-level loss, perceptual loss, degradation classification loss, and SSIM loss is consistently used, with the weights of each loss term remaining constant throughout the training process. The only difference between the three stages is the progressively increasing degradation intensity: the first stage uses mildly degraded data with a reflection intensity parameter of 0.2–0.5 and a tilt angle range of ±15°; the second stage uses moderately degraded data with a reflection intensity parameter of 0.3–0.8 and a tilt angle range of ±25°; and the third stage uses severely degraded data with a reflection intensity parameter of 0.5–1.0 and a tilt angle range of ±35°. By progressively increasing the degradation intensity of the samples, the model first learns basic reconstruction and degradation perception capabilities under mild degradation conditions, and then gradually adapts to more severe reflection and tilt degradation, thereby improving the model's image reconstruction accuracy and robustness under complex combined degradation conditions.

[0071] The loss curve and PSNR trend during training are as follows: Figure 4 and Figure 5 As shown, the three-stage training strategy exhibits clear phased convergence characteristics: the loss in the first stage rapidly decreases from 0.36 to 0.10, corresponding to the rapid establishment of basic reconstruction capabilities; the loss in the second stage jumps to 0.74 and then gradually falls back to 0.43, reflecting the exploration-convergence dynamics of the degradation classification and gated routing modules during the learning process; in the third stage, the overall training loss decreases from approximately 0.40 to approximately 0.35, and the overall validation loss decreases from approximately 0.40 to approximately 0.34, with slight fluctuations during this period, showing an overall convergence trend. The validation PSNR in the third stage reaches its highest value of 28.73 dB in Epoch 7, and the model parameters of this round are selected as the model checkpoint for subsequent complete model evaluation. The above training process shows that the three-stage training strategy helps alleviate optimization conflicts in multi-branch joint training. While keeping the joint loss function and its weights unchanged, by progressively increasing the sample degradation intensity, the model gradually transitions from basic reconstruction under mild degradation conditions to robust enhancement under severe joint degradation conditions, ultimately achieving end-to-end high-quality text image restoration capabilities.

[0072] The rest of this embodiment is the same as that of Embodiment 1, so it will not be described again.

[0073] Example 3: This embodiment discloses an adaptive correction and enhancement method for complex power document images, which is an improvement on Embodiment 1 or 2. To comprehensively evaluate the performance of this method, this embodiment designs a comparative experiment with three baseline methods: (1) Direct OCR: Directly uses a general OCR engine to recognize degraded images; (2) CLAHE+OCR: First, use the contrast-limited adaptive histogram equalization method for preprocessing, and then perform OCR recognition; (3) BilateralFilter+OCR: Use bilateral filtering to denoise the data before recognition; (4) Adaptive correction and enhancement method for complex power document images based on DUCE-Net + OCR recognition.

[0074] The experimental dataset includes: (1) Document highlighting dataset: Real power document scan dataset, including natural degradation such as reflection and tilt, with 1701 training images and 500 test images; (2) Text detection dataset: Natural scene text detection dataset, with 466 images in the training set and 266 images in the test set; (3) Synthetic comparison dataset: 200 degraded images synthesized based on power document templates, with controllable degradation parameters.

[0075] This embodiment systematically and quantitatively compares the method with three baseline methods on three datasets. The evaluation metric is uniformly OCR recognition accuracy, with the character recognition accuracy of the Tesseract 5.0 engine on the restored image used as the evaluation standard. The experiment focuses on two key dimensions: First, the absolute improvement of DUCE-Net relative to the Direct OCR baseline; Secondly, the performance gap between DUCE-Net and the two preprocessing enhancement schemes was compared to verify the superiority of the end-to-end degradation-aware recovery strategy over the traditional preprocessing process. All test images were uniformly sized to 1024×1024 to ensure fairness in the comparison.

[0076] Comparative experimental results are as follows Figure 3 As shown in Table 1, on the document highlighting dataset, DUCE-Net significantly improved OCR accuracy from 49.6% with Direct OCR to 88.2%. CLAHE preprocessing only improved accuracy to 58.0%, and BilateralFilter to 58.7%, both limited by insufficient handling of reflections and tilt degradation.

[0077] On the text detection dataset, DUCE-Net achieved an OCR accuracy of 85.8%, which is 32.3 percentage points higher than the 53.5% OCR accuracy of Direct OCR, verifying the model's ability to generalize to complex degraded images in natural scenes.

[0078] On the synthetic comparison dataset, DUCE-Net also significantly outperformed all baseline methods with an accuracy of 83.4%, indicating that traditional augmentation methods still have some effect, but there is still a gap compared with end-to-end solutions. The experimental results on the three datasets consistently show that DUCE-Net's degradation-aware end-to-end recovery strategy has significant advantages in various degradation scenarios.

[0079] Table 1. Comparison of OCR accuracy of various methods

[0080] Direct OCR 49.6% 53.5% 56.0% CLAHE+OCR 58.0% 61.1% 59.6% BilateralFilter+OCR 58.7% 58.4% 60.0% DUCE-Net+OCR 88.2% 85.8% 83.4%

[0081] The rest of this embodiment is the same as that of embodiment 1 or 2, so it will not be described again.

[0082] Example 4: This embodiment discloses an adaptive correction and enhancement method for complex power document images, which is optimized based on any one of embodiments 1-3. To verify the contributions of the degradation-aware gated routing module, anti-reflection branch, and tilt correction branch to the model performance, this embodiment conducts ablation experiments on a reflection-tilt joint degradation test set dynamically constructed by the synthetic degradation data generation module. The test samples simultaneously include reflection degradation and tilt degradation, where the reflection intensity parameter is 0.3 to 0.7, and the tilt angle ranges from ±25°. The specific model configuration is as follows: (1) Full DUCE-Net (complete model); (2) w / o DAMBR (remove degradation-aware routing); (3) w / o GlareBranch (remove the reflective correction sub-branch); (4) w / o TiltBranch (remove the tilt correction subbranch).

[0083] Ablation test results as follows Figure 6As shown. In the mixed degradation scenario, the full DUCE-Net model achieves an average PSNR of 28.73 dB and an average SSIM loss of 0.0962, i.e., average SSIM = 1 - SSIM loss = 1 - 0.0962 = 0.9038, exhibiting the best overall performance. After removing the degradation-aware gated routing module without DAMBR, the average PSNR decreases to 27.41 dB, a reduction of 1.32 dB; the average SSIM loss increases to 0.1282, an increase of 0.0320, showing the most significant decrease in overall performance, indicating that DAMBR plays an important role in the adaptive recognition and modulation of mixed degradation features. After removing the reflection correction sub-branch without GlareBranch, the average PSNR decreases to 27.54 dB, and the average SSIM loss increases to 0.1204, representing a reduction of 1.19 dB and an increase of 0.0242 compared to the full model, respectively, indicating that the reflection correction sub-branch helps to recover the brightness distribution and local details in the bright areas. After removing the tilt correction subbranch without TiltBranch, the average PSNR decreased to 27.69 dB, and the average SSIM loss increased to 0.1152, representing a decrease of 1.04 dB and an increase of 0.0190 compared to the complete model, respectively. This indicates that the tilt correction subbranch helps to mitigate the impact of geometric distortion on character structure and layout. In summary, removing any module leads to a decrease in PSNR and an increase in SSIM loss, validating the necessity and effectiveness of each module.

[0084] The rest of this embodiment is the same as any one of embodiments 1-3, so it will not be described again.

[0085] Example 5: This embodiment discloses an adaptive correction and enhancement method for complex power document images, which is optimized based on any one of embodiments 1-4. To comprehensively evaluate the robustness of the DUCE-Net network structure to different types of image degradation, this embodiment performs a five-dimensional robustness evaluation on a comprehensive test set containing multiple degradation types. The test covers five scenarios: Clean (no degradation baseline), Glare (glare interference), Tilt (tilt distortion), Blur (blurring degradation), and Noise (noise pollution). Character accuracy is used as a unified evaluation index. The evaluation results are as follows: Figure 7As shown in the figure. Experimental results demonstrate that DUCE-Net exhibits excellent robustness across five scenarios. Under the Clean benchmark, the character accuracy reaches 0.961; under Glare, 0.896; under Tilt, 0.893; under Blur, 0.911; and under Noise, 0.904. Accuracy remains above 0.89 in all degenerate scenarios, with an overall robustness degradation of only 0.068. The performance degradation caused by tilt distortion is relatively the largest, which is consistent with the physical characteristic of greater character structural distortion under tilted scenarios.

[0086] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications or equivalent changes made to the above embodiments based on the technical essence of the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for adaptive correction and enhancement of complex power document images, implemented based on a DUCE-Net network structure, wherein the DUCE-Net network structure includes a degradation classifier that receives degraded images in parallel and an encoder with a ResNet residual network as its backbone, wherein a gated degradation router and an adaptive joint correction module are provided between the encoder and the decoder, characterized in that, Includes the following steps: Step 1: Input the degraded image into the degradation classifier. The degradation classifier compresses the degraded image to obtain a multidimensional feature vector. The multidimensional feature vector is mapped into a two-dimensional logical value through a fully connected layer. The two-dimensional logical value is then converted into a two-dimensional degradation probability vector through the Sigmoid function. Step 2: Extract shared features from the degraded image. The degraded image is forward propagated through a ResNet residual network structure, and the layer 3 output of the ResNet residual network structure is extracted as the shared features of the degraded image. The number of channels of the shared features is 256. Step 3: Input the two-dimensional degradation probability vector and the shared features into the gated degradation router. The gated degradation router converts the two-dimensional degradation probability vector into a channel-level gating signal. Based on the channel-level gating signal, selectively activate or suppress each channel of the shared features to generate 256-dimensional channel-level gating weights. Then, weight the shared features channel by channel to obtain the gated shared features. Step 4: Input the gated shared features into the anti-reflection branch network for reflection correction to obtain the reflection correction output features; Step 5: Input the gated shared features into the tilt correction branch network for tilt correction to obtain the tilt correction output features; Step 6: Input the reflection correction output feature, tilt correction output feature, and shared feature into the adaptive joint correction module. The adaptive joint correction module weights the reflection correction output feature and tilt correction output feature based on the two-dimensional degradation probability vector, and then fuses the shared feature to obtain the fused feature. Step 7: Perform four-level upsampling on the fused features to restore the spatial size of the fused features to the original input size; use 3×3 convolution to map the 16-channel features output by the four-level upsampling to RGB three-channel output, and use the tanh activation function to constrain the output pixel values ​​of the RGB three-channel output to the (-1, 1) interval to obtain the enhanced image.

2. The method for adaptive correction and enhancement of complex power document images according to claim 1, characterized in that, Step 1 specifically includes: Step 1.1: Input the degraded image into the degradation classifier, which includes four stacked unit convolutional blocks. Each unit convolutional block includes a 3×3 convolutional layer with a stride of 2, a batch normalization layer, and a ReLU activation function. Step 1.2: The output feature tensor D of the fourth-level unit convolutional block... (4) Adaptive average pooling is performed to compress the spatial dimension of the output feature tensor of the fourth-level unit convolution block to 1×1, resulting in a 256-dimensional feature vector. Step 1.3: The feature vector is mapped to an intermediate representation vector through the first fully connected layer. The intermediate representation vector is activated by the ReLU activation function and then subjected to Dropout regularization. Step 1.4: The intermediate representation vector is converted into a two-dimensional logical value through the second fully connected layer. The two-dimensional logical value is then converted into reflection probability and tilt probability through the Sigmoid function. The reflection probability and tilt probability constitute a two-dimensional degradation probability vector.

3. The method for adaptive correction and enhancement of complex power document images according to claim 1, characterized in that, Step 3 specifically includes: Step 3.1: The gated degradation router performs global average pooling on the shared features to compress the spatial dimension of the shared features to obtain the channel description vector; Step 3.2: Concatenate the channel description vector and the two-dimensional degradation probability vector along the channel dimension to obtain a 258-dimensional joint representation vector; Step 3.3: The gated degradation router includes two fully connected layers. The joint representation vector is input into the first fully connected layer, and the joint representation vector is mapped from 258 dimensions to 64 dimensions before ReLU activation is performed. Step 3.4: After mapping the 64-dimensional intermediate representation vector to 256 dimensions through the second fully connected layer, Sigmoid activation is performed to generate 256-dimensional channel-level gating weights. The shared features are then weighted channel by channel to obtain the gated shared features.

4. The method for adaptive correction and enhancement of complex power document images according to claim 1, characterized in that, Step 4 specifically includes: Step 4.1: Input the gated shared features into the anti-reflective branch network to obtain the reflective input features; the anti-reflective branch network includes three parallel deep convolutional branches; Step 4.2: Input the reflective input features into three parallel deep convolutional branches. The kernel sizes of the three deep convolutional branches are 3×3, 7×7 and 15×15, respectively. Each deep convolutional branch has 256 input channels and 256 output channels, and 256 groups. The 256-channel features output by the three deep convolutional branches are concatenated along the channel dimension to form a 768-channel feature tensor. Then, channel fusion is performed by a 1×1 pointwise convolution with 768 input channels and 256 output channels to obtain a 256-channel multi-scale fused feature. Step 4.3: Derive the specular mask from the multi-scale fusion features, apply the specular mask to the multi-scale fusion features for position-by-position weighting, and then perform residual connection with the reflective input features to obtain the reflective correction output features.

5. The method for adaptive correction and enhancement of complex power document images according to claim 1, characterized in that, Step 5 specifically includes: Step 5.1: Input the gated shared features into the tilt correction branch network to obtain tilted input features; the tilt correction branch network includes two 3×3 convolutional layers, a first 1×1 convolutional layer and a second 1×1 convolutional layer set in sequence; Step 5.2: The skewed input features are output as 128-channel first-layer output features after passing through the first convolutional layer. The first-layer output features are then output as 64-channel second-layer output features after passing through the second convolutional layer. Step 5.3: Perform a 1×1 convolution on the output features of the second layer to generate a single-channel spatial attention map; Step 5.4: Apply the single-channel spatial attention map to the output features of the second layer and perform position-wise weighting to obtain 64-channel features. Map the weighted 64-channel features to 256 channels through the second 1×1 convolutional layer, and then perform residual connection with the tilted input features to obtain tilt-corrected output features.

6. The method for adaptive correction and enhancement of complex power document images according to claim 1, characterized in that, Step 6 specifically includes: Step 6.1: Extract the reflection probability from the two-dimensional degradation probability vector, and weight the reflection correction output feature using the reflection probability; Step 6.2: Extract the tilt probability from the two-dimensional degradation probability vector, and weight the tilt correction output feature using the tilt probability; Step 6.3: Add and fuse the weighted reflection correction output feature, the weighted tilt correction output feature, and the shared feature to obtain the fused feature.

7. The method for adaptive correction and enhancement of complex power document images according to claim 1, characterized in that, Step 7 specifically includes: Step 7.1: Input the fused features into a four-level transposed convolution and perform four levels of upsampling to restore the size of the fused features to the original size when inputting into the degenerate classifier; the transposed convolution has a size of 4×4 and a stride of 2; the first-level transposed convolution has 256 input channels and 128 output channels; the second-level transposed convolution has 128 input channels and 64 output channels; the third-level transposed convolution has 64 input channels and 32 output channels; the fourth-level transposed convolution has 32 input channels and 16 output channels. Step 7.2: Use 3×3 convolution to map the 16-channel features output by the fourth-level transposed convolution to RGB three-channel output; Step 7.3: Use the tanh activation function to map the output pixel values ​​of the RGB three channels to the (-1, 1) interval to obtain the enhanced image.

8. A method for adaptive correction and enhancement of complex power document images according to any one of claims 1-7, characterized in that, A clean image is introduced, and the error between each pixel of the enhanced image and the clean image is calculated as a pixel-level loss. The enhanced and cleaned images are input into a pre-trained VGG-19 network, and the enhanced and cleaned feature maps output from layer 36 of the VGG-19 network are extracted. The distance between feature elements on the enhanced and cleaned feature maps is calculated as the perceptual loss. The mean loss of the two-dimensional degradation probability vector is calculated on both the reflection and tilt dimensions using two-dimensional multi-label binary cross-entropy as the degradation classification loss. The structural similarity index between the enhanced and cleaned images is calculated, and 1 is subtracted from the structural similarity index as the SSIM loss. The total loss of the DUCE-Net network structure is calculated by weighting the pixel-level loss, perceptual loss, degradation classification loss, and SSIM loss.

9. The method for adaptive correction and enhancement of complex power document images according to claim 1, characterized in that, Pixel-level loss, perceptual loss, degradation classification loss, and SSIM loss are introduced into the DUCE-Net network structure. A three-stage progressive training method based on degradation intensity is adopted for the DUCE-Net network structure. Each of the three progressive training stages uses a total loss function composed of pixel-level loss, perceptual loss, degradation classification loss, and SSIM loss. The weights of pixel-level loss, perceptual loss, degradation classification loss, and SSIM loss remain constant throughout the training process to ensure consistency of the optimization objective at different stages. Each of the three progressive training stages is configured with no degradation, single reflection, and single tilt. The training employs four types of samples, including those with combined degradation based on reflectivity and tilt, to cover all combinations of degradation labels, enabling the degradation classifier to obtain complete multi-label supervision signals. The three-stage progressive training gradually increases the degradation simulation parameters to enhance the difficulty of the training samples. The first stage of progressive training uses mild degradation, with reflectivity parameters ranging from 0.2 to 0.5 and tilt angles ranging from ±15°. The second stage of progressive training uses moderate degradation, with reflectivity parameters ranging from 0.3 to 0.8 and tilt angles ranging from ±25°. The third stage of progressive training uses severe degradation, with reflectivity parameters ranging from 0.5 to 1.0 and tilt angles ranging from ±35°.

10. The method for adaptive correction and enhancement of complex power document images according to claim 9, characterized in that, The number of training rounds in the first phase of progressive training shall not be less than 2 rounds; The second phase of progressive training should consist of no fewer than three rounds. The third phase of progressive training involves no fewer than four rounds.