CN116009749A - Handwritten character erasing method and system based on attention mechanism - Google Patents

Handwritten character erasing method and system based on attention mechanism Download PDF

Info

Publication number
CN116009749A
CN116009749A CN202211391605.9A CN202211391605A CN116009749A CN 116009749 A CN116009749 A CN 116009749A CN 202211391605 A CN202211391605 A CN 202211391605A CN 116009749 A CN116009749 A CN 116009749A
Authority
CN
China
Prior art keywords
picture
module
erasure
erasing
mask
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211391605.9A
Other languages
Chinese (zh)
Inventor
杨辉
黄家昌
赵宝华
邱道椿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Ecan Information Technology Co ltd
Original Assignee
Fujian Ecan Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Ecan Information Technology Co ltd filed Critical Fujian Ecan Information Technology Co ltd
Priority to CN202211391605.9A priority Critical patent/CN116009749A/en
Publication of CN116009749A publication Critical patent/CN116009749A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Character Input (AREA)

Abstract

The invention provides a handwritten character erasing method and a system based on an attention mechanism in the technical field of image processing, wherein the method comprises the following steps: step S10, obtaining a large number of original pictures containing handwritten characters and printing bodies, and constructing a picture set based on the original pictures; step S20, carrying out data enhancement processing and picture preprocessing on the picture set to obtain a training data set; step S30, creating an erasure model based on the attention mechanism; step S40, training the erasure model by using the training data set; and S50, automatically erasing the handwritten characters of the picture to be erased by using the trained erasing model. The invention has the advantages that: the accuracy and the efficiency of hand-written character erasure are greatly improved.

Description

Handwritten character erasing method and system based on attention mechanism
Technical Field
The invention relates to the technical field of image processing, in particular to a handwritten character erasing method and system based on an attention mechanism.
Background
Along with the progress of science and technology, OCR scanning is used in numerous scenes such as learning, working and the like, and through technology and algorithm, handwritten characters (handwriting) on a scanned paper document can be restored and repaired, namely, the handwritten characters on a picture are electronically erased, so that the appearance of the document is restored, the document does not need to be edited again, and the user experience is improved.
Conventionally, erasure of a handwritten character requires two steps, first, extraction of the handwritten character and then filling of the handwritten character area with pixel values. However, the conventional method is unsatisfactory in terms of erasing effect, and is too labor-consuming to erase manually using image editing software.
Therefore, how to provide a handwritten character erasing method and system based on an attention mechanism, so as to improve the accuracy and efficiency of handwritten character erasing, is a technical problem to be solved.
Disclosure of Invention
The invention aims to solve the technical problem of providing a handwritten character erasing method and a handwritten character erasing system based on an attention mechanism, which can improve the accuracy and efficiency of handwritten character erasing.
In a first aspect, the present invention provides a method for erasing handwritten characters based on an attention mechanism, including the steps of:
step S10, obtaining a large number of original pictures containing handwritten characters and printing bodies, and constructing a picture set based on the original pictures;
step S20, carrying out data enhancement processing and picture preprocessing on the picture set to obtain a training data set;
step S30, creating an erasure model based on the attention mechanism;
step S40, training the erasure model by using the training data set;
and S50, automatically erasing the handwritten characters of the picture to be erased by using the trained erasing model.
Further, the step S10 specifically includes:
obtaining a large number of original pictures containing handwritten characters and printing bodies, removing the handwritten characters in the original pictures by utilizing image editing software to obtain target pictures, carrying out mask processing on the target pictures to obtain mask pictures, and constructing a picture set based on the original pictures, the target pictures and the mask pictures.
Further, the step S20 specifically includes:
carrying out random rotation, random overturn, brightness transformation and random graying data enhancement processing on each picture in the picture set;
and setting a picture size, cutting the picture subjected to the data enhancement processing based on the picture size to complete picture preprocessing, and further obtaining a training data set.
Further, in the step S30, the erasure model is provided with a semantic segmentation module, a coarse erasure module and a fine erasure module;
the semantic segmentation module is used for carrying out semantic segmentation on the picture so as to distinguish the handwritten characters from the printed matter; the rough erasing module is used for erasing the handwritten characters of the picture once; the fine erasing module is used for secondarily erasing the handwritten characters of the picture;
the semantic segmentation module, the coarse erasure module and the fine erasure module are all based on a Unet framework of an attention mechanism; the semantic segmentation module and the rough erasure module share a feature extraction part; the high-level network layer of the semantic segmentation module and the rough erasure module is provided with a CBAM unit and an ASPP unit; the low-level network layer of the fine erase module is provided with Non-Local self-attention units, and the number of network characteristic channels is larger than that of the coarse erase module.
Further, the step S40 specifically includes:
inputting an original picture in the training data set into an erasure model for training, obtaining a predicted target picture and a predicted mask picture, calculating target loss values of the target picture and the predicted target picture in the training data set through a target loss function, calculating mask loss values of the mask picture and the predicted mask picture in the training data set through a mask loss function, accumulating the target loss values and the mask loss values to obtain a total loss value, and continuously training the erasure model until a preset training iteration number is reached;
the target loss function is an average absolute error function; the mask loss function is a cross entropy loss function.
In a second aspect, the present invention provides a handwriting character erasing system based on an attention mechanism, including the following modules:
the picture set construction module is used for acquiring a large number of original pictures containing handwritten characters and printing bodies and constructing a picture set based on the original pictures;
the training data set construction module is used for carrying out data enhancement processing and picture preprocessing on the picture set so as to obtain a training data set;
the erasure model creation module is used for creating an erasure model based on the attention mechanism;
the erasure model training module is used for training the erasure model by utilizing the training data set;
and the handwritten character erasing module is used for automatically erasing the handwritten characters of the picture to be erased by utilizing the trained erasing model.
Further, the picture set construction module is specifically configured to:
obtaining a large number of original pictures containing handwritten characters and printing bodies, removing the handwritten characters in the original pictures by utilizing image editing software to obtain target pictures, carrying out mask processing on the target pictures to obtain mask pictures, and constructing a picture set based on the original pictures, the target pictures and the mask pictures.
Further, the training data set construction module is specifically configured to:
carrying out random rotation, random overturn, brightness transformation and random graying data enhancement processing on each picture in the picture set;
and setting a picture size, cutting the picture subjected to the data enhancement processing based on the picture size to complete picture preprocessing, and further obtaining a training data set.
Further, in the erasure model creation module, the erasure model is provided with a semantic segmentation module, a coarse erasure module and a fine erasure module;
the semantic segmentation module is used for carrying out semantic segmentation on the picture so as to distinguish the handwritten characters from the printed matter; the rough erasing module is used for erasing the handwritten characters of the picture once; the fine erasing module is used for secondarily erasing the handwritten characters of the picture;
the semantic segmentation module, the coarse erasure module and the fine erasure module are all based on a Unet framework of an attention mechanism; the semantic segmentation module and the rough erasure module share a feature extraction part; the high-level network layer of the semantic segmentation module and the rough erasure module is provided with a CBAM unit and an ASPP unit; the low-level network layer of the fine erase module is provided with Non-Local self-attention units, and the number of network characteristic channels is larger than that of the coarse erase module.
Further, the erasure model training module is specifically configured to:
inputting an original picture in the training data set into an erasure model for training, obtaining a predicted target picture and a predicted mask picture, calculating target loss values of the target picture and the predicted target picture in the training data set through a target loss function, calculating mask loss values of the mask picture and the predicted mask picture in the training data set through a mask loss function, accumulating the target loss values and the mask loss values to obtain a total loss value, and continuously training the erasure model until a preset training iteration number is reached;
the target loss function is an average absolute error function; the mask loss function is a cross entropy loss function.
The invention has the advantages that:
the method comprises the steps of obtaining an original picture containing handwritten characters and a printing body, constructing a picture set, carrying out data enhancement processing and picture preprocessing on the picture set to obtain a training data set, training a created erasure model by utilizing the training data set, so that the erasure model has stronger robustness and generalization, creating the erasure model based on an attention mechanism, enhancing the characteristic extraction capability of the erasure model, setting an ASPP unit to promote the receptive fields of a semantic segmentation module and a rough erasure module, further improving the characteristic extraction capability, setting Non-Local self-attention units on a low-level network layer of the fine erasure module, and effectively improving the capability of the fine erasure module to obtain global information, greatly improving the learning capability of the module, automatically erasing the handwritten characters of the picture to be erased by the trained erasure model, and finally greatly improving the accuracy and efficiency of handwritten character erasure.
Drawings
The invention will be further described with reference to examples of embodiments with reference to the accompanying drawings.
FIG. 1 is a flow chart of a handwriting character erasing method based on an attention mechanism of the present invention.
FIG. 2 is a schematic diagram of a handwriting character erasing system based on an attention mechanism according to the present invention.
FIG. 3 is a schematic diagram of the erasure model of the present invention.
Fig. 4 is a schematic structural diagram of the semantic segmentation module and the rough erasure module of the present invention.
Fig. 5 is a schematic diagram of the structure of the fine erase module of the present invention.
Detailed Description
According to the technical scheme in the embodiment of the application, the overall thought is as follows: training an erasure model by utilizing a training data set obtained by data enhancement processing and picture preprocessing to improve robustness and generalization of the erasure model, creating the erasure model based on an attention mechanism, enhancing feature extraction capability, setting an ASPP unit to improve a receptive field of a module, setting a Non-Local self-attention unit and more network feature channel numbers at a low-level network layer of a fine erasure module, and effectively improving the capability and learning capability of the fine erasure module for acquiring global information, so that the trained erasure model can automatically erase handwritten characters of pictures to be erased, and further improving the erasure accuracy and efficiency of the handwritten characters.
Referring to fig. 1 to 5, a preferred embodiment of a handwriting character erasing method based on an attention mechanism of the present invention includes the following steps:
step S10, obtaining a large number of original pictures containing handwritten characters and printing bodies, and constructing a picture set based on the original pictures;
step S20, carrying out data enhancement processing and picture preprocessing on the picture set to obtain a training data set;
step S30, creating an erasure model based on the attention mechanism;
step S40, training the erasure model by using the training data set;
and S50, automatically erasing the handwritten characters of the picture to be erased by using the trained erasing model.
The step S10 specifically includes:
obtaining a large number of original pictures containing handwritten characters and printing bodies, removing the handwritten characters in the original pictures by utilizing image editing software to obtain target pictures, carrying out mask processing on the target pictures to obtain mask pictures, and constructing a picture set based on the original pictures, the target pictures and the mask pictures.
The image editing software can be selected as photoshop; and removing and filling the handwritten characters in the original picture pixel by utilizing the image editing software to obtain a target picture.
The mask processing specifically includes: setting a pixel threshold value, performing difference on pixel values of the original picture and the target picture to obtain an average difference value of three channels, updating the average difference value which is larger than or equal to the pixel threshold value to be 1, and updating the average difference value which is smaller than the pixel threshold value to be the pixel threshold value or keeping the original value.
The step S20 specifically includes:
carrying out random rotation, random overturn, brightness transformation and random graying data enhancement processing on each picture in the picture set;
the data enhancement processing can greatly improve the generalization capability and robustness of the model, is an indispensable picture preprocessing process before training, can enhance the segmentation capability of characters in different directions through random rotation and random overturn, and can ensure the accuracy when the model segments images with abnormal illumination or shadows through brightness conversion and graying.
Setting a picture size, cutting the picture subjected to the data enhancement processing based on the picture size to complete picture pretreatment, and further obtaining a training data set; the picture size may be set as desired, for example 768×768, to ensure consistency of the input picture size.
In the step S30, the erasure model is provided with a semantic segmentation module, a coarse erasure module and a fine erasure module; the fine erasing module is connected behind the coarse erasing module;
the semantic segmentation module is used for carrying out semantic segmentation on the picture so as to distinguish the handwritten characters from the printed matter; the rough erasing module is used for erasing the handwritten characters of the picture once; the fine erasing module is used for secondarily erasing the handwritten characters of the picture;
the semantic segmentation module, the coarse erasure module and the fine erasure module are all based on a Unet framework of an attention mechanism, and the Unet can achieve better balance between precision and speed; the semantic segmentation module and the rough erasure module share a feature extraction part; the high-level network layers of the semantic segmentation module and the rough erasure module are provided with a CBAM unit and an ASPP unit, the CBAM unit can make the model focus on a target area to be segmented, and the ASPP unit is used for expanding a receptive field to enhance the feature extraction capability so as to cope with detection areas with different sizes; the low-level network layer of the fine erasure module is provided with Non-Local self-attention units, and the number of network characteristic channels is larger than that of the coarse erasure module; since the degradation difference of different pictures is larger than the denoising task no matter the colors are enhanced or the handwritten characters are erased, and a larger receptive field is needed than the denoising (rough erasure module), the fine erasure module needs to perform downsampling for more times, a Non-Local self-attention unit is added to further increase the receptive field, and the number of network characteristic channels is increased to improve the learning capability.
The step S40 specifically includes:
inputting an original picture in the training data set into an erasure model for training, obtaining a predicted target picture and a predicted mask picture, calculating target loss values of the target picture and the predicted target picture in the training data set through a target loss function, calculating mask loss values of the mask picture and the predicted mask picture in the training data set through a mask loss function, accumulating the target loss values and the mask loss values to obtain a total loss value, and continuously training the erasure model until a preset training iteration number is reached, namely training until the model converges;
the target loss function is an average absolute error function; the mask loss function is a cross entropy loss function.
The step S50 specifically includes:
obtaining pictures to be erased, performing angle correction on the pictures to be erased, cutting the pictures to be erased based on a set picture size to obtain sub-pictures, inputting each sub-picture into a trained erasure model to perform handwriting character erasure, and then splicing the sub-pictures after erasure to complete handwriting character erasure of the pictures to be erased.
The size of the picture size is constrained by the size of the video memory, and in the case of video memory permission, a larger picture size (dividing size) can be adopted in order to increase the erasing speed.
The preferred embodiment of the handwriting character erasing system based on the attention mechanism comprises the following modules:
the picture set construction module is used for acquiring a large number of original pictures containing handwritten characters and printing bodies and constructing a picture set based on the original pictures;
the training data set construction module is used for carrying out data enhancement processing and picture preprocessing on the picture set so as to obtain a training data set;
the erasure model creation module is used for creating an erasure model based on the attention mechanism;
the erasure model training module is used for training the erasure model by utilizing the training data set;
and the handwritten character erasing module is used for automatically erasing the handwritten characters of the picture to be erased by utilizing the trained erasing model.
The picture set construction module is specifically configured to:
obtaining a large number of original pictures containing handwritten characters and printing bodies, removing the handwritten characters in the original pictures by utilizing image editing software to obtain target pictures, carrying out mask processing on the target pictures to obtain mask pictures, and constructing a picture set based on the original pictures, the target pictures and the mask pictures.
The image editing software can be selected as photoshop; and removing and filling the handwritten characters in the original picture pixel by utilizing the image editing software to obtain a target picture.
The mask processing specifically includes: setting a pixel threshold value, performing difference on pixel values of the original picture and the target picture to obtain an average difference value of three channels, updating the average difference value which is larger than or equal to the pixel threshold value to be 1, and updating the average difference value which is smaller than the pixel threshold value to be the pixel threshold value or keeping the original value.
The training data set construction module is specifically configured to:
carrying out random rotation, random overturn, brightness transformation and random graying data enhancement processing on each picture in the picture set;
the data enhancement processing can greatly improve the generalization capability and robustness of the model, is an indispensable picture preprocessing process before training, can enhance the segmentation capability of characters in different directions through random rotation and random overturn, and can ensure the accuracy when the model segments images with abnormal illumination or shadows through brightness conversion and graying.
Setting a picture size, cutting the picture subjected to the data enhancement processing based on the picture size to complete picture pretreatment, and further obtaining a training data set; the picture size may be set as desired, for example 768×768, to ensure consistency of the input picture size.
The erasure model creation module is provided with a semantic segmentation module, a coarse erasure module and a fine erasure module; the fine erasing module is connected behind the coarse erasing module;
the semantic segmentation module is used for carrying out semantic segmentation on the picture so as to distinguish the handwritten characters from the printed matter; the rough erasing module is used for erasing the handwritten characters of the picture once; the fine erasing module is used for secondarily erasing the handwritten characters of the picture;
the semantic segmentation module, the coarse erasure module and the fine erasure module are all based on a Unet framework of an attention mechanism, and the Unet can achieve better balance between precision and speed; the semantic segmentation module and the rough erasure module share a feature extraction part; the high-level network layers of the semantic segmentation module and the rough erasure module are provided with a CBAM unit and an ASPP unit, the CBAM unit can make the model focus on a target area to be segmented, and the ASPP unit is used for expanding a receptive field to enhance the feature extraction capability so as to cope with detection areas with different sizes; the low-level network layer of the fine erasure module is provided with Non-Local self-attention units, and the number of network characteristic channels is larger than that of the coarse erasure module; since the degradation difference of different pictures is larger than the denoising task no matter the colors are enhanced or the handwritten characters are erased, and a larger receptive field is needed than the denoising (rough erasure module), the fine erasure module needs to perform downsampling for more times, a Non-Local self-attention unit is added to further increase the receptive field, and the number of network characteristic channels is increased to improve the learning capability.
The erasure model training module is specifically configured to:
inputting an original picture in the training data set into an erasure model for training, obtaining a predicted target picture and a predicted mask picture, calculating target loss values of the target picture and the predicted target picture in the training data set through a target loss function, calculating mask loss values of the mask picture and the predicted mask picture in the training data set through a mask loss function, accumulating the target loss values and the mask loss values to obtain a total loss value, and continuously training the erasure model until a preset training iteration number is reached, namely training until the model converges;
the target loss function is an average absolute error function; the mask loss function is a cross entropy loss function.
The handwritten character erasing module is specifically used for:
obtaining pictures to be erased, performing angle correction on the pictures to be erased, cutting the pictures to be erased based on a set picture size to obtain sub-pictures, inputting each sub-picture into a trained erasure model to perform handwriting character erasure, and then splicing the sub-pictures after erasure to complete handwriting character erasure of the pictures to be erased.
The size of the picture size is constrained by the size of the video memory, and in the case of video memory permission, a larger picture size (dividing size) can be adopted in order to increase the erasing speed.
In summary, the invention has the advantages that:
the method comprises the steps of obtaining an original picture containing handwritten characters and a printing body, constructing a picture set, carrying out data enhancement processing and picture preprocessing on the picture set to obtain a training data set, training a created erasure model by utilizing the training data set, so that the erasure model has stronger robustness and generalization, creating the erasure model based on an attention mechanism, enhancing the characteristic extraction capability of the erasure model, setting an ASPP unit to promote the receptive fields of a semantic segmentation module and a rough erasure module, further improving the characteristic extraction capability, setting Non-Local self-attention units on a low-level network layer of the fine erasure module, and effectively improving the capability of the fine erasure module to obtain global information, greatly improving the learning capability of the module, automatically erasing the handwritten characters of the picture to be erased by the trained erasure model, and finally greatly improving the accuracy and efficiency of handwritten character erasure.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that the specific embodiments described are illustrative only and not intended to limit the scope of the invention, and that equivalent modifications and variations of the invention in light of the spirit of the invention will be covered by the claims of the present invention.

Claims (10)

1. A handwritten character erasing method based on an attention mechanism is characterized by comprising the following steps of: the method comprises the following steps:
step S10, obtaining a large number of original pictures containing handwritten characters and printing bodies, and constructing a picture set based on the original pictures;
step S20, carrying out data enhancement processing and picture preprocessing on the picture set to obtain a training data set;
step S30, creating an erasure model based on the attention mechanism;
step S40, training the erasure model by using the training data set;
and S50, automatically erasing the handwritten characters of the picture to be erased by using the trained erasing model.
2. A method for erasing handwritten characters based on an attention mechanism as recited in claim 1, wherein: the step S10 specifically includes:
obtaining a large number of original pictures containing handwritten characters and printing bodies, removing the handwritten characters in the original pictures by utilizing image editing software to obtain target pictures, carrying out mask processing on the target pictures to obtain mask pictures, and constructing a picture set based on the original pictures, the target pictures and the mask pictures.
3. A method for erasing handwritten characters based on an attention mechanism as recited in claim 1, wherein: the step S20 specifically includes:
carrying out random rotation, random overturn, brightness transformation and random graying data enhancement processing on each picture in the picture set;
and setting a picture size, cutting the picture subjected to the data enhancement processing based on the picture size to complete picture preprocessing, and further obtaining a training data set.
4. A method for erasing handwritten characters based on an attention mechanism as recited in claim 1, wherein: in the step S30, the erasure model is provided with a semantic segmentation module, a coarse erasure module and a fine erasure module;
the semantic segmentation module is used for carrying out semantic segmentation on the picture so as to distinguish the handwritten characters from the printed matter; the rough erasing module is used for erasing the handwritten characters of the picture once; the fine erasing module is used for secondarily erasing the handwritten characters of the picture;
the semantic segmentation module, the coarse erasure module and the fine erasure module are all based on a Unet framework of an attention mechanism; the semantic segmentation module and the rough erasure module share a feature extraction part; the high-level network layer of the semantic segmentation module and the rough erasure module is provided with a CBAM unit and an ASPP unit; the low-level network layer of the fine erase module is provided with Non-Local self-attention units, and the number of network characteristic channels is larger than that of the coarse erase module.
5. A method for erasing handwritten characters based on an attention mechanism as recited in claim 1, wherein: the step S40 specifically includes:
inputting an original picture in the training data set into an erasure model for training, obtaining a predicted target picture and a predicted mask picture, calculating target loss values of the target picture and the predicted target picture in the training data set through a target loss function, calculating mask loss values of the mask picture and the predicted mask picture in the training data set through a mask loss function, accumulating the target loss values and the mask loss values to obtain a total loss value, and continuously training the erasure model until a preset training iteration number is reached;
the target loss function is an average absolute error function; the mask loss function is a cross entropy loss function.
6. A handwriting character erasing system based on an attention mechanism, characterized in that: the device comprises the following modules:
the picture set construction module is used for acquiring a large number of original pictures containing handwritten characters and printing bodies and constructing a picture set based on the original pictures;
the training data set construction module is used for carrying out data enhancement processing and picture preprocessing on the picture set so as to obtain a training data set;
the erasure model creation module is used for creating an erasure model based on the attention mechanism;
the erasure model training module is used for training the erasure model by utilizing the training data set;
and the handwritten character erasing module is used for automatically erasing the handwritten characters of the picture to be erased by utilizing the trained erasing model.
7. An attention-based handwritten character erasing system as in claim 6, wherein: the picture set construction module is specifically configured to:
obtaining a large number of original pictures containing handwritten characters and printing bodies, removing the handwritten characters in the original pictures by utilizing image editing software to obtain target pictures, carrying out mask processing on the target pictures to obtain mask pictures, and constructing a picture set based on the original pictures, the target pictures and the mask pictures.
8. An attention-based handwritten character erasing system as in claim 6, wherein: the training data set construction module is specifically configured to:
carrying out random rotation, random overturn, brightness transformation and random graying data enhancement processing on each picture in the picture set;
and setting a picture size, cutting the picture subjected to the data enhancement processing based on the picture size to complete picture preprocessing, and further obtaining a training data set.
9. An attention-based handwritten character erasing system as in claim 6, wherein: the erasure model creation module is provided with a semantic segmentation module, a coarse erasure module and a fine erasure module;
the semantic segmentation module is used for carrying out semantic segmentation on the picture so as to distinguish the handwritten characters from the printed matter; the rough erasing module is used for erasing the handwritten characters of the picture once; the fine erasing module is used for secondarily erasing the handwritten characters of the picture;
the semantic segmentation module, the coarse erasure module and the fine erasure module are all based on a Unet framework of an attention mechanism; the semantic segmentation module and the rough erasure module share a feature extraction part; the high-level network layer of the semantic segmentation module and the rough erasure module is provided with a CBAM unit and an ASPP unit; the low-level network layer of the fine erase module is provided with Non-Local self-attention units, and the number of network characteristic channels is larger than that of the coarse erase module.
10. An attention-based handwritten character erasing system as in claim 6, wherein: the erasure model training module is specifically configured to:
inputting an original picture in the training data set into an erasure model for training, obtaining a predicted target picture and a predicted mask picture, calculating target loss values of the target picture and the predicted target picture in the training data set through a target loss function, calculating mask loss values of the mask picture and the predicted mask picture in the training data set through a mask loss function, accumulating the target loss values and the mask loss values to obtain a total loss value, and continuously training the erasure model until a preset training iteration number is reached;
the target loss function is an average absolute error function; the mask loss function is a cross entropy loss function.
CN202211391605.9A 2022-11-08 2022-11-08 Handwritten character erasing method and system based on attention mechanism Pending CN116009749A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211391605.9A CN116009749A (en) 2022-11-08 2022-11-08 Handwritten character erasing method and system based on attention mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211391605.9A CN116009749A (en) 2022-11-08 2022-11-08 Handwritten character erasing method and system based on attention mechanism

Publications (1)

Publication Number Publication Date
CN116009749A true CN116009749A (en) 2023-04-25

Family

ID=86023676

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211391605.9A Pending CN116009749A (en) 2022-11-08 2022-11-08 Handwritten character erasing method and system based on attention mechanism

Country Status (1)

Country Link
CN (1) CN116009749A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117132994A (en) * 2023-08-17 2023-11-28 华南理工大学 Handwritten character erasing method based on generation countermeasure network
CN117253233A (en) * 2023-09-05 2023-12-19 广东奥普特科技股份有限公司 Character erasing method, device and equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117132994A (en) * 2023-08-17 2023-11-28 华南理工大学 Handwritten character erasing method based on generation countermeasure network
CN117132994B (en) * 2023-08-17 2024-07-02 华南理工大学 Handwritten character erasing method based on generation countermeasure network
CN117253233A (en) * 2023-09-05 2023-12-19 广东奥普特科技股份有限公司 Character erasing method, device and equipment
CN117253233B (en) * 2023-09-05 2024-05-17 广东奥普特科技股份有限公司 Character erasing method, device and equipment

Similar Documents

Publication Publication Date Title
CN111723585B (en) Style-controllable image text real-time translation and conversion method
CN116009749A (en) Handwritten character erasing method and system based on attention mechanism
CN109977723B (en) Large bill picture character recognition method
CN113012059B (en) Shadow elimination method and device for text image and electronic equipment
JP2003298837A (en) Graphical input and display system for creating and manipulating electronic image, method for editing source electronic image inputted to display device to meaningful image object, and product including computer usable medium with computer readable program code incorporated
CN110766020A (en) System and method for detecting and identifying multi-language natural scene text
CN113673338A (en) Natural scene text image character pixel weak supervision automatic labeling method, system and medium
CN112926565B (en) Picture text recognition method, system, equipment and storage medium
CN111626145A (en) Simple and effective incomplete form identification and page-crossing splicing method
JP6671613B2 (en) Character recognition method and computer program
CN110991440A (en) Pixel-driven mobile phone operation interface text detection method
CN112733857B (en) Image character detection model training method and device for automatically segmenting character area
JP5618719B2 (en) Image processing apparatus, method and program thereof
CN117409057A (en) Panorama depth estimation method, device and medium
CN115457448B (en) Intelligent extraction system for video key frames
CN108133205B (en) Method and device for copying text content in image
CN113766147B (en) Method for embedding image in video, and method and device for acquiring plane prediction model
JP4890351B2 (en) Image processing apparatus, image processing program, computer-readable recording medium storing the image processing program, and image processing method
JP2003046746A (en) Method and apparatus for processing image
JP4911585B2 (en) Image processing apparatus, image processing method, program, and information recording medium
CN111556251A (en) Electronic book generation method, device and medium
CN115713774A (en) Test paper handwritten character erasing method and system with high robustness
Vinod et al. Camera captured document de-warping and de-skewing
JP7402931B2 (en) METHODS, COMPUTER READABLE PROGRAMS AND SYSTEM
Wang et al. MobileSky: Real-Time Sky Replacement for Mobile AR

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination