Interference object processing model training and interference object processing method and device
By building a neural network model consisting of an encoder and two decoders, and training and adjusting parameters, the problem of inaccurate text recognition caused by watermarks and seals in images was solved. Effective erasure of interference objects of different types and colors and improved accuracy of text recognition were achieved.
Patent Information
- Application Number
- CN202310699541.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-13
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2043-06-13
AI Technical Summary
In the prior art, interfering objects such as watermarks and seals in images may cover the image content, resulting in incomplete or inaccurate text content during optical character recognition.
A neural network model consisting of an encoder and two decoders is used to generate interference object background prediction images and mask prediction images through training data. The model parameters are adjusted to enhance the performance of the interference object processing model, which can simultaneously detect and erase interference objects of different types and colors.
The applicability and accuracy of the interference object processing model have been improved, which can effectively erase watermarks and seals in images and improve the accuracy of text acquisition in optical character recognition.
Smart Images

Figure CN116844169B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, particularly artificial intelligence technologies such as deep learning, big data, cloud services, and natural language processing. A method, apparatus, electronic device, and readable storage medium for training an interference object processing model and processing interference objects are provided. Background Art
[0002] In everyday life, interfering objects such as watermarks and seals in document or receipt images can obscure the image content. This can lead to incomplete or inaccurate text content in some applications, such as optical character recognition (OCR). Therefore, removing interfering objects such as watermarks and seals from images is a pressing technical challenge. Summary of the Invention
[0003] According to a first aspect of the present disclosure, a training method for an interference object processing model is provided, comprising: obtaining training data, the training data comprising a sample image and a true image group of the sample image, the true image group comprising an interference object mask true image and a sample true image; constructing a neural network model comprising an encoder, a first decoder and a second decoder, the encoder being used to obtain image features based on the sample image, the first decoder being used to generate an interference object background prediction image based on the image features, and the second decoder being used to generate an interference object mask prediction image based on the image features; inputting the sample image into the neural network model to obtain an interference object background prediction image and an interference object mask prediction image output by the neural network model; adjusting parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true image group to obtain an interference object processing model.
[0004] According to the second aspect of the present disclosure, a method for processing interference objects is provided, including: obtaining an image to be processed; inputting the image to be processed into an interference object processing model to obtain an interference object background prediction image and an interference object mask prediction image output by the interference object processing model; and obtaining a target image based on the image to be processed, the interference object background prediction image and the interference object mask prediction image.
[0005] According to a third aspect of the present disclosure, a training device for an interference object processing model is provided, comprising: a first acquisition unit, for acquiring training data, wherein the training data comprises a sample image and a true value image group of the sample image, wherein the true value image group comprises an interference object mask true value image and a sample true value image; a construction unit, for constructing a neural network model comprising an encoder, a first decoder and a second decoder, wherein the encoder is used to obtain image features based on the sample image, the first decoder is used to generate an interference object background prediction image based on the image features, and the second decoder is used to generate an interference object mask prediction image based on the image features; a first processing unit, for inputting the sample image into the neural network model to obtain an interference object background prediction image and an interference object mask prediction image output by the neural network model; a training unit, for adjusting parameters of the neural network model based on the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain an interference object processing model.
[0006] According to the fourth aspect of the present disclosure, a device for processing interference objects is provided, including: a second acquisition unit, used to acquire an image to be processed; a second processing unit, used to input the image to be processed into an interference object processing model, and obtain an interference object background prediction image and an interference object mask prediction image output by the interference object processing model; and a third processing unit, used to obtain a target image based on the image to be processed, the interference object background prediction image and the interference object mask prediction image.
[0007] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described above.
[0008] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method as described above.
[0009] According to a sixth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the method described above when executed by a processor.
[0010] It can be seen from the above technical solution that the present disclosure uses a neural network model including an encoder and two decoders to simultaneously complete the two tasks of detecting interference objects and erasing interference objects, thereby enhancing the model performance of the interference object processing model, and does not impose restrictions on the type, color, etc. of the interference objects to be processed, which can improve the applicability of the interference object processing model.
[0011] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0013] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0014] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;
[0015] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;
[0016] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;
[0017] Figure 5 is a schematic diagram according to a fifth embodiment of the present disclosure;
[0018] Figure 6 is a schematic diagram according to a sixth embodiment of the present disclosure;
[0019] Figure 7 is a schematic diagram according to a seventh embodiment of the present disclosure;
[0020] Figure 8 It is a block diagram of an electronic device used to implement the training of the interference object processing model or the interference object processing method according to the embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, and various details of the embodiments of the present disclosure are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and mechanisms are omitted in the following description.
[0022] Figure 1Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the training method of the interference object processing model of this embodiment specifically includes the following steps:
[0023] S101, acquiring training data, wherein the training data includes a sample image and a true value image group of the sample image, wherein the true value image group includes an interference object mask true value image and a sample true value image;
[0024] S102: Construct a neural network model including an encoder, a first decoder, and a second decoder, wherein the encoder is configured to obtain image features based on a sample image, the first decoder is configured to generate an interference object background prediction image based on the image features, and the second decoder is configured to generate an interference object mask prediction image based on the image features;
[0025] S103, inputting the sample image into the neural network model to obtain an interference object background prediction image and an interference object mask prediction image output by the neural network model;
[0026] S104: Adjust the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain an interference object processing model.
[0027] The training method of the interference object processing model of this embodiment constructs a neural network model including an encoder and two decoders. The neural network model simultaneously completes the two tasks of detecting interference objects and erasing interference objects, thereby enhancing the model performance of the interference object processing model. There are no restrictions on the type of interference objects to be processed (watermarks, seals, etc. in the image) and color (red seals, blue seals, black seals, etc.), which can improve the applicability of the interference object processing model.
[0028] The interference object in this embodiment may be an object contained in the image that covers the image content, such as a watermark and / or a seal; that is, the interference object processing model obtained through training in this embodiment can detect and erase objects such as watermarks and / or seals contained in the image.
[0029] The training data obtained by executing S101 in this embodiment may include multiple sample images, each sample image is an image containing an interference object (watermark and / or seal); the sample true value image included in the true value image group is an image obtained after erasing the interference object contained in the sample image.
[0030] In this embodiment, after executing S101 to obtain training data including a sample image and its corresponding true value image group, executing S102 to construct a neural network model including an encoder, a first decoder, and a second decoder.
[0031] The encoder and decoder in this embodiment can be an encoder and decoder based on the Unet network, or an encoder and decoder based on the ResUnet network. The Unet network and the ResUnet network are fully convolutional neural networks used for semantic segmentation of images; the encoder in this embodiment is used to extract image features from an image, and the decoder is used to generate an image based on the image features.
[0032] In the neural network model constructed by executing S102 in this embodiment, the encoder is used to obtain image features based on the input sample image, and then input the obtained image features into the first decoder and the second decoder respectively, so that different decoders can generate corresponding predicted images.
[0033] In the neural network model constructed by executing S102 in this embodiment, the first decoder is used to generate an interference object background prediction image based on the image features obtained by the encoder; the interference object background prediction image includes an interference object mask and image content covered by the interference object.
[0034] In the neural network model constructed by executing S102 in this embodiment, the second decoder is used to generate an interference object mask prediction image based on the image features obtained by the encoder; the interference object mask prediction image includes an interference object mask, which is a binary pixel-level area, and uses a pixel value of 0 or 1 to indicate whether the current pixel belongs to the interference object. For example, a pixel value of 1 indicates that the current pixel belongs to the interference object, and a pixel value of 0 indicates that the current pixel does not belong to the interference object.
[0035] In this embodiment, the first decoder and the second decoder share a set of network parameters, but the first decoder and the second decoder each have independent attention calculation modules, for example, the first decoder has a first attention calculation module, and the second decoder has a second attention calculation module.
[0036] Different attention calculation modules are used to determine the weights of each feature contained in the image features, reorganize the image features according to the weights of each feature, and then generate different predicted images based on the reorganized image features; it can be understood that the attention calculation module contained in the decoder gradually improves the accuracy of the weights of different features set during the training process of the neural network model.
[0037] For example, the first attention calculation module in the first decoder sets the weight of the features in the image features used to generate the background image of the interference object to be larger, and sets the weight of the features for generating other images to be smaller, thereby generating the interference object background prediction image; the second attention calculation module in the second decoder sets the weight of the features in the image features used to generate the mask image of the interference object to be larger, and sets the weight of the features for generating other images to be smaller, thereby generating the interference object mask prediction image.
[0038] After executing S102 to construct a neural network model including an encoder, a first decoder and a second decoder, this embodiment executes S103 to input the sample image into the neural network model to obtain the interference object background prediction image and the interference object mask prediction image output by the neural network model.
[0039] If the training data obtained by executing S101 in this embodiment includes multiple sample images, then when executing S103 in this embodiment, the multiple sample images can be input into the neural network model respectively, and then the interference object background prediction image and the interference object mask prediction image output by the neural network model for each sample image are obtained.
[0040] When executing S103 to input the sample image into the neural network model, this embodiment can also first process the sample image to a preset size (for example, 256×256, 512×512), and then input the processed sample image into the neural network model, thereby preventing the problem of inaccurate model training due to different image sizes.
[0041] If the sample image is a black and white image, when executing S103, this embodiment can also first expand the black and white image into an RGB image in which the grayscale values of the three RGB channels are the same, and then normalize the grayscale value of each pixel in the RGB image to between [0, 1]. Finally, the processed sample image is input into the neural network model, so that the neural network model can process the black and white image.
[0042] After executing S103 to obtain the interference object background prediction image and the interference object mask prediction image output by the neural network model, this embodiment executes S104 to adjust the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain the interference object processing model.
[0043] In this embodiment, when executing S104, the parameters of the neural network model are adjusted according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain the interference object processing model. An optional implementation method that can be adopted is: according to the sample image, the interference object background prediction image and the interference object mask prediction image, a sample prediction image is obtained. The sample prediction image obtained in this embodiment can be regarded as an image after the interference object is removed by processing the neural network model; according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image and the interference object mask prediction image, a first target loss function value is obtained; according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image and the interference object mask prediction image, the parameters of the neural network model are adjusted according to the first target loss function value to obtain the interference object processing model.
[0044] That is to say, in addition to using the true value image group, this embodiment also obtains the first target loss function value for adjusting the parameters of the neural network model based on the sample image and the predicted image output by the neural network model, which can improve the accuracy of the obtained first target loss function value and thus improve the accuracy of the parameter adjustment.
[0045] In this embodiment, when executing S104 to obtain a sample prediction image based on the sample image, the interference object background prediction image, and the interference object mask prediction image, the following formula (1) may be used:
[0046] I pred =F bg (I)×M'+I×(1-M')
[0047] In formula (1): I pred represents the sample prediction image; F bg (I) represents the interference object background prediction image; M' represents the interference object mask prediction image; I represents the sample image.
[0048] In this embodiment, when executing S104 to adjust the parameters of the neural network model according to the target loss function value to obtain the interference object processing model, after at least one training, it can be determined that the neural network model has converged when it is determined that the calculated target loss function value has converged, thereby completing the training of the neural network model, and using the neural network model after the last parameter adjustment as the interference object processing model.
[0049] When executing S104 in this embodiment to obtain the first target loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image and the interference object mask prediction image, the optional implementation method that can be adopted is: obtaining the first loss function value according to the interference object mask true value image, the interference object mask prediction image, the interference object background prediction image, the sample true value image and the sample prediction image; obtaining the second loss function value according to the interference object mask prediction image and the interference object mask true value image; obtaining the first target loss function value according to the first loss function value and the second loss function value, for example, taking the addition result between the first loss function value and the second loss function value as the first target loss function value.
[0050] That is to say, this embodiment obtains the first loss function value and the second loss function value according to different true value images and predicted images, so that the first target loss function can simultaneously take into account the generation of the interference object background and the interference object mask, thereby adjusting the parameters of the decoder and different encoders more accurately, thereby improving the accuracy of the image generated by the trained interference object processing model.
[0051] In this embodiment, when executing S104, the first loss function value is obtained according to the interference object mask true value image, the interference object mask prediction image, the interference object background prediction image, the sample true value image and the sample prediction image, the following formula (2) can be used:
[0052]
[0053] In formula (2): r represents the first loss function value; α and β represent the loss function coefficients; With φ ssim represents the perceptual loss function; k represents the convolutional layer number, ranging from 1, 2, 3; I pred Represents the sample prediction image; I gt Represents the sample true value image.
[0054] In the above formula (2), and The following calculation formulas are used respectively:
[0055]
[0056]
[0057] In the formula: M represents the true value image of the interference object mask; M' represents the interference object mask prediction image; F bg (I) represents the interference object background prediction image; I gt Represents the sample true value image.
[0058] In this embodiment, when executing S104 to obtain the second loss function value according to the interference object mask prediction image and the interference object mask true value image, the following formula (3) can be used:
[0059] l m =Mlog(M')+(1-M)log(1-M')
[0060] In formula (3): m Represents the value of the second loss function; M represents the true value image of the interference object mask; M' represents the predicted image of the interference object mask.
[0061] That is to say, this embodiment designs the calculation methods of the first loss function and the second loss function respectively according to the constructed neural network model including an encoder and two decoders, so that the obtained loss function values are more consistent with the currently constructed neural network model, thereby further improving the training effect of the neural network model.
[0062] In this embodiment, after executing S104 to obtain the interference object processing model, the obtained interference object processing model can be used to process the image containing the interference object, thereby obtaining a clean image with the interference object erased.
[0063] Figure 2 Schematic diagram of the second embodiment of the present application. Figure 2 As shown, the training method of the interference object processing model of this embodiment may specifically include the following steps:
[0064] S201, acquiring training data, wherein the training data includes a sample image and a true value image group of the sample image, wherein the true value image group includes an interference object mask true value image and a sample true value image;
[0065] S202, constructing a neural network model including an encoder, a first decoder, a second decoder, and a third decoder, wherein the third decoder is used to generate an interference object prediction image according to image features;
[0066] S203, inputting the sample image into the neural network model to obtain an interference object background prediction image, an interference object mask prediction image, and an interference object prediction image output by the neural network model;
[0067] S204. Adjust the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image, the interference object prediction image and the true value image group to obtain the interference object processing model.
[0068] That is to say, when constructing the neural network model, this embodiment, in addition to setting the encoder, the first decoder and the second decoder, will also set the third decoder for generating the predicted image of the interference object, so that the constructed neural network model can not only complete the detection task and the erasure task of the interference object, but also complete the generation task of the interference object (that is, generate the image corresponding to the interference object itself), thereby further enhancing the model performance of the interference object processing model and improving the applicability of the interference object processing model.
[0069] In the neural network model constructed by executing S202 in this embodiment, the third decoder is used to generate an interference object prediction image based on the image features obtained by the encoder; the interference object prediction image is an image corresponding to the interference object itself.
[0070] The network parameters of the third decoder are the same as those of the first decoder and the second decoder, but the third decoder and the other two decoders each have an independent attention calculation module, for example, the third decoder has a third attention calculation module; for example, the third attention calculation module in the third decoder sets the weight of the features used to generate the interference object image in the image features to be larger, and sets the weight of the features used to generate other images to be smaller, thereby generating the interference object prediction image.
[0071] In this embodiment, when executing S204, the parameters of the neural network model are adjusted according to the sample image, the interference object background prediction image, the interference object mask prediction image, the interference object prediction image and the true value image group to obtain the interference object processing model. An optional implementation method that can be adopted is: obtaining the sample prediction image according to the sample image, the interference object background prediction image and the interference object mask prediction image; obtaining the second target loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, the interference object mask prediction image and the interference object prediction image; adjusting the parameters of the neural network model according to the second target loss function value to obtain the interference object processing model.
[0072] In this embodiment, when executing S204 and obtaining the second target loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, the interference object mask prediction image and the interference object prediction image, an optional implementation method that can be adopted is: obtaining the first loss function value according to the interference object mask true value image, the interference object mask prediction image, the interference object background prediction image, the sample true value image and the sample prediction image; obtaining the second loss function value according to the interference object mask prediction image and the interference object mask true value image; obtaining the third loss function value according to the interference object prediction image, the interference object mask prediction image, the interference object mask true value image and the sample true value image; obtaining the second target loss function value according to the first loss function value, the second loss function value and the third loss function value, for example, taking the addition result of the first loss function value, the second loss function value and the third loss function value as the second target loss function value.
[0073] That is to say, this embodiment obtains the second target loss function value based on the third loss function value obtained from the predicted image and the true image of the interference object, so that the second target loss function can take into account the generation of the interference object background and the interference object mask while also taking into account the generation of the interference object, thereby more accurately adjusting the parameters of the decoder and different encoders, thereby enhancing the model performance of the interference object processing model.
[0074] The calculation method for obtaining the first loss function value and the second loss function value by executing S204 in this embodiment is the same as the calculation method involved in S104 in the above embodiment, and will not be repeated here.
[0075] In this embodiment, when executing S204 to obtain the third loss function value based on the interference object prediction image, the interference object mask prediction image, the interference object mask true value image, and the sample true value image, the following formula (4) can be used:
[0076]
[0077] In formula (4): n Represents the value of the third loss function; M represents the true value image of the interference object mask; M' represents the interference object mask prediction image; I gt represents the sample true value image; F s (I) represents the interference object prediction image.
[0078] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure. Figure 3The structural diagram of the neural network model constructed in this embodiment is shown in the figure: the neural network model constructed in this embodiment includes an encoder, a first decoder, a second decoder and a third decoder. After the encoder extracts image features from the input image (including the seal), the extracted image features are input into the first decoder, the second decoder and the third decoder respectively; the first decoder generates a seal background prediction image based on the image features, the second decoder generates a seal mask prediction image based on the image features, and the third decoder generates a seal prediction image based on the image features; based on the input image, the seal background prediction image and the seal mask prediction image, the target image after erasing the seal is obtained; further, the seal prediction image output by the third decoder can also be obtained, so that the seal prediction image can be used to stamp other documents, or the seal prediction image can be stored as a seal extraction result.
[0079] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure. Figure 4 The figure shows the relationship between the three decoders in the neural network model constructed in this embodiment: the three decoders share a set of network parameters, but each decoder has an attention calculation module, which is composed of a pooling layer, a first linear layer, a second linear layer and an activation function layer. The training process of the neural network model will adjust the parameters of each neural layer contained in each attention calculation module.
[0080] Figure 5 Schematic diagram of the fifth embodiment of the present disclosure. Figure 5 As shown in , the method for processing interference objects in this embodiment specifically includes the following steps:
[0081] S501, obtaining an image to be processed;
[0082] S502: Input the image to be processed into an interference object processing model to obtain an interference object background prediction image and an interference object mask prediction image output by the interference object processing model;
[0083] S503 : Obtain a target image according to the image to be processed, the interference object background prediction image, and the interference object mask prediction image.
[0084] The interference object processing method of this embodiment uses the interference object processing model obtained by training in the above embodiment to obtain the background prediction image and mask prediction image of the interference object in the image to be processed, and then obtains the target image based on the obtained prediction image and the image to be processed, thereby achieving the purpose of erasing the interference objects contained in the image to be processed, and obtaining a target image that does not contain interference objects such as watermarks and seals. Optical Character Recognition (OCR) can then be performed on the target image to obtain text in the image, which can improve the accuracy of the obtained text.
[0085] The image to be processed obtained by executing S501 in this embodiment may be an existing image or an image captured in real time. The image to be processed may be an image used for OCR recognition.
[0086] It is understandable that, when executing S501 in this embodiment, if it is determined that the acquired image contains an interference object, the acquired image may be used as the image to be processed.
[0087] After executing S501 to obtain the image to be processed, this embodiment executes S502 to input the image to be processed into the interference object processing model, thereby obtaining the interference object background prediction image and the interference object mask prediction image output by the interference object processing model.
[0088] If the pre-trained interference object processing model further includes a third decoder, when executing S502 , in addition to obtaining the predicted images of the background and the mask, this embodiment can also obtain the interference object predicted image output by the interference object processing model.
[0089] After executing S502 to obtain the interference object prediction image output by the interference object processing model, this embodiment can also store the interference object prediction image, for example, obtain the identification information of the interference object, and then store the obtained identification information together with the interference object prediction image. In subsequent use, the corresponding interference object prediction image can be obtained according to the identification information.
[0090] After executing S502 to obtain the interference object background prediction image and the interference object mask prediction image output by the interference object processing model, this embodiment executes S503 to obtain the target image based on the image to be processed, the interference object background prediction image and the interference object mask prediction image; wherein, the target image obtained by executing S503 in this embodiment is the image after erasing the watermark and / or seal.
[0091] In this embodiment, when executing S503 to obtain the target image according to the image to be processed, the interference object background prediction image and the interference object mask prediction image, the formula (1) in the above embodiment can be used to obtain it, which will not be repeated in this embodiment.
[0092] After executing S503 to obtain the target image, this embodiment can perform OCR recognition on the target image to obtain the text content contained in the target image; since the target image no longer contains interference objects, the accuracy of the obtained text content can be improved.
[0093] Figure 6 Schematic diagram of the sixth embodiment of the present disclosure. Figure 6 As shown, the training device 600 for the interference object processing model of this embodiment includes:
[0094] A first acquiring unit 601 is configured to acquire training data, where the training data includes a sample image and a true value image group of the sample image, where the true value image group includes a true value image of an interference object mask and a true value image of a sample;
[0095] A construction unit 602 is configured to construct a neural network model comprising an encoder, a first decoder, and a second decoder, wherein the encoder is configured to obtain image features based on a sample image, the first decoder is configured to generate an interference object background prediction image based on the image features, and the second decoder is configured to generate an interference object mask prediction image based on the image features;
[0096] A first processing unit 603 is configured to input the sample image into the neural network model to obtain an interference object background prediction image and an interference object mask prediction image output by the neural network model;
[0097] The training unit 604 is configured to adjust the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain an interference object processing model.
[0098] The training data acquired by the first acquisition unit 601 may include multiple sample images, each sample image is an image containing an interference object (watermark and / or seal); the sample true value image included in the true value image group is an image obtained after erasing the interference object contained in the sample image.
[0099] In this embodiment, after the first acquisition unit 601 acquires the training data including the sample image and its corresponding true value image group, the construction unit 602 constructs a neural network model including an encoder, a first decoder and a second decoder.
[0100] In the neural network model constructed by the construction unit 602, the encoder is used to obtain image features based on the input sample image, and then input the obtained image features into the first decoder and the second decoder respectively, so that different decoders can generate corresponding predicted images.
[0101] In the neural network model constructed by the construction unit 602, the first decoder is used to generate an interference object background prediction image based on the image features obtained by the encoder; the interference object background prediction image includes the interference object mask and the image content covered by the interference object.
[0102] In the neural network model constructed by the construction unit 602, the second decoder is used to generate an interference object mask prediction image based on the image features obtained by the encoder; the interference object mask prediction image includes an interference object mask, which is a binary pixel-level area, and uses a pixel value of 0 or 1 to indicate whether the current pixel belongs to the interference object. For example, a pixel value of 1 indicates that the current pixel belongs to the interference object, and a pixel value of 0 indicates that the current pixel does not belong to the interference object.
[0103] In addition, when constructing the neural network model including the encoder, the first decoder and the second decoder, the construction unit 602 may further include the following content: constructing a neural network model including the encoder, the first decoder, the second decoder and the third decoder.
[0104] In the neural network model constructed by the construction unit 602, the third decoder is used to generate an interference object prediction image based on image features; the interference object prediction image is an image corresponding to the interference object itself.
[0105] In this embodiment, the first decoder, the second decoder and the third decoder share a set of network parameters, but the first decoder, the second decoder and the third decoder each have independent attention calculation modules. For example, the first decoder has a first attention calculation module, the second decoder has a second attention calculation module, and the third decoder has a third attention calculation module.
[0106] Different attention calculation modules are used to determine the weights of each feature contained in the image features, reorganize the image features according to the weights of each feature, and then generate different predicted images based on the reorganized image features; it can be understood that the attention calculation module contained in the decoder gradually improves the accuracy of the weights of different features set during the training process of the neural network model.
[0107] In this embodiment, after the construction unit 602 constructs a neural network model including an encoder, a first decoder and a second decoder, the first processing unit 603 inputs the sample image into the neural network model to obtain the interference object background prediction image and the interference object mask prediction image output by the neural network model.
[0108] If the training data includes multiple sample images, the first processing unit 603 can input the multiple sample images into the neural network model respectively, and then obtain the interference object background prediction image and the interference object mask prediction image output by the neural network model for each sample image.
[0109] When inputting the sample image into the neural network model, the first processing unit 603 may also first process the sample image to a preset size (for example, 256×256, 512×512), and then input the processed sample image into the neural network model, thereby preventing the problem of inaccurate model training due to different image sizes.
[0110] If the sample image is a black and white image, the first processing unit 603 can also first expand the black and white image into an RGB image in which the grayscale values of the three RGB channels are the same, and then normalize the grayscale value of each pixel in the RGB image to between [0, 1]. Finally, the processed sample image is input into the neural network model, so that the neural network model can process the black and white image.
[0111] If the neural network model constructed by the construction unit 602 also includes a third decoder, then when the first processing unit 603 inputs the sample image into the neural network model to obtain the interference object background prediction image and the interference object mask prediction image output by the neural network model, it may also include the following content: inputting the sample image into the neural network model to obtain the interference object background prediction image, the interference object mask prediction image and the interference object prediction image output by the neural network model.
[0112] In this embodiment, after the first processing unit 603 obtains the interference object background prediction image and the interference object mask prediction image output by the neural network model, the training unit 604 adjusts the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain the interference object processing model.
[0113] When the training unit 604 adjusts the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain the interference object processing model, the optional implementation method that can be adopted is: according to the sample image, the interference object background prediction image and the interference object mask prediction image, a sample prediction image is obtained; according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image and the interference object mask prediction image, a first target loss function value is obtained; according to the first target loss function value, the parameters of the neural network model are adjusted to obtain the interference object processing model.
[0114] That is to say, in addition to using the true value image group, the training unit 604 will also obtain the first target loss function value for adjusting the parameters of the neural network model based on the sample image and the predicted image output by the neural network model, which can improve the accuracy of the obtained first target loss function value and thus improve the accuracy of the parameter adjustment.
[0115] When the training unit 604 adjusts the parameters of the neural network model according to the target loss function value to obtain the interference object processing model, it can determine that the neural network model has converged after at least one training when it is determined that the calculated target loss function value has converged, thereby completing the training of the neural network model and using the neural network model after the last parameter adjustment as the interference object processing model.
[0116] When the training unit 604 obtains the first target loss function value based on the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image and the interference object mask prediction image, the optional implementation method that can be adopted is: obtaining the first loss function value based on the interference object mask true value image, the interference object mask prediction image, the interference object background prediction image, the sample true value image and the sample prediction image; obtaining the second loss function value based on the interference object mask prediction image and the interference object mask true value image; obtaining the first target loss function value based on the first loss function value and the second loss function value.
[0117] That is to say, the training unit 604 obtains the first loss function value and the second loss function value according to different true value images and predicted images, so that the first target loss function can take into account the generation of the interference object background and the interference object mask at the same time, thereby adjusting the parameters of the decoder and different encoders more accurately, thereby improving the accuracy of the image generated by the trained interference object processing model.
[0118] That is to say, the training unit 604 designs the calculation methods of the first loss function and the second loss function respectively according to the constructed neural network model including an encoder and two decoders, so that the obtained loss function values are more consistent with the currently constructed neural network model, thereby further improving the training effect of the neural network model.
[0119] If the first processing unit 603 obtains the interference object prediction image output by the neural network model, the training unit 604 adjusts the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain the interference object processing model, which may include the following content: according to the sample image, the interference object background prediction image, the interference object mask prediction image, the interference object prediction image and the true value image group, the parameters of the neural network model are adjusted to obtain the interference object processing model.
[0120] When the training unit 604 adjusts the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image, the interference object prediction image and the true value image group to obtain the interference object processing model, the optional implementation method that can be adopted is: according to the sample image, the interference object background prediction image and the interference object mask prediction image, a sample prediction image is obtained; according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, the interference object mask prediction image and the interference object prediction image, a second target loss function value is obtained; according to the second target loss function value, the parameters of the neural network model are adjusted to obtain the interference object processing model.
[0121] When the training unit 604 obtains the second target loss function value based on the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, the interference object mask prediction image and the interference object prediction image, the optional implementation method that can be adopted is: obtaining the first loss function value based on the interference object mask true value image, the interference object mask prediction image, the interference object background prediction image, the sample true value image and the sample prediction image; obtaining the second loss function value based on the interference object mask prediction image and the interference object mask true value image; obtaining the third loss function value based on the interference object prediction image, the interference object mask prediction image, the interference object mask true value image and the sample true value image; obtaining the second target loss function value based on the first loss function value, the second loss function value and the third loss function value, for example, taking the addition result of the first loss function value, the second loss function value and the third loss function value as the second target loss function value.
[0122] That is to say, the training unit 604 obtains the second target loss function value based on the third loss function value obtained from the predicted image and the true image of the interference object, so that the second target loss function can take into account the generation of the interference object background and the interference object mask while also taking into account the generation of the interference object, thereby more accurately adjusting the parameters of the decoder and different encoders, thereby enhancing the model performance of the interference object processing model.
[0123] Figure 7Schematic diagram of the seventh embodiment of the present disclosure. Figure 7 As shown in FIG, the interference object processing device 700 of this embodiment includes:
[0124] The second acquisition unit 701 is used to acquire an image to be processed;
[0125] The second processing unit 702 is configured to input the image to be processed into an interference object processing model to obtain an interference object background prediction image and an interference object mask prediction image output by the interference object processing model;
[0126] The third processing unit 703 is configured to obtain a target image according to the image to be processed, the interference object background prediction image, and the interference object mask prediction image.
[0127] The image to be processed acquired by the second acquisition unit 701 may be an existing image or an image captured in real time. The image to be processed may be an image used for OCR recognition.
[0128] It is understandable that, when it is determined that the acquired image contains an interference object, the second acquiring unit 701 may use the acquired image as the image to be processed.
[0129] In this embodiment, after the second acquisition unit 701 acquires the image to be processed, the second processing unit 702 inputs the image to be processed into the interference object processing model, thereby obtaining the interference object background prediction image and the interference object mask prediction image output by the interference object processing model.
[0130] If the pre-trained interference object processing model further includes a third decoder, the second processing unit 702 may obtain, in addition to the predicted images of the background and the mask, an interference object predicted image output by the interference object processing model.
[0131] After obtaining the interference object prediction image output by the interference object processing model, the second processing unit 702 can also store the interference object prediction image, for example, obtain the identification information of the interference object, and then store the obtained identification information together with the interference object prediction image. In subsequent use, the corresponding interference object prediction image can be obtained according to the identification information.
[0132] In this embodiment, after the second processing unit 702 obtains the interference object background prediction image and the interference object mask prediction image output by the interference object processing model, the third processing unit 703 obtains the target image based on the image to be processed, the interference object background prediction image and the interference object mask prediction image; wherein, the target image obtained by the third processing unit 703 is the image after the watermark and / or seal is erased.
[0133] When the third processing unit 703 obtains the target image according to the image to be processed, the interference object background prediction image and the interference object mask prediction image, it can use formula (1) in the above embodiment to obtain it, which is not described in detail in this embodiment.
[0134] After obtaining the target image, the third processing unit 703 may perform OCR recognition on the target image to obtain the text content contained in the target image; since the target image no longer contains interference objects, the accuracy of the obtained text content can be improved.
[0135] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0136] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0137] like Figure 8 , is a block diagram of an electronic device for training an interference object processing model or an interference object processing method according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0138] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the device 800 can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0139] Various components in device 800 are connected to I / O interface 805, including: an input unit 806, such as a keyboard, mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, optical disk, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0140] The computing unit 801 can be various general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as the training of the interference object processing model or the processing method of the interference object. For example, in some embodiments, the training of the interference object processing model or the processing method of the interference object can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808.
[0141] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the above-described interference object processing model training or interference object processing method may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform interference object processing model training or interference object processing method in any other appropriate manner (e.g., by means of firmware).
[0142] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0143] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable interference object processing model training or interference object processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0144] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0145] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0146] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0147] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. The client-server relationship is established by computer programs running on the respective computers and establishing a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service system that addresses the management difficulties and poor business scalability of traditional physical hosts and VPS services ("Virtual Private Servers," or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.
[0148] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0149] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for training an interference object processing model, comprising: Acquire training data, wherein the training data includes a sample image and a true value image group of the sample image, wherein the true value image group includes an interference object mask true value image and a sample true value image; Constructing a neural network model comprising an encoder, a first decoder, and a second decoder, wherein the encoder is configured to obtain image features based on a sample image, the first decoder is configured to generate an interference object background prediction image based on the image features, and the second decoder is configured to generate an interference object mask prediction image based on the image features; Inputting the sample image into the neural network model to obtain an interference object background prediction image and an interference object mask prediction image output by the neural network model; According to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group, the parameters of the neural network model are adjusted to obtain an interference object processing model.
2. The method according to claim 1, wherein The step of adjusting the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image, and the true value image group to obtain the interference object processing model includes: Obtaining a sample prediction image according to the sample image, the interference object background prediction image, and the interference object mask prediction image; Obtaining a first target loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, and the interference object mask prediction image; The parameters of the neural network model are adjusted according to the first objective loss function value to obtain the interference object processing model.
3. The method according to claim 2, wherein: Obtaining a first target loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, and the interference object mask prediction image includes: Obtaining a first loss function value according to the interference object mask true value image, the interference object mask prediction image, the interference object background prediction image, the sample true value image and the sample prediction image; Obtaining a second loss function value according to the interference object mask prediction image and the interference object mask true value image; The first target loss function value is obtained according to the first loss function value and the second loss function value.
4. The method according to claim 1, wherein The constructing of a neural network model including an encoder, a first decoder, and a second decoder includes: Constructing a neural network model including the encoder, the first decoder, the second decoder and the third decoder; The third decoder is used to generate an interference object prediction image according to the image features.
5. The method according to claim 4, wherein Inputting the sample image into the neural network model to obtain the interference object background prediction image and the interference object mask prediction image output by the neural network model includes: The sample image is input into the neural network model to obtain the interference object background prediction image, the interference object mask prediction image and the interference object prediction image output by the neural network model.
6. The method according to claim 5, wherein: The step of adjusting the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image, and the true value image group to obtain the interference object processing model includes: According to the sample image, the interference object background prediction image, the interference object mask prediction image, the interference object prediction image and the true value image group, the parameters of the neural network model are adjusted to obtain the interference object processing model.
7. The method according to claim 6, wherein: The step of adjusting the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image, the interference object prediction image, and the true value image group to obtain the interference object processing model includes: Obtaining a sample prediction image according to the sample image, the interference object background prediction image, and the interference object mask prediction image; Obtaining a second objective loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, the interference object mask prediction image and the interference object prediction image; The parameters of the neural network model are adjusted according to the second objective loss function value to obtain the interference object processing model.
8. The method according to claim 7, wherein: Obtaining a second objective loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, the interference object mask prediction image, and the interference object prediction image includes: Obtaining a first loss function value according to the interference object mask true value image, the interference object mask prediction image, the interference object background prediction image, the sample true value image and the sample prediction image; Obtaining a second loss function value according to the interference object mask prediction image and the interference object mask true value image; Obtaining a third loss function value according to the interference object prediction image, the interference object mask prediction image, the interference object mask true value image, and the sample true value image; The second target loss function value is obtained according to the first loss function value, the second loss function value and the third loss function value.
9. A method for processing an interference object, comprising: Get the image to be processed; Inputting the image to be processed into an interference object processing model to obtain an interference object background prediction image and an interference object mask prediction image output by the interference object processing model; Obtaining a target image according to the image to be processed, the interference object background prediction image, and the interference object mask prediction image; The interference object processing model is trained according to any one of the methods in claims 1-8.
10. The method according to claim 9, further comprising, Obtaining an interference object prediction image output by the interference object processing model.
11. A training device for an interference object processing model, comprising: A first acquisition unit is configured to acquire training data, wherein the training data includes a sample image and a true value image group of the sample image, and the true value image group includes an interference object mask true value image and a sample true value image; a construction unit, configured to construct a neural network model comprising an encoder, a first decoder, and a second decoder, wherein the encoder is configured to obtain image features based on a sample image, the first decoder is configured to generate an interference object background prediction image based on the image features, and the second decoder is configured to generate an interference object mask prediction image based on the image features; A first processing unit is configured to input the sample image into the neural network model to obtain an interference object background prediction image and an interference object mask prediction image output by the neural network model; A training unit is used to adjust the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain an interference object processing model.
12. The device according to claim 11, wherein When the training unit adjusts the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain the interference object processing model, the training unit specifically performs: Obtaining a sample prediction image according to the sample image, the interference object background prediction image, and the interference object mask prediction image; Obtaining a first target loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, and the interference object mask prediction image; The parameters of the neural network model are adjusted according to the first objective loss function value to obtain the interference object processing model.
13. The device according to claim 12, wherein When the training unit obtains a first target loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, and the interference object mask prediction image, the training unit specifically performs: Obtaining a first loss function value according to the interference object mask true value image, the interference object mask prediction image, the interference object background prediction image, the sample true value image and the sample prediction image; Obtaining a second loss function value according to the interference object mask prediction image and the interference object mask true value image; The first target loss function value is obtained according to the first loss function value and the second loss function value.
14. The device according to claim 11, wherein When constructing a neural network model including an encoder, a first decoder, and a second decoder, the construction unit specifically performs: Constructing a neural network model including the encoder, the first decoder, the second decoder and the third decoder; The third decoder is used to generate an interference object prediction image according to the image features.
15. The device according to claim 14, wherein When the first processing unit inputs the sample image into the neural network model to obtain the interference object background prediction image and the interference object mask prediction image output by the neural network model, the first processing unit specifically performs: The sample image is input into the neural network model to obtain the interference object background prediction image, the interference object mask prediction image and the interference object prediction image output by the neural network model.
16. The device according to claim 15, wherein When the training unit adjusts the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image and the true value image group to obtain the interference object processing model, the training unit specifically performs: According to the sample image, the interference object background prediction image, the interference object mask prediction image, the interference object prediction image and the true value image group, the parameters of the neural network model are adjusted to obtain the interference object processing model.
17. The device according to claim 16, wherein When the training unit adjusts the parameters of the neural network model according to the sample image, the interference object background prediction image, the interference object mask prediction image, the interference object prediction image and the true value image group to obtain the interference object processing model, the training unit specifically performs: Obtaining a sample prediction image according to the sample image, the interference object background prediction image, and the interference object mask prediction image; Obtaining a second objective loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, the interference object mask prediction image and the interference object prediction image; The parameters of the neural network model are adjusted according to the second objective loss function value to obtain the interference object processing model.
18. The device according to claim 17, wherein When the training unit obtains the second target loss function value according to the sample prediction image, the sample true value image, the interference object mask true value image, the interference object background prediction image, the interference object mask prediction image and the interference object prediction image, the training unit specifically performs: Obtaining a first loss function value according to the interference object mask true value image, the interference object mask prediction image, the interference object background prediction image, the sample true value image and the sample prediction image; Obtaining a second loss function value according to the interference object mask prediction image and the interference object mask true value image; Obtaining a third loss function value according to the interference object prediction image, the interference object mask prediction image, the interference object mask true value image, and the sample true value image; The second target loss function value is obtained according to the first loss function value, the second loss function value and the third loss function value.
19. A device for processing an interference object, comprising: A second acquiring unit, configured to acquire an image to be processed; a second processing unit, configured to input the image to be processed into an interference object processing model, and obtain an interference object background prediction image and an interference object mask prediction image output by the interference object processing model; a third processing unit, configured to obtain a target image according to the image to be processed, the interference object background prediction image, and the interference object mask prediction image; The interference object processing model is obtained by training according to any one of the devices in claims 11-18.
20. The device according to claim 19, wherein The second processing unit is further configured to execute: Obtaining an interference object prediction image output by the interference object processing model.
21. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.
22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 10.
23. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Watermark removing method and device
CN111626912A
Model training method and device, computer equipment and storage medium
CN112257471A