Riveting defect detection method for built-in KB part of notebook computer

By preprocessing the riveting image dataset with built-in KB parts of the laptop and an improved detection algorithm, the riveting defects are automatically identified, which solves the subjective error problem of manual visual inspection and improves detection accuracy and production efficiency.

CN120374498APending Publication Date: 2025-07-25重庆智能机器人研究院
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510223754.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing manual visual inspection laptop computers have built-in KB parts that are easily subject to subjective judgment errors and cannot meet the strict requirements of mass production.

Method used

The rivet image data set of KB parts is collected for preprocessing and partitioning. Based on the shape length and width ratio characteristics, the initial anchor box is selected using a clustering algorithm, dynamic convolution and attention mechanism are introduced, and the object detection algorithm is improved in combination with the loss function, and the detection model is trained to automatically identify rivet defects.

Benefits of technology

It realizes high-precision automatic detection of riveting defects, improves production line efficiency and finished product qualification rate, reduces manual dependence, and improves the intelligence level of quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374498A_ABST
    Figure CN120374498A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image detection, in particular to a riveting defect detection method for a built-in KB part of a notebook computer, and the method comprises the steps: collecting a riveting image data set of the KB part, and carrying out the preprocessing and dividing, thereby obtaining a training set and a test set; based on the shape length-width ratio characteristic of the riveting defect of the KB part, selecting an initial anchor point frame by adopting a clustering algorithm, introducing dynamic convolution, and improving a target detection algorithm in combination with an attention mechanism and a loss function to obtain a detection model; inputting the training set into a detection model for iterative training to obtain a target detection model; the test set is input into the target detection model for testing, and the riveting defect category of the KB part is obtained.According to the method, the image processing and mode recognition technology is utilized, flaws of the riveting part are automatically recognized and classified with high precision, defective products are completely detected and automatically removed, the production line efficiency and the qualified rate of finished products are improved, the detection precision is improved, manual dependence is reduced, and the detection efficiency is improved. And intelligent upgrading of quality control manufacturing is brought to the notebook computer manufacturing industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image detection, and particularly to a method for detecting riveting defects of built-in KB components in laptop computers. Background Art

[0002] In the modern electronic manufacturing field, with the rapid development of technology and the improvement of production efficiency, laptop computers, as the mainstream products of daily office and mobile computing devices, their quality control has become increasingly important. In the precise assembly process of laptop computer built-in components, especially key components such as keyboards (KB), riveting joint fixation technology is often used to ensure a stable connection. Any minor defect will directly affect the user experience, even lead to functional failures, shorten the product life, and increase the maintenance cost. Therefore, efficient and accurate detection of defects in the riveting parts of laptop built-in KB components has become an indispensable part of ensuring overall quality control.

[0003] Traditional detection methods rely on manual visual inspection, which is not only time-consuming and laborious, but also vulnerable to subjective judgment errors and cannot meet the strict requirements of mass production. Summary of the Invention

[0004] The purpose of the present invention is to provide a method for detecting riveting defects of built-in KB components in laptop computers, aiming to solve the problem that the existing manual visual inspection of built-in KB components in laptop computers is vulnerable to subjective judgment errors and cannot meet the strict requirements of mass production.

[0005] To achieve the above purpose, the present invention provides a method for detecting riveting defects of built-in KB components in laptop computers, including the following steps:

[0006] Collect the riveting image dataset of the built-in KB components of the laptop computer for preprocessing and partitioning to obtain a training set and a test set;

[0007] Based on the shape length-width ratio characteristics of the riveting defects of the KB components, use a clustering algorithm to select initial anchor boxes, introduce dynamic convolution, and combine the attention mechanism and loss function to improve the object detection algorithm to obtain an improved detection model;

[0008] Input the training set into the detection model for iterative training to obtain an object detection model;

[0009] Input the test set into the object detection model for testing to obtain the riveting defect categories of the KB components.

[0010] Among them, the specific method of collecting the riveting image dataset of the built-in KB components of the laptop computer for preprocessing and partitioning to obtain a training set and a test set:

[0011] Collect the riveting images of the built-in KB parts of laptops from the public dataset and factory workpieces respectively to obtain an image dataset;

[0012] Perform data augmentation and preprocessing on the image dataset to expand the image dataset;

[0013] Perform label annotation on the processed image dataset and randomly divide it into a training set and a test set based on the division ratio.

[0014] Among them, the preprocessing includes rotating, scaling, brightness adjustment, color gamut transformation, splicing, and mirroring operations on the pictures in the image dataset.

[0015] Among them, the label annotation needs to be performed using a data annotation tool. The annotation categories include bounding box and classification. The bounding box is used to annotate the positions of missing rivets and defective rivets in the pictures, and the classification is used to annotate the categories to which the defects belong.

[0016] Among them, the division ratio is 9:1.

[0017] Among them, the specific method of using a clustering algorithm to select initial anchor boxes based on the shape length-width ratio characteristics of the KB part riveting defects, introducing dynamic convolution, combining the attention mechanism and the loss function to improve the object detection algorithm, and obtaining an improved detection model:

[0018] Based on the shape length-width ratio characteristics of the KB part riveting defects, use a clustering algorithm to select initial anchor boxes;

[0019] Introduce the attention mechanism and the loss function into the backbone network of the object detection algorithm, and introduce dynamic convolution into the neck network of the object detection algorithm to obtain an improved detection model.

[0020] Among them, the specific method of inputting the training set into the detection model for iterative training to obtain the object detection model:

[0021] Input the training set into the object detection model and train it using the Adam optimizer for 100 rounds. The initial learning rate is set to 0.001, the weight decay coefficient is 0.0005, and the training momentum is 0.9. When the total loss value reaches the preset loss value, the model converges to obtain the object detection model.

[0022] A method for detecting riveting defects of built-in KB parts in laptop computers, which collects a riveting image dataset of built-in KB parts in laptop computers for preprocessing and division to obtain a training set and a test set; based on the shape length-width ratio characteristics of KB part riveting defects, a clustering algorithm is used to select initial anchor boxes, dynamic convolution is introduced, and the target detection algorithm is improved by combining the attention mechanism and the loss function to obtain an improved detection model; the training set is input into the detection model for iterative training to obtain a target detection model; the test set is input into the target detection model for testing to obtain the categories of KB part riveting defects. This method uses image processing and pattern recognition technologies to automatically and accurately identify and classify the defects of the riveting parts, such as incompleteness, offset, looseness, missing, etc., and even surface damage, effectively detecting the KB parts with incomplete riveting, offset, looseness, and missing, so as to achieve full detection of defective products and automatic rejection, improve the production line efficiency and the qualified rate of finished products. This method comprehensively uses deep learning models and image feature extraction, optimizes the recognition algorithm for the specific pattern of the riveting area of the laptop KB parts, overcomes the problems of light changes, angles, and background interference, improves the robust adaptability, and ensures stable application on high-speed assembly lines, not only improving the detection accuracy, but also reducing the dependence on manual labor, bringing an intelligent upgrade of quality control manufacturing to the laptop manufacturing industry. It solves the problem that the existing manual visual inspection of the built-in KB parts of laptop computers is vulnerable to subjective judgment errors and cannot meet the strict requirements of mass production. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0024] Figure 1 It is a flowchart of a method for detecting riveting defects of built-in KB parts in laptop computers provided by the present invention.

[0025] Figure 2 It is a schematic diagram of the YOLOv5 backbone network.

[0026] Figure 3 It is a schematic diagram of the insertion position of dynamic convolution.

[0027] Figure 4 It is a flowchart of a method for detecting riveting defects of built-in KB parts in laptop computers provided by the present invention.

[0028] Figure 5It is a flowchart of the specific method for preprocessing and dividing the riveting image dataset of the built-in KB parts of a notebook computer to obtain a training set and a test set.

[0029] Figure 6 It is a flowchart of the specific method for improving the object detection algorithm by selecting initial anchor boxes using a clustering algorithm based on the shape length-width ratio characteristics of the riveting defects of the KB parts, introducing dynamic convolution, combining the attention mechanism and the loss function to obtain an improved detection model. Specific implementation manners

[0030] The embodiments of the present invention will be described in detail below. The examples of the embodiments are shown in the drawings, in which the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and are intended to explain the present invention and should not be construed as limiting the present invention.

[0031] Please refer to Figures 1 to 6 , the present invention provides a method for detecting riveting defects of the built-in KB parts of a notebook computer, including the following steps:

[0032] S1 Collect the riveting image dataset of the built-in KB parts of a notebook computer for preprocessing and division to obtain a training set and a test set;

[0033] Specific method:

[0034] S11 Collect the riveting images of the built-in KB parts of a notebook computer from the public dataset and factory workpieces respectively to obtain an image dataset;

[0035] S12 Perform data augmentation and preprocessing on the image dataset to expand the image dataset;

[0036] In the embodiment of the present invention, through the resize operation on the images of the image dataset, the originally high-resolution pictures are set to 640 pixels × 640 pixels, and the original pictures are rotated, scaled, brightness-adjusted, mirrored, and Gaussian noise is added, etc. The processed pictures are incorporated into the dataset, and the finally obtained pictures are used for model training.

[0037] S13 Perform label annotation on the processed image dataset and randomly divide it into a training set and a test set based on the division ratio.

[0038] In the embodiments of the present invention, the processed data set is labeled by the data annotation tool labelImg. The annotation categories include: bounding box, which is used to label the position of the defect in the image; classification, which is used to label the category of the defect. The annotation format is PASCAL VOC, and an xml location label file with the same name as the data set will be automatically generated. The xml file describes the useful information in the annotation, where size is the size and depth of the annotated image, and the node bounding box contains the defect.

[0039] S2 Based on the shape length-width ratio characteristics of the riveting defects of KB parts, the clustering algorithm is used to select the initial anchor boxes, dynamic convolution is introduced, and the attention mechanism and loss function are combined to improve the object detection algorithm, and an improved detection model is obtained;

[0040] Specific method:

[0041] S21 Based on the shape length-width ratio characteristics of the riveting defects of KB parts, the clustering algorithm is used to select the initial anchor boxes;

[0042] In the embodiments of the present invention, according to the shape length-width ratio characteristics of the riveting defects of KB parts, the K-means++ clustering algorithm is used to select the initial anchor boxes.

[0043] S22 The attention mechanism and loss function are introduced into the backbone network of the object detection algorithm, and dynamic convolution is introduced into the neck network of the object detection algorithm to obtain an improved detection model.

[0044] In the embodiments of the present invention, the attention mechanism (CBAM) is introduced into the backbone network of the object detection algorithm (YOLOv5). The attention mechanism is placed before SPPF, the neck network of the YOLOv5 model is introduced with dynamic convolution (ODConv) to improve the recognition accuracy, and the regression loss function of YOLOv5 is replaced with SIoU-Loss.

[0045] SIoU-Loss is specifically:

[0046]

[0047] In the formula, IoU is the intersection over union of the ground truth box and the predicted box, Δ is the distance loss, and Ω is the shape loss.

[0048] S3 Input the training set into the detection model for iterative training to obtain the object detection model;

[0049] In an embodiment of the present invention, the divided training set is input into the object detection model of the present invention for training. Among them, the Adam optimizer is used for training, iterating 100 rounds, the initial learning rate is set to 0.001, the weight decay coefficient is 0.0005, and the training momentum is 0.9. When the total loss value reaches the preset loss value, the model converges, and a trained object detection model is obtained.

[0050] S4 Input the test set into the object detection model for testing to obtain the riveting defects categories of the KB parts.

[0051] In an embodiment of the present invention, when detecting defective images such as incomplete riveting, offset position, looseness, and missing, the system issues a voice broadcast to remind the personnel. The main evaluation indicators used are precision (Precision, P), recall (Recall, R), F1 index, average precision (Average Precision, AP), and mean average precision (mean Average Precision, mAP). The calculation formulas for precision, recall, and F1 index are as follows:

[0052]

[0053] In the formula: TP represents the number of true positive sample, FP represents the number of false positive, and FN represents the number of false negative samples.

[0054] AP represents the average precision of a single category. The average of the APs of all categories is obtained to get mAP. The specific formula is as follows:

[0055]

[0056] The present invention can subdivide defects such as incomplete riveting, offset position, looseness, and missing and normal riveting situations, effectively detect the KB parts with incomplete riveting, offset position, looseness, and missing. This model can effectively improve the detection accuracy, and the generalization ability of the model is stronger.

[0057] The above-disclosed is only a preferred embodiment of a method for detecting riveting defects of the built-in KB parts of a notebook computer according to the present invention. Of course, the scope of the rights of the present invention cannot be limited by this. Those of ordinary skill in the art can understand all or part of the processes of implementing the above embodiments, and the equivalent changes made according to the claims of the present invention still fall within the scope covered by the invention.

Claims

1. A method for detecting riveting defects of the built-in KB parts of a laptop, characterized in that, It includes the following steps: Collect the riveting image dataset of the built-in KB parts of the laptop for preprocessing and division to obtain a training set and a test set; Based on the aspect ratio characteristics of the shape of the riveting defects of the KB parts, use a clustering algorithm to select the initial anchor boxes, introduce dynamic convolution, and combine the attention mechanism and loss function to improve the object detection algorithm to obtain an improved detection model; Input the training set into the detection model for iterative training to obtain an object detection model; Input the test set into the object detection model for testing to obtain the categories of the riveting defects of the KB parts.

2. The riveting defect detection method for the built-in KB parts of a laptop as described in claim 1, It is characterized in that; The specific method of collecting the riveting image dataset of the built-in KB parts of the laptop for preprocessing and division to obtain a training set and a test set: Collect the riveting images of the built-in KB parts of the laptop from the public dataset and factory workpieces respectively to obtain an image dataset; Perform data augmentation and preprocessing on the image dataset to expand the image dataset; Perform label annotation on the processed image dataset and randomly divide it into a training set and a test set based on the division ratio.

3. The riveting defect detection method for the built-in KB parts of a laptop according to claim 2, wherein ; The preprocessing includes rotating, scaling, brightness adjustment, color gamut transformation, splicing, and mirroring operations on the pictures in the image dataset.

4. The riveting defect detection method for the built-in KB parts of a laptop according to claim 2, characterized in that ; The label annotation needs to be performed using a data annotation tool, and the annotation categories include bounding box and classification. The bounding box is used to annotate the positions of missing rivets and defective rivets in the picture, and the classification is used to annotate the categories to which the defects belong.

5. The riveting defect detection method for the built-in KB component of a laptop according to claim 2, characterized in that ; The division ratio is 9:

1.

6. The riveting defect detection method for the built-in KB parts of a laptop as described in claim 1, It is characterized in that; The specific method of based on the aspect ratio characteristics of the shape of the riveting defects of the KB parts, using a clustering algorithm to select the initial anchor boxes, introducing dynamic convolution, and combining the attention mechanism and loss function to improve the object detection algorithm to obtain an improved detection model: Based on the aspect ratio characteristics of the shape of the riveting defects of the KB parts, use a clustering algorithm to select the initial anchor boxes; Introduce the attention mechanism and loss function into the backbone network of the object detection algorithm, and introduce dynamic convolution into the neck network of the object detection algorithm to obtain an improved detection model.

7. The riveting defect detection method for the built-in KB parts of the laptop according to claim 1, characterized in that; The specific method of inputting the training set into the detection model for iterative training to obtain an object detection model: Input the training set into the object detection model and train it using the Adam optimizer for 100 rounds. The initial learning rate is set to 0.001, the weight decay coefficient is 0.0005, and the training momentum is 0.

9. When the total loss value reaches the preset loss value, the model converges to obtain an object detection model.