Search

CN-121999317-A - Training method and device for picture processing model and electronic equipment

CN121999317ACN 121999317 ACN121999317 ACN 121999317ACN-121999317-A

Abstract

The application discloses a training method and device for a picture processing model and electronic equipment. The method comprises the steps of obtaining a training data set, wherein the training data set comprises a plurality of base pictures without watermarks, a plurality of base pictures with added seals, a plurality of base pictures with added watermarks and a third picture with the seals, inputting the third picture into a multi-branch supervised picture processing model to be trained to obtain a first watermarking result picture, a second watermarking result picture and a third watermarking result picture which are output by the picture processing model to be trained, calculating a total loss value according to the first watermarking result picture, the first picture, the second watermarking result picture, the third watermarking result picture and the base pictures, and training the picture processing model to be trained according to the total loss value to obtain a trained picture processing model. The method has the advantages of short time consumption and good removal effect.

Inventors

  • Zeng chan
  • DONG HUIYAN
  • ZHANG YUNRU
  • ZHANG FEIXIONG
  • KE JING

Assignees

  • 人保信息科技有限公司
  • 中国人民保险集团股份有限公司

Dates

Publication Date
20260508
Application Date
20260116

Claims (10)

  1. 1. A method for training a picture processing model, comprising: Acquiring a training data set, wherein the training data set comprises a plurality of base pictures without watermarks and without seals, a first picture with the seals added by the plurality of base pictures, a second picture with the watermarks added by the plurality of base pictures and a third picture with the watermarks and the seals added by the plurality of base pictures; inputting the third picture into a multi-branch supervised picture processing model to be trained, and obtaining a first watermarking result diagram, a second watermarking result diagram and a third watermarking result diagram which are output by the picture processing model to be trained; calculating a total loss value according to the first result diagram, the first picture, the second result diagram, the second picture, the third result diagram and the base diagram; And training the picture processing model to be trained according to the total loss value to obtain a trained picture processing model.
  2. 2. The method according to claim 1, wherein inputting the third picture into a multi-branch supervised picture processing model to be trained, obtaining a first result diagram of de-watermarking, a second result diagram of de-stamping, and a third result diagram of de-watermarking and stamping output by the picture processing model to be trained, comprises: Inputting the third picture into a picture processing model to be trained, performing 4 times downsampling processing on the third picture to be trained to obtain a shared feature picture, performing water printing upsampling and seal removing upsampling on the shared feature picture to obtain a watermark removing feature picture and a seal removing feature picture, performing dimension reduction processing on the water printing feature picture and the seal removing feature picture to obtain a first result picture and a second result picture which are consistent with the third picture in size, performing convolution operation on a fusion feature picture obtained by fusing the water printing feature picture and the seal removing feature picture to obtain the third result picture, and outputting the first result picture, the second result picture and the third result picture.
  3. 3. The method according to claim 2, wherein the image processing model to be trained performs 4 times downsampling processing on the third image to obtain a shared feature image, including: And carrying out 4 times downsampling processing on the third picture by using a MobileNetV network in the picture processing model to be trained to obtain the sharing characteristic diagram.
  4. 4. The method according to claim 2, wherein the dimension reduction processing is performed on the feature map of the water stamp and the feature map of the stamp removal, respectively, and includes: And performing dimension reduction treatment on the feature map of the water stamp and the feature map of the seal removal respectively by using a 1x1 convolution network in the picture processing model to be trained.
  5. 5. The method of claim 1, wherein the calculating a total loss value from the first result map, the first picture, the second result map, the second picture, the third result map, and the base map comprises: calculating a first loss value according to the first result graph and the corresponding first picture; calculating a second loss value according to the second result graph and the corresponding second picture; Calculating a third loss value according to the third result graph and the corresponding base graph; And calculating the total loss value according to the first loss value, the second loss value and the third loss value.
  6. 6. The method of claim 5, wherein the first loss value and/or the second loss value is an L1 loss value.
  7. 7. The method of claim 5, wherein the third loss value is a peak signal-to-noise loss value.
  8. 8. The method as recited in claim 1, further comprising: acquiring a test data set, wherein the test data set comprises a plurality of test base pictures without watermarks and without seals, a first test picture with the seals added by the plurality of test base pictures, a second test picture with the watermarks added by the plurality of test base pictures and a third test picture with the watermarks and the seals added by the plurality of test base pictures; inputting the third test picture into the trained picture processing model to obtain a first test result diagram of the watermark output by the trained picture processing model, a second test result diagram of the seal and a third test result diagram of the watermark and the seal; And generating a performance test result of the trained picture processing model according to the first test result diagram, the first test picture, the second test result diagram, the second test picture, the third test result diagram and the test base diagram.
  9. 9. A training device for a picture processing model, comprising: The device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a training data set, and the training data set comprises a plurality of base pictures without watermarks and without seals, a first picture with the seals added by the plurality of base pictures, a second picture with the watermarks added by the plurality of base pictures and a third picture with the watermarks and the seals added by the plurality of base pictures; The input module is used for inputting the third picture into a multi-branch supervised picture processing model to be trained to obtain a first watermarking result diagram, a second watermarking result diagram and a third watermarking result diagram, wherein the first watermarking result diagram, the second watermarking result diagram and the third watermarking result diagram are output by the picture processing model to be trained; The calculation module is used for calculating a total loss value according to the first result diagram, the first picture, the second result diagram, the second picture, the third result diagram and the base diagram; And the training module is used for training the picture processing model to be trained according to the total loss value to obtain a trained picture processing model.
  10. 10. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which program or instruction when executed by the processor implements the steps of the method according to any of claims 1-8.

Description

Training method and device for picture processing model and electronic equipment Technical Field The application belongs to the technical field of deep learning, and particularly relates to a training method and device for a picture processing model and electronic equipment. Background With the development of information technology, intelligent document picture processing can help enterprises to realize automation of daily document processing work, and help enterprise staff in various aspects of document identification, classification, information extraction and comparison and the like. In the practical application process, many document pictures have watermarks and seals, which can shade key word information, so that word recognition based on optical character recognition (Optical Character Recognition, abbreviated as OCR) is problematic, and subsequent information extraction is affected. Therefore, the document picture needs to be subjected to watermarking and stamping processing. In the related art, the de-watermark model and the de-seal model are generally trained separately based on a generated countermeasure network or other deep learning network, respectively. And if the watermark removal and the seal removal are needed, connecting the watermark removal model and the seal removal model in series. On the other hand, under the condition that the picture has both watermarks and seals, the watermark features and the seal features have certain similarity, the water removal impression model and the seal removal model can be mutually influenced, and the two models are connected in series, so that the aim of completely erasing all the watermarks and the seals and keeping background characters can not be realized, namely the removal effect is poor. Disclosure of Invention The embodiment of the application aims to provide a training method and device for a picture processing model and electronic equipment, and aims to solve the problems of long time consumption and poor removal effect existing in the serial connection of a water removal stamp model and a seal removal model in the related technology. In order to achieve the above purpose, the embodiment of the present application adopts the following technical scheme: in a first aspect, an embodiment of the present application provides a training method for a picture processing model, including obtaining a training dataset, where the training dataset includes a plurality of base pictures without watermarks and without stamps, a plurality of first pictures with base pictures with stamps, a plurality of second pictures with base pictures with watermarks and a plurality of third pictures with base pictures with watermarks, inputting the third pictures into a multi-branch supervised picture processing model to be trained to obtain a first result picture with watermarks, a second result picture with watermarks and a third result picture with stamps output by the picture processing model to be trained, calculating a total loss value according to the first result picture, the second result picture, the third result picture and the base pictures, and training the picture processing model to be trained according to the total loss value to obtain a picture processing model to be trained. In a second aspect, an embodiment of the application provides a training device for a picture processing model, which comprises an acquisition module, a training data set, a calculation module and a training module, wherein the acquisition module is used for acquiring a training data set, the training data set comprises a plurality of base pictures without watermarks and without stamps, a plurality of first pictures with the base pictures added with the stamps, a plurality of second pictures with the base pictures added with the watermarks and a plurality of third pictures with the base pictures added with the watermarks and the stamps, the input module is used for inputting the third pictures into the picture processing model to be trained of multi-branch supervision to obtain a first result picture with the watermarks removed, a second result picture with the watermarks removed and a third result picture with the stamps outputted by the picture processing model to be trained, and the calculation module is used for calculating a total loss value according to the first result picture, the second result picture, the third result picture and the base pictures, and the training module is used for training the picture processing model to be trained according to the total loss value to obtain a training completed picture processing model. In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, the program or instruction when executed by the processor implementing the steps of the method according to the first aspect. The above at least one techn