Infant paper diaper surface defect detection method

By introducing depth-separable kernel warehouse convolution and lightweight positioning quality assessment detection head into the surface defect detection model of baby diapers, the network structure is optimized, solving the problems of large model parameters and high computational complexity, and achieving efficient detection on edge devices.

CN121962002APending Publication Date: 2026-05-01ZHEJIANG UNIV OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG UNIV OF TECH
Filing Date
2025-12-10
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing deep learning-based methods for detecting surface defects in baby diapers suffer from problems such as large number of model parameters, high computational complexity, and difficulty in efficient deployment on edge devices with limited computing resources.

Method used

We replace some standard convolutions with depthwise separable kernel warehouse convolutions (DSKWConv) and introduce a lightweight localization quality assessment detection head (LLQEHead). Combined with a high-level screening feature pyramid network structure (HSFPN), we optimize the network structure to reduce the number of parameters and computational overhead while maintaining detection accuracy.

Benefits of technology

While significantly reducing the number of model parameters and computational cost, it maintains the ability to identify the location features of defects at different scales, achieving a good balance between accuracy and efficiency, and is suitable for resource-constrained edge devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962002A_ABST
    Figure CN121962002A_ABST
Patent Text Reader

Abstract

The invention discloses an infant paper diaper defect detection method. The method comprises the following steps: firstly, collecting baby diaper pictures and constructing a training data set; thirdly, constructing an infant paper diaper surface defect detection model, and training the infant paper diaper surface defect detection model by utilizing the training data set to obtain a trained infant paper diaper surface defect detection model; the infant paper diaper surface defect detection model is obtained by improving a yo11n model. And finally, inputting a to-be-detected baby paper diaper picture into the trained baby paper diaper surface defect detection model, and outputting a defect detection result by the model. According to the infant paper diaper surface defect detection model provided by the invention, on the premise that the model parameter quantity and the calculation quantity are remarkably reduced, the average precision can still be kept at the same level as that of an existing reference model, and good balance of precision and efficiency is realized.
Need to check novelty before this filing date? Find Prior Art

Description

A method for detecting surface defects in baby diapers Technical Field

[0001] This invention belongs to the field of target detection, and specifically relates to a method for detecting surface defects in baby diapers. Background Technology

[0002] As a core product in the modern infant care system, baby diapers are an important component of disposable hygiene products, and their quality directly affects the health and comfort of infants and young children. During the high-speed production of baby diapers, various factors (such as uneven distribution of raw materials, aging equipment and vibration, and the inability to completely isolate insects) can lead to surface defects such as breakage, missing parts, and foreign matter adhesion. These defects not only affect the product's appearance but may also impair key functional indicators such as absorption speed and rewetting rate. Therefore, efficient and accurate quality testing has become a crucial link in ensuring product compliance with various standards and enhancing brand reputation.

[0003] Currently, the widely used defect detection methods in the industry mainly rely on a combination of traditional digital image processing technology and manual visual inspection. However, manual inspection suffers from problems such as low efficiency and inconsistent standards, and its inspection speed is difficult to keep up with the pace of high-speed production lines, so it is usually used as an auxiliary inspection method. The traditional image processing algorithms used to cooperate with it use industrial cameras to acquire images, are usually designed for specific defects, and have poor generalization ability.

[0004] In recent years, surface defect detection methods based on deep learning have gradually become a research hotspot. Among them, the YOLO (YouOnly Look Once) series of algorithms, as a representative network in the field of single-stage object detection, has been favored in industrial visual inspection due to its end-to-end training structure and fast inference speed. Specifically: 1) CN117011225A discloses a method, device, equipment, and storage medium for detecting defects in hygiene products. This patent uses YOLOv5 as the baseline network model and aims to improve the detection effect of surface defects in hygiene products by embedding a CF-FPN structure, introducing a CBAM attention mechanism, and improving the feature fusion method; 2) CN116403042A discloses a lightweight method and device for detecting defects in hygiene products. This patent is based on the YOLOv5 model and reduces model complexity and improves the detection accuracy of small target samples by introducing GSConv, embedding an EVC module, and using channel pruning techniques; 3) CN117953350A proposes a method for detecting diaper images based on an improved YOLOv7 network model. This patent addresses the problems of poor detection performance and slow detection speed for small targets by optimizing the feature fusion module, introducing a fast attention mechanism, and using a high-efficiency detection head based on depth convolution.

[0005] The aforementioned existing technologies demonstrate that deep learning has shown application potential in the field of target detection for hygiene products. However, current deep learning-based detection methods generally suffer from large model parameter counts and high computational complexity. This issue significantly limits the effective deployment of such methods on resource-constrained edge devices. Summary of the Invention

[0006] To address the common problems of existing deep learning-based surface defect detection methods, such as large model parameter counts, high computational complexity, and difficulty in efficient deployment on edge devices with limited computing resources, this invention aims to provide a lightweight method for detecting surface defects in baby diapers. Without significantly reducing detection accuracy, this invention effectively reduces the overall parameter size and computational overhead of the model by optimizing the network structure, designing lightweight components, and improving the feature fusion path, thereby enhancing its applicability in real-time detection scenarios for surface defects in baby diapers.

[0007] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: I. A method for detecting surface defects in baby diapers. Step 1: Collect images of baby diapers and construct a training dataset; Step 2: Construct a surface defect detection model for baby diapers and train the model using the training dataset to obtain a trained surface defect detection model for baby diapers; the surface defect detection model for baby diapers is an improvement on the YOLOv11n model; Step 3: Input the image of the baby diaper to be detected into the trained surface defect detection model for baby diapers, and the model outputs the defect detection result.

[0008] In step 2, the training dataset is preprocessed before the training samples are input into the baby diaper surface defect detection model.

[0009] In step 2, the surface defect detection model for baby diapers is an improvement on the YOLOv11n model. Specifically, it includes: for the backbone network of the YOLOv11n model, replacing the original standard convolution with a depthwise separable kernel repository convolution; replacing the standard convolution of the bottleneck layer in the C3k2 module with the depthwise separable kernel repository convolution to form the C3k2_DSKW module; and replacing the original C3k2 module with the C3k2_DSKW module. The neck network includes a feature selection module, a feature fusion module, and a C3k2_DSKW module. The first feature P5 output by the backbone network is used as the input of the first feature selection module, and the second feature P4 output by the backbone network is used as the input of the second feature selection module. The output third feature P3 serves as the input to the third feature selection module. The first feature selection module is connected to the first convolutional layer, the second feature selection module is connected to the second convolutional layer, and the third feature selection module is connected to the third convolutional layer. Both the first and second convolutional layers are connected to the first feature fusion module, and both the third convolutional layer and the first feature fusion module are connected to the second feature fusion module. The first feature fusion module is connected to the first C3k2_DSKW module, and the second feature fusion module is connected to the second C3k2_DSKW module. The first convolutional layer, the first C3k2_DSKW module, and the second C3k2_DSKW module are each connected to their respective detection heads. The detection head includes a lightweight positioning quality assessment detection head.

[0010] The depth-separable kernel warehouse convolution includes a depth dynamic convolution layer, a pointwise dynamic convolution layer, a batch normalization layer, and an activation layer with SILU activation function, connected in sequence.

[0011] The feature selection module includes a first max pooling layer and a first average pooling layer. The input of the feature selection module is used as the input of the first max pooling layer and the first average pooling layer. The first max pooling layer is connected to the fourth convolutional layer, the fourth convolutional layer is connected to the fifth convolutional layer, the first average pooling layer is connected to the sixth convolutional layer, and the sixth convolutional layer is connected to the seventh convolutional layer. The result of adding and fusing the outputs of the fifth convolutional layer and the seventh convolutional layer is used as the input of the first activation layer. The result of fusing the output of the first activation layer with the input of the feature selection module is used as the output of the feature selection module.

[0012] The feature fusion module includes a transposed convolution, a second max pooling layer, and a second average pooling layer. The high-level input of the feature fusion module is used as the input of the transposed convolution, and the output of the transposed convolution is used as the input of the second max pooling layer and the second average pooling layer. The second max pooling layer is connected to the eighth convolutional layer, the eighth convolutional layer is connected to the ninth convolutional layer, the second average pooling layer is connected to the tenth convolutional layer, and the tenth convolutional layer is connected to the eleventh convolutional layer. The result of adding and fusing the outputs of the eighth and eleventh convolutional layers is used as the input of the second activation layer. The result of fusing the output of the second activation layer with the low-level input of the feature fusion module is then added and fusing with the output of the transposed convolution, and then used as the output of the feature fusion module.

[0013] The lightweight positioning quality assessment detection head includes a classification branch and a regression branch, wherein the regression branch contains a positioning quality assessment module connected to the classification branch, used to generate an adjustment score for the predicted bounding box.

[0014] II. A device for detecting surface defects in baby diapers includes an image acquisition unit for acquiring images of baby diapers; a dataset construction unit for constructing a training dataset based on the pre-processed images of baby diapers; a data preprocessing unit for performing data preprocessing on the training dataset for the model; and a defect detection unit for storing the baby diaper surface defect detection model and training the model using the training dataset.

[0015] III. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method for detecting surface defects in baby diapers.

[0016] IV. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method for detecting surface defects in baby diapers.

[0017] Compared with the prior art, the method proposed in this invention has the following beneficial effects: 1. By using a newly designed depth-separable kernel warehouse convolution (DSKWConv) to replace part of the standard convolution and adopting an anchor-free lightweight positioning quality assessment head (LLQEHead), this invention directly reduces the number of parameters and floating-point computation from the network structure. These improvements directly lead to a decrease in network complexity, making it more suitable for deployment on resource-constrained edge devices.

[0018] 2. Despite the lightweight design of the network, the introduction and optimization of the High-Level Feature Pyramid Network (HSFPN) and the Localization Quality Evaluation (LQE) module effectively collaborate to optimize the fusion path of feature maps at different scales while maintaining the ability to identify the location features of defects at different scales. Validated on a baby diaper defect dataset, this invention achieves a good balance between accuracy and efficiency while significantly reducing the number of model parameters and computational cost, while maintaining the same level of mean accuracy (Map@50) as existing benchmark models. Attached Figure Description

[0019] Figure 1 is a flowchart of a method for detecting surface defects in baby diapers proposed in this invention.

[0020] Figure 2 shows images of three types of baby diapers with surface defects: a) a baby diaper with material joint defects, b) a baby diaper with cotton layer abnormalities, and c) a baby diaper with abnormal guards.

[0021] Figure 3 shows the structure of the depth-separable kernel warehouse convolutional layer in the detection model.

[0022] Figure 4 shows the structure of the neck network in the detection model, where a) is the overall structure of the neck network, b) is the structure of the feature selection module, and c) is the structure of the feature fusion module.

[0023] Figure 5 is a structural diagram of the Lightweight Positioning Quality Assessment Head (LLQEHead) in the detection model.

[0024] Figure 6 shows the structure of the backbone network in the detection model. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0026] As shown in Figure 1, the present invention proposes a method for detecting surface defects in baby diapers, which includes the following steps: Step 1: Collect images of baby diapers and construct a training dataset; Specifically: Collect images of baby diapers containing surface defects, and use data annotation tools to accurately label the defect types and location information in the images of baby diapers containing surface defects.

[0027] More specifically, as shown in Figures 2a), 2b), and 2c), the baby diaper surface defect dataset used in this embodiment contains three common surface defects: material joints, cotton layer abnormalities, and guard abnormalities, totaling 15,142 images with a resolution of 1600×996. The Labelimg tool was used to annotate all the images, and the generated annotation files followed the YOLO standard format, meaning each image corresponds to a separate txt text file. Each file records the category index and normalized bounding box coordinates of all defect targets present in the image.

[0028] The dataset is divided into a training set, a validation set, and a test set according to a preset ratio (7:2:1) for model training and evaluation.

[0029] Step 2: Construct a surface defect detection model for baby diapers and train it using the training dataset to obtain a trained model. This model is an improvement on the YOLOv11n model. Specifically, the training dataset is preprocessed before being input into the model.

[0030] In one feasible implementation, the surface defect detection model for baby diapers is an improvement upon the YOLOv11n model. This model follows a three-part architecture: backbone, neck, and head, and features a lightweight design specifically for edge deployment scenarios. Specifically, for the YOLOv11n model's backbone, a depthwise separable kernel warehouse convolution replaces the standard convolutions in the original backbone. A depthwise separable kernel warehouse convolution (DSKWConv) replaces the standard convolutions in the bottleneck layer of the C3k2 module, forming the C3k2_DSKW module. This C3k2_DSKW module replaces the original C3k2 module, while maintaining the same parameters for control at corresponding positions as the C3k2 module. The backbone structure is shown in Figure 6. The depthwise separable kernel warehouse convolution dynamically generates convolution weights through a kernel warehouse. Specifically, the Depthwise Separable Kernel Warehouse Convolution (DSKWConv) is responsible for rapidly compressing image data size and extracting basic features at different scales. The C3k2_DSKW module is responsible for semantic refinement and enhancement of the basic features at each scale, significantly reducing computational overhead while maintaining feature extraction capabilities. Furthermore, the feature maps are pooled and processed using the Spatial Pyramid Pooling - Fast (SPPF) module with C2PSA attention. Finally, the backbone network outputs feature maps at three different scales (P3, P4, and P5). As shown in Figure 4a), the neck network includes a feature selection module, a feature fusion module, and a C3k2_DSKW module. The first feature P5 output from the backbone network (i.e., the output of the C2PSA attention mechanism layer) serves as the input to the first feature selection module. The second feature P4 output from the backbone network (i.e., the output of the third C3k2_DSKW module in the backbone network) serves as the input to the second feature selection module. The third feature P3 output from the backbone network (i.e., the output of the second C3k2_DSKW module in the backbone network) serves as the input to the third feature selection module. Among the first features P5, P4, and P3, the higher-level features are P5 > P4 > P3.The first feature selection module is connected to the first convolutional layer, the second feature selection module is connected to the second convolutional layer, the third feature selection module is connected to the third convolutional layer, the first and second convolutional layers are both connected to the first feature fusion module, the third convolutional layer and the first feature fusion module are both connected to the second feature fusion module, the first feature fusion module is connected to the first C3k2_DSKW module, the second feature fusion module is connected to the second C3k2_DSKW module, and the first convolutional layer, the first C3k2_DSKW module, and the second C3k2_DSKW module are respectively connected to their corresponding detection heads; the detection head includes a lightweight positioning quality assessment detection head (LLQEHead).

[0031] As shown in Figure 3, the depth-separable kernel warehouse convolution includes a depth dynamic convolution layer, a pointwise dynamic convolution layer, a batch normalization layer, and an activation layer with SILU activation function, which are connected in sequence.

[0032] Depthwise Separable Kernel Repository Convolution (DSKWConv) is a dynamic convolution module that dynamically generates convolution weights through a globally shared, learnable kernel repository, replacing the static parameters of traditional convolution. Depthwise KWConv and Pointwise KWConv perform independent spatial adaptive filtering and cross-channel feature transformation on each channel of the input features, respectively, thus significantly improving parameter efficiency and reducing computational complexity while maintaining the dynamic adaptability of convolution operations. The C3k2_DSKW module, based on Depthwise Separable Kernel Repository Convolution, retains the advantages of dense multi-path connections while enabling dynamic weight generation. This allows the model to adaptively adjust the convolution kernel parameters according to the input image, significantly reducing the overall number of parameters and computational overhead while maintaining high feature richness, making it more suitable for real-time vision task deployment in computationally limited environments.

[0033] As shown in Figure 4b), the feature selection module includes a first max pooling layer and a first average pooling layer. The input of the feature selection module is used as the input of the first max pooling layer and the first average pooling layer. The first max pooling layer is connected to the fourth convolutional layer, the fourth convolutional layer is connected to the fifth convolutional layer, the first average pooling layer is connected to the sixth convolutional layer, and the sixth convolutional layer is connected to the seventh convolutional layer. The result of adding and fusing the outputs of the fifth and seventh convolutional layers is used as the input of the first activation layer. The activation function of the first activation layer is the sigmoid function. The result of fusing the output of the first activation layer with the input of the feature selection module is used as the output of the feature selection module.

[0034] As shown in Figure 4c), the feature fusion module includes a transposed convolution, a second max pooling layer, and a second average pooling layer. The high-level input in the feature fusion module is used as the input to the transposed convolution, and the output of the transposed convolution is used as the input to the second max pooling layer and the second average pooling layer. The second max pooling layer is connected to the eighth convolutional layer, the eighth convolutional layer is connected to the ninth convolutional layer, the second average pooling layer is connected to the tenth convolutional layer, and the tenth convolutional layer is connected to the eleventh convolutional layer. The result of fusing the outputs of the eighth and eleventh convolutional layers is used as the input to the second activation layer, and the activation function of the second activation layer is the Sigmoid function. The result of fusing the output of the second activation layer with the low-level input in the feature fusion module is then added to the output of the transposed convolution and used as the output of the feature fusion module.

[0035] This invention introduces a High-Level Feature Pyramid Network (HSFPN) structure into the feature fusion path, with the core being a two-stage structure of feature selection (FS) and feature fusion (SFF). Specifically, cross-level feature fusion is achieved through channel attention weighting in the feature selection stage and high-level feature modulation of low-level feature functions in the fusion stage. This enables adaptive fusion of shallow detail information and deep semantic information, generating a processed feature map. Specifically, the feature selection module extracts channel statistical features through parallel global average pooling and max pooling, and generates attention weights through two 1×1 convolutions to weight the input features by channel. In the fusion stage, high-level features modulate low-level features through attention weights, and finally, the semantic information and detail features are enhanced and fused through an addition operation.

[0036] The lightweight localization quality assessment (LQE) head employs an anchor-free design that combines classification and regression. As shown in Figure 5, its classification branch uses a shallow network, specifically consisting of two consecutive 3×3 convolutional layers and one 1×1 convolutional layer. Its regression branch introduces depthwise separable convolution (DSConv) and integrates a localization quality estimator (LQE) module. By jointly learning the classification confidence and the spatial distribution parameters of the regression boxes, it generates an adjusted score that incorporates localization reliability, effectively preventing the false deletion of accurately predicted boxes during the non-maximum suppression stage. Specifically, the regression branch includes three consecutive depthwise separable convolutional layers and a 1×1 convolutional layer connected to the last depthwise separable convolutional layer.

[0037] In one feasible implementation, the localization quality assessment module includes the following steps: 1) calculating the Softmax probability of the bounding box corner distribution predicted by the regression branch; 2) extracting the top k highest probability values ​​and their indices from the Softmax probabilities, and using the result of concatenating the top-k probabilities and their mean as statistical features, and using them as input to the multilayer perceptron; 3) using the multilayer perceptron to calculate the quality score adjustment value; 4) adding the initial score of the classification branch to the quality score adjustment value to generate the adjusted score.

[0038] The training environment and some parameter settings used in this embodiment are shown in Table 1.

[0039] Table 1. Environment and parameter settings for the baby diaper surface defect detection model. Data preprocessing includes randomly shuffling the training set order and using data augmentation methods such as mosaic to process the images. For example, the training set is randomly shuffled and input into the network in batches (32 in this example), while all input images are uniformly adjusted to 640×640 pixels. Mosaic data augmentation is then applied, randomly selecting four defective images for scaling, cropping, and stitching to generate synthetic training samples. Simultaneously, random deformation and cropping enhancement methods are used to generate initial feature maps.

[0040] During model training, a loss function is used to calculate the difference between the predictions generated by the baby diaper surface defect detection model and the actual annotations. Then, the gradient of the loss function with respect to each model parameter is calculated using the backpropagation algorithm. The model parameters are updated using an optimizer, and the loss function is gradually minimized through iterative training. Within each training cycle, training data is input into the model in batches to complete forward propagation, loss calculation, backpropagation, and parameter updates. Simultaneously, the model's performance is evaluated on the validation set, and key metrics such as loss, mean, and average accuracy are monitored. Training is terminated early when the early stopping condition is met. Finally, model convergence is determined when the training loss continuously decreases and stabilizes, and the validation set metrics also stabilize.

[0041] This embodiment evaluates and updates the model by calculating localization regression loss and category loss. This embodiment uses the binary cross-entropy loss function (… Calculate the class loss, and set a binary cross-entropy loss for each class. To achieve multi-class classification, the calculation formula is as follows: Where N is the number of samples in the batch (batch size); For the first The true class of each sample, with a value of 0 or 1; For the model to predict the first The probability that a sample belongs to the positive class.

[0042] This embodiment uses the full cross-union loss function. and distribution focus loss function The formula for calculating the localization regression loss is as follows: In the formula, IOU is the ratio of the intersection to the union of the predicted bounding box and the ground truth bounding box; d is the distance between the center points of the predicted bounding box and the ground truth bounding box; c is the diagonal distance between the minimum bounding rectangles of the predicted bounding box and the ground truth bounding box. , The width and height of the target bounding box; , The width and height of the predicted bounding box; In the formula, y is the true continuous value of the bounding box coordinates; , The two discrete anchor points closest to the true value y; , The model predicts that the coordinates fall on two discrete anchor points. , The probability of.

[0043] The localization regression loss and the category loss are each multiplied by a pre-defined corresponding ratio and then summed to obtain the total loss value. The backpropagation algorithm is used to adjust the network model parameters and minimize the total loss. Total loss value The specific calculation formula is as follows: Step 3: Input the image of the baby diaper to be detected into the trained baby diaper surface defect detection model, and the model outputs the defect detection results.

[0044] In this embodiment, the trained and saved optimal weight model is loaded into the inference environment and evaluated using a reserved test set. Diaper images from the test set are input into the trained network model, which then predicts all diaper images in the test set. Redundant prediction boxes are removed using score adjustment and non-maximum suppression methods to obtain prediction boxes on the prediction feature map. Based on the proportional relationship, the prediction boxes on the prediction feature map are mapped to the scale of the original image to obtain the final prediction boxes.

[0045] To verify the effectiveness of the method of this invention in detecting defects in baby diapers, a comparative evaluation was conducted with mainstream YOLO detection models under the premise of ensuring the rigor of the verification experiment and maintaining consistency in the dataset and training parameters. The key differences between the models in terms of accuracy-efficiency balance are shown in Table 2. As can be seen from Table 2, this invention, while significantly reducing the number of model parameters and floating-point operations (FLOPs), achieves a reduction of less than 1% in mean precision (mAP@50) and recall compared to mainstream YOLO models. The modular design approach of this invention provides a universal reference value for target detection tasks in resource-constrained scenarios and has significant engineering application prospects.

[0046] Table 2 Comparative Experiments This invention verifies the necessity and relative importance of each innovative component in the proposed method through ablation experiments. The ablation experiment results are shown in Table 3. The results show that, whether acting individually or synergistically, each component proposed in this invention can effectively reduce the number of model parameters and floating-point calculations without significantly reducing mean average precision (mAP@50) and recall.

[0047] Table 3 Ablation Experiment This invention also proposes a device for detecting surface defects in baby diapers. The device includes: an image acquisition unit for acquiring images of baby diapers; a dataset construction unit for constructing a training dataset based on the pre-processed images of baby diapers; a data preprocessing unit for performing data preprocessing on the training dataset to create a model; and a defect detection unit for storing a baby diaper surface defect detection model and training the model using the training dataset.

[0048] The present invention also proposes a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of a method for detecting surface defects in baby diapers.

[0049] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a method for detecting surface defects in baby diapers.

[0050] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for detecting surface defects in baby diapers, characterized in that, Includes the following steps: Step 1: Collect images of baby diapers and construct a training dataset; Step 2: Construct a surface defect detection model for baby diapers and train the model using the training dataset to obtain a trained surface defect detection model for baby diapers; the surface defect detection model for baby diapers is an improvement on the YOLOv11n model; Step 3: Input the images of baby diapers to be detected into the trained surface defect detection model for baby diapers, and the model outputs the defect detection results.

2. The method for detecting surface defects in baby diapers according to claim 1, characterized in that, In step 2, the training dataset is preprocessed before the training samples are input into the baby diaper surface defect detection model.

3. The method for detecting surface defects in baby diapers according to claim 1, characterized in that, In step 2, the surface defect detection model for baby diapers is an improvement on the YOLOv11n model. Specifically, it includes: for the backbone network of the YOLOv11n model, replacing the original standard convolution with a depthwise separable kernel repository convolution; replacing the standard convolution of the bottleneck layer in the C3k2 module with the depthwise separable kernel repository convolution to form the C3k2_DSKW module; and replacing the original C3k2 module with the C3k2_DSKW module. The neck network includes a feature selection module, a feature fusion module, and a C3k2_DSKW module. The first feature P5 output by the backbone network is used as the input of the first feature selection module, and the second feature P4 output by the backbone network is used as the input of the second feature selection module. The output third feature P3 serves as the input to the third feature selection module. The first feature selection module is connected to the first convolutional layer, the second feature selection module is connected to the second convolutional layer, and the third feature selection module is connected to the third convolutional layer. Both the first and second convolutional layers are connected to the first feature fusion module, and both the third convolutional layer and the first feature fusion module are connected to the second feature fusion module. The first feature fusion module is connected to the first C3k2_DSKW module, and the second feature fusion module is connected to the second C3k2_DSKW module. The first convolutional layer, the first C3k2_DSKW module, and the second C3k2_DSKW module are each connected to their respective detection heads. The detection head includes a lightweight positioning quality assessment detection head.

4. The method for detecting surface defects in baby diapers according to claim 3, characterized in that, The depth-separable kernel warehouse convolution includes a depth dynamic convolution layer, a pointwise dynamic convolution layer, a batch normalization layer, and an activation layer with SILU activation function, connected in sequence.

5. The method for detecting surface defects in baby diapers according to claim 3, characterized in that, The feature selection module includes a first max pooling layer and a first average pooling layer. The input of the feature selection module is used as the input of the first max pooling layer and the first average pooling layer. The first max pooling layer is connected to the fourth convolutional layer, the fourth convolutional layer is connected to the fifth convolutional layer, the first average pooling layer is connected to the sixth convolutional layer, and the sixth convolutional layer is connected to the seventh convolutional layer. The result of adding and fusing the outputs of the fifth convolutional layer and the seventh convolutional layer is used as the input of the first activation layer. The result of fusing the output of the first activation layer with the input of the feature selection module is used as the output of the feature selection module.

6. The method for detecting surface defects in baby diapers according to claim 3, characterized in that, The feature fusion module includes a transposed convolution, a second max pooling layer, and a second average pooling layer. The high-level input of the feature fusion module is used as the input of the transposed convolution, and the output of the transposed convolution is used as the input of the second max pooling layer and the second average pooling layer. The second max pooling layer is connected to the eighth convolutional layer, the eighth convolutional layer is connected to the ninth convolutional layer, the second average pooling layer is connected to the tenth convolutional layer, and the tenth convolutional layer is connected to the eleventh convolutional layer. The result of adding and fusing the outputs of the eighth and eleventh convolutional layers is used as the input of the second activation layer. The result of fusing the output of the second activation layer with the low-level input of the feature fusion module is then added and fusing with the output of the transposed convolution, and then used as the output of the feature fusion module.

7. The method for detecting surface defects in baby diapers according to claim 3, characterized in that, The lightweight positioning quality assessment detection head includes a classification branch and a regression branch, wherein the regression branch contains a positioning quality assessment module connected to the classification branch, used to generate an adjustment score for the predicted bounding box.

8. A device for detecting surface defects in baby diapers, characterized in that, include: The image acquisition unit is used to capture images of baby diapers. Dataset building unit, used to build a training dataset based on preprocessed baby diaper images; The data preprocessing unit is used to preprocess the training dataset for model data; The defect detection unit is used to store the defect detection model of baby diaper surface and train the model using the training dataset.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method for detecting surface defects in baby diapers as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for detecting surface defects in baby diapers as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Hygienic product defect detection method, device and equipment and storage medium

    CN117011225A

  • Paper diaper image detection method based on improved YOLOv7 network model

    CN117953350A