Document image shadow removal method based on color perception

Through the end-to-end shadow removal method based on color perception, the color-aware background extraction network and shadow removal network are used, and combined with multiple loss functions, the problems of shadow removal in the prior art are solved, and the document image is realized Efficient shadow removal and detail retention, suitable for real-time processing.

CN118898848AInactive Publication Date: 2024-11-05XIAMEN UNIV OF TECH

Patent Information

Application Number
CN202411399838.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2024-11-05
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, when processing document images, shadow removal methods rely on fixed parameters, cannot adapt to shadow diversity and complexity, and may damage image details, be computationally costly, and are not suitable for real-time environments.

Method used

Using the end-to-end shadow removal method based on color perception, the network and background-guided shadow removal network are extracted through color-aware background, combined with structural consistency, background reconstruction and appearance consistency loss functions, and performs two-stage processing to remove shadows and preserve details. .

Benefits of technology

It realizes precise positioning and removal of document image shadows, preserves image details, reduces computing resource consumption, is suitable for real-time processing, and improves the readability and operation convenience of document images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118898848A_ABST
    Figure CN118898848A_ABST
Patent Text Reader

Abstract

The invention relates to a document image shadow removal method based on color perception, and the method comprises the steps: obtaining document images for training, and forming a training set; an end-to-end shadow removal model is constructed, a color perception background extraction network extracts background features from an input shadow image and predicts a background image, the shadow removal network generates a rough shadow removal result for the input shadow image by using the background features in a first stage, and then refinement is performed through a second stage, so that the shadow removal result is obtained. A final shadow-removed image is obtained; constructing a loss function combining structure consistency loss, background reconstruction loss and appearance consistency loss, training an end-to-end shadow removal model by using the training set, and optimizing model parameters through training; and applying the trained end-to-end shadow removal model to a new document image, and automatically performing shadow removal processing on the document image. According to the method, the shadow in the document image can be effectively removed, and the text details are reserved, so that the readability of the document image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision and image processing, and in particular to a document image shadow removal method based on color perception. Background Art

[0002] In digital document processing and analysis, image quality is critical for accurate identification and subsequent processing of document content. Actual document images often introduce shadows due to problems such as uneven lighting, occlusion, or shooting angle. These shadows reduce image quality, affect document readability, and pose challenges to automated processing processes such as text recognition and content analysis. Existing shadow removal methods have many limitations when processing document images. Traditional methods may rely on fixed parameters and have difficulty adapting to the diversity and complexity of shadows in different document images. In addition, these methods may damage important details in the image, such as text and graphics, while removing shadows. Some other methods can handle complex shadows, but the computational cost is high and they are not suitable for real-time or resource-constrained environments. Summary of the invention

[0003] The object of the present invention is to provide a document image shadow removal method based on color perception, which can effectively remove shadows in document images and retain text details, thereby improving the readability of the document image.

[0004] In order to achieve the above object, the technical solution adopted by the present invention is: a document image shadow removal method based on color perception, comprising the following steps: Step S1, obtaining document images for training to form a training set; Step S2, constructing an end-to-end shadow removal model, the end-to-end shadow removal model includes a color-aware background extraction network and a background-guided shadow removal network, the color-aware background extraction network extracts background features from an input shadow image, predicts a background image and performs feature extraction on it, the shadow removal network generates a rough shadow removal result for the input shadow image using background features in the first stage, and refines the rough shadow removal result through a background attention module and a detail enhancement module in the second stage to obtain a final de-shadowed image; constructing a loss function combining structural consistency loss, background reconstruction loss and appearance consistency loss, training the end-to-end shadow removal model using a training set, and optimizing model parameters through training to remove shadows while retaining image details; Step S3: Apply the trained end-to-end shadow removal model to a new document image, automatically perform shadow removal processing on the document image, and output a clear document image without shadows.

[0005] Furthermore, in step S1, the training set includes multiple pairs of real shadow images and corresponding real shadow-free images, and different real shadow images have multiple different shadow types, so as to improve the robustness of the model when using them to train the end-to-end shadow removal model.

[0006] Further, in step S2, the color-aware background extraction network includes a background encoder and a background decoder; the background encoder applies five convolutional layers, a first batch of normalization layers and a first activation function to extract background features from the input real shadow image; the background decoder applies five deconvolutional layers, a second batch of normalization layers and a second activation function to predict the background image , the convolutional layer and the deconvolutional layer use skip connections to increase the number of network channels and retain the context information of the previous layer; When training the color-aware background extraction network, the predicted background image is trained by the real background image B. Loss constraints and optimization Generation; First, the real shadow-free image I gt The image is divided into k×k patches. For each patch, it is clustered into two clusters according to the intensity of each pixel in the patch, corresponding to the text content and the background respectively. The brighter cluster is regarded as the background cluster, and the average color of the background cluster is used as the background of the patch. The processed patches together constitute the preliminary background. Then the color-preserving smoothing operator is used to After refinement, the real background image B is obtained, which is expressed as: (1) Among them, B i is the i-th pixel in the real background image B, For initial background The i-th pixel in the image, N(i) is the local neighborhood of the i-th pixel; W ij is the filter kernel, which is used to measure the color similarity between the i-th pixel and the j-th pixel in its local neighborhood.

[0007] Further, in step S2, the first stage of the shadow removal network includes an image encoder and a background constraint decoder; the image encoder encodes the input real shadow image and converts it into a low-dimensional feature representation while retaining the structure and content information of the image; in order to utilize the background features, the background features extracted by each layer of the background encoder of the color-aware background extraction network are integrated into the corresponding layers of the background constraint decoder; the background constraint decoder decodes the image features encoded by the image encoder using the background features extracted by the background encoder to generate a rough shadow removal result I coarse; Then, the generated rough shadow removal result is combined with the input true shadow image to form a new feature map, which is then input into the second stage of the shadow removal network to further generate a clear de-shadowed image.

[0008] Further, in step S2, the second stage of the shadow removal network includes a second image encoder, a second image decoder, a background attention module and a detail enhancement module; the second image encoder encodes the input feature map, converts it into a low-dimensional feature representation, and then refines it through the background attention module and the detail enhancement module; The background attention module first fuses the features extracted from each layer of the second image encoder and the features extracted from the predicted background image, obtains the comprehensive features through channel connection, and then inputs the comprehensive features into the attention calculation unit to generate a color perception attention map; finally, the color perception attention map is fused with the comprehensive features through element multiplication to obtain the output features of the background attention module, and then the output features are embedded in the corresponding layer of the second image decoder; At the same time, the features from the first two low-level layers of the second image encoder are fused to obtain the concatenated low-level features, which are input into the detail enhancement module for processing; the detail enhancement module first generates a feature map M using two 2×2 convolutional layers, and then performs global average pooling on the feature map M to obtain the global average feature map M. ; Then, use the cosine similarity to calculate M and The correlation between them is obtained to obtain the correlation matrix S; a set of quantization levels L is constructed to divide the range between the minimum and maximum values ​​of S into N equal parts; then, the correlation matrix S is quantized into a quantization coding matrix E using L; the elements in the quantization coding matrix E It is expressed as: (2) Where i∈[1, HW], n∈[1, N], H and W are the length and width of the image; L n represents the nth quantization level, S i represents the i-th element in the correlation matrix S; Based on the obtained quantization coding matrix E, feature statistics are performed to obtain the output features of the detail enhancement module; Finally, the second image decoder uses the features extracted by the background attention module and the detail enhancement module to decode the features encoded by the second image encoder to generate the final de-shadowed image I free .

[0009] Further, in step S2, the background reconstruction loss is used to constrain the color-aware background extraction network to obtain an ideal background image, which uses the background image predicted by the color-aware background extraction network The difference between the background image B and the real background image B is measured; the background reconstruction loss L background It is expressed as: (3).

[0010] Furthermore, in step S2, the appearance consistency loss is used to evaluate the prediction result and the true shadow-free image I gt The data loss between the two, where the prediction result includes the rough shadow removal result I generated in the first stage coarse And the final de-shadowed image I generated in the second stage free ; Appearance consistency loss L appearance It is expressed as: (4) Among them, λ1 and λ2 are both set weight parameters.

[0011] Furthermore, in step S2, a structural consistency loss is used to preserve the image structure. The structural consistency loss L stucture It is expressed as: (5) Among them, VGG( ) is the feature extractor of the pre-trained VGG19 model.

[0012] Furthermore, the final loss function L final It is expressed as: in, , and is the weight parameter set, L background is the background reconstruction loss, L appearance is the appearance consistency loss, L stucture is the structural consistency loss.

[0013] The present invention proposes a document image shadow removal method based on color perception, which focuses on accurately identifying and removing shadows in document images while maximally retaining key details in the image. The present method achieves accurate positioning and effective removal of shadows in document images through a color-aware background extraction network and a background-guided shadow removal network. The present invention optimizes the shadow removal process by utilizing spatially varying background information and two-stage network processing while maintaining the natural features and readability of the image. Compared with the prior art, the present invention has the following beneficial effects: (1) The background image extracted by the color-aware background extraction network can accurately reflect the various background colors in the document image and provide precise background information for shadow recognition and removal.

[0014] (2) The background-guided shadow removal network adopts a two-stage processing mechanism. First, a rough shadow removal result is generated through the background constraint decoder, and then the result is further optimized through the background attention module and detail enhancement module, which effectively improves the quality of shadow removal and the retention of details.

[0015] (3) The design of the background attention module and detail enhancement module in this method enables the network to adaptively focus on the shadow area while enhancing the detail features of the image, thereby improving the accuracy of shadow removal and the clarity of the image.

[0016] (4) The lightweight design and optimized loss function enable this method to reduce the consumption of computing resources while maintaining the shadow removal effect, making it suitable for real-time and high-resolution document image processing requirements.

[0017] (5) The method of the present invention automatically learns the optimal strategy for shadow removal through end-to-end training without the need for complex parameter adjustment or manual intervention, which significantly improves the convenience and practicality of operation and is suitable for automatic shadow removal tasks of various document images. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flow chart of a method implementation of an embodiment of the present invention; Figure 2 is a schematic diagram of the structure of an end-to-end shadow removal model in an embodiment of the present invention; Figure 3 Schematic diagram of the structure of the background attention module in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0020] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0021] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0022] like Figure 1 As shown, this embodiment provides a document image shadow removal method based on color perception, comprising the following steps: Step S1: Obtain document images for training to form a training set.

[0023] Step S2, construct an end-to-end shadow removal model, the end-to-end shadow removal model includes a color-aware background extraction network and a background-guided shadow removal network, the color-aware background extraction network extracts spatially varying background features from the input shadow image, predicts the background image and performs feature extraction on it, the shadow removal network generates a rough shadow removal result for the input shadow image using background features in the first stage, and refines the rough shadow removal result through the background attention module and the detail enhancement module in the second stage to obtain the final de-shadowed image. Construct a loss function that combines structural consistency loss, background reconstruction loss and appearance consistency loss, train the end-to-end shadow removal model using the training set, and optimize the model parameters through training to ensure the effect of shadow removal and the retention of image details.

[0024] Step S3: Apply the trained end-to-end shadow removal model to a new document image, automatically perform shadow removal processing on the document image, and output a clear document image without shadows.

[0025] The training set includes multiple pairs of real shadow images and corresponding real shadow-free images, and different real shadow images have multiple different shadow types, so as to improve the robustness of the model when using them to train an end-to-end shadow removal model.

[0026] Figure 2 Schematic diagram of the structure of the end-to-end shadow removal model in an embodiment of the present invention. Figure 2 As shown, the end-to-end shadow removal model includes a color-aware background extraction network and a background-guided shadow removal network.

[0027] The color-aware background extraction network includes a background encoder and a background decoder; the background encoder applies five convolutional layers, a first batch of normalization layers and a first activation function to extract background features from an input real shadow image; the background decoder applies five deconvolutional layers, a second batch of normalization layers and a second activation function to predict the background image The convolutional layer and deconvolution layer use skip connections to increase the number of network channels and retain the context information of the previous layer.

[0028] When training the color-aware background extraction network, the predicted background image is trained by the real background image B. Loss constraints and optimization The process of generating the real background image B adopts the background calculation strategy from local to global to generate the real background features. First, the real shadow-free image I gt Divide into k×k patches (in this embodiment, into 16×16 patches). For each patch, use the Gaussian mixture model to cluster it into two clusters according to the intensity of each pixel in the patch, corresponding to the text content and the background respectively. Since the background color of the document is usually brighter, the cluster with brighter color is regarded as the background cluster, and the average color of the background cluster is used as the background of the patch. The processed patches together constitute the preliminary background Then a color-preserving smoothing operator is used to After refinement, the real background image B is obtained, which is expressed as: (1) Among them, B i is the i-th pixel in the real background image B, For initial background The i-th pixel in the image, N(i) is the local neighborhood of the i-th pixel; W ij is the filter kernel, which is used to measure the color similarity between the i-th pixel and the j-th pixel in its local neighborhood.

[0029] The first stage of the shadow removal network includes an image encoder and a background constraint decoder. The image encoder encodes the input real shadow image and converts it into a low-dimensional feature representation while retaining the structure and content information of the image. In order to make full use of the background features, the method uses a background constraint decoder to replace the ordinary image decoder, and integrates the background features extracted by each layer of the background encoder of the color-aware background extraction network into the corresponding layer of the background constraint decoder to supplement the color and texture information of the image during the decoding process. The background constraint decoder uses the background features extracted by the background encoder to decode the image features encoded by the image encoder to generate a rough shadow removal result. coarse Then, the generated rough shadow removal result is combined with the input true shadow image to form a new feature map, which is then input into the second stage of the shadow removal network to further generate a clear de-shadowed image.

[0030] The second stage of the shadow removal network includes a second image encoder, a second image decoder, a background attention module and a detail enhancement module; the second image encoder encodes the input feature map, converts it into a low-dimensional feature representation, and then refines it through the background attention module and the detail enhancement module.

[0031] The processing flow of the background attention module is as follows Figure 3As shown in the figure. The background attention module first fuses the features extracted from each layer of the second image encoder and the features extracted from the predicted background image, obtains the comprehensive features through channel connection, and then inputs the comprehensive features into the attention calculation unit to generate the color perception attention map. Finally, the color perception attention map is fused with the comprehensive features through element multiplication to obtain the output features of the background attention module, and then the output features are embedded in the corresponding layers of the second image decoder.

[0032] At the same time, the features from the first two low-level layers of the second image encoder are fused to obtain the concatenated low-level features, which are then input into the detail enhancement module for processing. The detail enhancement module first generates a feature map M using two 2×2 convolutional layers, and then performs global average pooling on the feature map M to obtain the global average feature map M. Then, the cosine similarity is used to calculate the difference between M and The correlation between them is obtained to obtain the correlation matrix S. In order to effectively perform quantization and statistics, a set of quantization levels L is constructed to divide the range between the minimum and maximum values ​​of S into N equal parts; then, L is used to quantize the correlation matrix S into a quantization coding matrix E; the elements in the quantization coding matrix E It is expressed as: (2) Where i∈[1, HW], n∈[1, N], H and W are the length and width of the image; L n represents the nth quantization level, S i represents the i-th element in the correlation matrix S.

[0033] Based on the obtained quantization coding matrix E, feature statistics are performed to obtain the output features of the detail enhancement module.

[0034] Finally, the second image decoder uses the features extracted by the background attention module and the detail enhancement module to decode the features encoded by the second image encoder to generate the final de-shadowed image I free .

[0035] In order to achieve a good shadow removal effect and optimize the network parameters, the background reconstruction loss is used to constrain the color-aware background extraction network to obtain an ideal background image, which uses the background image predicted by the color-aware background extraction network. The background reconstruction loss L is measured by the gap between the real background image B and the background image B. background It can be expressed as: (3).

[0036] In order to achieve a good shadow removal effect and optimize the network parameters, the appearance consistency loss is used to evaluate the difference between the predicted results and the real shadow-free image Igt The data loss between the two, where the prediction result includes the rough shadow removal result I generated in the first stage coarse And the final de-shadowed image I generated in the second stage free ; Appearance consistency loss L appearance It can be expressed as: (4) Among them, λ1 and λ2 are both set weight parameters.

[0037] In order to achieve a good shadow removal effect and optimize the network parameters, the structural consistency loss is used to retain the image structure. stucture It can be expressed as: (5) Among them, VGG( ) is the feature extractor of the pre-trained VGG19 model.

[0038] Therefore, the final loss function L final for: in, , and is the weight parameter set, L background is the background reconstruction loss, L appearance is the appearance consistency loss, L stucture is the structural consistency loss.

[0039] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0040] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.

[0041] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0042] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0043] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.

Claims

1. A document image shadow removal method based on color perception, characterized in that: The following steps are involved: Step S1, obtaining document images for training to form a training set; Step S2, constructing an end-to-end shadow removal model, the end-to-end shadow removal model includes a color-aware background extraction network and a background-guided shadow removal network, the color-aware background extraction network extracts background features from an input shadow image, predicts a background image and performs feature extraction on it, the shadow removal network generates a rough shadow removal result for the input shadow image using background features in the first stage, and refines the rough shadow removal result through a background attention module and a detail enhancement module in the second stage to obtain a final de-shadowed image; constructing a loss function combining structural consistency loss, background reconstruction loss and appearance consistency loss, training the end-to-end shadow removal model using a training set, and optimizing model parameters through training to remove shadows while retaining image details; Step S3: Apply the trained end-to-end shadow removal model to a new document image, automatically perform shadow removal processing on the document image, and output a clear document image without shadows.

2. The method for removing document image shadow based on color perception according to claim 1, characterized in that: In step S1, the training set includes multiple pairs of real shadow images and corresponding real shadow-free images, and different real shadow images have multiple different shadow types, so as to improve the robustness of the model when using them to train an end-to-end shadow removal model.

3. The method for removing document image shadow based on color perception according to claim 1, characterized in that: In step S2, the color-aware background extraction network includes a background encoder and a background decoder; The background encoder applies five convolutional layers, a first normalization layer, and a first activation function to extract background features from an input true shadow image; The background decoder applies five deconvolution layers, a second batch of normalization layers, and a second activation function to predict the background image. , the convolutional layer and the deconvolutional layer use skip connections to increase the number of network channels and retain the context information of the previous layer; When training the color-aware background extraction network, the predicted background image is trained by the real background image B. Loss constraints and optimization Generation; First, the real shadow-free image I gt The image is divided into k×k patches. For each patch, it is clustered into two clusters according to the intensity of each pixel in the patch, corresponding to the text content and the background respectively. The brighter cluster is regarded as the background cluster, and the average color of the background cluster is used as the background of the patch. The processed patches together constitute the preliminary background. Then the color-preserving smoothing operator is used to After refinement, the real background image B is obtained, which is expressed as: (1) Among them, B i is the i-th pixel in the real background image B, For initial background The i-th pixel in the image, N(i) is the local neighborhood of the i-th pixel; W ij is the filter kernel, which is used to measure the color similarity between the i-th pixel and the j-th pixel in its local neighborhood.

4. The method for removing document image shadow based on color perception according to claim 1, characterized in that: In step S2, the first stage of the shadow removal network includes an image encoder and a background constraint decoder; the image encoder encodes the input real shadow image and converts it into a low-dimensional feature representation while retaining the structure and content information of the image; in order to utilize the background features, the background features extracted by each layer of the background encoder of the color-aware background extraction network are integrated into the corresponding layers of the background constraint decoder; The background constraint decoder decodes the image features encoded by the image encoder using the background features extracted by the background encoder to generate a rough shadow removal result I coarse ; Then, the generated rough shadow removal result is combined with the input true shadow image to form a new feature map, which is then input into the second stage of the shadow removal network to further generate a clear de-shadowed image.

5. The method for removing document image shadow based on color perception according to claim 1, characterized in that: In step S2, the second stage of the shadow removal network includes a second image encoder, a second image decoder, a background attention module and a detail enhancement module; the second image encoder encodes the input feature map, converts it into a low-dimensional feature representation, and then refines it through the background attention module and the detail enhancement module; The background attention module first fuses the features extracted from each layer of the second image encoder and the features extracted from the predicted background image, obtains the comprehensive features through channel connection, and then inputs the comprehensive features into the attention calculation unit to generate a color perception attention map; finally, the color perception attention map is fused with the comprehensive features through element multiplication to obtain the output features of the background attention module, and then the output features are embedded in the corresponding layer of the second image decoder; At the same time, the features from the first two low-level layers of the second image encoder are fused to obtain the concatenated low-level features, which are input into the detail enhancement module for processing; The detail enhancement module first uses two 2×2 convolutional layers to generate a feature map M, and then performs global average pooling on the feature map M to obtain the global average feature map M. ; Then, the cosine similarity is used to calculate M and The correlation between them is obtained, and the correlation matrix S is obtained; Construct a set of quantization levels L, divide the range between the minimum and maximum values ​​of S into N equal parts; then, use L to quantize the correlation matrix S into a quantization coding matrix E; the elements in the quantization coding matrix E It is expressed as: (2) Where i∈[1, HW], n∈[1, N], H and W are the length and width of the image; L n represents the nth quantization level, S i represents the i-th element in the correlation matrix S; Based on the obtained quantization coding matrix E, feature statistics are performed to obtain the output features of the detail enhancement module; Finally, the second image decoder uses the features extracted by the background attention module and the detail enhancement module to decode the features encoded by the second image encoder to generate the final de-shadowed image I free .

6. The method for removing document image shadow based on color perception according to claim 1, characterized in that: In step S2, the background reconstruction loss is used to constrain the color-aware background extraction network to obtain an ideal background image, which uses the background image predicted by the color-aware background extraction network The difference between the background image B and the real background image B is measured; the background reconstruction loss L background It is expressed as: (3)。 7. The method for removing document image shadow based on color perception according to claim 1, characterized in that: In step S2, the appearance consistency loss is used to evaluate the prediction result and the true shadow-free image I gt The data loss between the two, where the prediction result includes the rough shadow removal result I generated in the first stage coarse And the final de-shadowed image I generated in the second stage free ; Appearance consistency loss L appearance It is expressed as: (4) Among them, λ1 and λ2 are both set weight parameters.

8. The method for removing document image shadow based on color perception according to claim 1, characterized in that: In step S2, a structural consistency loss is used to preserve the image structure. The structural consistency loss L stucture It is expressed as: (5) Among them, VGG( ) is the feature extractor of the pre-trained VGG19 model.

9. The method for removing document image shadow based on color perception according to claim 1, characterized in that: The final loss function L final It is expressed as: in, , and is the weight parameter set, L background is the background reconstruction loss, L appearance is the appearance consistency loss, L stucture is the structural consistency loss.

Citation Information

Patent Citations

  • Text image shadow elimination method based on background guidance

    CN116703757A

  • Image shadow removal method based on mask refinement

    CN118314038A

  • Device and method for acquiring shadow-free images of documents for scanning purposes

    US20210227096A1

Cited By

  • Plug-and-play image shadow edge removing method and device, equipment and medium

    CN119941602A

  • Highlight removal method constructed based on granularity interactive mixing highlight removal model

    CN120374481A

  • A highlight removal method based on granularity interactive hybrid highlight removal model

    CN120374481B