Textile industry pattern image restoration method and device, computer equipment and storage medium
Through the combination of STNet and ClothSR models, the fabric interference in textile images is automatically removed and the clarity is improved, which solves the problem of low-quality sample drafts in the textile industry and significantly improves production efficiency and image quality.
Patent Information
- Application Number
- CN202411773178.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2024-12-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The textile industry faces the problems of fabric interference and low image clarity when extracting high-quality pattern designs from low-quality samples, resulting in low production efficiency and high labor costs.
The STNet-based pattern removal model and ClothSR clear model are used to automatically remove pattern interference in the finished draft and improve the clarity of pattern images, respectively. Through convolution blocks, STB structures, deconvolution layers and scoring networks Perform feature extraction, refinement and image reconstruction to generate high-definition images.
It realizes automatic removal of fabric interference, improves the clarity of pattern images, reduces manual tracing costs and design time, and improves production efficiency.
Smart Images

Figure CN119228694A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a pattern image repair method, and more specifically to a pattern image repair method, device, computer equipment and storage medium in the textile industry. Background Art
[0002] The textile industry plays an important role in the manufacturing industry, especially in economic development and social production. Pattern design is an important part of textile production. It not only determines the appearance quality of the product, but also directly affects market demand and the competitiveness of enterprises. However, how to extract high-quality pattern designs that meet customer needs from low-quality samples is still a technical problem facing the current textile industry.
[0003] At present, the textile industry mainly uses two methods to obtain pattern materials to meet the needs of different customers. One is manual tracing. Customers usually provide low-quality finished textile samples. These samples are usually taken from finished products such as clothing, sheets or quilts, and there may be interference such as fabric patterns in the images. Textile companies need to hire special tracing personnel to extract pattern patterns from the samples by manual tracing, remove interference such as fabric patterns, and restore the details of the pattern as accurately as possible. Although this method can ensure a certain degree of accuracy, the whole process is very time-consuming and requires high labor costs, resulting in low production efficiency. The other is material search based on design requirements. Customers usually provide text descriptions or reference images based on specific pattern requirements. Designers of textile companies design by searching for pattern materials on the Internet based on these requirements. The problem is that the pattern materials on the Internet are of low quality, with poor image resolution, and the accuracy and details often cannot meet the actual design requirements. This makes designers face great restrictions when selecting materials, and they need to spend a lot of time to adjust them, and they may not even be directly applied to the design, reducing design efficiency and accuracy.
[0004] Therefore, it is necessary to design a new method to automatically remove fabric interference, improve the clarity of pattern images, and effectively solve the problems in tracing and design work. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device, computer equipment and storage medium for pattern image repair in the textile industry.
[0006] To achieve the above object, the present invention adopts the following technical solution: a method for repairing pattern images in the textile industry, comprising: Obtaining materials to be repaired; Determining whether the material to be repaired is a finished product; If the material to be repaired is a finished product, the material to be repaired is input into the STNet-based cloth pattern removal model for cloth pattern removal to obtain a repair result; Outputting the repair result; If the material to be repaired is not a finished product, the material to be repaired is input into a sharpening model based on ClothSR to perform pattern image sharpening to obtain a repair result; Execute and output the repair result.
[0007] Its further technical solution is: the STNet-based cloth pattern removal model includes sequentially connected convolution blocks, several STB structures, and deconvolution layers, and several of the STB structures are connected across layers; each of the STB structures across layers includes a regularization layer, a TKSA layer, a regularization layer, and an MSFN layer connected in sequence.
[0008] A further technical solution is: the material to be repaired is input into a cloth pattern removal model based on STNet to remove the cloth pattern to obtain a repair result, including: Inputting the material to be repaired into the STNet-based cloth pattern removal model, and performing coarse feature extraction and dimensionality reduction through the convolution block to obtain a convolution result; Using a plurality of the STB structures to separate the cloth texture from the base image on the convolution result, and to perform fine-tuning and repairing on the base image to obtain a repaired result; The deconvolution layer performs a size transformation on the restoration result to obtain a restoration result.
[0009] A further technical solution is: the convolution result is stripped of the cloth texture and the base image by a plurality of STB structures, and the base image is refined and repaired to obtain a repair result, including: The convolution result is cut into different blocks by a plurality of STB structures, and effective features of each region are processed and extracted respectively, and the cloth texture features are filtered out by using a Mask layer to retain the base image features; Two-way convolutional layers of different scales are used to refine and repair the filtered base image features to obtain the repaired results.
[0010] Its further technical solution is: the ClothSR-based sharpening model includes a backbone network and a scoring network, the backbone network is used to sharpen the image of the input material, the scoring network extracts noise and blur features respectively through two branches, generates noise scores and blur scores, and superimposes the noise scores and blur scores into the backbone network.
[0011] A further technical solution is: the material to be repaired is input into a ClothSR-based clearing model to perform pattern image clearing to obtain a repair result, including: Input the material to be repaired into a ClothSR-based sharpening model, and use the convolutional layer of the backbone network to perform feature extraction to obtain an extraction result; A double-layer residual module of the backbone network is used to extract detail features from the extraction result, and to enhance edge and detail information of the image, so as to obtain a residual processing result; The residual processing result is reconstructed using a deconvolution layer, and a high-definition image is generated in combination with the scoring network to obtain a restoration result.
[0012] A further technical solution is: using the deconvolution layer to reconstruct the residual processing result, and combining the scoring network to generate a high-definition image to obtain a restoration result, including: Using a deconvolution layer to reconstruct the residual processing result to generate a preliminary high-definition image; Extracting problem features corresponding to the material to be repaired through multiple convolutional layers and ReLU activation functions; After reducing the dimension of the problem features through the average pooling layer, the sigmoid layer is used to score them to obtain the noise score and the fuzzy score; The noise score and blur score are superimposed into the backbone network, and the preliminary high-definition image is combined with the noise score and blur score to generate the restoration result.
[0013] The present invention also provides a pattern image repair device for the textile industry, comprising: A material acquisition unit, used for acquiring materials to be repaired; A judging unit, used for judging whether the material to be repaired is a finished draft; A cloth pattern removal unit, for inputting the material to be repaired into a cloth pattern removal model based on STNet to remove the cloth pattern if the material to be repaired is a finished product, so as to obtain a repair result; An output unit, used for outputting the repair result; The image clearing unit is used for inputting the material to be repaired into a ClothSR-based clearing model to perform pattern image clearing to obtain a repair result if the material to be repaired is not a finished product; and outputting the repair result.
[0014] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.
[0015] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention determines whether the material to be repaired is a finished draft. For the finished draft, the cloth texture interference is automatically removed by using the cloth texture removal model based on STNet; and for the unfinished draft, the clarity of the pattern image is improved by using the clarity model based on ClothSR. In either case, the repair result will be outputted in the end, which can automatically remove the cloth texture interference, improve the clarity of the pattern image, and effectively solve the problems in tracing and designing work.
[0017] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0019] Figure 1 A schematic diagram of an application scenario of a method for restoring pattern images in the textile industry provided by an embodiment of the present invention; Figure 2 A schematic diagram of a process flow of a method for restoring a pattern image in the textile industry provided by an embodiment of the present invention; Figure 3 A schematic diagram for comparing tracing effects provided by an embodiment of the present invention; Figure 4 A schematic diagram of the structure of a cloth pattern removal model based on STNet provided in an embodiment of the present invention; Figure 5 A schematic diagram of the TSKA structure provided by an embodiment of the present invention; Figure 6 A schematic diagram of the MSFN structure provided in an embodiment of the present invention; Figure 7 Schematic diagram of the effect of removing fabric grain provided by the embodiment of the present invention Figure 1 ; Figure 8 Schematic diagram of the effect of removing fabric grain provided by the embodiment of the present invention Figure 2 ; Fig. 9 Schematic diagram of the effect of removing fabric grain provided by the embodiment of the present invention Figure 3 ; Fig.10 Schematic diagram of the effect of removing fabric grain provided by the embodiment of the present invention Figure 4 ; Fig.11 A schematic diagram of the structure of a ClothSR-based clarity model provided in an embodiment of the present invention; Fig.12 A schematic diagram of the structure of a scoring network provided by an embodiment of the present invention; Fig.13 Schematic diagram of the clarity effect provided by the embodiment of the present invention Figure 1 ; Fig.14 Schematic diagram of the clarity effect provided by the embodiment of the present invention Figure 2 ; Fig.15 Schematic diagram of the clarity effect provided by the embodiment of the present invention Figure 3 ; Fig.16 Schematic diagram of the clarity effect provided by the embodiment of the present invention Figure 4 ; Fig.17 A schematic block diagram of a pattern image restoration device for the textile industry provided by an embodiment of the present invention; Fig.18 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0022] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0023] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0024] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of an application scenario of a method for restoring pattern images in the textile industry provided by an embodiment of the present invention. Figure 2 A schematic flow chart of a method for repairing pattern images in the textile industry provided by an embodiment of the present invention. The method for repairing pattern images in the textile industry is applied in a server. The server interacts with a terminal for data, and based on deep learning technology, automatically removes interference and improves image quality for the cloth interference and low definition problems of textile pattern images, thereby quickly and accurately converting low-quality finished product samples into high-quality target patterns, effectively reducing costs and improving production efficiency. The method of an embodiment of the present invention can quickly remove cloth interference in pattern images and improve the clarity of pattern images, solving the pain points in tracing and design work, and quickly and accurately converting low-quality textile finished product samples into high-quality target patterns, significantly reducing costs for textile enterprises and improving production efficiency.
[0025] Figure 2 FIG. 1 is a flow chart of a method for restoring a pattern image in the textile industry provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S150.
[0026] S110, obtaining materials to be repaired.
[0027] In this embodiment, the material to be repaired can be a finished draft or a pattern image, etc., information input from the terminal.
[0028] S120, determining whether the material to be repaired is a finished product.
[0029] In this embodiment, the finished draft and the pattern image have obvious differences, and can be distinguished based on the difference between the draft and the pattern image obtained according to the design requirements.
[0030] S130: If the material to be repaired is a finished product, the material to be repaired is input into a cloth texture removal model based on STNet to remove the cloth texture, so as to obtain a repair result.
[0031] In this embodiment, the restoration result refers to the material after resolving the problem of cloth texture interference in the tracing process or the problem of low definition of the pattern image in the design process.
[0032] For the low-quality finished drafts provided by customers, the tracers need to manually trace them to remove the interference of the cloth texture in the image and improve its quality. Figure 3As shown in the figure, the finished draft on the left has obvious cloth texture, wrinkles, incompleteness and other problems, while the printed draft on the right has no such interference and the image is clear. The entire draft tracing process requires a lot of manpower and time costs, and the cost of hiring draft tracers is high. In this regard, this embodiment provides a cloth texture removal model based on STNet to solve the problem of removing cloth texture in the draft tracing process.
[0033] In this embodiment, if Figure 4 As shown, the STNet-based cloth pattern removal model includes sequentially connected convolution blocks, several STB structures, and deconvolution layers, and several STB structures are connected across layers; each STB structure cross-layer includes a sequentially connected regularization layer, a TKSA layer, a regularization layer, and an MSFN layer. The STNet-based cloth pattern removal model can automatically remove various types of interference in the finished manuscript, improve image quality, and greatly reduce enterprise costs.
[0034] In one embodiment, the above-mentioned step S130 may include steps S131 - S133 .
[0035] S131, inputting the material to be repaired into the STNet-based cloth pattern removal model, and performing coarse feature extraction and dimensionality reduction through the convolution block to obtain a convolution result.
[0036] In this embodiment, the material to be repaired is first subjected to a 3×3 convolution block to perform coarse feature extraction on the input cloth pattern image, while reducing its feature dimension.
[0037] S132, using a plurality of the STB structures to separate the cloth texture and the base image from the convolution result, and to perform refinement and repair on the base image to obtain a repair result.
[0038] The restoration process is to effectively remove the cloth texture interference in the image through a multi-level feature extraction and restoration mechanism, while maintaining or enhancing the original content characteristics of the image.
[0039] In one embodiment, the above-mentioned step S132 may include steps S1321 - S1322 .
[0040] S1321. Cut the convolution result into different blocks by using a plurality of STB structures, process and extract effective features of each area respectively, and use a Mask layer to filter out cloth texture features and retain base image features.
[0041] Specifically, first, after the input image is processed by the initial 3×3 convolution block, the convolution result is sent to multiple STB structures. Each STB structure cuts the convolution result into different small blocks, and each small block is processed separately. This local processing method can better capture the detailed features of different areas in the image and improve the accuracy of feature extraction.
[0042] Each small block is then processed by modules in the traditional Transformer structure, which can extract effective features of their respective regions. Through local processing, the model can extract the features of each region more finely, avoiding the information loss that may be caused by global processing.
[0043] Finally, in the process of processing each small block, the Mask layer is introduced to filter the features, filter out the cloth texture features, and retain the background features. The Mask layer can effectively distinguish the cloth texture features from the background features, ensuring that only useful information is retained in the final output image, improving the clarity and quality of the image.
[0044] S1322. Use two-way convolutional layers of different scales to refine and repair the filtered base image features to obtain a repair result.
[0045] In this embodiment, the filtered base image features are processed by two convolution layers of different scales. The two convolution layers use convolution kernels of different sizes to refine and repair the features. The design of the two-way convolution layer can capture and repair features from multiple scales, improving the comprehensiveness and meticulousness of the repair. Convolution kernels of different scales can process features of different sizes, ensuring that all parts of the image can be effectively repaired.
[0046] Through the processing of the two-way convolutional layer, the base image features are further refined and repaired to generate higher quality intermediate results. This multi-scale repair method can better restore image details, reduce distortion, and improve the quality of the final output image.
[0047] S133: The deconvolution layer performs a size transformation on the restoration result to obtain a restoration result.
[0048] In this embodiment, the feature map processed by the STB structure and the dual-path convolution layer is resized through a 3×3 deconvolution layer to restore it to the size of the original image.
[0049] The deconvolution layer can restore the size of the feature map to the size of the original image, ensuring that the output image is consistent in size with the input image, which is convenient for subsequent use and processing.
[0050] The feature map after size transformation generates the final restoration result, which is a high-definition image with cloth texture interference removed. The final output image not only removes cloth texture interference, but also maintains the original content features, improves the clarity and quality of the image, and meets the actual needs of the enterprise.
[0051] Through the above steps, the STNet model of the method of this embodiment can effectively remove the cloth texture interference in the image while maintaining or enhancing the original content characteristics of the image. This method not only reduces the time and cost of manual tracing, but also improves the automation level of image processing, and has significant practical application value.
[0052] In this embodiment, first, a 3×3 convolution block is used to perform preliminary feature extraction on the input image with a cloth pattern, while reducing the feature dimension. This step helps to reduce noise and lays the foundation for subsequent feature processing.
[0053] Next, a multi-layer spatial transformer structure (STB) is used to separate the cloth texture from the background image. Figure 4 As shown, each STB includes: 2 regularization layers (LN): used to prevent overfitting during training.
[0054] 1 TKSA layer: Figure 5 As shown in the figure, this layer is improved on the basis of the traditional Transformer structure. It cuts the input image features into three different small blocks, processes and extracts the effective features of each area respectively. In addition, the TKSA layer introduces a Mask layer to filter the features, thereby filtering out the cloth texture features and retaining the base image features.
[0055] 1 MSFN layer: such as Figure 6 As shown in Figure 1, this layer uses two convolutional layers of different scales to further refine and repair the filtered content features.
[0056] By stacking multiple layers of STB structures, the model can process image features layer by layer, gradually remove cloth texture interference, and retain and enhance the background features.
[0057] Before each STB, a cross-layer connection structure is introduced to prevent the loss of shallow features of the image as the network depth increases. Cross-layer connections help maintain shallow features of the image and ensure that the quality of the generated image does not decrease as the network depth increases.
[0058] Finally, a 3×3 deconvolution module is used to resize the repaired feature map to generate a pattern image after removing the fabric texture. The deconvolution module can restore the feature map to the size of the original image, ensuring that the output image is consistent in size with the input image for subsequent use.
[0059] When training the cloth texture removal model based on STNet, the model is also trained using materials after and before cloth texture removal. Since it is difficult to obtain real matching image pairs (finished product images with interference and high-definition tracing images) and the number is limited, this embodiment increases the number of training data sets by means of data simulation. Specifically, a variety of cloth textures are synthesized and superimposed on the high-definition image to generate a simulated finished product image and construct a simulated cloth texture removal data set. The data simulation method can significantly increase the size of the training data set and improve the generalization ability and robustness of the model.
[0060] The model is pre-trained using the constructed simulated texture removal dataset, and then fine-tuned using the real dataset through transfer learning. Pre-training enables the model to learn general feature representations on large-scale data, while fine-tuning enables the model to better adapt to the characteristics of the real dataset and improve the texture removal effect.
[0061] like Figures 7 to 10 As shown in the figure, the cloth texture removal model performs well in practical applications and can effectively remove cloth texture interference in images while maintaining high quality and clarity of the images. This achievement not only improves the automation level of image processing, but also significantly reduces the cost of enterprises, and has important practical application value.
[0062] S140: Output the repair result.
[0063] In this embodiment, the modified result is output to the terminal for display.
[0064] S150. If the material to be repaired is not a finished product, the material to be repaired is input into a clearing model based on ClothSR to perform pattern image clearing to obtain a repair result; and the step S140 is executed.
[0065] In this embodiment, if Fig.11 As shown, the ClothSR-based sharpening model includes a backbone network and a scoring network. The backbone network is used to sharpen the image of the input material. The scoring network extracts noise and blur features respectively through two branches, generates noise scores and blur scores, and superimposes the noise scores and blur scores into the backbone network.
[0066] The ClothSR-based clarity model aims to solve the problems of blurred patterns and low clarity in the pattern materials collected in design work, and improve the clarity of the image for further processing. The model combines image super-resolution technology and scoring mechanism to effectively improve the clarity and quality of the image.
[0067] Specifically, the backbone network (Base Network) is responsible for converting the input low-resolution image into a high-definition image. It includes the following: Convolutional layer (Conv): First, the input low-resolution image is passed through the convolutional layer for preliminary feature extraction.
[0068] Double-layer residual block (RRDB): Next, a double-layer residual block (RRDB) is stacked to further extract detailed features of the image, especially edge and texture information.
[0069] Deconvolution layer (DeConv): Finally, a deconvolution layer is used to reconstruct the extracted features and generate a preliminary high-definition image.
[0070] The scoring network assists the backbone network to more accurately handle the noise and blur issues in the image. It includes the following: Two branches: Two branches are set up respectively for noise and blur problems.
[0071] Convolutional layer and ReLU activation: Each branch extracts the corresponding problem features through multiple convolutional layers and ReLU activation functions.
[0072] Average Pooling: Use the average pooling layer to reduce the dimension of the extracted problem features.
[0073] Sigmoid layer: The dimensionality-reduced features are scored through the Sigmoid layer to obtain noise scores (S n ) and fuzzy score (S b ).
[0074] In one embodiment, the above-mentioned step S150 may include steps S151 - S153 .
[0075] S151, inputting the material to be repaired into a ClothSR-based sharpening model, and using the convolutional layer of the backbone network to perform feature extraction to obtain an extraction result.
[0076] In this embodiment, the material to be repaired is input into a sharpening model based on ClothSR, and the convolutional layer of the backbone network is used for feature extraction. The preliminary feature extraction lays the foundation for the subsequent detail feature extraction.
[0077] S152, using a double-layer residual module of the backbone network to extract detail features from the extraction result, and enhancing edge and detail information of the image to obtain a residual processing result.
[0078] In this embodiment, the double-layer residual block (RRDB) of the backbone network is used to process the extraction results to further extract the detailed features of the image, especially to enhance the edge and detail information of the image. Through the RRDB module, the model can capture more image details and improve the clarity of the image.
[0079] S153, using a deconvolution layer to reconstruct the residual processing result, and combining the scoring network to generate a high-definition image to obtain a restoration result.
[0080] In one embodiment, the above-mentioned step S153 may include steps S1531 - S1534 .
[0081] S1531, using a deconvolution layer to reconstruct the residual processing result to generate a preliminary high-definition image; S1532, extracting problem features corresponding to the material to be repaired through multiple convolutional layers and ReLU activation functions; S1533, after reducing the dimension of the problem feature through the average pooling layer, scoring is performed using the Sigmoid layer to obtain a noise score and a fuzzy score; S1534, superimposing the noise score and the fuzzy score into the backbone network, combining the preliminary high-definition image with the noise score and the fuzzy score, and generating a restoration result.
[0082] In this embodiment, the deconvolution layer is used to reconstruct the image features after being processed by the double-layer residual module to generate a preliminary high-definition image. The deconvolution layer enlarges the image size by learning while keeping the image features unchanged, thereby restoring the image details.
[0083] Through multiple convolutional layers and ReLU activation functions, the problem features in the material to be repaired are extracted and the noise and blur areas in the image are identified. The convolutional layer is used to extract the local features of the image, and the ReLU activation function increases the nonlinear ability of the model, which helps the model better capture the complex patterns in the image.
[0084] The extracted problem features are processed by average pooling layer to reduce the dimension, and then scored by Sigmoid layer. The noise score (S n ) and fuzzy score (S b ). The average pooling layer reduces the dimension by calculating the average value of each feature map, reducing the amount of calculation while retaining important feature information. The output of the Sigmoid layer is a value between 0 and 1, which can be used to represent the importance or probability of a feature. Here it is used to quantify the noise level and blur of the image.
[0085] The noise score and blur score are added to the backbone network and combined with the initially generated high-definition image to generate the final restoration result. By feeding the scoring information back to the backbone network, the model can adjust the image restoration strategy according to the degree of noise and blur, thereby improving the accuracy and effect of the restoration. Specifically, the model may apply a stronger denoising algorithm in areas with higher noise and strengthen the restoration of edges and details in areas with severe blur.
[0086] Through the detailed implementation of the above steps S1531 to S1534, the ClothSR model can not only effectively restore the details of the low-resolution image, but also make corresponding adjustments based on the specific problems of the image (such as noise and blur), ensuring that the generated high-definition image is both clear and natural. This process fully demonstrates the powerful ability and flexibility of the ClothSR model in processing pattern materials.
[0087] The workflow of the entire ClothSR-based sharpening model includes: First, the input low-resolution image is fed into the first convolutional layer (Conv) of the backbone network, which is responsible for preliminary feature extraction of the image. The goal of this stage is to capture basic visual information from the original image and lay the foundation for subsequent deep processing. Next, a double-layer residual module (RRDB) referenced from the ESRGAN architecture is used for multi-layer stacking to further mine and refine the deep features of the image. The design of RRDB enables the model to focus more on enhancing local details while maintaining global information. After completing the feature deepening extraction, a deconvolution layer (DeConv) is used to reconstruct these features in order to restore the spatial resolution of the image and generate a preliminary high-definition image.
[0088] Given that the most common problems in low-resolution pattern images are noise and blur, a scoring network is introduced to improve the model's processing efficiency on these problems. Fig.12 As shown in the figure, this scoring network consists of two independent branches, each of which is designed with multiple convolutional layers and ReLU activation units to specifically extract noise or blur features. Afterwards, these features are processed by average pooling layer for dimensionality reduction, and the corresponding score (S) is output by the sigmoid layer. n ) and fuzzy score (S b ). These two scores are then incorporated into the backbone network and combined with the preliminary generated HD images to more accurately adjust and optimize the image processing strategy, especially for noise removal and blur correction.
[0089] In order to evaluate the effectiveness of the proposed image processing framework, extensive experimental tests were conducted using datasets covering various types of low-resolution flower pattern images. Figures 13 to 16As shown in the figure, the test results show that the images processed by this model have significant improvements in overall clarity and pattern boundary sharpness, which fully proves the superior performance of this method in improving the quality of pattern images and meets the high standards of the textile industry.
[0090] The above-mentioned pattern image restoration method for the textile industry determines whether the material to be restored is a finished draft. For the finished draft, the cloth texture removal model based on STNet is used to automatically remove the cloth texture interference; and for the unfinished draft, the clarity of the pattern image is improved by the clarity model based on ClothSR. In either case, the restoration result will be output in the end, which can automatically remove the cloth texture interference, improve the clarity of the pattern image, and effectively solve the problems in tracing and design work.
[0091] Fig.17 FIG. 3 is a schematic block diagram of a pattern image restoration device 300 for the textile industry provided by an embodiment of the present invention. Fig.17 As shown, corresponding to the above textile industry pattern image repair method, the present invention also provides a textile industry pattern image repair device 300. The textile industry pattern image repair device 300 includes a unit for executing the above textile industry pattern image repair method, and the device can be configured in a server. Fig.17 The textile industry pattern image restoration device 300 includes a material acquisition unit 301, a judgment unit 302, a cloth pattern removal unit 303, an output unit 304 and an image clearing unit 305.
[0092] The material acquisition unit 301 is used to acquire the material to be repaired; the judgment unit 302 is used to judge whether the material to be repaired is a finished product; the cloth texture removal unit 303 is used to input the material to be repaired into a cloth texture removal model based on STNet to remove the cloth texture to obtain a repair result if the material to be repaired is a finished product; the output unit 304 is used to output the repair result; the image clearing unit 305 is used to input the material to be repaired into a clearing model based on ClothSR to clear the pattern image to obtain a repair result if the material to be repaired is not a finished product; and execute to output the repair result.
[0093] In one embodiment, the cloth pattern removal unit 303 includes: A convolution subunit, used for inputting the material to be repaired into the STNet-based cloth pattern removal model, and performing coarse feature extraction and dimensionality reduction through the convolution block to obtain a convolution result; A repair subunit, configured to use a plurality of the STB structures to separate the cloth texture from the base image on the convolution result, and to perform fine repair on the base image to obtain a repair result; The deconvolution subunit is used to perform size transformation on the restoration result by the deconvolution layer to obtain the restoration result.
[0094] In one embodiment, the repair subunit comprises: A cutting and stripping module, used for cutting the convolution result into different blocks by a plurality of the STB structures, processing and extracting effective features of each region respectively, and using a Mask layer to filter out the cloth texture features and retain the base image features; The refinement and restoration module is used to refine and restore the filtered base image features using two-way convolutional layers of different scales to obtain the restoration result.
[0095] In one embodiment, the image clearing unit 305 includes: An extraction subunit, used for inputting the material to be repaired into a ClothSR-based sharpening model, and performing feature extraction using a convolutional layer of a backbone network to obtain an extraction result; An enhancement subunit, configured to extract detail features from the extraction result by using a double-layer residual module of a backbone network, and enhance edge and detail information of the image to obtain a residual processing result; The reconstruction combination subunit is used to use the deconvolution layer to reconstruct the image of the residual processing result, and generate a high-definition image in combination with the scoring network to obtain a restoration result.
[0096] In one embodiment, the reconstruction combination subunit includes: An image reconstruction module, used to reconstruct the residual processing result using a deconvolution layer to generate a preliminary high-definition image; A feature extraction module, used to extract the problem features corresponding to the material to be repaired through multiple convolutional layers and ReLU activation functions; A scoring module is used to score the problem features using a Sigmoid layer after reducing their dimensions through an average pooling layer, to obtain a noise score and a fuzzy score; The superposition module is used to superimpose the noise score and the blur score into the backbone network, and combine the preliminary high-definition image with the noise score and the blur score to generate the restoration result.
[0097] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned textile industry pattern image repair device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0098] The textile industry pattern image restoration device 300 can be implemented in the form of a computer program. The computer program can be used in Fig.18 Runs on the computer device shown.
[0099] See also Fig.18 , Fig.18 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.
[0100] See also Fig.18 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0101] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a method for repairing pattern images in the textile industry.
[0102] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0103] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for repairing pattern images in the textile industry.
[0104] The network interface 505 is used to communicate with other devices over the network. Fig.18 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0105] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps: Obtain the material to be repaired; determine whether the material to be repaired is a finished product; if the material to be repaired is a finished product, input the material to be repaired into a cloth texture removal model based on STNet to remove the cloth texture to obtain a repair result; output the repair result; if the material to be repaired is not a finished product, input the material to be repaired into a clearing model based on ClothSR to clear the pattern image to obtain a repair result; execute and output the repair result.
[0106] Among them, the STNet-based cloth pattern removal model includes sequentially connected convolution blocks, several STB structures, and deconvolution layers, and several of the STB structures are connected across layers; each of the STB structures across layers includes a regularization layer, a TKSA layer, a regularization layer, and an MSFN layer connected in sequence.
[0107] The ClothSR-based sharpening model includes a backbone network and a scoring network. The backbone network is used to sharpen the image of the input material. The scoring network extracts noise and blur features respectively through two branches, generates noise scores and blur scores, and superimposes the noise scores and blur scores into the backbone network.
[0108] In one embodiment, when the processor 502 implements the step of inputting the material to be repaired into the STNet-based cloth pattern removal model to remove the cloth pattern to obtain the repair result, the processor 502 specifically implements the following steps: The material to be repaired is input into the cloth texture removal model based on STNet, and the convolution block is used to perform coarse feature extraction and dimensionality reduction to obtain a convolution result; a plurality of STB structures are used to separate the cloth texture and the base image of the convolution result, and the base image is refined and repaired to obtain a repair result; the deconvolution layer is used to resize the repair result to obtain a repair result.
[0109] In one embodiment, when the processor 502 implements the step of separating the texture and the base image of the convolution result by using the plurality of STB structures and performing fine-tuning and repairing on the base image to obtain the repair result, the processor 502 specifically implements the following steps: The convolution result is cut into different blocks by a plurality of STB structures, and effective features of each area are processed and extracted respectively. The cloth texture features are filtered out by a Mask layer, and the base image features are retained. The filtered base image features are refined and repaired by using two-way convolution layers of different scales to obtain the repaired results.
[0110] In one embodiment, when the processor 502 implements the step of inputting the material to be repaired into the ClothSR-based sharpening model to perform pattern image sharpening to obtain a repair result, the processor 502 specifically implements the following steps: The material to be repaired is input into a ClothSR-based sharpening model, and the convolution layer of the backbone network is used to perform feature extraction to obtain an extraction result; the double-layer residual module of the backbone network is used to extract detail features from the extraction result, and the edge and detail information of the image are enhanced to obtain a residual processing result; the deconvolution layer is used to reconstruct the residual processing result, and a high-definition image is generated in combination with the scoring network to obtain a repair result.
[0111] In one embodiment, when the processor 502 implements the step of reconstructing the residual processing result using the deconvolution layer and generating a high-definition image in combination with the scoring network to obtain a restoration result, the following steps are specifically implemented: The residual processing result is reconstructed using a deconvolution layer to generate a preliminary high-definition image; the problem features corresponding to the material to be repaired are extracted through multiple convolution layers and ReLU activation functions; the problem features are reduced in dimension through an average pooling layer, and then scored using a Sigmoid layer to obtain a noise score and a fuzzy score; the noise score and the fuzzy score are superimposed on the backbone network, and the preliminary high-definition image is combined with the noise score and the fuzzy score to generate a repair result.
[0112] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0113] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0114] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps: Obtain the material to be repaired; determine whether the material to be repaired is a finished product; if the material to be repaired is a finished product, input the material to be repaired into a cloth texture removal model based on STNet to remove the cloth texture to obtain a repair result; output the repair result; if the material to be repaired is not a finished product, input the material to be repaired into a clearing model based on ClothSR to clear the pattern image to obtain a repair result; execute and output the repair result.
[0115] Among them, the STNet-based cloth pattern removal model includes sequentially connected convolution blocks, several STB structures, and deconvolution layers, and several of the STB structures are connected across layers; each of the STB structures across layers includes a regularization layer, a TKSA layer, a regularization layer, and an MSFN layer connected in sequence.
[0116] The ClothSR-based sharpening model includes a backbone network and a scoring network. The backbone network is used to sharpen the image of the input material. The scoring network extracts noise and blur features respectively through two branches, generates noise scores and blur scores, and superimposes the noise scores and blur scores into the backbone network.
[0117] In one embodiment, when the processor executes the computer program to implement the step of inputting the material to be repaired into the STNet-based cloth pattern removal model to remove the cloth pattern to obtain a repair result, the processor specifically implements the following steps: The material to be repaired is input into the cloth texture removal model based on STNet, and the convolution block is used to perform coarse feature extraction and dimensionality reduction to obtain a convolution result; a plurality of STB structures are used to separate the cloth texture and the base image of the convolution result, and the base image is refined and repaired to obtain a repair result; the deconvolution layer is used to resize the repair result to obtain a repair result.
[0118] In one embodiment, when the processor executes the computer program to implement the step of separating the texture and the base image of the convolution result by using a plurality of the STB structures and refining and repairing the base image to obtain the repair result, the processor specifically implements the following steps: The convolution result is cut into different blocks by a plurality of STB structures, and effective features of each area are processed and extracted respectively. The cloth texture features are filtered out by a Mask layer, and the base image features are retained. The filtered base image features are refined and repaired by using two-way convolution layers of different scales to obtain the repaired results.
[0119] In one embodiment, when the processor executes the computer program to implement the step of inputting the material to be repaired into the ClothSR-based sharpening model to perform pattern image sharpening to obtain a repair result, the processor specifically implements the following steps: The material to be repaired is input into a ClothSR-based sharpening model, and the convolution layer of the backbone network is used to perform feature extraction to obtain an extraction result; the double-layer residual module of the backbone network is used to extract detail features from the extraction result, and the edge and detail information of the image are enhanced to obtain a residual processing result; the deconvolution layer is used to reconstruct the residual processing result, and a high-definition image is generated in combination with the scoring network to obtain a repair result.
[0120] In one embodiment, when the processor executes the computer program to implement the step of reconstructing the image using the deconvolution layer with the residual processing result and generating a high-definition image in combination with the scoring network to obtain a restoration result, the following steps are specifically implemented: The residual processing result is reconstructed using a deconvolution layer to generate a preliminary high-definition image; the problem features corresponding to the material to be repaired are extracted through multiple convolution layers and ReLU activation functions; the problem features are reduced in dimension through an average pooling layer, and then scored using a Sigmoid layer to obtain a noise score and a fuzzy score; the noise score and the fuzzy score are superimposed on the backbone network, and the preliminary high-definition image is combined with the noise score and the fuzzy score to generate a repair result.
[0121] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0122] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0123] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0124] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0125] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0126] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for restoring pattern images in the textile industry, characterized in that: include: Obtaining materials to be repaired; Determining whether the material to be repaired is a finished product; If the material to be repaired is a finished product, the material to be repaired is input into the STNet-based cloth pattern removal model for cloth pattern removal to obtain a repair result; Outputting the repair result; If the material to be repaired is not a finished product, the material to be repaired is input into a sharpening model based on ClothSR to perform pattern image sharpening to obtain a repair result; Execute and output the repair result.
2. The method for restoring pattern images in the textile industry according to claim 1, characterized in that: The STNet-based cloth pattern removal model includes sequentially connected convolution blocks, several STB structures, and deconvolution layers, and several STB structures are connected across layers; each STB structure cross-layer includes a regularization layer, a TKSA layer, a regularization layer, and an MSFN layer connected in sequence.
3. The method for restoring pattern images in the textile industry according to claim 2, characterized in that: The step of inputting the material to be repaired into a cloth pattern removal model based on STNet to remove the cloth pattern to obtain a repair result includes: Inputting the material to be repaired into the STNet-based cloth pattern removal model, and performing coarse feature extraction and dimensionality reduction through the convolution block to obtain a convolution result; Using a plurality of the STB structures to separate the cloth texture from the base image on the convolution result, and to perform fine-tuning and repairing on the base image to obtain a repaired result; The deconvolution layer performs a size transformation on the restoration result to obtain a restoration result.
4. The method for restoring pattern images in the textile industry according to claim 3, characterized in that: The step of using a plurality of STB structures to separate the cloth texture from the base image on the convolution result and performing fine-tuning and repairing on the base image to obtain a repair result includes: The convolution result is cut into different blocks by a plurality of STB structures, and effective features of each region are processed and extracted respectively, and the cloth texture features are filtered out by using a Mask layer to retain the base image features; Two-way convolutional layers of different scales are used to refine and repair the filtered base image features to obtain the repaired results.
5. The method for restoring pattern images in the textile industry according to claim 1, characterized in that: The ClothSR-based sharpening model includes a backbone network and a scoring network. The backbone network is used to sharpen the image of the input material. The scoring network extracts noise and blur features respectively through two branches, generates noise scores and blur scores, and superimposes the noise scores and blur scores into the backbone network.
6. The method for restoring pattern images in the textile industry according to claim 5, characterized in that: The step of inputting the material to be repaired into a ClothSR-based clearing model to perform pattern image clearing to obtain a repair result includes: Input the material to be repaired into a ClothSR-based sharpening model, and use the convolutional layer of the backbone network to perform feature extraction to obtain an extraction result; A double-layer residual module of the backbone network is used to extract detail features from the extraction result, and to enhance edge and detail information of the image, so as to obtain a residual processing result; The residual processing result is reconstructed using a deconvolution layer, and a high-definition image is generated in combination with the scoring network to obtain a restoration result.
7. The method for restoring pattern images in the textile industry according to claim 6, characterized in that: The reconstructing the image of the residual processing result by using the deconvolution layer and generating a high-definition image in combination with the scoring network to obtain a restoration result includes: Using a deconvolution layer to reconstruct the residual processing result to generate a preliminary high-definition image; Extracting problem features corresponding to the material to be repaired through multiple convolutional layers and ReLU activation functions; After reducing the dimension of the problem features through the average pooling layer, the sigmoid layer is used to score them to obtain the noise score and the fuzzy score; The noise score and blur score are superimposed into the backbone network, and the preliminary high-definition image is combined with the noise score and blur score to generate the restoration result.
8. A pattern image restoration device for the textile industry, characterized in that: include: A material acquisition unit, used for acquiring materials to be repaired; A judging unit, used for judging whether the material to be repaired is a finished draft; A cloth pattern removal unit, for inputting the material to be repaired into a cloth pattern removal model based on STNet to remove the cloth pattern if the material to be repaired is a finished product, so as to obtain a repair result; An output unit, used for outputting the repair result; The image clearing unit is used for inputting the material to be repaired into a ClothSR-based clearing model to perform pattern image clearing to obtain a repair result if the material to be repaired is not a finished product; and outputting the repair result.
9. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image restoration method and device, electronic equipment and computer storage medium
CN113298722A
Image restoration method and storage medium
CN114331903A
