Fabric printing and dyeing on-line detection system and method

By improving the high-resolution feature enhancement, deformable convolution and dual-focus attention module of the YOLOv8 model, the detection problem of fine defects and irregular shape defects in fabric printing and dyeing detection is solved, and high-precision and high-efficiency automated detection is achieved.

CN120431442AActive Publication Date: 2025-08-05ZHEJIANG XIANYU FIBER WEAVING & DYEING GARMENT CO LTD

Patent Information

Application Number
CN202510515646.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-08-05
Estimated Expiration
2045-04-23

AI Technical Summary

Technical Problem

The existing YOLOv8 model is difficult to effectively detect subtle defects in fabric printing and dyeing detection, and its generalization ability to complex backgrounds and irregular shape defects is insufficient, which cannot meet the real-time inspection requirements of high-speed production lines.

Method used

Improved YOLOv8 model enhances the extraction and fusion ability of subtle features, adapts to irregular shapes, and reduces calculation load by introducing high-resolution feature enhancement module (HR-FEM), deformable convolution (DCNv3), dual focus attention module (DFAM), and lightweight defect prediction head (LDPH).

Benefits of technology

It significantly improves the detection accuracy and robustness of fine defects such as fine stains and slight color difference, meets the real-time inspection needs of industrial production lines, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120431442A_ABST
    Figure CN120431442A_ABST
Patent Text Reader

Abstract

The invention provides a fabric printing and dyeing on-line detection system and method. A fabric printing and dyeing on-line detection system comprises an image acquisition unit; the data processing unit is electrically connected with the image acquisition unit and is used for receiving the surface image of the printed and dyed fabric and running an improved YOLOv8 defect detection model to execute a defect detection algorithm so as to output a defect detection result of the printed and dyed fabric; a result output and control unit; wherein the improved YOLOv8 defect detection model is obtained by performing the following improvements on a standard YOLOv8 model with a backbone network, a neck network and a head network: setting a high-resolution feature enhancement module for enhancing fine feature extraction of the model; the deformable convolution is integrated; setting a double focusing attention module; and the head network is a lightweight defect prediction head. On-line detection of fabric printing and dyeing defects is realized based on the improved YOLOv8 model, and particularly, the method has relatively high accuracy and detection efficiency for tiny and complex defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a fabric online detection system and method, in particular to a fabric printing and dyeing online detection system and method, and belongs to the technical field of industrial automation detection. Background Art

[0002] Fabric printing and dyeing is a critical process in the textile industry, and its product quality directly impacts the value and market competitiveness of the final garment or textile. During the dyeing process, various defects may appear on the fabric surface, such as color difference, stains, missing or misprinted prints, creases, holes, oil stains, and flyaways, due to factors such as raw materials, equipment, processes, and operations. These defects severely impact the fabric's aesthetics and performance.

[0003] Currently, the detection of textile printing and dyeing defects primarily relies on manual visual inspection. However, manual inspection has numerous drawbacks: First, it is inefficient and cannot meet the demands of modern, high-speed production lines; second, inspection results are easily influenced by the subjective factors of the inspector, resulting in inconsistent standards, high rates of missed and false positives; third, working in strong light or in specific environments for extended periods of time is detrimental to the inspector's eyesight, and labor costs continue to rise.

[0004] To overcome the shortcomings of manual inspection, automated inspection technologies based on machine vision have emerged. Traditional machine vision methods are typically based on image processing algorithms (such as threshold segmentation, edge detection, morphological processing, texture analysis, and color feature extraction) or simple machine learning models. These methods are somewhat effective for scenes with simple backgrounds and distinct defect features. However, for printed and dyed fabrics, the background patterns are complex and varied, and the defects are numerous, varied in shape, and of varying sizes (especially subtle defects), often confused with background textures or patterns. Traditional methods often struggle to detect them accurately and robustly, suffering from poor adaptability, high false alarm rates, and sensitivity to lighting changes.

[0005] In recent years, deep learning technologies, such as convolutional neural networks (CNNs), have made breakthroughs in the field of object detection. The YOLO (You Only Look Once) series of algorithms, as representatives of single-stage object detection, boasts broad application potential in industrial inspection due to its fast detection speed and high efficiency. YOLOv8, a newer version of the series, has significantly improved accuracy and speed compared to earlier versions and has been applied to fabric defect detection. However, directly applying the existing YOLOv8 model to complex online inspection of fabric printing and dyeing still faces the following challenges:

[0006] First, for extremely small, low-contrast defects, such as tiny stains and slight color stripes, the feature extraction and fusion mechanism of the standard YOLOv8 model may not be able to capture sufficient discriminative information, which can easily lead to missed detections.

[0007] Second, printed and dyed fabrics have rich colors, textures, and patterns. These normal background features may be similar to certain defect features, causing the standard YOLOv8 model to misclassify normal areas as defects.

[0008] Third, the shape, color, and size of printing and dyeing defects vary greatly, and the existing YOLOv8 model's generalization ability for irregular shapes or rare types of defects needs to be improved;

[0009] Fourth, on high-speed production lines, the detection system needs to complete image acquisition, processing, and judgment in a very short time, which places high demands on the model's inference speed (FPS). If the sole pursuit of improving model detection accuracy is achieved, the detection speed may not meet the standard.

[0010] Therefore, there is an urgent need to develop an online detection system and method for fabric printing and dyeing that can overcome the above problems and take into account high precision, high efficiency and strong robustness. Summary of the Invention

[0011] Based on the above background, the purpose of the present invention is to provide a system and method for online detection of fabric printing and dyeing, which can realize online detection of fabric printing and dyeing defects based on an improved YOLOv8 model, especially for subtle and complex defects with high accuracy and detection efficiency.

[0012] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:

[0013] A fabric printing and dyeing online detection system, comprising:

[0014] An image acquisition unit is provided on the fabric printing and dyeing production line and is used to acquire surface images of the printed and dyed fabrics in real time;

[0015] a data processing unit electrically connected to the image acquisition unit, configured to receive a surface image of the printed and dyed fabric, and run an improved YOLOv8 defect detection model to execute a defect detection algorithm, thereby outputting a defect detection result of the printed and dyed fabric;

[0016] A result output and control unit is electrically connected to the data processing unit and is used to receive the defect detection results of the printed and dyed fabrics and record, display or alarm the defect information of the printed and dyed fabrics;

[0017] The improved YOLOv8 defect detection model is obtained by making the following improvements to the standard YOLOv8 model having a backbone network, a neck network, and a head network:

[0018] A high-resolution feature enhancement module is provided for enhancing the model's ability to extract subtle features, wherein the input of the high-resolution feature enhancement module is connected to the intermediate layer feature output of the main network, and the output of the high-resolution feature enhancement module is connected to the neck network;

[0019] Integrating deformable convolution into the convolutional modules of the deep layer of the backbone network and / or the convolutional modules of the neck network;

[0020] After the neck network outputs feature maps of different scales and before the head network receives the feature maps, a dual focus attention module is set up respectively;

[0021] The head network is a lightweight defect prediction head for performing defect classification and bounding box regression on the received feature map, and the lightweight defect prediction head is constructed using depthwise separable convolution and standard convolution.

[0022] Preferably, the high-resolution feature enhancement module includes:

[0023] At least two parallel convolution branches, each convolution branch including at least one dilated convolution layer using a preset dilation rate, and the dilated convolution layers of the at least two parallel convolution branches have different dilation rates;

[0024] a splicing component, configured to splice the output feature maps of the at least two parallel convolution branches in a channel dimension;

[0025] A subsequent convolutional layer, connected after the concatenation component, for adjusting the number of channels and / or mixing features; and,

[0026] A fusion component is used to fuse the output of the subsequent convolutional layer with the input feature map of the high-resolution feature enhancement module.

[0027] Preferably, each of the parallel convolution branches further includes a 1x1 convolution layer for adjusting the number of channels before the dilated convolution layer, and the fusion component performs residual connection by element-by-element addition.

[0028] Preferably, the deformable convolution is integrated into the last two convolution modules of the backbone network and the C2f module for fusion features in the neck network, and the integration method is to replace at least part of the original 3x3 standard convolution with the deformable convolution.

[0029] Preferably, the dual focus attention module includes:

[0030] A channel attention branch that learns and applies channel weights to enhance important feature channels; and,

[0031] A spatial attention branch that learns and applies a spatial weight map to enhance feature responses in key spatial regions;

[0032] The outputs of the channel attention branch and the spatial attention branch are combined and applied to the input feature map to generate an attention-weighted output feature map.

[0033] Preferably, the lightweight defect prediction head includes:

[0034] At least one depthwise separable convolutional layer for feature extraction and transformation; and,

[0035] A 1x1 convolutional layer is used to output prediction results, which include bounding box regression parameters, object confidence, and defect category probability.

[0036] Preferably, the neck network adopts a path aggregation structure, including a top-down path and a bottom-up path; the top-down path fuses multiple feature maps of different layers of the backbone network and the output feature map of the high-resolution feature enhancement module; the bottom-up path fuses feature maps of different levels generated by the top-down path; the fusion adopts a splicing operation combined with a weighted fusion mechanism.

[0037] A method for online detection of textile printing and dyeing using any of the above-mentioned online detection systems for textile printing and dyeing, the method comprising the following steps:

[0038] Loading the improved YOLOv8 defect detection model into the data processing unit and performing system initialization;

[0039] The surface image of the printed and dyed fabric is collected in real time by an image acquisition unit and pre-processed;

[0040] Inputting the preprocessed printed and dyed fabric image into the improved YOLOv8 defect detection model for forward reasoning, and outputting a detection result including defect category, confidence score, and predicted bounding box position;

[0041] Performing non-maximum suppression processing on the detection results, screening according to a preset confidence threshold, and obtaining the final defect prediction result;

[0042] The final defect prediction result is recorded, displayed or alarmed through the result output and control unit.

[0043] Preferably, the improved YOLOv8 defect detection model is pre-trained by the following steps:

[0044] Construct an image dataset containing various types of fabric printing and dyeing defects with bounding boxes and category annotations;

[0045] Expanding the image dataset using a data augmentation strategy;

[0046] The enhanced image dataset is input into the improved YOLOv8 defect detection model in batches for training, and the combined loss function including bounding box regression loss, classification loss and confidence loss is optimized by the back propagation algorithm to update the model network parameters until the model performance converges.

[0047] Preferably, the data enhancement strategy includes at least one of random rotation, random flipping, random cropping, color jittering and noise addition.

[0048] Compared with the prior art, the present invention has the following advantages:

[0049] By introducing the HR-FEM module, the present invention effectively utilizes shallow high-resolution features and combines them with multi-scale dilated convolution to capture context. It also combines DFAM to focus on features and suppress background interference, significantly enhancing the detection capability of fine defects such as small stains and slight color differences, and improving overall detection accuracy and robustness.

[0050] The present invention integrates DCNv3 at key positions of the backbone network and the neck network, enabling the model to better adapt to the irregular shapes and scale changes of printing and dyeing defects, thereby improving the detection rate of various defects with variable shapes.

[0051] The present invention adopts LDPH as the prediction head and utilizes lightweight designs such as depthwise separable convolution. While ensuring or even improving detection accuracy, it effectively reduces the computational load of the model, ensures a high inference speed, and meets the requirements of real-time detection of industrial production lines.

[0052] The present invention effectively solves the key technical difficulties in online detection of fabric printing and dyeing defects through deep customized improvements to the YOLOv8 model, especially through collaborative innovation in feature enhancement (HR-FEM), geometric adaptability (DCNv3), feature focusing (DFAM) and efficiency optimization (LDPH), and provides a high-precision, high-efficiency and strong robust automated detection solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0054] Figure 1 This is a schematic diagram of the principle of an online detection system for fabric printing and dyeing according to the present invention;

[0055] Figure 2 Schematic diagram of the structure of the improved YOLOv8 defect detection model in the present invention;

[0056] Figure 3 Schematic diagram of the structure of the high-resolution feature enhancement module (HR-FEM) in the present invention;

[0057] Figure 4 It is a schematic flow chart of an online detection method for fabric printing and dyeing of the present invention;

[0058] Figure 5 This is a performance comparison chart of a fabric printing and dyeing online detection method of the present invention and the benchmark YOLOv8 on the same test data set;

[0059] In the figure: 10, image acquisition unit; 20, data processing unit; 30, result output and control unit. DETAILED DESCRIPTION

[0060] The technical solution of the present invention will be further described in detail below through specific embodiments and in conjunction with the accompanying drawings. It should be understood that the implementation of the present invention is not limited to the following embodiments, and any form of modification and / or change made to the present invention will fall within the scope of protection of the present invention.

[0061] In the present invention, unless otherwise specified, all parts and percentages are by weight. The equipment and raw materials used are commercially available or commonly used in the art. The methods in the following embodiments, unless otherwise specified, are conventional methods in the art. The components or equipment in the following embodiments, unless otherwise specified, are all universal standard parts or components known to those skilled in the art. Their structures and principles are known to those skilled in the art through technical manuals or routine experimental methods.

[0062] The following detailed description of the embodiments of the present invention is made in conjunction with the accompanying drawings. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present invention. However, one or more embodiments may be implemented by those skilled in the art without these specific details.

[0063] The embodiment of the present invention discloses an online detection system for fabric printing and dyeing, referring to Figure 1 The system is deployed on or near a textile printing and dyeing production line to perform real-time surface defect detection on running textiles. The system mainly includes an image acquisition unit 10, a data processing unit 20, and a result output and control unit 30.

[0064] Image acquisition unit 10 is positioned above the production line or in a location where it can clearly capture the fabric surface. Its function is to continuously capture images of the fabric surface in real time. Image acquisition unit 10 typically includes at least one industrial camera (e.g., a high-speed line scan camera or a high-resolution area scan camera) and a corresponding light source (e.g., an LED line or area light source that provides uniform illumination). Image data captured by the industrial camera is transmitted to data processing unit 20 via an interface (e.g., a wired or wireless network).

[0065] The data processing unit 20 is the core computing component of the system, which is usually a high-performance industrial computer, server or embedded computing platform, and is equipped with a graphics processing unit (GPU) to accelerate the calculation of the deep learning model. It is electrically connected to the image acquisition unit 10 (for example, through a data cable or network connection) to receive the real-time acquired fabric surface image. The received original image is preprocessed to meet the input requirements of the subsequent improved YOLOv8 defect detection model. After the preprocessing is completed, the image is sent to the improved YOLOv8 defect detection model loaded in the memory of the data processing unit 20 to execute the defect detection algorithm. After the model inference is completed, the data processing unit 20 outputs the detection results containing information such as defect location, category, and confidence.

[0066] The result output and control unit 30 is electrically connected to the data processing unit 20 and is used to receive and process the test results. The result output and control unit 30 includes a display and an audible and visual alarm. The display displays the current fabric image, the location and type of marked defects, and statistical information in real time.

[0067] Reference Figure 2 The improved YOLOv8 defect detection model has made targeted structural improvements based on the standard YOLOv8 model (usually including the backbone network, neck network and head network).

[0068] The backbone network is responsible for extracting multi-level features from the input image. The backbone network consists of stages C1, C2, C3, C4, and C5. C1 is an initial convolutional layer (Conv+BN+Act). C2 to C5 are constructed using efficient convolutional modules, such as the cross-stage local network module (CSP Block). The backbone network reduces the size of the feature map and increases the number of channels by downsampling step by step, thereby obtaining features of different receptive fields and semantic levels. In order to enhance the adaptability to the irregular shapes of fabric defects, in the deep stage of the backbone network, that is, Figure 2In the convolutional modules of the C4 and C5 stages shown in the figure, some of the original 3x3 standard convolutional layers are replaced with deformable convolutional (DCNv3) layers. In addition, the end of the C5 stage also includes a spatial pyramid pooling fast module (SPPF) to further increase the receptive field and aggregate contextual information. The backbone network ultimately outputs multiple feature maps of different scales, namely Figure 2 The feature maps derived from C3, C4, and C5 are shown as P3, P4, and P5, respectively, and are used by the neck network.

[0069] To enhance the model's ability to detect subtle defects (such as small stains and slight color differences), the present invention specifically designs and introduces a High-Resolution Feature Enhancement Module (HR-FEM). The input of the HR-FEM is connected to the intermediate layer feature output of the backbone network, that is, it receives the output feature map P3 from the C3 stage.

[0070] Reference Figure 3 , the internal structure of HR-FEM is as follows:

[0071] The input feature map P3 first flows directly to the fusion component at the end of the module through a residual connection to preserve the original details;

[0072] At the same time, the input feature map P3 is fed into a parallel convolution structure. This structure contains three parallel convolution branches;

[0073] In each parallel branch, the input features first pass through a 1x1 convolution layer to adjust the channel dimension and reduce the amount of computation;

[0074] The adjusted feature map is then fed into a dilated convolution layer. Different branches use different dilation rates: 3x3 dilated convolutions with rate=1, rate=3, and rate=5. These different dilation rates allow each branch to capture contextual information of varying ranges. The dilated convolution layer is followed by batch normalization (BN) and activation functions.

[0075] The output feature maps of all parallel branches are concatenated in the channel dimension to form a combined feature map containing multi-scale context information;

[0076] The concatenated feature map then passes through a subsequent 1x1 convolutional layer to further fuse features and adjust the number of output channels;

[0077] Finally, this feature map processed and fused by multi-scale dilated convolution is added element-by-element with the original input feature map retained previously through a fusion component.

[0078] HR-FEM finally outputs an enhanced feature map that is connected to the neck network for subsequent feature fusion. The enhanced feature map contains rich multi-scale contextual information while retaining the original high-resolution details.

[0079] The neck network is responsible for fusing feature information from different layers of the backbone network (P3, P4, P5) and the HR-FEM output to generate multi-scale feature maps (N3, N4, N5) suitable for detecting defects of different sizes. The present invention adopts a path aggregation structure, which includes two paths: top-down and bottom-up.

[0080] The structure of the top-down path is as follows: first, the P5 feature map from the deepest layer of the backbone network is processed by a convolutional layer (Conv). The processed P5 feature map is upsampled (Upsample) and then concatenated with the P4 feature map from the backbone network using a weighted fusion mechanism (Concat+W). The fused feature map is input into a C2f module (in which DCNv3 is integrated) for further feature interaction and refinement. The output of the C2f module is upsampled again and then concatenated with the P3 feature map from the backbone network and the output feature map from HR-FEM using a weighted fusion mechanism (Concat+W). This final fused feature map is then input into another C2f module for processing, ultimately generating the highest-resolution neck feature map N3.

[0081] The structure of the bottom-up path is that the feature map N3 passes through a downsampling layer, and the downsampling result is concatenated with the intermediate feature map of the corresponding level (P4 level) in the top-down path (i.e., the output of the first C2f module) using a weighted fusion mechanism (Concat+W). The fused feature map is input into another C2f module (in which DCNv3 is integrated) for processing to generate a medium-resolution neck feature map N4. Similarly, the feature map N4 passes through another downsampling layer and is concatenated with the intermediate feature map of the corresponding level (P5 level) in the top-down path (i.e., the output of the Conv layer after processing P5) using a weighted fusion mechanism (Concat+W). The fused feature map is input into the last C2f module for processing to generate the lowest-resolution neck feature map N5.

[0082] To further refine features and suppress noise before the final prediction, a DFAM module is connected in series before the three feature maps N3, N4, and N5 of different scales output by the neck network. Each DFAM module receives the neck feature map of the corresponding scale as input. The DFAM module includes:

[0083] A channel attention branch, for example, adopting the efficient channel attention (ECA) mechanism to learn and recalibrate the importance weights of feature channels;

[0084] A spatial attention branch, for example, generates a spatial attention map through convolution or pooling operations to highlight key areas related to defects on the feature map.

[0085] The outputs of these two branches are combined and acted on the input feature map to generate a refined feature map after dual attention focus, which is then passed to the subsequent head network.

[0086] The final inspection results are generated by three parallel head networks, each responsible for a specific scale. These head networks are designed as lightweight defect prediction heads (LDPHs) to ensure online inspection efficiency. Each LDPH receives as input the refined feature map output by the corresponding DFAM module. The structure of each LDPH includes:

[0087] A depthwise separable convolution (DSC) layer. DSC decomposes the standard convolution into depthwise convolution and 1x1 pointwise convolution, significantly reducing the amount of computation and parameters for efficient feature extraction and transformation.

[0088] A 1x1 standard convolutional layer (Conv) is used to map features to the final prediction output. For each prediction unit, the output includes bounding box regression parameters, object confidence, and defect category probability.

[0089] The outputs of the three LDPHs are aggregated to form the complete detection result of the model for the input image.

[0090] These targeted structural improvements (HR-FEM, DCNv3 integration, DFAM, LDPH) based on the standard YOLOv8 model jointly improve the overall performance of fabric printing and dyeing defect detection.

[0091] The standard YOLOv8 model (especially when processing small input sizes) can lose fine texture and edge information crucial for subtle defects in deep networks. The HR-FEM module, through its parallel multi-dilation rate convolution design, effectively captures multi-scale contextual information from shallow features (at the P3 level) while maintaining high resolution, significantly enhancing the original representation of details such as tiny stains and fine color stripes. However, simply enhancing details through the HR-FEM module is not enough; this detail information must be combined with deeper features containing richer semantic information. The improved neck network receives the enhanced high-resolution features from HR-FEM and performs effective path aggregation with features from deeper layers of the backbone network (P4 and P5). This ensures that this detail information is effectively integrated into the global feature representation, rather than being diluted or lost during subsequent downsampling or deep processing. This enables the model to understand the overall defect context and accurately perceive its subtle features in the final prediction, significantly improving the detection rate and localization accuracy of small, low-contrast defects.

[0092] Printing and dyeing defects often have irregular shapes and varying sizes. Integrating DCNv3 into key convolutional modules in the backbone and neck networks allows the model to better adapt to geometric deformations of defects during feature extraction and fusion. By learning the offsets and modulation factors of sampling points, DCNv3 can more flexibly capture features of non-rigid objects, avoiding the inaccurate or missing features that can occur with standard convolution due to the fixed receptive field. Before the neck network outputs the N3, N4, and N5 feature maps, DFAM uses channel-wise and spatial attention mechanisms to refine and focus the fused feature maps. DCNv3 ensures that even for oddly shaped defects, their features are more accurately extracted and integrated into the neck network output. This provides DFAM with higher-quality input features, allowing it to more effectively identify and enhance the characteristic responses captured by DCNv3 that are truly defective, while suppressing interference from complex background textures. This combination of features makes the model more robust to the recognition of defects with varying shapes. Finally, LDPH receives feature maps with a higher signal-to-noise ratio and more concentrated information. This allows LDPH to achieve accurate classification and regression tasks with relatively fewer parameters and computation (via DSC) (if the potentially noisier features without DFAM processing are directly fed into the lightweight head, its performance may degrade).

[0093] In summary, the detailed features of a small and irregularly shaped defect are first enhanced by HR-FEM, and its irregular shape is better processed in the module containing DCNv3. The fused features are focused by DFAM and finally accurately predicted by the efficient LDPH.

[0094] The embodiment of the present invention also discloses a method for online detection of fabric printing and dyeing, referring to Figure 4 , the process of this method is as follows:

[0095] Step S1: System initialization. Start the image acquisition unit 10, the data processing unit 20, and the result output and control unit 30. Load the pre-trained improved YOLOv8 defect detection model into the data processing unit 20.

[0096] Step S2: Image acquisition and preprocessing. The image acquisition unit 10 continuously captures the surface images of the fabric on the production line in real time and transmits them to the data processing unit 20. The data processing unit 20 performs necessary preprocessing on the images, such as correction, normalization, and size adjustment.

[0097] Step S3: Defect Detection. The preprocessed fabric image is fed into the improved YOLOv8 defect detection model. The model performs forward inference, passing through the backbone network, HR-FEM, neck network, DFAM, and LDPH, ultimately outputting a detection result containing the possible defect location (bounding box), category, and confidence level.

[0098] Step S4: Post-processing of results. Apply the non-maximum suppression (NMS) algorithm to the detection results output by the model to eliminate duplicate or highly overlapping prediction boxes for the same defect, retaining the optimal box. Prediction boxes with low scores are then filtered out based on a preset confidence threshold (e.g., 0.5) to obtain the final defect prediction result list.

[0099] Step S5: Result Output and Response. The final defect prediction results are sent to the result output and control unit 30. This unit records the data based on the results, displays defect information on the user interface, triggers an audible and visual alarm, or issues control instructions for online marking or rejection.

[0100] The improved YOLOv8 defect detection model is pre-trained through the following steps:

[0101] First, a dataset of fabric printing and dyeing defect images is constructed. The dataset contains various common and rare defect types (such as color difference, stains, missing prints, holes, wrinkles, etc.), covering different fabric materials, colors, pattern backgrounds, as well as defects of different sizes and shapes. Each defect instance in the dataset is accurately manually annotated, providing its category label and bounding box coordinates.

[0102] Secondly, we employ a variety of data augmentation strategies to expand the dataset and improve the model's generalization capabilities. Common augmentation methods include geometric transformations (such as random rotation, random flipping, random cropping, and random scaling), color transformations (such as brightness, contrast, saturation, and hue jitter), blurring (such as Gaussian blur), and adding noise (such as Gaussian noise and salt and pepper noise) to simulate the various variations that may be encountered in actual production.

[0103] The augmented dataset is then divided into training, validation, and test sets. The training set is fed into the initialized improved YOLOv8 defect detection model in batches. In each training iteration, the model performs a forward propagation to obtain predictions and then calculates a combined loss function between the predictions and the true annotations. This loss function includes bounding box regression loss, classification loss, and object confidence loss. The gradient of the loss function with respect to the model parameters is calculated using the backpropagation algorithm, and the model weights are updated based on the gradient using the AdamW optimizer. This process is repeated for multiple cycles, while monitoring model performance on the validation set, until the model performance reaches the preset target or stops improving significantly.

[0104] Reference Figure 5 The performance of the proposed method was compared with that of the benchmark YOLOv8 on the same test dataset. While maintaining a high detection speed (FPS), the proposed method achieved significant improvements in mean average precision (mAP) and recall rate for subtle and difficult-to-detect defects. Compared with the benchmark YOLOv8, although the FPS of the proposed method dropped from approximately 95 FPS to >80 FPS, this was due to the increased computational effort caused by the introduction of new modules (HR-FEM, DFAM) and more complex convolutions (DCNv3 replacing standard convolutions), resulting in longer inference time. However, this is a completely acceptable price to pay for a significant improvement in accuracy. Moreover, >80 FPS is still a sufficiently high speed for most online detection scenarios and is fully capable of meeting the requirements for online detection of fabric printing and dyeing defects.

[0105] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from the principles of the present invention, and such improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A fabric printing and dyeing online detection system, characterized by: The fabric printing and dyeing online detection system includes: An image acquisition unit is provided on the fabric printing and dyeing production line and is used to acquire surface images of the printed and dyed fabrics in real time; a data processing unit electrically connected to the image acquisition unit, configured to receive a surface image of the printed and dyed fabric, and run an improved YOLOv8 defect detection model to execute a defect detection algorithm, thereby outputting a defect detection result of the printed and dyed fabric; A result output and control unit is electrically connected to the data processing unit and is used to receive the defect detection results of the printed and dyed fabrics and record, display or alarm the defect information of the printed and dyed fabrics; The improved YOLOv8 defect detection model is obtained by making the following improvements to the standard YOLOv8 model having a backbone network, a neck network, and a head network: A high-resolution feature enhancement module is provided for enhancing the model's ability to extract subtle features, wherein the input of the high-resolution feature enhancement module is connected to the intermediate layer feature output of the main network, and the output of the high-resolution feature enhancement module is connected to the neck network; Integrating deformable convolution into the convolutional modules of the deep layer of the backbone network and / or the convolutional modules of the neck network; After the neck network outputs feature maps of different scales and before the head network receives the feature maps, a dual focus attention module is set up respectively; The head network is a lightweight defect prediction head for performing defect classification and bounding box regression on the received feature map, and the lightweight defect prediction head is constructed using depthwise separable convolution and standard convolution.

2. The online detection system for textile printing and dyeing according to claim 1, characterized in that: The high-resolution feature enhancement module includes: At least two parallel convolution branches, each convolution branch including at least one dilated convolution layer using a preset dilation rate, and the dilated convolution layers of the at least two parallel convolution branches have different dilation rates; a splicing component, configured to splice the output feature maps of the at least two parallel convolution branches in a channel dimension; A subsequent convolutional layer, connected after the concatenation component, for adjusting the number of channels and / or mixing features; and, A fusion component is used to fuse the output of the subsequent convolutional layer with the input feature map of the high-resolution feature enhancement module.

3. The online detection system for textile printing and dyeing according to claim 2, characterized in that: Each parallel convolution branch further includes a 1x1 convolution layer for adjusting the number of channels before the dilated convolution layer, and the fusion component performs residual connection by element-by-element addition.

4. The online detection system for textile printing and dyeing according to claim 1, characterized in that: The deformable convolution is integrated into the last two convolution modules of the backbone network and the C2f module for fusion features in the neck network. The integration method is to replace at least part of the original 3x3 standard convolution with the deformable convolution.

5. The online detection system for textile printing and dyeing according to claim 1, characterized in that: The dual focus attention module includes: A channel attention branch that learns and applies channel weights to enhance important feature channels; and a spatial attention branch that learns and applies spatial weight maps to enhance feature responses in key spatial regions; The outputs of the channel attention branch and the spatial attention branch are combined and applied to the input feature map to generate an attention-weighted output feature map.

6. The online detection system for textile printing and dyeing according to claim 1, characterized in that: The lightweight defect prediction head includes: At least one depthwise separable convolutional layer for feature extraction and transformation; and, A 1x1 convolutional layer is used to output prediction results, which include bounding box regression parameters, object confidence, and defect category probability.

7. The online detection system for textile printing and dyeing according to claim 1, characterized in that: The neck network adopts a path aggregation structure, including a top-down path and a bottom-up path; the top-down path fuses multiple feature maps of different layers of the backbone network and the output feature map of the high-resolution feature enhancement module; the bottom-up path fuses feature maps of different levels generated by the top-down path; the fusion adopts a splicing operation combined with a weighted fusion mechanism.

8. A method for online detection of textile printing and dyeing using the textile printing and dyeing online detection system according to any one of claims 1 to 7, characterized in that: The method comprises the following steps: Loading the improved YOLOv8 defect detection model into the data processing unit and performing system initialization; The surface image of the printed and dyed fabric is collected in real time by an image acquisition unit and pre-processed; Inputting the preprocessed printed and dyed fabric image into the improved YOLOv8 defect detection model for forward reasoning, and outputting a detection result including defect category, confidence score, and predicted bounding box position; Performing non-maximum suppression processing on the detection results, screening according to a preset confidence threshold, and obtaining the final defect prediction result; The final defect prediction result is recorded, displayed or alarmed through the result output and control unit.

9. The online detection method for textile printing and dyeing according to claim 1, wherein: The improved YOLOv8 defect detection model is pre-trained by the following steps: Construct an image dataset containing various types of fabric printing and dyeing defects with bounding boxes and category annotations; Expanding the image dataset using a data augmentation strategy; The enhanced image dataset is input into the improved YOLOv8 defect detection model in batches for training, and the combined loss function including bounding box regression loss, classification loss and confidence loss is optimized by the back propagation algorithm to update the model network parameters until the model performance converges.

10. The online detection method for textile printing and dyeing according to claim 1, characterized in that: The data enhancement strategy includes at least one of random rotation, random flipping, random cropping, color jittering, and noise addition.

Citation Information

Patent Citations

  • Method for detecting defects of plain yarn-dyed fabric

    CN117495836A

  • Lightweight YOLO target detection method based on bidirectional multi-scale feature enhancement

    CN118015247A

  • Medical image classification method and system based on global and local information fusion

    CN118691875A

  • Remote sensing image aircraft target detection method based on YOLOv8 improvement

    CN119863609A

Cited By

  • Fire assaying soot blowing detection method and system based on computer vision

    CN121458625A