Garment sewing quality evaluation system and method based on YOLOv8

The YOLOv8-based garment sewing quality assessment system solves the problems of high-precision defect detection and automated process traceability in existing technologies, achieving efficient and accurate garment sewing quality assessment, meeting the needs of high-speed production, and improving detection accuracy and efficiency.

CN121937756APending Publication Date: 2026-04-28ANHUI POLYTECHNIC UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511788551.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-01
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

The existing garment sewing quality evaluation system lacks the integrated capabilities of high-precision defect detection, automated process traceability, and standardized improvement feedback, resulting in a broken evaluation process and low efficiency in quality improvement. Traditional machine vision algorithms have poor resistance to interference from fabric texture and lighting changes, and the detection accuracy of the three typical defects is insufficient.

Method used

A garment sewing quality assessment system based on YOLOv8 is adopted, including a central control unit, a sample preparation module, an image acquisition and annotation module, a data processing module, a YOLOv8 model training module, and a garment inspection module. Through standardized sample preparation, multi-strategy data augmentation, and YOLOv8 deep learning model optimization, a fully automated collaborative system is constructed, and a mapping knowledge base of defect types, core factors, and improvement suggestions is established.

Benefits of technology

It achieves seamless linkage between high-precision defect identification and process traceability improvement. The test results are directly linked with process adjustments, which improves the efficiency of quality improvement and meets the needs of high-speed production and precise quality control in the garment manufacturing industry. The dual advantages of detection accuracy and speed extend the system's adaptability and service life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121937756A_ABST
    Figure CN121937756A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of garment detection, in particular to a garment sewing quality evaluation system and method based on YOLOv8. Comprising a central control unit, and a sample preparation module, an image acquisition and labeling module, a data processing module, a YOLOv8 model training module, a to-be-detected garment detection module and a process diagnosis and feedback module which are in signal connection with the central control unit, the sample preparation module is used for preparing a garment sewing sample containing three typical defects of thread breakage, thread jumping and thread floating. The system has the beneficial effects that the central control unit comprehensively plans the six modules of sample preparation, image acquisition and labeling, data processing, YOLOv8 model training, to-be-detected garment detection and process diagnosis and feedback; and a whole-process automatic collaborative system with sample standardized generation, annotation data set construction, model optimization training, defect accurate identification and process traceability improvement is constructed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of garment inspection technology, specifically to a garment sewing quality evaluation system and method based on YOLOv8. Background Technology

[0002] The quality of garment sewing is a core indicator determining the pass rate, wearing comfort, and brand reputation of garment products. Broken threads, skipped threads, and loose threads account for over 70% of all garment sewing defects. Failure to detect and address these defects promptly will lead to increased rework rates, longer production cycles, and higher costs. Therefore, the garment manufacturing industry urgently needs efficient and accurate sewing quality assessment technologies. While existing technologies offer some solutions, they all suffer from the following problems: The existing garment sewing quality evaluation system generally lacks the integrated capabilities of high-precision defect detection, automated process traceability, and standardized improvement feedback, resulting in a broken evaluation process, low efficiency in quality improvement, and an inability to meet the core needs of high-speed production and precise quality control in the garment manufacturing industry. Traditional machine vision algorithms are limited by feature extraction capabilities and have poor resistance to interference from fabric texture and lighting changes. The average detection accuracy of the three types of typical defects is insufficient and cannot meet the needs of high-precision detection. Based on this, the present invention provides a garment sewing quality evaluation system and method based on YOLOv8 to solve the problems mentioned in the background art. Summary of the Invention

[0003] This invention addresses the technical problems existing in the prior art by providing a garment sewing quality evaluation system and method based on YOLOv8. This solves the problem that the existing garment sewing quality evaluation system generally lacks the integrated capabilities of high-precision defect detection, automated process traceability, and standardized improvement feedback, resulting in a broken evaluation process and low efficiency in quality improvement.

[0004] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: A garment sewing quality evaluation system based on YOLOv8, including a central control unit, and a sample preparation module, an image acquisition and annotation module, a data processing module, a YOLOv8 model training module, a garment detection module, and a process diagnosis and feedback module that are signal-connected to the central control unit; The central control unit is used to coordinate the working sequence of each module, transmit data, and control the start and stop of the modules. The sample preparation module is used to prepare garment sewing samples containing three typical defects: broken threads, skipped threads, and loose threads. The image acquisition and annotation module is used to acquire defect sample images and generate annotated datasets; The data processing module is used to enhance the labeled dataset and divide it into training, validation, and test sets. The YOLOv8 model training module is used to build and train a YOLOv8 detection model that meets the requirements of accuracy and inference speed. The garment detection module is used to identify defects and output parameters from the images of the garment under test. The process diagnosis and feedback module compares the inference results of the test set with the actual manual inspection results based on the YOLOv8 model training module to establish a mapping knowledge base based on defect type, core factors, and improvement suggestions, and generates process improvement suggestions based on defect type.

[0005] Based on the above technical solution, the present invention can be further improved as follows.

[0006] As a preferred technical solution of the present invention, the improvement suggestions of the mapping knowledge base based on defect type, core factors, and improvement suggestions include, but are not limited to: A broken thread indicates abnormal tension; it is recommended to check the suture and loosen the tension. The skipped thread indicates a mechanical failure; it is recommended to replace the needle and lubricate the rotary hook. The float indicates an imbalance in tension. It is recommended to adjust the tension and check the needle.

[0007] As a preferred technical solution of the present invention, the central control unit includes a central processing unit, a data storage chip, and an analog control circuit. The central processing unit executes a control program, the data storage chip stores a labeled dataset and a mapping knowledge base based on defect type, core factors, and improvement suggestions, and the analog control circuit converts control commands to achieve coordination among the modules.

[0008] As a preferred technical solution of the present invention, a method for evaluating garment sewing quality based on YOLOv8 is provided. This method is implemented based on the YOLOv8-based garment sewing quality evaluation system described above, and includes the following steps: S1. Sample preparation: Iron the garment fabric. Lay the fabric flat on an ironing board covered with a pure cotton lining. Move the iron along the warp direction at a speed of 2-3 cm / s. Increase the amount of steam for stubborn wrinkles. After ironing, let the fabric cool naturally at room temperature for 3-5 minutes. Using a 300mm×250mm template ruler, align the left edge of the template ruler with the radial baseline of the fabric, and trace and cut out sample fabric pieces in the radial, 45° bias, and weft directions along the edge of the cutout area of ​​the template ruler. Typical defect samples are reproduced in the cut sample fabric pieces through sewing process. The typical defect samples include skipped stitch samples, broken stitch samples, and loose stitch samples. S2. Image acquisition and annotation: The typical defect samples prepared in step S1 are laid flat on the image acquisition sample stage. Under the same height, angle and light source conditions, images of the typical defect samples are taken. No less than 200 images are acquired for each type of defect sample. Use the LabelImg image annotation tool to outline the rectangular areas of defects in the image, and annotate the category labels of broken lines, jump lines, and floating lines, as well as the size parameters of the rectangles. The rectangles corresponding to different category labels are different colors. After the annotation is completed, an XML format annotation file and N high-resolution defect image samples are generated. The generated N high-resolution defect image samples are set as the initial dataset, where N≥600. S3. Data Augmentation and Dataset Partitioning: Data augmentation is performed on the high-resolution defect image samples labeled in step S2. The initial dataset in step S2 is divided into training set, validation set and test set according to the proportions of 89%, 9% and 2% respectively. The training set is used for model parameter learning, the validation set is used for model parameter adjustment and overfitting monitoring during training, and the test set is used for model performance verification. The proportions of the three types of defect images are kept consistent in each dataset. S4, YOLOv8 Model Training: Build the model installation environment. After setting the installation environment, set the training parameters. The training parameters are: learning rate of 0.01, momentum of 0.937, weight decay of 0.005, input image size of 640×640 pixels, batch size of 16, and training epochs of 100. After setting the training parameters, set the model optimization strategy. S5. Quality Detection of the Garment Under Test: Input the image of the garment under test into the trained model. Preprocess the input image and pass the preprocessed image tensor into the YOLOv8 detection model for inference. Before inference, add batch dimension and disable gradient calculation. After inference, postprocess the inference result to obtain the detection result of the YOLOv8 model. The detection result of the YOLOv8 model includes, but is not limited to, the category of defects in the image of the garment under test, the coordinates of the center position, and the size parameters of the defect area. When the YOLOv8 detection model is running, the model performance is evaluated and verified every 10 training rounds. The model trained on the test set is used for evaluation and verification. Evaluation metrics are established during evaluation and verification. Evaluation metrics include, but are not limited to, mean precision, recall, accuracy, confidence, and F1 score. The YOLOv8 model is required to meet the following conditions: mean precision ≥ 83% and single frame image inference time ≤ 107ms. If the above conditions are not met, the learning rate in step S4 is adjusted. The learning rate decay coefficient is set to 0.5 until the above conditions are met. S6. Receive defect category information output by S5: Call the preset defect type, core factor, and process improvement suggestion mapping knowledge base in the process diagnosis and feedback module, match the core factor and process improvement suggestion of the corresponding defect, output and display the matching result, and store the defect information and corresponding improvement suggestion in the data storage chip of the central control unit.

[0009] As a preferred technical solution of the present invention, in step S3, the data enhancement strategy includes, but is not limited to, flipping, cropping, rotating, saturation adjustment, blurring with a maximum blur radius of 0.6 pixels, and adding no more than 0.1% pixel noise.

[0010] As a preferred technical solution of the present invention, the installation environment in step S4 is Python 3.8, PyTorch 1.8.0 framework, and NVIDIA RTX 3060.

[0011] As a preferred technical solution of the present invention, in step S4, the optimization strategy adopts a dynamic label allocation strategy, which combines CIoU box localization loss and cross-entropy category loss to construct a total loss function. The weight ratio of the two is set to 1:1.2. The cross-entropy category loss adopts a cross-entropy algorithm with category weights, and the category weights are set inversely proportional to the number of samples. The dynamic label allocation strategy achieves positive and negative sample matching by calculating the CIoU value between the predicted rectangle and the real rectangle.

[0012] As a preferred technical solution of the present invention, in step S5, the image preprocessing steps include, but are not limited to, image resizing, tensor format conversion, and normalization. When resizing the image, the image is adjusted to 640×640 pixels. The mean value during normalization is set to [0.485, 0.456, 0.406] and the standard deviation is [0.229, 0.224, 0.225]. In step S5, the post-processing steps include, but are not limited to, thresholding the bounding box and decoding the predicted category.

[0013] As a preferred technical solution of the present invention, in step S5: The average precision value refers to the mean of the average precision across all categories. Recall rate is the proportion of correctly detected defective samples out of the total number of actual defective samples; Precision rate refers to the proportion of truly positive samples among those for which the model's inference results are positive. Confidence level refers to the probability assessment of the detection model's accuracy in predicting the presence and category of a target within a bounding box; The F1 score is the harmonic mean of precision and recall.

[0014] As a preferred technical solution of the present invention, in step S6, the mapping knowledge base supports manually adding new defect types and corresponding improvement suggestions through the human-computer interaction interface of the process diagnosis and feedback module.

[0015] The beneficial effects of this invention are: 1. This invention integrates six modules—sample preparation, image acquisition and annotation, data processing, YOLOv8 model training, garment inspection, process diagnosis and feedback—through a central control unit. It constructs a fully automated, collaborative system encompassing standardized sample generation, labeled dataset construction, model optimization and training, accurate defect identification, and process traceability and improvement. This solves the problem of fragmented high-precision detection, automated process traceability, and standardized improvement feedback in existing technologies. In existing technologies, defect detection often relies on independent equipment, and process improvement depends solely on operator experience. The lack of direct linkage between detection results and process adjustments leads to a broken evaluation process and low efficiency in quality improvement. This invention, however, achieves seamless integration of modules through command coordination and data transmission via the central control unit. When the garment inspection module outputs the defect category, the process diagnosis and feedback module can call the mapping knowledge base in real time, matching core factors and improvement suggestions within 10 seconds. Simultaneously, defect information and suggestions are stored in a data storage chip for easy traceability. This collaborative linkage of detection, feedback, and archiving reduces the overall evaluation time and improves quality improvement efficiency, perfectly meeting the needs of high-speed production and precise quality control in the garment manufacturing industry.

[0016] 2. This invention addresses the shortcomings of traditional machine vision algorithms, such as weak feature extraction capabilities, poor resistance to fabric texture interference and lighting changes, and insufficient average detection accuracy for three typical defects, through a combination of standardized sample preparation, multi-strategy data augmentation, and YOLOv8 deep learning model optimization. Specifically, the sample preparation module prepares standardized defect samples with a matching degree of ≥95% with the actual production scenario by fixing the ironing speed, template size, and fabric texture direction, providing high-quality basic data for model training. The data processing module employs strategies such as flipping, cropping, 0.6-pixel blurring, and 0.1% pixel noise addition. Simulating scenarios such as fabric texture interference and image blurring in actual production, this invention enhances the model's anti-interference capabilities. The YOLOv8 model training module, through a combination of dynamic label allocation strategy, CIoU box localization loss, and cross-entropy category loss optimization, accurately captures minute defect features of 5-15 pixels, such as broken lines, skipped lines, and floating lines. Compared with existing technologies, the detection accuracy of this invention achieves a qualitative leap, meeting the real-time detection needs of production lines. Its dual advantages of accuracy and speed stem from the deep synergy of data, model, and training strategy. This combination of technologies differs from the existing approach of relying solely on algorithm optimization and is significantly innovative.

[0017] 3. This invention establishes a standardized mapping knowledge base for defect types, core factors, and process improvement suggestions by comparing the inference results of the model test set with the actual manual inspection results. It also supports manually adding new defect types, solving the problem of existing technologies where process feedback relies on operator experience and has poor generalization of suggestions. In existing technologies, when faced with defects such as broken wires and jumpers, operators often adjust equipment based on personal experience, lacking precise targeting, resulting in time-consuming equipment debugging and unstable improvement effects. In contrast, the process diagnosis and feedback module of this invention uses a knowledge base calibrated through test sets, secondary inference verification, and manual inspection results to ensure improved accuracy in matching defects, factors, and suggestions. Furthermore, the knowledge base supports manually adding new defect types through a human-computer interaction interface, without modifying system hardware or core algorithms; the detection range can be expanded simply by updating data. Compared to the high-cost solution of redeveloping algorithms for adding new defects in existing technologies, this significantly improves system adaptability and lifespan. Attached Figure Description

[0018] Figure 1 A flowchart of a garment sewing quality assessment system based on YOLOv8; Figure 2 This is a schematic diagram of the structure of the broken wire sample of the present invention; Figure 3 This is a schematic diagram of the jumper sample of the present invention; Figure 4 This is a schematic diagram of the structure of the floating line sample of the present invention; Figure 5 This is a scene diagram of sample cutting in step S1 of the present invention; Figure 6 This is a scene depiction of the sample in step S1 of the present invention; Figure 7 This is a schematic diagram of the test results of the YOLOv8 model of this invention; Figure 8 This is a graph showing the accuracy versus confidence level of the present invention. Figure 9 This is a sample distribution confusion matrix diagram for the present invention; Figure 10 This is a diagram showing the size distribution of the rectangular frame in this invention; Figure 11 This is a training and prediction graph of the YOLOv8 model of this invention; Figure 12 This is the training label diagram of the YOLOv8 model of this invention; Figure 13 This diagram shows the installation scenario and experimental parameter configuration for the YOLOv8 model in step S4. Detailed Implementation

[0019] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0020] The present invention provides the following preferred embodiments. like Figure 1-13 As shown, a garment sewing quality evaluation system based on YOLOv8 includes a central control unit, and a sample preparation module, an image acquisition and annotation module, a data processing module, a YOLOv8 model training module, a garment testing module, and a process diagnosis and feedback module that are connected to the central control unit via signals. The central control unit is used to coordinate the working sequence of each module, transmit data, and control the start and stop of the modules; The sample preparation module is used to prepare garment sewing samples containing three typical defects: broken threads, skipped threads, and loose threads. The image acquisition and annotation module is used to acquire images of defect samples and generate annotated datasets; The defect sample image acquisition and annotation module includes a 20-megapixel high-definition industrial camera, a 6000K standard white light source, a standard image acquisition sample platform, and a LabelImg annotation terminal; The data processing module is used to augment the labeled dataset and divide it into training, validation, and test sets; The YOLOv8 model training module is used to build and train a YOLOv8 detection model that meets the requirements for accuracy and inference speed. The garment inspection module is used to identify defects and output parameters from images of the garments under test. By coordinating six major modules—sample preparation, image acquisition, data processing, model training, test detection, and process feedback—a fully automated workflow is formed, encompassing standardized sample generation, labeled dataset construction, model optimization and training, defect identification of garments under test, and process problem tracing and improvement. This solves the problems of traditional garment sewing quality assessment relying on manual visual inspection, which is inefficient and prone to misjudgment due to subjective experience. Meanwhile, compared to traditional machine vision algorithms, this solution incorporates the YOLOv8 deep learning model. Its Anchor-Free design and dynamic label allocation strategy can accurately capture minor defects such as broken threads, skipped threads, and floating threads, improving detection accuracy and achieving an integrated breakthrough in high-precision detection and automated process optimization, thus promoting the transformation of the garment manufacturing industry from experience-driven to data-driven.

[0021] The process diagnosis and feedback module compares the inference results of the test set with the actual manual inspection results based on the YOLOv8 model training module to establish a mapping knowledge base based on defect type, core factors, and improvement suggestions, and generates process improvement suggestions based on defect type.

[0022] This module uses the bidirectional comparison between the inference results of the YOLOv8 model on the test set and the actual manual detection results as its core workflow. Through repeated verification and correction, it establishes a knowledge base mapping defect types, core factors, and improvement suggestions to ensure the accuracy of the corresponding relationship matching. Compared to traditional processes that rely solely on operator experience and have poor generalization of suggestions, this solution can directly pinpoint the root cause based on the detected defect type and output a feasible equipment adjustment plan. This reduces equipment setup time from the traditional 30 minutes to within 5 minutes, lowers the recurrence rate of similar defects, effectively improves the stability of garment sewing production, and simultaneously achieves closed-loop control of detection results, process improvement, and quality enhancement. Based on the mapping knowledge base of defect type, core factors, and improvement suggestions, improvement suggestions include, but are not limited to: A broken thread indicates abnormal tension; it is recommended to check the suture and loosen the tension. The skipped thread indicates a mechanical failure; it is recommended to replace the needle and lubricate the rotary hook. The float thread indicates an imbalance in tension. It is recommended to adjust the tension and check the needle. For three typical defects—broken wire, skipped wire, and floating wire—the workflow is based on defect feature analysis, reverse engineering of process parameters, and verification of improvement measures. This establishes a precise correspondence between core factors and improvement suggestions, avoiding the drawbacks of the traditional one-size-fits-all approach to improvement suggestions. The central control unit includes a central processing unit, a data storage chip, and an analog control circuit. The central processing unit executes the control program, the data storage chip stores the labeled dataset and a mapping knowledge base based on defect type, core factors, and improvement suggestions, and the analog control circuit converts control commands to achieve coordination among the modules.

[0023] The mapping knowledge base is stored in JSON format; The central control unit operates on a workflow of issuing instructions from the central processor, converting signals from analog control circuits, coordinating the execution of various modules, and archiving data from the data storage chip. The central processor coordinates the working sequence of each module to avoid transmission conflicts caused by image acquisition and data enhancement simultaneously occupying storage resources. The data storage chip uniformly stores the labeled dataset, model weight file, and knowledge base data, solving the traceability difficulties caused by the scattered storage of data in traditional systems, and facilitating the retrieval of historical test data for process optimization analysis in the later stages; The analog control circuit converts the digital instructions of the central processing unit into analog signals that can be recognized by each module, enabling precise connection between sample preparation, model training and other stages, and further improving the efficiency of the entire system's automated collaborative process. A method for evaluating garment sewing quality based on YOLOv8, implemented using the aforementioned YOLOv8-based garment sewing quality evaluation system, includes the following steps: S1. Sample preparation: Iron the garment fabric. Lay the fabric flat on an ironing board covered with a pure cotton lining. Move the iron along the warp direction at a speed of 2-3 cm / s. Increase the amount of steam for stubborn wrinkles. After ironing, let the fabric cool naturally at room temperature for 4 minutes. Using a 300mm×250mm template ruler, align the left edge of the template ruler with the radial baseline of the fabric, and trace and cut out sample fabric pieces in the radial, 45° bias, and weft directions along the edge of the cutout area of ​​the template ruler. Typical defect samples are reproduced in the cut sample fabric pieces through sewing process. The typical defect samples include skipped stitch samples, broken stitch samples, and loose stitch samples. By fixing the ironing speed, cooling time, and template size, and covering three fabric grain directions—radial, 45° bias, and weft—standardization of sample preparation is achieved, solving the problem of unclear defect characteristics caused by residual fabric wrinkles and fabric grain misalignment in traditional samples. Simultaneously, specific methods are employed to accurately reproduce actual defect morphologies in production, such as using a foot pedal to pull the fabric sample to reproduce skipped stitches, cutting seams to reproduce broken threads, and adjusting the tension knob and bobbin screw to reproduce floating threads. This ensures a high degree of match between the prepared samples and actual production scenarios. Furthermore, this solution integrates three major variables—fabric grain direction, garment location, and defect type—to construct 18 typical working condition combinations, overcoming the limitation of single variables in traditional sample preparation and providing a high-quality, highly diverse training sample foundation for the YOLOv8 model. S2. Image acquisition and annotation: Lay the typical defect samples prepared in step S1 flat on the image acquisition sample stage, and take images of the typical defect samples under the same height, angle and light source conditions. Collect no less than 200 images for each type of defect sample. Use the LabelImg image annotation tool to outline the rectangular areas of defects in the image, and annotate the category labels of broken lines, jump lines, and floating lines, as well as the size parameters of the rectangles. The rectangles corresponding to different category labels are different colors. After the annotation is completed, an XML format annotation file and N high-resolution defect image samples are generated. The generated N high-resolution defect image samples are set as the initial dataset, where N≥600. Images are acquired under the same height, angle and light source conditions to eliminate the interference of ambient light intensity and shooting angle deviation on defect characteristics, ensuring that the image brightness and resolution deviation is ≤5%, and the data consistency is significantly better than the traditional random acquisition method; By using the LabelImg tool to outline the rectangle of the defect area, label the category and size parameters, the labeling accuracy is improved to over 99%, avoiding the problems of omissions and errors in traditional manual labeling; Meanwhile, at least 200 samples of each type of defect are collected, and ≥600 high-quality defect images and corresponding XML annotation files are generated. The initial dataset size meets the training requirements of the YOLOv8 model, solving the technical problems of model overfitting and low detection accuracy caused by traditional small datasets. S3. Data Augmentation and Dataset Partitioning: Data augmentation is performed on the high-resolution defect image samples labeled in step S2. The initial dataset in step S2 is divided into training set, validation set and test set according to the proportions of 89%, 9% and 2% respectively. The training set is used for model parameter learning, the validation set is used for model parameter adjustment and overfitting monitoring during training, and the test set is used for model performance verification. The proportions of the three types of defect images are kept consistent in each dataset. In step S3, data augmentation strategies include, but are not limited to, flipping, cropping, rotating, saturation adjustment, blurring with a maximum blur radius of 0.6 pixels, and adding no more than 0.1% pixel noise. By employing strategies such as flipping, cropping, ±3° rotation, ±3% saturation adjustment, maximum 0.6 pixel blurring, and no more than 0.1% pixel noise addition, the initial dataset size was expanded, effectively addressing the challenges of collecting garment sewing defect samples and the insufficient data volume. Meanwhile, the enhancement strategy simulates scenarios that may occur in actual production, such as fabric texture interference and slight image blurring, thereby improving the model's ability to resist interference in complex environments. The training set, validation set and test set are divided by stratified sampling method of 89%:9%:2%, and the proportion of images of the three types of defects is kept consistent. This avoids the bias of the training set caused by traditional random partitioning, and makes the overfitting monitoring of the model on the validation set more accurate and the performance verification on the test set more realistic. S4, YOLOv8 Model Training: Build the model installation environment. After setting the installation environment, set the training parameters. The training parameters are: learning rate of 0.01, momentum of 0.937, weight decay of 0.005, input image size of 640×640 pixels, batch size of 16, and training epochs of 100. After setting the training parameters, set the model optimization strategy. The installation environment in step S4 is Python 3.8, PyTorch 1.8.0 framework, and NVIDIA RTX 3060; In step S4, the optimization strategy adopts a dynamic label allocation strategy, which combines CIoU box localization loss and cross-entropy category loss to construct the total loss function, with the weight ratio of the two set to 1:1.2; Among them, the cross-entropy category loss adopts the cross-entropy algorithm with category weights, and the category weights are set inversely proportional to the number of samples. The dynamic label assignment strategy achieves positive and negative sample matching by calculating the CIoU value between the predicted rectangle and the true rectangle. The workflow consists of image preprocessing, model inference, result postprocessing, and performance iterative optimization. The images of the clothing to be tested are preprocessed into 640×640 pixel tensors and normalized according to the mean [0.485, 0.456, 0.406] and standard deviation [0.229, 0.224, 0.225] to ensure the uniformity of the model input data and avoid inference errors caused by differences in image size and pixel distribution, thereby reducing inference errors. Before inference, batch dimension is added and gradient calculation is turned off to reduce GPU resource consumption and ensure that the single-frame inference time is ≤107ms, which meets the real-time detection requirements of the production line. Post-processing filters bounding boxes by thresholding, decodes predicted categories, removes redundant detection results, and ensures the accuracy of the detection results. In addition, the model performance is evaluated using a validation set every 10 training rounds. If there is no improvement for 5 consecutive rounds, the learning rate is adjusted with a decay coefficient of 0.5 to dynamically optimize the model parameters, avoid model overfitting, and ensure that the model maintains high detection performance in long-term use, thus solving the problem that the performance of traditional models cannot be continuously optimized after training. S5. Quality Inspection of the Garment Under Test: Input the image of the garment under test into the trained model, preprocess the input image, and input the preprocessed image tensor into the YOLOv8 detection model for inference. Before inference, add batch dimension and turn off gradient calculation. After inference, postprocess the inference result to finally obtain the detection result of the YOLOv8 model. The detection result of the YOLOv8 model includes, but is not limited to, the category of defects in the image of the garment under test, the coordinates of the center position, and the size parameters of the defect area. During the YOLOv8 detection model's operation, model performance is evaluated and verified every 10 training rounds. The evaluation and verification are performed using the model trained on the test set. Evaluation metrics are established during the evaluation and verification, including but not limited to mean precision, recall, accuracy, confidence, and F1 score. The YOLOv8 model is required to meet the following requirements: mean precision ≥ 83% and single-frame image inference time ≤ 107ms. If the above conditions are not met, the learning rate in step S4 is adjusted, and the learning rate decay coefficient is set to 0.5 until the above conditions are met. In step S5, image preprocessing steps include, but are not limited to, image resizing, tensor format conversion, and normalization. During image resizing, the image is resized to 640×640 pixels. During normalization, the mean is set to [0.485, 0.456, 0.406] and the standard deviation to [0.229, 0.224, 0.225]. Post-processing steps in step S5 include, but are not limited to, thresholding for bounding boxes and decoding predicted categories. In step S5: The average precision value refers to the mean of the average precision across all categories. Recall rate is the proportion of correctly detected defective samples out of the total number of actual defective samples; Precision rate refers to the proportion of truly positive samples among those for which the model's inference results are positive. Confidence level refers to the probability assessment of the detection model's accuracy in predicting the presence and category of a target within a bounding box; The F1 score is the harmonic mean of precision and recall.

[0024] S6. Receive defect category information output by S5: Call the preset defect type, core factor, and process improvement suggestion mapping knowledge base in the process diagnosis and feedback module, match the core factor and process improvement suggestion of the corresponding defect, output and display the matching result, and store the defect information and corresponding improvement suggestion in the data storage chip of the central control unit.

[0025] In step S6, the mapping knowledge base allows users to manually add new defect types and corresponding improvement suggestions through the human-machine interface of the process diagnosis and feedback module.

[0026] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A garment sewing quality evaluation system based on YOLOv8, characterized in that, It includes a central control unit, and a sample preparation module, an image acquisition and annotation module, a data processing module, a YOLOv8 model training module, a garment testing module, and a process diagnosis and feedback module that are connected to the central control unit via signals. The central control unit is used to coordinate the working sequence of each module, transmit data, and control the start and stop of the modules. The sample preparation module is used to prepare garment sewing samples containing three typical defects: broken threads, skipped threads, and loose threads. The image acquisition and annotation module is used to acquire defect sample images and generate annotated datasets; The data processing module is used to enhance the labeled dataset and divide it into training, validation, and test sets. The YOLOv8 model training module is used to build and train a YOLOv8 detection model that meets the requirements of accuracy and inference speed. The garment detection module is used to identify defects and output parameters from the images of the garment under test. The process diagnosis and feedback module compares the inference results of the test set with the actual manual inspection results based on the YOLOv8 model training module to establish a mapping knowledge base based on defect type, core factors, and improvement suggestions, and generates process improvement suggestions based on defect type.

2. The garment sewing quality evaluation system based on YOLOv8 according to claim 1, characterized in that, The improvement suggestions in the mapping knowledge base based on defect type, core factors, and improvement recommendations include, but are not limited to: A broken thread indicates abnormal tension; it is recommended to check the suture and loosen the tension. The skipped thread indicates a mechanical failure; it is recommended to replace the needle and lubricate the rotary hook. The float indicates an imbalance in tension. It is recommended to adjust the tension and check the needle.

3. The garment sewing quality evaluation system based on YOLOv8 according to claim 1, characterized in that, The central control unit includes a central processing unit, a data storage chip, and an analog control circuit. The central processing unit executes control programs, the data storage chip stores labeled datasets and a mapping knowledge base based on defect types, core factors, and improvement suggestions, and the analog control circuit converts control commands to achieve collaboration among the modules.

4. A method for evaluating garment sewing quality based on YOLOv8, characterized in that, This method is implemented based on the YOLOv8-based garment sewing quality assessment system described in any one of claims 1-3, and includes the following steps: S1. Sample preparation: Iron the garment fabric. Lay the fabric flat on an ironing board covered with a pure cotton lining. Move the iron along the warp direction at a speed of 2-3 cm / s. Increase the amount of steam for stubborn wrinkles. After ironing, let the fabric cool naturally at room temperature for 3-5 minutes. Using a 300mm×250mm template ruler, align the left edge of the template ruler with the radial baseline of the fabric, and trace and cut out sample fabric pieces in the radial, 45° bias, and weft directions along the edge of the cutout area of ​​the template ruler. Typical defect samples are reproduced in the cut sample fabric pieces through sewing process. The typical defect samples include skipped stitch samples, broken stitch samples, and loose stitch samples. S2. Image acquisition and annotation: The typical defect samples prepared in step S1 are laid flat on the image acquisition sample stage. Under the same height, angle and light source conditions, images of the typical defect samples are taken. No less than 200 images are acquired for each type of defect sample. Use the LabelImg image annotation tool to outline the rectangular areas of defects in the image, and annotate the category labels of broken lines, jump lines, and floating lines, as well as the size parameters of the rectangles. The rectangles corresponding to different category labels are different colors. After the annotation is completed, an XML format annotation file and N high-resolution defect image samples are generated. The generated N high-resolution defect image samples are set as the initial dataset, where N≥600. S3. Data Augmentation and Dataset Partitioning: Data augmentation is performed on the high-resolution defect image samples labeled in step S2. The initial dataset in step S2 is divided into training set, validation set and test set according to the proportions of 89%, 9% and 2% respectively. The training set is used for model parameter learning, the validation set is used for model parameter adjustment and overfitting monitoring during training, and the test set is used for model performance verification. The proportions of the three types of defect images are kept consistent in each dataset. S4, YOLOv8 Model Training: Build the model installation environment. After setting the installation environment, set the training parameters. The training parameters are: learning rate of 0.01, momentum of 0.937, weight decay of 0.005, input image size of 640×640 pixels, batch size of 16, and training epochs of 100. After setting the training parameters, set the model optimization strategy. S5. Quality Detection of the Garment Under Test: Input the image of the garment under test into the trained model. Preprocess the input image and pass the preprocessed image tensor into the YOLOv8 detection model for inference. Before inference, add batch dimension and disable gradient calculation. After inference, postprocess the inference result to obtain the detection result of the YOLOv8 model. The detection result of the YOLOv8 model includes, but is not limited to, the category of defects in the image of the garment under test, the coordinates of the center position, and the size parameters of the defect area. When the YOLOv8 detection model is running, the model performance is evaluated and verified every 10 training rounds. The model trained on the test set is used for evaluation and verification. Evaluation metrics are established during evaluation and verification. Evaluation metrics include, but are not limited to, mean precision, recall, accuracy, confidence, and F1 score. The YOLOv8 model is required to meet the following conditions: mean precision ≥ 83% and single frame image inference time ≤ 107ms. If the above conditions are not met, the learning rate in step S4 is adjusted. The learning rate decay coefficient is set to 0.5 until the above conditions are met. S6. Receive defect category information output by S5: Call the preset defect type, core factor, and process improvement suggestion mapping knowledge base in the process diagnosis and feedback module, match the core factor and process improvement suggestion of the corresponding defect, output and display the matching result, and store the defect information and corresponding improvement suggestion in the data storage chip of the central control unit.

5. The garment sewing quality evaluation method based on YOLOv8 according to claim 4, characterized in that, In step S3, the data augmentation strategies include, but are not limited to, flipping, cropping, rotating, saturation adjustment, blurring with a maximum blur radius of 0.6 pixels, and adding no more than 0.1% pixel noise.

6. The garment sewing quality evaluation method based on YOLOv8 according to claim 4, characterized in that, The installation environment in step S4 is Python 3.8, PyTorch 1.8.0 framework, and NVIDIA RTX 3060.

7. The garment sewing quality evaluation system and method based on YOLOv8 according to claim 4, characterized in that, In step S4, the optimization strategy adopts a dynamic label allocation strategy, which combines CIoU box localization loss and cross-entropy category loss to construct a total loss function. The weight ratio of the two is set to 1:1.

2. The cross-entropy category loss adopts a cross-entropy algorithm with category weights, and the category weights are set inversely proportional to the number of samples. The dynamic label allocation strategy achieves positive and negative sample matching by calculating the CIoU value between the predicted rectangle and the real rectangle.

8. The garment sewing quality evaluation method based on YOLOv8 according to claim 4, characterized in that, In step S5, the image preprocessing steps include, but are not limited to, image resizing, tensor format conversion, and normalization. When resizing the image, the image is adjusted to 640×640 pixels. The mean value for normalization is set to [0.485, 0.456, 0.406] and the standard deviation is set to [0.229, 0.224, 0.225]. In step S5, the post-processing steps include, but are not limited to, thresholding the bounding box and decoding the predicted category.

9. The garment sewing quality evaluation method based on YOLOv8 according to claim 4, characterized in that, In step S5: The average precision value refers to the mean of the average precision across all categories. Recall rate is the proportion of correctly detected defective samples out of the total number of actual defective samples; Precision rate refers to the proportion of truly positive samples among those for which the model's inference results are positive. Confidence level refers to the probability assessment of the detection model's accuracy in predicting the presence and category of a target within a bounding box; The F1 score is the harmonic mean of precision and recall.

10. The garment sewing quality evaluation method based on YOLOv8 according to claim 4, characterized in that, In step S6, the mapping knowledge base allows users to manually add new defect types and corresponding improvement suggestions through the human-machine interface of the process diagnosis and feedback module.