Surface defect detection method and equipment for ceramic component
通过改进YOLOv5模型,结合Swin-Transformer网络和D-IoU loss,实现了陶瓷增材制造过程中的实时缺陷检测,解决了现有技术中检测不实时、不精准的问题,具有高检测率和抗干扰性。
Patent Information
- Application Number
- CN202411800556.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to achieve real-time, fast and accurate surface defect detection in the ceramic additive manufacturing process, and high-precision sensor hardware is often required, which affects printer design and environmental conditions.
Using the improved YOLOv5 model, the network is extracted as a Swin-Transformer network by replacing the backbone feature, and the loss function is set to D-IoU loss. Combining deep learning algorithms and machine vision technology, real-time detection of surface defects of ceramic components is achieved.
Real-time defect detection of ceramic components in the additive manufacturing process is realized, with high detection rate, anti-interference and low environmental requirements, and does not affect the printer design.
Smart Images

Figure CN119649137A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field related to robot visual target detection, and more specifically, relates to a surface defect detection method and equipment for ceramic components. Background Art
[0002] Special ceramics have excellent performance in many aspects such as stability, hardness and wear resistance, and are widely used in aerospace, energy, electronics, medical, chemical, metallurgy and other fields. For example, the radome is a key component used to maintain the detection system inside the seeker to ensure normal operation under the extreme conditions of high-speed and high-maneuverability flight of missiles. It is characterized by large size, high processing precision requirements and strict performance control. It has a key impact on the aerodynamic characteristics and detection performance of missiles.
[0003] The production of meter-scale large-scale ceramic components in additive manufacturing is based on sedimentation digital light processing technology (DLP). Every 20-30 microns of sinking, the slurry is injected, and a large-span scraper is used to scrape it flat, and then the slurry layer is photocured, and then stacked layer by layer. In actual production, multiple factors will affect the formability of ceramic components. For example, the scraper will be worn due to the continuous scraping of the slurry after long-term use, which will lead to the failure to ensure the smoothness of the slurry liquid surface in subsequent processes. The photocured interlayer structure is prone to defects such as bubbles, scratches or protrusions. Under the multi-layer stacking of complex structures of components, the defects extend and expand, resulting in the failure to ensure the formability of the green structure. Therefore, it is very meaningful to monitor the processing morphology of the surface of ceramic components in real time.
[0004] In view of the difficulties in monitoring the above-mentioned component defects, a variety of mature and effective measurement methods have been proposed, including acoustic detection method, infrared thermal imaging method, etc. Among them, the acoustic detection method constructs the sound generated by the surface by analyzing the tool scraping, and indirectly determines whether the surface of the tool scraping component is normal, and the infrared thermal imaging method obtains thermal images based on the heat energy generated during the scraping process. For example, patent CN202311756887.2 proposes a gas leakage position detection method based on ultrasonic and infrared thermal imaging, which obtains multiple filtered audio information within a certain time period for the target, and thereby determines the time when no gas leakage occurs and the time when gas leakage occurs in the corresponding time period, respectively obtains the first infrared image information of the target when no gas leakage occurs, and the second infrared image information of the target when gas leakage occurs, and compares the above two to obtain the position where the gas leakage occurs in the target. This method is suitable for regular detection of finished products that have been put into use, and cannot meet the real-time requirements of additive manufacturing process detection; patent CN202410220116.X proposes a chip hotspot detection method based on infrared thermal imaging, which achieves the accuracy of micro-target segmentation by performing feature fusion on visible light grayscale images and infrared grayscale images, but its image grayscale value threshold is obtained from the pixel level, which has an overfitting trend for the defect size of ceramic additive manufacturing, and there is a tendency to misjudge normal Texture risk; Patent CN202011273832.2 proposes a ceramic defect detection method based on acoustics, which consists of a computer system composed of a computer, a microphone, a serial communication module, etc., to drive relays and stepper motors to start and stop knocking components in a timely and quantitative manner, knock on different parts of the ceramic body and collect and analyze audio data. It has high requirements for environmental noise control in the additive manufacturing process and is not robust; Patent CN201710525505.3 uses a transducer array to be placed on the surface of a layered medium, emits a forward sound beam into the layered medium, receives scattered signals fed back by the target or defect and reflected signals fed back by the interface, and then time-reverses the received scattered signals and reflected signals to simulate and generate reverse sound beams corresponding to each array element, and convolutes the forward sound beam and the reverse sound beam respectively, and uses the sum of the maximum values obtained after convolution of each array element at the same point as the sound field value of the point in the layered medium space, and compares the coordinates corresponding to the point with the highest sound field value as the location of the target or defect. This method can suppress interface signal interference and achieve target or defect positioning, but it is not suitable for arrangement in the slurry cylinder and is not universal.
[0005] In summary, existing technologies either cannot achieve real-time defect detection in the ceramic additive manufacturing process, or require the installation of high-precision sensor hardware, which affects the inherent design of the additive manufacturing printer, such as the optical path and servo control, and cannot guarantee fast and accurate detection. Therefore, a detection method is needed that can integrate the characteristics of real-time detection, high detection rate, no impact on the printer body design, and low requirements on environmental conditions. Summary of the invention
[0006] In response to the above defects or improvement needs of the prior art, the present invention provides a surface defect detection method and equipment for ceramic components, which aims to provide a method that can realize real-time detection of surface morphology defects of special ceramic components during the entire additive manufacturing process under complex environmental conditions.
[0007] To achieve the above object, according to one aspect of the present invention, a method for detecting surface defects of a ceramic component is provided, the method comprising the following steps:
[0008] (1) obtaining surface image data of a ceramic component, annotating defects in the image to construct a data set, and forming a training set with a portion of the data set;
[0009] (2) The backbone feature extraction network Backbone of the YOLOv5 model is replaced by the Swin-Transformer network from CSPDarknet, and the loss function of the YOLOv5 model is set to D-IoU loss to obtain an improved YOLOv5 model;
[0010] (3) Using the training set to train the improved YOLOv5 model to obtain the final improved YOLOv5 model;
[0011] (4) The image of the ceramic component to be tested is input into the final improved YOLOv5 model, and the final improved YOLOv5 model outputs the defect detection result of the ceramic component to be tested.
[0012] Furthermore, in step (1), the image to be annotated is opened using labelimg software, and each defect area in the image is selected and named in turn. A label suffix .xml file is generated for each annotation in turn. The label file and the image file are respectively collected in the annotations folder and the voc folder to complete the annotation of the data set.
[0013] Furthermore, in step (2), the YOLOv5 model includes an input end, a backbone feature extraction network Backbone, a feature fusion part Neck and an output prediction part Head; the input end performs a Mosaic data enhancement operation on the input ceramic component image.
[0014] Furthermore, the image input at the input end passes through the Swin-Transformer network process as follows: input in the form of H×W×3, downsampled through a Patch Partition layer and stage I, stage II, stage III, stage IV, and obtain feature maps in the form of H / 8×W / 8×2C, H / 16×W / 16×4C, and H / 32×W / 32×8C at stage II, stage III, and stage IV respectively; among them, the Swin-Transformer Block in each stage is responsible for the feature fusion extraction operation; the compressed feature map entering the Swin-Transformer Block of each stage is a l-1 The feature is first normalized by the LN layer, enters the W-MSA for feature learning, and then obtains the feature through the residual Then, through LN, MLP and one residual, feature a is obtained. l , for a l Perform LN normalization and SW-MSA feature learning to obtain the features Continue to perform LN normalization and MLP to obtain the output feature a of this stage l+1 .
[0015] Furthermore, the formula corresponding to the picture input at the input end through the Swin-Transformer network process is:
[0016]
[0017] Where: and a l Represent the output features of W-MSA and its post-MLP, respectively. and a l+1 Represent the output features of SW-MSA and its post-MLP, respectively.
[0018] Furthermore, the three output features enter the Neck layer of the improved YOLOv5 model for feature fusion. In the prediction stage, the Head replaces the loss function IoU loss with D-IoU loss.
[0019] Furthermore, when the predicted box coincides with the defect target, D-IoU loss uses the square of the distance between the center points of the two divided by the square of the diagonal distance of the minimum closure area to measure whether the predicted box is located at the center of the defect target. The corresponding formula is:
[0020] Loss IoU =1-IoU
[0021]
[0022] Where ρ(,) is the Euclidean distance calculation, b and b gt are the intersection of the diagonals of the calibrated box and the predicted box, c is the diagonal length of the minimum bounding box of the predicted box and the real box of the defect target, and IoU is the intersection-over-union loss function.
[0023] The present invention also provides a surface defect detection system for ceramic components. The system includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it executes the surface defect detection method for ceramic components as described above.
[0024] The present invention also provides a computer-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the surface defect detection method for ceramic components as described above.
[0025] In general, compared with the prior art, the surface defect detection method and device for ceramic components provided by the present invention have the following beneficial effects:
[0026] 1. The detection method monitors the ceramic component production process from a visual level. Unlike methods that monitor parameters with relatively low change rates such as thermal energy, it has better real-time performance in data collection and can detect defects more promptly during the component production process, allowing operators to make corrections in a timely manner.
[0027] 2. The detection method can be applied to the monitoring of additive manufacturing of ceramic slurries with different proportions. Different from the acoustic detection method and the infrared thermal imaging method, different slurry proportions correspond to different production process parameters. At the visual level, this method only involves fixed categories of defects.
[0028] 3. The method proposed in the present invention has good anti-interference performance. In a complex production environment, it is difficult to ensure a good noise level and ambient temperature. Compared with the acoustic method and infrared thermal imaging method, this method uses machine vision to fully avoid the above interference and adapt to working conditions.
[0029] 4. The method proposed in the present invention combines an optimized deep learning algorithm model, and proposes an improved YOLOv5 model corresponding to production needs, which ensures the recognition speed of defective targets while optimizing the recognition accuracy. The image data is transmitted to the computer terminal via wire to achieve fast communication. The computer terminal uses the above model to quickly process the image information to realize the recognition of defects and the positioning frame selection and transmit it to the host computer, meeting the application needs of operators to remotely monitor and manage the production status in real time. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of the algorithm principle involved in the present invention;
[0031] Figure 2 It is a schematic flow chart of a surface defect detection method for a ceramic component provided by the present invention;
[0032] Figure 3 This is the original YOLOv5 network structure diagram;
[0033] Figure 4 It is an improved YOLOv5 model structure diagram;
[0034] Figure 5 It is the structure diagram of Swin-Transformer Block;
[0035] Figure 6 It is a block diagram of a surface defect detection system for ceramic components provided by the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0037] See also Figure 1 and Figure 2 The present invention provides a surface defect detection method for ceramic components. The detection method combines the anti-interference advantages of optical input and the high-precision advantages of deep learning models, and can realize real-time monitoring of surface morphology defects of special ceramic components during the additive manufacturing process under complex environmental conditions.
[0038] The detection method can cover complex lighting environments, achieve highly robust defect detection, and is used to measure whether different defects generated in the additive manufacturing process of ceramic components affect the normal forming of the components. The detection method involves hardware including a CMOS photosensitive digital camera and a computer terminal. The digital camera transmits the real-time image data via carriers such as optical fibers, and a series of analysis and processing methods such as reception, mode conversion, decoding and mapping are performed on the terminal monitoring station.
[0039] Specifically, digital cameras collect real-time image information of ceramic components during the production process, which will generate a large amount of real-time image data. The deep learning algorithm model is used to process the massive data, accurately identify different defect targets, and then obtain the corresponding defect category information and location information for this target. Automatic positioning and selection are performed on the computer terminal, and finally the local industrial computer controls whether to suspend the production process for defect intervention based on on-site needs.
[0040] Specifically, the detection method mainly includes the following steps:
[0041] Step 1: Obtain surface image data of ceramic components, annotate defects in the images to construct a data set, and divide the data set into a training set and a verification set.
[0042] Specifically, use labelimg software to open the image file to be annotated, select and name each defect area in the image in turn, generate a label suffix .xml file for each annotation, and collect the label file and image file in the annotations folder and voc folder respectively to complete the annotation of the data set.
[0043] Step 2: Replace the backbone feature extraction network Backbone of the YOLOv5 model from CSPDarknet to the Swin-Transformer network, and set the loss function of the YOLOv5 model to D-IoU loss to obtain an improved YOLOv5 model.
[0044] The original YOLOv5 network structure is as follows Figure 3 As shown in the figure, the original YOLOv5 model includes the input end, the backbone feature extraction network Backbone, the feature fusion part Neck and the output prediction part Head; the backbone feature extraction network Backbone is replaced by the Swin-Transformer network from the original YOLOv5 CSPDarknet, as shown in the figure. Figure 4 , and the loss function is replaced by D-IoU.
[0045] The input end performs a Mosaic data augmentation operation on the input ceramic component image by splicing four images into a large-size image. Using the spliced large-size image as input enriches the data set and reduces the batch size, thereby reducing GPU usage.
[0046] The image input at the input end passes through the Swin-Transformer network process as follows: it is input in the form of H×W×3, downsampled through a Patch Partition layer and stage I, stage II, stage III, and stage IV, and feature maps in the form of H / 8×W / 8×2C, H / 16×W / 16×4C, and H / 32×W / 32×8C are obtained in stage II, stage III, and stage IV respectively; among them, the Swin-Transformer Block in each stage is responsible for the feature fusion extraction operation, such as Figure 5 As shown in Figure 1, it is composed of the window multi-head self-attention mechanism W-MSA and the shift window multi-head attention mechanism SW-MSA. The compressed feature map enters the Swin-Transformer Block of each stage with the feature of a l-1 The feature is first normalized by the LN layer, enters the W-MSA for feature learning, and then obtains the feature through the residual Then, through LN, MLP and one residual, feature a is obtained. l , for a l Perform LN normalization and SW-MSA feature learning to obtain the features Continue to perform LN normalization and MLP to obtain the output feature a of this stage l+1 , the corresponding formula is:
[0047]
[0048] Where: and a l Represent the output features of W-MSA and its post-MLP, respectively. and a l+1 Represent the output features of SW-MSA and its post-MLP, respectively.
[0049] The three output features enter the Neck layer of the improved YOLOv5 model for feature fusion. In the prediction stage, Head replaces the loss function IoU loss with D-IoU loss. Compared with the original IoU loss, which considers the intersection-over-union ratio between the prediction box and the defect target, when the prediction box coincides with the defect target, D-IoU loss uses the square of the distance between the center points of the two divided by the square of the diagonal distance of the minimum closure area to measure whether the prediction box is located at the center of the defect target. The corresponding formula is:
[0050] Loss IoU =1-IoU
[0051]
[0052] Where ρ(,) is the Euclidean distance calculation, b and b gt are the intersection of the diagonals of the calibrated box and the predicted box, c is the diagonal length of the minimum bounding box of the predicted box and the real box of the defect target, and IoU is the intersection-over-union loss function.
[0053] By replacing the loss function with D-IoU loss, the predicted box is regressed to the real box, and finally the ceramic component defect detection result is obtained.
[0054] Step 3: Use the training set to train the improved YOLOv5 model to obtain the final improved YOLOv5 model.
[0055] Step 4: Input the image of the ceramic component to be tested into the final improved YOLOv5 model, and the final improved YOLOv5 model outputs the defect detection result of the ceramic component to be tested.
[0056] See also Figure 6 The present invention also provides a surface defect detection system for ceramic components, the detection system covers a three-layer structure of hardware, function and application from bottom to top, wherein:
[0057] The hardware layer includes CMOS photosensitive digital cameras, computer terminals and industrial computers. The CMOS photosensitive digital camera can be independently installed outside the ceramic component printer, which has the characteristics of not affecting the production environment and easy installation; the computer terminal is used to collect and analyze the high-frequency massive image data transmitted in real time by the CMOS photosensitive digital camera, with high data accuracy and low delay.
[0058] The functional layer is composed of interfaces written in C++ for interacting with the outside world, including a computer terminal for storing historical data of the detection system; the data analysis and processing module calls the Python interface for data augmentation and preprocessing; the defect detection network model trains the network based on the VOC data set to obtain the optimal weight parameters of the model, and extracts the fused effective feature layer according to the output feature of the input ceramic surface image, which is used for comparison and fitting between the decoded and real defect frames; the data monitoring module is used to monitor the occurrence of large-sized and high-confidence defect areas and give prompts; the visualization module provides the decoded picture of the former effective feature layer, the predicted defect area frame and its confidence, which is used to observe the production status of ceramic components in real time.
[0059] The application layer is written based on the Qt framework. The interface consists of menu components and display components. The display component receives the real-time prediction data of the functional layer visualization module, completing the integrated workflow of collection-extraction-identification-visualization in the ceramic surface defect detection system. When the functional layer data monitoring module indicates that a large-size defect has occurred, the production staff decides whether to intervene in the operation status of the ceramic component printer through the host computer.
[0060] The present invention also provides a surface defect detection system for ceramic components. The system includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it executes the surface defect detection method for ceramic components as described above.
[0061] The present invention also provides a computer-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the surface defect detection method for ceramic components as described above.
[0062] The present invention is further described in detail below with reference to specific embodiments.
[0063] The specific embodiment of the present invention provides a ceramic surface defect detection method, including the following stages: constructing a neural network data set based on labelimg, training a network model, collecting and preprocessing image data based on the ceramic surface, and predicting a target using a network model:
[0064] The steps include:
[0065] Step 1: Obtain surface image data of ceramic components, mark the defects therein to construct a data set, and divide the data set into a training set and a validation set.
[0066] Specifically, use labelimg software to open the image file to be annotated, select and name each defect area in the image in turn, and generate a label suffix .xml file for each annotation. The label file and image file are respectively collected in the annotations folder and the voc folder to complete the annotation of the data set. The valid images are divided into training set and verification set with a division ratio of 1:1.
[0067] Step 2: Build a ceramic component defect detection model based on improved YOLOv5. Figure 4 As shown in the figure, the ceramic component defect detection model includes an input end, a backbone feature extraction network Backbone, a feature fusion part Neck and an output prediction part Head; wherein the backbone feature extraction network Backbone is replaced by the original YOLOv5's CSPDarknet with a Swin-Transformer network, and the loss function is replaced with D-IoU.
[0068] The input end performs a Mosaic data enhancement operation on the input ceramic component image, that is, scaling, cropping, and arranging the four images and splicing them into a large-size image to obtain an enhanced image.
[0069] The backbone feature extraction network Backbone is replaced by the CSPDarknet of the original YOLOv5 with the Swin-Transformer network with better feature extraction capability. The image input at the input end passes through the Swin-Transformer network process as follows: it is input in the form of H×W×3, and downsampled through a Patch Partition layer and stage I, stage II, stage III, and stage IV. Feature maps in the form of H / 8×W / 8×2C, H / 16×W / 16×4C, and H / 32×W / 32×8C are obtained in stage II, stage III, and stage IV respectively; Among them, the Swin-Transformer Block in each stage is responsible for feature fusion extraction operations, such as Figure 5 As shown in Figure 2, they are composed of the window multi-head self-attention mechanism W-MSA and the shift window multi-head attention mechanism SW-MSA. The compressed feature map enters each
[0070] l-1
[0071] The feature of the Swin-Transformer Block in the stage is a, which is first normalized by the LN layer, enters the W-MSA for feature learning, and then obtains the feature through the residual Then in turn
[0072] ll
[0073] The feature a is obtained through LN, MLP and a residual, and LN normalization and SW-MSA feature learning are performed on a to obtain the feature Continue with the LN normalization operation and MLP to obtain the l+1
[0074] The output feature a of the stage is:
[0075]
[0076] Where: and a l Represent the output features of W-MSA and its post-MLP, respectively. and a l+1 Represent the output features of SW-MSA and its post-MLP, respectively.
[0077] The Neck layer of the feature fusion part receives the three output features of stage II, III, and IV in Backbone for feature fusion. The Neck layer of the feature fusion part uses the FPN feature pyramid of the native YOLOv5 to fuse features of different dimensions and output richer feature information.
[0078] In the prediction stage, the Head performs prediction operations on the output features of the Neck layer. In this stage, the loss function IoU loss is replaced by D-IoU loss. Compared with the original IoU loss, which considers the intersection-over-union ratio of the prediction box and the defect target, when the prediction box coincides with the defect target, D-IoU loss uses the square of the distance between the center points of the two divided by the square of the diagonal distance of the minimum closure area to measure whether the prediction box is located at the center of the defect target. The formula is:
[0079] Loss IoU =1-IoU
[0080]
[0081] Where ρ(,) is the Euclidean distance calculation, b and b gt are the intersection of the diagonals of the calibration box and the prediction box, c is the diagonal length of the minimum bounding box of the prediction box and the real box of the defect target, and IoU is the intersection-over-union loss function;
[0082] By replacing the loss function with D-IoU loss, the predicted box is regressed to the real box, and finally the ceramic component defect detection result is obtained.
[0083] Step 3: Use the training set and validation set in step 1 to train and validate the improved YOLOv5 model to obtain the optimized model.
[0084] Set the network parameters of the ceramic component defect detection model based on the improved YOLOv5 model, set the training epoch to 600, the batch size to 8, and use the default YOLOv5s parameter settings for other parameters. Use the training set to train the above model, and continuously optimize and update the network parameters based on the detection effect of the model based on the validation set, so that the model reaches the target accuracy and obtains the final optimized model.
[0085] Step 4: Apply the model obtained in step 3, input the image of the ceramic component to be inspected, and output the inspection results.
[0086] The images that need to be inspected during the additive manufacturing process of ceramic components are input in real time into the final optimization model obtained in step 3 to perform defect detection on the surface of the ceramic components, and the defect targets in the images to be inspected are obtained based on the output images with prediction boxes.
[0087] In another embodiment, a ceramic surface defect detection system based on ceramic surface acquisition-extraction-recognition-visualization integration is provided, which covers a three-layer structure of hardware, function and application from bottom to top, such as Figure 6 ,in:
[0088] The hardware layer includes CMOS photosensitive digital cameras, computer terminals and industrial computers. The CMOS photosensitive digital camera can be independently installed outside the ceramic component printer, which has the characteristics of not affecting the production environment and easy installation; the computer terminal is used to collect and analyze the high-frequency massive image data transmitted in real time by the CMOS photosensitive digital camera, with high data accuracy and low delay.
[0089] The functional layer is composed of interfaces written in C++ for interacting with the outside world, including a computer terminal for storing historical data of the detection system; the data analysis and processing module calls the Python interface for data augmentation and preprocessing; the defect detection network model trains the network based on the VOC data set to obtain the optimal weight parameters of the model, and extracts the fused effective feature layer according to the output feature of the input ceramic surface image, which is used for comparison and fitting between the decoded and real defect frames; the data monitoring module is used to monitor and prompt the occurrence of large-size and high-confidence defect areas; the visualization module provides the decoded picture of the former effective feature layer, the predicted defect area frame and its confidence, which is used to observe the production status of ceramic components in real time.
[0090] The application layer is written based on the Qt framework. The interface consists of menu components and display components. The display component receives the real-time prediction data of the functional layer visualization module, completing the integrated workflow of collection-extraction-identification-visualization in the ceramic surface defect detection system. When the functional layer data monitoring module indicates that a large-size defect has occurred, the production staff decides whether to intervene in the operation status of the ceramic component printer through the host computer.
[0091] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting surface defects of a ceramic component, characterized in that: The method comprises the following steps: (1) obtaining surface image data of a ceramic component, annotating defects in the image to construct a data set, and forming a training set with a portion of the data set; (2) The backbone feature extraction network Backbone of the YOLOv5 model is replaced by the Swin-Transformer network from CSPDarknet, and the loss function of the YOLOv5 model is set to D-IoU loss to obtain an improved YOLOv5 model; (3) Using the training set to train the improved YOLOv5 model to obtain the final improved YOLOv5 model; (4) The image of the ceramic component to be tested is input into the final improved YOLOv5 model, and the final improved YOLOv5 model outputs the defect detection result of the ceramic component to be tested.
2. The method for detecting surface defects of a ceramic component according to claim 1, wherein: In step (1), use labelimg software to open the image to be annotated, select and name each defect area in the image in turn, and generate a label suffix .xml file for each annotation. The label file and image file are respectively collected in the annotations folder and the voc folder to complete the annotation of the data set.
3. The method for detecting surface defects of a ceramic component according to claim 1, wherein: In step (2), the YOLOv5 model includes an input end, a backbone feature extraction network Backbone, a feature fusion part Neck and an output prediction part Head; the input end performs a Mosaic data enhancement operation on the input ceramic component image.
4. The method for detecting surface defects of a ceramic component according to claim 3, wherein: The image input at the input end passes through the Swin-Transformer network process as follows: it is input in the form of H×W×3, downsampled through a Patch Partition layer and stage I, stage II, stage III, and stage IV, and feature maps in the form of H / 8×W / 8×2C, H / 16×W / 16×4C, and H / 32×W / 32×8C are obtained in stage II, stage III, and stage IV respectively; among them, the Swin-Transformer Block in each stage is responsible for the feature fusion extraction operation; the compressed feature map enters the Swin-Transformer Block of each stage with a l-1 The feature is first normalized by the LN layer, enters the W-MSA for feature learning, and then obtains the feature through the residual Then, through LN, MLP and one residual, feature a is obtained. l , for a l Perform LN normalization and SW-MSA feature learning to obtain the features Continue to perform LN normalization and MLP to obtain the output feature a of this stage l+1 .
5. The method for detecting surface defects of a ceramic component according to claim 4, characterized in that: The formula corresponding to the picture input at the input end through the Swin-Transformer network process is: Where: and a l Represent the output features of W-MSA and its post-MLP, respectively. and a l+1 Represent the output features of SW-MSA and its post-MLP, respectively.
6. The method for detecting surface defects of a ceramic component according to claim 5, characterized in that: The three output features enter the Neck layer of the improved YOLOv5 model for feature fusion. In the prediction stage, Head replaces the loss function IoU loss with D-IoU loss.
7. The method for detecting surface defects of a ceramic component according to claim 6, wherein: When the prediction box coincides with the defect target, D-IoU loss uses the square of the distance between the center points of the two divided by the square of the diagonal distance of the minimum closure area to measure whether the prediction box is located at the center of the defect target. The corresponding formula is: Loss IoU =1-IoU Where ρ(,) is the Euclidean distance calculation, b and b gt are the intersection of the diagonals of the calibrated box and the predicted box, c is the diagonal length of the minimum bounding box of the predicted box and the real box of the defect target, and IoU is the intersection-over-union loss function.
8. A surface defect detection system for ceramic components, characterized in that: The system includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the surface defect detection method for ceramic components according to any one of claims 1 to 7 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the surface defect detection method for ceramic components according to any one of claims 1-7.
Citation Information
Patent Citations
Acoustic detection method for target or defect in layered medium
CN107271573A
Ceramic body defect detection device and method based on acoustics
CN112433001A
Gas leakage position detection method based on ultrasonic wave and infrared thermal imaging
CN117781188A
Chip hot spot detection method based on infrared thermal imaging
CN117893525A
Information identification and surface defect on-line detection method based on machine visual sense
CN104992449A
Cited By
Ceramic surface defect detection method
CN120298341A
A method for detecting defects on a ceramic surface
CN120298341B