A fabric printing and dyeing on-line detection system and method
By improving the high-resolution feature enhancement module, deformable convolution, and dual-focus attention module of the YOLOv8 model, the problem of detecting minute defects in online inspection of textile printing and dyeing was solved, achieving high-precision, high-efficiency, and robust automated inspection.
Patent Information
- Application Number
- CN202510515646.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-04-23
AI Technical Summary
The existing YOLOv8 model is difficult to accurately detect minute defects in online inspection of textile printing and dyeing, is sensitive to interference from complex backgrounds, has insufficient generalization ability, and its detection speed does not meet the requirements of high-speed production lines.
The improved YOLOv8 model enhances feature extraction and fusion capabilities, adapts to irregular shapes and background interference, and reduces computational load by introducing a high-resolution feature enhancement module (HR-FEM), deformable convolution (DCNv3), dual focus attention module (DFAM), and lightweight defect prediction head (LDPH).
It significantly improves the detection accuracy and robustness of minute defects, meets the real-time detection needs of high-speed production lines, and enhances detection efficiency and accuracy.
Smart Images

Figure CN120431442B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to an online fabric detection system and method, in particular to an online fabric printing and dyeing detection system and method, and belongs to the technical field of industrial automation detection. BACKGROUND
[0002] Fabric printing and dyeing is a key link in the textile industry, and the product quality directly affects the value and market competitiveness of the final garment or textile. During the printing and dyeing process, due to various factors such as raw materials, equipment, process or operation, various defects may appear on the surface of the fabric, such as color difference, stains, missing printing, wrong printing, creases, holes, oil stains, flying flower attachment, etc. These defects seriously affect the appearance and performance of the fabric.
[0003] Currently, the detection of fabric printing and dyeing defects mainly relies on manual visual inspection. However, manual inspection has many drawbacks: first, the detection efficiency is low, which is difficult to meet the needs of modern high-speed production lines; second, the inspection results are easily affected by the subjective factors of the inspectors, leading to inconsistent standards, high omission rate and high false detection rate; third, long-term work in strong light or specific environment is harmful to the vision health of the inspectors, and the labor cost is continuously rising.
[0004] In order to overcome the shortcomings of manual inspection, automatic detection technology based on machine vision has emerged. Traditional machine vision methods are usually based on image processing algorithms (such as threshold segmentation, edge detection, morphological processing, texture analysis, color feature extraction, etc.) or simple machine learning models. These methods have certain effect on scenes with simple background and obvious defect features, but for printed and dyed fabrics, the background patterns are complex and varied, the defect types are numerous, the shapes are different, and the sizes are different (especially for subtle defects), and often confused with background texture or pattern, traditional methods often cannot accurately and robustly detect, and have poor adaptability, high false alarm rate, and sensitivity to light changes.
[0005] In recent years, deep learning technology represented by convolutional neural network (CNN) has made breakthrough progress in target detection field. YOLO (You Only Look Once) series algorithm as a representative of single-stage target detection, with its fast detection speed and high efficiency, has wide application potential in industrial detection field. YOLOv8 as a newer version of this series, has significantly improved in accuracy and speed compared to earlier versions, and has been applied to fabric defect detection. However, if the existing YOLOv8 model is directly applied to complex online fabric printing and dyeing detection, the following challenges still exist:
[0006] First, for very small size and low contrast defects, such as subtle stains and slight color difference strips, the feature extraction and fusion mechanism of the standard YOLOv8 model may not be sufficient to capture enough discriminative information, which may lead to missed detection;
[0007] Second, the printed and dyed fabric itself has rich colors, textures and patterns, and these normal background features may be similar to some defect features, causing the standard YOLOv8 model to misjudge the normal area as a defect;
[0008] Third, the shape, color and size of the printed and dyed defect vary greatly, and the existing YOLOv8 model needs to improve the generalization ability for irregular shapes or rare types of defects;
[0009] Fourth, on the high-speed production line, the detection system needs to complete image acquisition, processing and judgment in a very short time, and has high requirements for the inference speed (FPS) of the model. If the model detection accuracy is simply improved, the detection speed may not meet the standard.
[0010] Therefore, it is urgent to develop a fabric printing and dyeing online detection system and method that can overcome the above problems and balance high precision, high efficiency and strong robustness. SUMMARY
[0011] Based on the above background, the purpose of the present application is to provide a fabric printing and dyeing online detection system and method, which realizes online detection of fabric printing and dyeing defects based on an improved YOLOv8 model, and has high accuracy and detection efficiency for fine and complex defects.
[0012] In order to achieve the above-mentioned purpose of the application, the present application provides the following technical solutions:
[0013] A fabric printing and dyeing online detection system, comprising:
[0014] An image acquisition unit arranged on a fabric printing and dyeing production line for real-time acquisition of surface images of printed and dyed fabric;
[0015] A data processing unit electrically connected to the image acquisition unit for receiving the surface images of the printed and dyed fabric and running 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 electrically connected to the data processing unit for receiving the defect detection result of the printed and dyed fabric and recording, displaying or alarming the defect information of the printed and dyed fabric;
[0017] The improved YOLOv8 defect detection model is obtained by improving the standard YOLOv8 model with a backbone network, a neck network and a head network as follows:
[0018] A high-resolution feature enhancement module is arranged to strengthen the model in extracting fine features, the input of the high-resolution feature enhancement module is connected to the intermediate layer feature output of the backbone network, and the output of the high-resolution feature enhancement module is connected to the neck network.
[0019] In the convolution module of the deep stage of the backbone network and / or the convolution module of the neck network, a deformable convolution is integrated.
[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 arranged respectively.
[0021] The head network is a lightweight defect prediction head for defect classification and bounding box regression of the received feature maps, and the lightweight defect prediction head is constructed by using depth separable convolution and standard convolution.
[0022] Preferably, the high-resolution feature enhancement module comprises:
[0023] At least two parallel convolution branches, each of which contains 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 is arranged to splice the output feature maps of the at least two parallel convolution branches in the channel dimension;
[0025] A subsequent convolution layer is connected after the splicing component to adjust the channel number and / or mix the features; and,
[0026] A fusion component is arranged to fuse the output of the subsequent convolution layer with the input feature map of the high-resolution feature enhancement module.
[0027] Preferably, each parallel convolution branch further contains a 1x1 convolution layer for adjusting the channel number before the dilated convolution layer, and the fusion component performs residual connection in the form of element-wise addition.
[0028] Preferably, the deformable convolution is integrated in the last two convolution modules of the backbone network and the C2f module for fusing features in the neck network, and the integration method is to replace at least part of the original 3x3 standard convolution with deformable convolution.
[0029] Preferably, the dual focus attention module comprises:
[0030] A channel attention branch is arranged to learn and apply channel weights to enhance important feature channels; and,
[0031] a spatial attention branch for learning and applying 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 to input feature maps to generate attention-weighted output feature maps.
[0033] Preferably, the lightweight defect prediction head includes:
[0034] at least one depth separable convolutional layer for feature extraction and transformation; and,
[0035] an 1x1 convolutional layer for outputting prediction results containing bounding box regression parameters, target confidence and defect class 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 layer stages of the backbone network and the output feature map of the high-resolution feature enhancement module; the bottom-up path fuses different level feature maps generated by the top-down path; the fusion adopts a splicing operation combined with a weighted fusion mechanism.
[0037] A fabric printing and dyeing online detection method using any of the above fabric printing and dyeing online detection systems, the method comprising the following steps:
[0038] Load the improved YOLOv8 defect detection model into the data processing unit and perform system initialization;
[0039] Real-time acquisition of surface images of printed fabrics by an image acquisition unit and pre-processing;
[0040] Input the fabric image of the pre-processed printed fabric into the improved YOLOv8 defect detection model for forward inference, and output a detection result containing defect categories, confidence scores and predicted bounding box positions;
[0041] Non-maximum suppression processing is performed on the detection result, and a final defect prediction result is obtained by screening according to a pre-set confidence threshold;
[0042] The final defect prediction result is recorded, displayed or alarmed through a result output and control unit.
[0043] Preferably, the improved YOLOv8 defect detection model is obtained by pre-training through the following steps:
[0044] An image dataset containing multiple types of fabric printing and dyeing defects with bounding boxes and class labels is constructed;
[0045] adopting a data augmentation strategy to expand the image dataset;
[0046] The augmented image dataset is input into the improved YOLOv8 defect detection model in batches for training, and a combined loss function including a boundary box regression loss, a classification loss and a confidence loss is optimized through a back propagation algorithm to update model network parameters until the model performance converges.
[0047] Preferably, the data augmentation 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 application has the following advantages:
[0049] By introducing the HR-FEM module, the present application effectively utilizes shallow high-resolution features and captures context through multi-scale dilated convolution, and 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 the overall detection precision and robustness.
[0050] The present application integrates DCNv3 at key positions of the backbone network and the neck network, so that the model can better adapt to the irregular shape and scale variation of printing and dyeing defects, and improves the detection rate of various morphologically variable defects.
[0051] The present application uses LDPH as a prediction head, and uses lightweight design such as depth separable convolution to effectively reduce the computational load of the model while ensuring or even improving the detection accuracy, ensuring high inference speed and meeting the requirements of real-time detection of industrial production lines.
[0052] The present application solves the key technical problems in online detection of fabric printing and dyeing defects through deep customization and improvement of the YOLOv8 model, especially in the aspects of feature enhancement (HR-FEM), geometric adaptability (DCNv3), feature focusing (DFAM) and efficiency optimization (LDPH), and provides an automatic detection solution with high precision, high efficiency and strong robustness. BRIEF DESCRIPTION OF DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only embodiments of the present application, and those skilled in the art can obtain other drawings according to the provided drawings without creative labor.
[0054] Figure 1 is a schematic diagram of a fabric printing and dyeing online detection system of the present application;
[0055] Figure 2 is a structural schematic diagram of the improved YOLOv8 defect detection model in the application;
[0056] Figure 3 is a structural schematic diagram of the high-resolution feature enhancement module (HR-FEM) in the application;
[0057] Figure 4 is a flowchart of the fabric printing and dyeing online detection method in the application;
[0058] Figure 5 is a performance comparison chart of the fabric printing and dyeing online detection method in the application 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 solutions of the application will be further specifically described below by means of specific embodiments and in combination with the drawings. It should be understood that the implementation of the application is not limited to the following embodiments, and any form of modification and / or change of the application will fall within the scope of protection of the application.
[0061] In the application, unless otherwise specified, all parts and percentages are by weight, and the equipment and raw materials used can be purchased from the market or are commonly used in the art. The methods in the following examples are conventional methods in the art, unless otherwise specified. The components or equipment in the following examples are general standard components or components known to those skilled in the art, and their structure and principles can be known to those skilled in the art through technical manuals or through conventional experimental methods.
[0062] The embodiments of the application will be described in detail below in combination with the drawings. In the following detailed description, many specific details are set forth in order to provide a thorough understanding of the embodiments of the application. However, one or more embodiments can be implemented without these specific details by those skilled in the art.
[0063] Embodiments of the application disclose a fabric printing and dyeing online detection system, referring to Figure 1 The system is deployed on or near the fabric printing and dyeing production line for real-time surface defect detection of the running fabric. The system mainly includes an image acquisition unit 10, a data processing unit 20, and a result output and control unit 30.
[0064] The image acquisition unit 10 is arranged above the production line or at a position where the surface of the fabric can be clearly captured. Its function is to continuously collect the surface images of the running fabric in real time. The image acquisition unit 10 usually includes at least one industrial camera (such as a high-speed linear array camera or a high-resolution area array camera) and a matching light source (such as an LED line light source or an area light source that provides uniform illumination). The image data captured by the industrial camera is transmitted to the data processing unit 20 through an interface (such as a wired or wireless network).
[0065] The data processing unit 20 is the core computing component of the system, usually a high-performance industrial computer, a server, or an embedded computing platform, and is configured with a graphics processing unit (GPU) to accelerate the computation of deep learning models. It is electrically connected to the image acquisition unit 10 (for example, through a data line or a network connection) and receives the real-time collected fabric surface images. The received raw images are preprocessed to meet the input requirements of the improved YOLOv8 defect detection model. After preprocessing, the images are sent to the improved YOLOv8 defect detection model loaded in the memory of the data processing unit 20 for execution of the defect detection algorithm. After the model inference is completed, the data processing unit 20 outputs the detection results containing the position, category, and confidence of the defects.
[0066] The result output and control unit 30 is electrically connected to the data processing unit 20 for receiving and processing the detection results. The result output and control unit 30 has a display and an audible and visual alarm. The display is used to display the current detected fabric image, the marked defect position and type, statistical information, etc. in real time.
[0067] Reference Figure 2 The improved YOLOv8 defect detection model is based on the standard YOLOv8 model (usually including a backbone network, a neck network, and a head network) and has been structurally improved for specific purposes.
[0068] The backbone network is responsible for extracting multi-level features from the input image. The backbone network successively includes stages C1, C2, C3, C4, and C5. C1 is an initial convolutional layer (Conv+BN+Act). C2 to C5 are built with efficient convolutional modules, such as the Cross Stage Local Network Module (CSP Block). The backbone network reduces the feature map size and increases the channel number through step-by-step downsampling, thereby obtaining features with different receptive fields and semantic levels. In order to enhance the adaptability to the irregular shape of fabric defects, the deep stages of the backbone network, i.e. Figure 2The original 3x3 standard convolutional layers in the convolutional modules of C4 and C5 are replaced by deformable convolution (DCNv3) layers. In addition, the end of the C5 stage also contains a spatial pyramid pooling fast module (SPPF) to further increase the receptive field and aggregate context information. The backbone network finally outputs multiple feature maps of different scales, i.e. Figure 2 The feature maps extracted from C3, C4 and C5 are denoted as P3, P4 and P5, respectively, for the neck network.
[0069] To enhance the model's ability to detect subtle defects such as small stains and slight color differences, the application specially designs and introduces a high-resolution feature enhancement module (HR-FEM). The input of the high-resolution feature enhancement module is connected to the intermediate layer feature output of the backbone network, i.e., it receives the output feature map P3 from the C3 stage.
[0070] Referring to Figure 3 , the internal structure of the HR-FEM is as follows:
[0071] The input feature map P3 is first directly fed 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. The structure contains three parallel convolution branches;
[0073] In each parallel branch, the input feature first passes through a 1x1 convolutional layer to adjust the channel dimension and reduce the computational load;
[0074] Subsequently, the feature map after adjusting the channel is fed into a dilated convolution layer (Dilated Conv). Different branches use different dilation rates (dilation rates), i.e., 3x3 dilated convolutions with rate = 1, rate = 3, and rate = 5. Different dilation rates enable each branch to capture different ranges of context information. The dilated convolution layer is followed by batch normalization (BN) and an activation function (Act);
[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 is then passed through a subsequent 1x1 convolutional layer to further fuse the features and adjust the output channel number;
[0077] Finally, this feature map processed by multi-scale dilated convolution and fusion is added element by element to the original input feature map preserved by a fusion component.
[0078] The enhanced feature map output by the HR-FEM is finally connected to the neck network for subsequent feature fusion. The enhanced feature map contains rich multi-scale context information and retains the original high-resolution details.
[0079] The neck network is responsible for fusing feature information from different levels (P3, P4, P5) of the backbone network and the output of the HR-FEM to generate multi-scale feature maps (N3, N4, N5) suitable for detecting defects of different sizes. The present application adopts a path aggregation structure, including a top-down path and a bottom-up path.
[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 convolution layer (Conv). The processed P5 feature map is upsampled and then concatenated and weighted fused (Concat+W) with the P4 feature map from the backbone network. The fused feature map is input into a C2f module (which integrates DCNv3) for further feature interaction and refinement. The output of the C2f module is again upsampled and then concatenated and weighted fused (Concat+W) with the P3 feature map from the backbone network and the output feature map from the HR-FEM. This final fused feature map is input into another C2f module for processing, and the highest resolution neck feature map N3 is finally generated.
[0081] The structure of the bottom-up path is as follows: the feature map N3 is passed through a downsampling layer, and the downsampled result is concatenated and weighted fused (Concat+W) with the intermediate feature map (i.e., the output of the first C2f module) of the corresponding level (P4 level) in the top-down path. The fused feature map is input into another C2f module (which integrates DCNv3) for processing, and the medium resolution neck feature map N4 is generated. Similarly, the feature map N4 is passed through a downsampling layer, and is concatenated and weighted fused (Concat+W) with the intermediate feature map (i.e., the output of the Conv layer after processing P5) of the corresponding level (P5 level) in the top-down path. The fused feature map is input into the last C2f module for processing, and the lowest resolution neck feature map N5 is generated.
[0082] To further refine the features and suppress noise before the final prediction, a DFAM module is connected in series before each of the three different scale feature maps N3, N4, N5 output by the neck network. Each DFAM module receives the corresponding scale neck feature map as input. The DFAM module includes:
[0083] A channel attention branch, for example, using the efficient channel attention (ECA) mechanism, to learn and recalibrate the importance weights of the feature channels;
[0084] One spatial attention branch, for example, generates a spatial attention map by convolution or pooling operation, highlighting the key regions on the feature map related to the defects.
[0085] The outputs of the two branches are combined and applied to the input feature map to generate a refined feature map after double attention focusing, which is then passed to the subsequent head network.
[0086] The final detection results are generated by three parallel head networks, each responsible for a specific scale. These head networks are designed as lightweight defect prediction heads (LDPH) to ensure online detection efficiency. Each LDPH receives the refined feature map output from the corresponding DFAM module as input, and the structure of each LDPH includes:
[0087] A depth separable convolution (DSC) layer, which decomposes standard convolution into depth-wise convolution and 1x1 point-wise convolution, significantly reducing computational and parameter quantities, for efficient feature extraction and transformation;
[0088] A 1x1 standard convolution layer (Conv) for mapping features to the final prediction output. For each prediction unit, the output includes bounding box regression parameters, target confidence, and defect class probability.
[0089] The outputs of the three LDPHs are combined to form the complete detection results of the input image by the model.
[0090] The above targeted structural improvements (HR-FEM, DCNv3 integration, DFAM, LDPH) based on the standard YOLOv8 model collectively improve the overall performance of fabric printing and dyeing defect detection.
[0091] Standard YOLOv8, especially when dealing with smaller input sizes, can lose fine texture and edge information that is crucial for subtle defects in the deep network. The HR-FEM module, through its parallel multi-hole rate convolution design, effectively captures the multi-scale context information of shallow features (P3 level) while maintaining high resolution, significantly enhancing the original expression ability of small defects, fine color difference strips and other detailed features. However, simply enhancing details through the HR-FEM module is not enough, and these detailed information also needs to be combined with deeper features that contain more semantic information. The improved neck network receives enhanced high-resolution features from HR-FEM and effectively aggregates them with features from deeper layers (P4, P5) of the backbone network, ensuring that these detailed information can be effectively integrated into the global feature representation, rather than being diluted or lost in subsequent downsampling or deep processing. This allows the model to understand both the overall context of the defect and its subtle features when making the final prediction, greatly improving the detection rate and positioning accuracy of small, low-contrast defects.
[0092] Printing defects often have irregular shapes and variable sizes. Integrating DCNv3 in key convolution modules of the backbone network and neck network allows the model to better adapt to the geometric deformation of defects during feature extraction and fusion. DCNv3 can more flexibly capture the features of non-rigid targets by learning the offset and modulation factor of the sampling points, avoiding inaccurate or missing feature extraction caused by fixed receptive fields in standard convolution. Before the neck network outputs N3, N4, N5 feature maps, DFAM uses channel and spatial attention mechanisms to "purify" and "focus" the fused feature maps. DCNv3 ensures that even for defects with unusual shapes, their features can be more accurately extracted and integrated into the neck network output, providing higher quality input features for DFAM, which can then more effectively identify and enhance these features that truly belong to the defect while suppressing the surrounding complex background texture interference. The combination of the two makes the model more robust in recognizing defects with variable shapes. Finally, LDPH receives feature maps with higher signal-to-noise ratio and more concentrated information. This allows LDPH to perform accurate classification and regression tasks with relatively fewer parameters and computational complexity (through DSC). If the unprocessed features without DFAM are directly input into the lightweight head, the performance may decrease.
[0093] In summary, a small and irregularly shaped defect has its detailed features enhanced by HR-FEM, its irregular shape better handled in modules containing DCNv3, the fused features focused by DFAM, and finally accurately predicted by the efficient LDPH.
[0094] Embodiments of the present application also disclose a fabric printing and dyeing online detection method, referring to Figure 4 The flow of the 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 improved YOLOv8 defect detection model pre-trained 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 images are input into the improved YOLOv8 defect detection model. The model performs forward inference calculation through the backbone network, HR-FEM, neck network, DFAM and LDPH, and finally outputs the detection results, including possible defect positions (bounding boxes), categories and confidence.
[0098] Step S4: result post-processing. The non-maximum suppression (NMS) algorithm is applied to the detection results output by the model to eliminate repeated or highly overlapped prediction boxes for the same defect and retain the optimal box. Then, according to a preset confidence threshold (for example, 0.5), prediction boxes with lower scores are filtered out to obtain a final list of defect prediction results.
[0099] Step S5: result output and response. The final defect prediction results are sent to the result output and control unit 30. According to the results, the unit records data, displays defect information on the user interface, triggers an audible and light 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 fabric printing and dyeing defect image dataset is constructed, which contains various common and rare defect types (such as color difference, stains, missing printing, holes, wrinkles, etc.), covers different fabric materials, colors, pattern backgrounds, and defects of different sizes and shapes. Each defect instance in the dataset is accurately manually labeled to provide its category label and bounding box coordinates.
[0102] Secondly, a rich data augmentation strategy is adopted to expand the dataset and improve the generalization ability of the model. Commonly used augmentation methods include geometric transformations (such as random rotation, random flip, random cropping, random scaling), color transformations (such as brightness, contrast, saturation, hue jitter), blur processing (such as Gaussian blur), adding noise (such as Gaussian noise, salt and pepper noise), etc. to simulate various changes that may be encountered in actual production.
[0103] Then, the augmented dataset is divided into training set, validation set and test set. The training set is input into the initialized improved YOLOv8 defect detection model in batches. In each training iteration, the model performs forward propagation to obtain the prediction result, and then calculates the combined loss function between the prediction result and the true label. The loss function includes bounding box regression loss, classification loss and target confidence loss. The gradient of the loss function with respect to the model parameters is calculated through the backpropagation algorithm, and the AdamW optimizer is used to update the model weights according to the gradient. Repeat this process for multiple cycles while monitoring the model performance on the validation set until the model performance reaches the preset target or no longer improves significantly.
[0104] Reference Figure 5 Compared with the benchmark YOLOv8 using the method of the present application on the same test dataset, the method of the present application has significantly improved the average precision mean (mAP) and the recall rate for subtle and difficult-to-detect defects while maintaining a high detection speed (FPS). Compared with the benchmark YOLOv8, the FPS of the method of the present application has decreased from about 95FPS to >80FPS, which is because the introduction of new modules (HR-FEM, DFAM) and more complex convolution (DCNv3 instead of standard convolution) increases the amount of calculation, resulting in an increase in inference time. However, this is a reasonable price to pay for significantly improving accuracy, and >80FPS is still a high enough speed for most online detection scenarios, fully meeting the requirements of online detection of fabric printing defects.
[0105] The principles and embodiments of the present application are described in this paper using specific examples. The above examples are only used to help understand the method of the present application and its core idea. It should be noted that for ordinary skilled persons in the technical field, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. An on-line fabric printing detection system, characterized by: The fabric printing and dyeing online detection system comprises: An image acquisition unit is arranged on the fabric printing and dyeing production line and is used for collecting the surface image of the printed and dyed fabric in real time; A data processing unit is electrically connected with the image acquisition unit, used for receiving the surface image of the printed and dyed fabric, and running the improved YOLOv8 defect detection model to execute a defect detection algorithm, thereby outputting the defect detection result of the printed and dyed fabric; A result output and control unit is electrically connected with the data processing unit, used for receiving the defect detection result of the printed and dyed fabric, and recording, displaying or alarming the defect information of the printed and dyed fabric; The improved YOLOv8 defect detection model is obtained by improving the standard YOLOv8 model with a backbone network, a neck network and a head network as follows: A high-resolution feature enhancement module for strengthening the model to extract fine features is arranged, the input of the high-resolution feature enhancement module is connected with the intermediate layer feature output of the backbone network, and the output of the high-resolution feature enhancement module is connected to the neck network; A deformable convolution is integrated in the convolution module of the deep layer stage of the backbone network and / or the convolution module of the neck network; After the neck network outputs feature maps of different scales, a double focus attention module is arranged respectively before the head network receives the feature maps; The head network is a lightweight defect prediction head for defect classification and bounding box regression of the received feature maps, and the lightweight defect prediction head is constructed by using a depth separable convolution and a standard convolution.
2. An on-line fabric printing detection system according to claim 1, characterized in that: The high-resolution feature enhancement module comprises: At least two parallel convolution branches, each of which contains at least one dilated convolution layer with a preset hole rate, the dilated convolution layers of the at least two parallel convolution branches have different hole rates; A splicing component is used for splicing the output feature maps of the at least two parallel convolution branches in the channel dimension; A subsequent convolution layer is connected after the splicing component and is used for adjusting the channel number and / or mixing the features; and A fusion component is used for fusing the output of the subsequent convolution layer with the input feature map of the high-resolution feature enhancement module.
3. An on-line fabric printing detection system according to claim 2, wherein: Each parallel convolution branch further contains a 1x1 convolution layer for adjusting the channel number before the dilated convolution layer, and the fusion component adopts an element-wise addition manner for residual connection.
4. The fabric printing on-line detection system according to claim 1, characterized in that: The deformable convolution is integrated in the last two convolution modules of the backbone network and the C2f module for fusing features in the neck network, and the integration manner is to replace at least part of the original 3x3 standard convolution with the deformable convolution.
5. An on-line fabric printing detection system according to claim 1, wherein: The double focus attention module comprises: A channel attention branch is used for learning and applying channel weights to enhance important feature channels; and A spatial attention branch is used for learning and applying a spatial weight map to enhance the feature response of a key spatial region; The outputs of the channel attention branch and the spatial attention branch are combined to be applied to the input feature map to generate an attention-weighted output feature map.
6. An on-line fabric printing detection system according to claim 1, wherein: The lightweight defect prediction head comprises: At least one depth separable convolution layer is used for feature extraction and transformation; and A 1x1 convolutional layer for outputting a prediction result, the prediction result including bounding box regression parameters, target confidence, and defect class probability.
7. An on-line fabric printing detection system according to claim 1, wherein: 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 layer stages of the backbone network and an output feature map of a high-resolution feature enhancement module; the bottom-up path fuses different level feature maps generated by the top-down path; the fusion adopts a splicing operation combined with a weighted fusion mechanism.
8. A fabric printing and dyeing on-line detection method using the fabric printing and dyeing on-line 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; real-time acquisition of surface images of the printing and dyeing fabric through the image acquisition unit and pre-processing; inputting the fabric image of the pre-processed printing and dyeing fabric into the improved YOLOv8 defect detection model for forward reasoning, and outputting a detection result containing defect categories, confidence scores and predicted bounding box positions; performing non-maximum suppression processing on the detection result, screening according to a pre-set confidence threshold, and obtaining a final defect prediction result; recording, displaying or alarming the final defect prediction result through the result output and control unit.
9. The method for online detection of fabric printing and dyeing according to claim 8, characterized in that: The improved YOLOv8 defect detection model is obtained by pre-training through the following steps: constructing an image dataset containing multiple types of fabric printing and dyeing defects with bounding boxes and category labels; expanding the image dataset using a data augmentation strategy; inputting the enhanced image dataset into the improved YOLOv8 defect detection model in batches for training, optimizing a combined loss function including bounding box regression loss, classification loss and confidence loss through a back propagation algorithm, updating model network parameters until the model performance converges.
10. The method for on-line detection of fabric printing and dyeing according to claim 9, characterized in that: The data augmentation 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