A progressive image bleeding prediction method based on recurrent feature reasoning
By progressively identifying and filling bleed areas through a recurrent feature inference network, the problem of bleed prediction in images with complex textures and colors is solved, achieving high-precision bleed effects and avoiding the shortcomings of existing technologies.
Patent Information
- Application Number
- CN202310413714.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-18
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2043-04-18
AI Technical Summary
Existing technologies struggle to accurately predict bleed in images with complex textures and colors. Manual processing is time-consuming, labor-intensive, and ineffective, while digital image processing methods are not ideal for images with complex colors.
A progressive image bleed prediction method based on recurrent feature inference is adopted. Through preprocessing, image enhancement, training of recurrent feature inference network and feature merging, the bleed area is gradually identified and filled, avoiding color separation and utilizing the semantic information of the original image.
It achieves precise bleed prediction for high-resolution color images, avoids structural and color inconsistencies, preserves rich semantic information of the image, and improves bleed accuracy and effect.
Smart Images

Figure CN116433635B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image printing, in particular to a progressive image bleeding prediction method based on recurrent feature reasoning. BACKGROUND
[0002] Bleeding refers to the part reserved for cutting during printing to retain the effective content of the image, which is a common printing term. In printing, bleeding refers to extending the pattern of the product outward, and adding some extended patterns outward in the cutting position. The design file is divided into design size and finished product size during printing. The design size is always larger than the finished product size. The part that is too large needs to be cut after printing. Manual operation and mechanical precision problems can cause errors. Therefore, cutting the image after bleeding can avoid the situation that the finished product is cut too little to expose the white edge or cut too much to cut the effective content. The bleeding position is generally set to 3mm and can be set according to different printing needs. Printing bleeding has important applications in the fields of graphic design and printing process, which ensures the stability of the finished product size after printing to meet the needs of the printed matter.
[0003] Currently, there are two main methods for predicting bleeding. One is to rely on manual operation, manually drawing lines and depicting outward expansion of a certain area through some image processing software such as PhotoShop. This method can be used to process images with simple textures and single colors. However, as the colors and textures of printed matter become more complex and the patterns become more delicate, manual processing is time-consuming and labor-intensive, and the bleeding precision cannot meet the requirements. Moreover, due to the different experiences of personnel, the bleeding results will also be different. These factors will affect the final bleeding effect and thus affect the quality of the printed matter. Therefore, this manual processing method cannot meet the growing demand for complex image bleeding. The other method is to use digital image processing technology to uniformly process the image. Currently, there is an image bleeding position prediction method based on adversarial edge learning. First, a contour generation network is used to generate the edge structure of the image. Then, the generated edge structure is used as a priori to predict the bleeding position according to the known information of the original image. This method requires color separation, and the bleeding effect requires high quality of the color-separated image. For some images with complex colors, such as images with gradient color lines and patterns, the bleeding effect is not good, and the one-time bleeding effect is not fine enough, which affects the quality of the printed matter.
[0004] Therefore, how to accurately predict the bleeding of images with complex textures and colors has become a technical problem to be solved. SUMMARY
[0005] The purpose of the present application is to overcome the defects of the prior art and provide a progressive image bleeding prediction method based on recurrent feature reasoning.
[0006] The objective of this invention can be achieved through the following technical solutions:
[0007] A progressive image bleeding prediction method based on cyclic feature inference, comprising the following steps:
[0008] 1) Preprocess the initial image to remove noise and enhance the image;
[0009] 2) Crop the image in four directions along the edges of the preprocessed image to use as the training set, add white edges with the required number of bleed pixels in four directions and crop the image to use as the test set, and create a mask dataset corresponding to the training set and the test set.
[0010] 3) Input the training set and the corresponding mask dataset as feature maps into the recurrent feature inference network for training, identify the regions that need to be inferred, fill the identified regions with the feature values obtained by the feature inference model, and gradually reduce the regions to be filled.
[0011] 4) Determine whether the area to be filled has been completely filled. If not, proceed to step 3). If yes, perform adaptive feature merging on the multiple feature maps obtained by the loop filling, and convert the feature maps into RGB images to obtain the image after bleed prediction.
[0012] 5) Test using the test set and the corresponding mask dataset to obtain several small images after edge bleeding. Then, stitch the small images back into the initial image in order to obtain the images after bleeding prediction in the four directions except for the four corners of the initial image.
[0013] 6) Using the bleed prediction image obtained in 5) as the prior, train the model by creating training and test sets at the four corners, generate bleed prediction small images at the four corners, and then stitch the images together to achieve the final bleed prediction filling at the image boundary, thus obtaining the final bleed prediction image.
[0014] Further, 1) specifically refers to: using a Gaussian filter to filter out Gaussian noise in the image, performing linear smoothing filtering on the image, then using histogram transformation to make the color levels of the image more distinct, and finally using a high-pass filter to sharpen the image in the frequency domain.
[0015] Furthermore, the training set consists of 4000 randomly cropped images of size 256*256.
[0016] Furthermore, the test set consists of several images of size 256*256.
[0017] Further, the mask data set is a binary image, the number of which is consistent with the number of the training set and the test set, the size is 256*256, and the gray level is set to zero at the edge of the image in the mask data set. The zeroed area is the part that needs to be bled.
[0018] Further, the identified area in 3) is specifically: three partial convolution layers with convolution kernels of 7*7, 5*5 and 3*3 are cascaded, the feature map is updated in each cycle after the input feature map passes through the cascaded partial convolution layer, and the difference between the updated mask and the input mask is defined as the area to be inferred in the cycle.
[0019] Further, the feature inference module includes an encoder, a decoder and an attention module.
[0020] Further, the filling of the identified area using the feature value obtained by the feature inference model in 3) is specifically: four times of down-sampling are performed by using a convolution layer with a stride of 2, and then four times of up-sampling are performed by using deconvolution to return to the original size of the image. A feature map with the same size as the initial image is generated, and an attention mechanism is used at the fourth layer from the bottom to search for possible textures from the background and use them to replace the textures in the identified area.
[0021] An electronic device includes a memory and a processor, the memory has a computer program stored thereon, and the processor implements the method as described above when executing the program.
[0022] A computer readable storage medium has a computer program stored thereon, and the program is executed by a processor to implement the method as described above.
[0023] Compared with the prior art, the present application has the following beneficial effects:
[0024] First, the progressive image bleeding prediction method based on cycle feature inference of the present application avoids the irrationality of structure and color caused by one-time outward bleeding filling, and has a more fine result.
[0025] Second, the method of region identification + feature inference + feature merging proposed by the present application gradually fills the bleeding area, avoids color separation, and maximally retains and utilizes the rich semantic information in the original image.
[0026] Third, the present application proposes a bleeding scheme for high-resolution color images, which cuts the edges of the original image step by step by using the cropping method, splices the bleeding results back to the original image, and uses different bleeding directions to train different models to achieve the best bleeding effect. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 A method flowchart of the present application;
[0028] Figure 2 A structure diagram of an image filling recurrent feature inference network of the present application
[0029] Figure 3 A bleeding process picture demonstration schematic diagram of the present application. DETAILED DESCRIPTION
[0030] The present application will be described in detail below in conjunction with the drawings and specific embodiments. The embodiments are implemented on the premise of the technical solutions of the present application, and detailed implementation modes and specific operation processes are given, but the protection scope of the present application is not limited to the following embodiments.
[0031] EMBODIMENT
[0032] As shown in the figure, a progressive image bleeding prediction method based on recurrent feature inference, the method comprises the following steps: Figure 1
[0033] 1) Preprocess the initial image to eliminate noise in the image and perform image enhancement.
[0034] Gaussian filter is used to filter out Gaussian noise in the image, linear smoothing filter is used for the image, histogram transformation is used to make the color level of the image more distinct, and finally high-pass filter is used to sharpen the image in the frequency domain, so that the edge profile of the image is more clear.
[0035] 2) Since the image that needs to bleed is a high-resolution color image, the image needs to be blocked first. Randomly crop 4000 256*256 size images in four directions of the edge of the preprocessed image as a training set, add white edges with the number of pixels that need to bleed in four directions and crop a number of 256*256 size images as a test set, and make a mask data set corresponding to the training set and the test set; the mask data set is a binary image, the number of which is consistent with the number of the training set and the test set, the size is 256*256, and the gray level at the edge of the image in the mask data set is set to zero, and the zeroed area is the part that needs to bleed.
[0036] 3) as shown in the figure, the training set and the corresponding mask data set are input into the recurrent feature inference network as feature maps for training, the region that needs to be inferred is identified, the feature values obtained by the feature inference model are used to fill the identified region, and the region to be filled is gradually reduced. Figure 2
[0037] Partial convolution is used to identify the regions that need to be inferred in each loop. Three partial convolutional layers with kernels of 7×7, 5×5 and 3×3 are cascaded together. The input feature map is updated in each loop after passing through the cascaded partial convolutional layers. The difference between the updated mask and the input mask is defined as the region to be inferred in the loop.
[0038] The feature inference module includes an encoder, a decoder, and an attention module. First, a convolutional layer with a stride of 2 is used to perform four downsampling operations, and then deconvolution is used to perform four upsampling operations to return the image to its original size, generating a feature map with the same size as the initial image. In the fourth-to-last layer, an attention mechanism is used to search for possible textures in the background and use them to replace the textures in the identified regions, thereby synthesizing higher quality features.
[0039] 4) Determine whether the area to be filled has been completely filled. If not, proceed to step 3). If yes, perform adaptive feature merging on the multiple feature maps obtained by cyclic filling, convert the feature maps into RGB images to obtain the bleed prediction image, and calculate the values in the output feature maps only from the feature maps that have been filled at their corresponding positions.
[0040] 5) such as Figure 3 As shown, by testing with the test set and the corresponding mask dataset, several small images after edge bleeding are obtained. The small images are then stitched back into the initial image in order to obtain the images after bleeding prediction in the four directions except for the four corners of the initial image.
[0041] 6) Using the bleed prediction image obtained in 5) as the prior, train the model by creating training and test sets at the four corners, generate bleed prediction small images at the four corners, and then stitch the images together to achieve the final bleed prediction filling at the image boundary, thus obtaining the final bleed prediction image.
[0042] This invention uses a cyclic feature inference network structure that combines region recognition, feature inference, and feature merging. This avoids the structural and color inconsistencies caused by one-time outward bleed filling, eliminates the need for color separation, and maximizes the preservation and utilization of rich semantic information in the original image, resulting in more refined results. Furthermore, it achieves bleed prediction for large-size images by cropping and stitching the images.
[0043] The present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the method described above.
[0044] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0045] The preferred embodiments of the present application have been described above in detail. It should be understood that modifications and variations to the present application can be affected by those skilled in the art without departing from the scope of the application. Accordingly, it is intended that all of the subject matter of the above description and the claims be interpreted to encompass all such modifications and changes.
Claims
1. A progressive image bleeding prediction method based on cyclic feature reasoning, characterized in that, The method includes the following steps: 1) Preprocess the initial image to remove noise and enhance the image; 2) Crop the image in four directions of the preprocessed image edge to use as the training set, add white edges with the required number of bleed pixels in four directions and crop the image to use as the test set, and create a mask dataset corresponding to the training set and test set. 3) Input the training set and the corresponding mask dataset as feature maps into the recurrent feature inference network for training, identify the regions that need to be inferred, use the feature values obtained by the feature inference model to fill the identified regions, and gradually reduce the regions to be filled. 4) Determine whether the area to be filled has been completely filled. If not, proceed to step 3). If yes, perform adaptive feature merging on the multiple feature maps obtained by the loop filling, and convert the feature maps into RGB images to obtain the image after bleed prediction. 5) Test using the test set and the corresponding mask dataset to obtain several small images after edge bleeding. Then, stitch the small images back into the initial image in order to obtain the images after bleeding prediction in the four directions except for the four corners of the initial image. 6) Using the bleed prediction image obtained in 5) as the prior, training sets and test sets are created at the four corners to train the model, generating bleed prediction small images at the four corners, and then the images are stitched together to achieve the final bleed prediction filling at the image boundary, thus obtaining the final bleed prediction image.
2. The progressive image bleeding prediction method based on cyclic feature reasoning according to claim 1, characterized in that, Specifically, 1) involves using a Gaussian filter to remove Gaussian noise from the image, performing linear smoothing filtering on the image, then using histogram transformation to make the color levels of the image more distinct, and finally using a high-pass filter to sharpen the image in the frequency domain.
3. The progressive image bleeding prediction method based on cyclic feature reasoning according to claim 1, characterized in that, The training set consists of 4000 randomly cropped images of size 256*256.
4. The progressive image bleeding prediction method based on cyclic feature reasoning according to claim 3, characterized in that, The test set consists of several images of size 256*256.
5. The progressive image bleeding prediction method based on cyclic feature reasoning according to claim 4, characterized in that, The mask dataset consists of binary images, the number of which is consistent with the number of training and testing sets, and the size is 256*256. The gray levels of the images in the mask dataset are set to zero at the edges, and the areas with zero gray levels are the parts that need to be bleed.
6. The progressive image bleeding prediction method based on cyclic feature reasoning according to claim 1, characterized in that, The specific steps for identifying the region to be inferred in step 3) are as follows: three partial convolutional layers with kernels of 7×7, 5×5 and 3×3 are cascaded together. After the input feature map passes through the cascaded partial convolutional layers, the mask and feature map are updated in each loop. The difference between the updated mask and the input mask is defined as the region to be inferred in the loop.
7. The progressive image bleeding prediction method based on cyclic feature reasoning according to claim 1, characterized in that, The feature reasoning module includes an encoder, a decoder, and an attention module.
8. The progressive image bleeding prediction method based on cyclic feature reasoning according to claim 7, characterized in that, The specific steps for filling the identified region with the feature values obtained by the feature inference model in 3) are as follows: First, a convolutional layer with a stride of 2 is used to perform four downsampling operations, and then deconvolution is used to perform four upsampling operations to return the image to its original size, generating a feature map with the same size as the initial image. In the fourth-to-last layer, an attention mechanism is used to search for possible textures in the background and use them to replace the textures in the identified region.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Image bleeding position prediction method based on adversarial edge learning
CN114693630A
Method of detecting image, electronic device, and storage medium
US20230102467A1