System and method for detecting defects of neodymium iron boron blank product

By combining machine vision technology and YOLOX-m algorithm with industrial cameras and PLC, the problem of slow detection speed and low accuracy of NdFeB blank products has been solved, fast and accurate online intelligent defect detection has been achieved, and production efficiency and product quality have been improved.

CN118583876APending Publication Date: 2024-09-03INNER MONGOLIA UNIV OF SCI & TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410657912.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The detection speed of NdFeB blank products is slow and the accuracy is low, resulting in the inability to effectively guarantee production efficiency and product quality.

Method used

Machine vision technology is used to detect defects in NdFeB blank products through industrial cameras and YOLOX-m algorithms, combined with programmable logic controllers (PLC) and material transfer and sorting platforms to achieve fast and accurate online intelligent defect detection.

Benefits of technology

It realizes intelligent defect detection with fast detection speed and high precision, saves human resources, improves production efficiency and product quality, and facilitates mass production without increasing additional costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118583876A
    Figure CN118583876A
Patent Text Reader

Abstract

The invention belongs to the technical field of machine vision part appearance defect detection, and particularly relates to a neodymium iron boron blank product defect detection system and a detection method thereof. The product defect detection system comprises a programmable logic controller (PLC), an industrial camera, a feeding mechanism, a material carrying mechanism and a material conveying and sorting mechanism. The industrial camera is installed at the starting position of the material conveying and sorting mechanism. The feeding mechanism is used for placing neodymium iron boron blank products to be detected; the material carrying mechanism is used for clamping neodymium iron boron materials from the feeding mechanism to the material conveying and sorting mechanism; and the industrial camera is used for detecting whether the appearance of the neodymium iron boron material has defects or not and communicating with the PLC through an algorithm so as to control sorting. The method is simple in technological process, high-precision and short-time-consumption intelligent real-time detection is achieved, the method is easily integrated into industrial production, and high-requirement product quality control of enterprises is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision component appearance defect detection, and in particular to a NdFeB blank product defect detection system and a detection method thereof. Background Art

[0002] With the continuous development of science and technology, machine vision technology is gradually emerging in the field of appearance defect detection of mechanical parts. Traditional appearance defect detection methods usually rely on human eye observation and manual measurement, which has many disadvantages. First, manual detection is time-consuming and labor-intensive, requiring a large amount of human resources to support, which not only increases costs but also affects production efficiency. Secondly, due to the interference of human factors, it is easy to cause missed detection or false detection, resulting in the inability to effectively guarantee product quality. Therefore, in order to improve detection efficiency and accuracy, more and more machinery manufacturing companies are turning to machine vision image processing technology. Machine vision systems can use high-precision cameras and advanced image processing algorithms to quickly and accurately detect defects on the surface of parts without human intervention. This can not only greatly save human resources, but also improve product quality and production efficiency, bringing huge economic benefits and competitive advantages to enterprises. Therefore, it can be foreseen that with the continuous advancement and application of machine vision technology, traditional manual detection methods will gradually be replaced, and machine vision will become the mainstream means of appearance defect detection in the future machinery manufacturing field.

[0003] NdFeB blanks made of rare earth materials usually need to undergo secondary processing to become key components of new energy vehicle engines. However, during transportation and processing, blanks often have surface defects due to collisions, and there are situations where the shapes and sizes are different. These damaged blanks cannot continue to undergo secondary processing and need to be screened out. In order to solve this problem, the present invention uses machine vision technology to identify and detect NdFeB blank products. Through the machine vision system, defects on the surface of the blanks can be quickly and accurately identified, including damage caused by collisions and irregular shapes. In this way, unqualified blanks can be identified and removed in a timely manner, thereby ensuring the smooth progress of subsequent processing procedures and improving production efficiency and product quality. Summary of the invention

[0004] The technical problem to be solved by the present invention is: in order to solve the problem of slow detection speed and low precision of NdFeB blank products, the present invention provides a defect detection system and a detection method for NdFeB blank products, which not only saves human resources, but also realizes the technical problem of realizing online intelligent defect detection with fast detection speed and high precision.

[0005] The technical solution adopted by the present invention to solve the technical problem is: A defect detection system for NdFeB blank products includes a programmable logic controller (PLC), an industrial camera, a feeding mechanism, a material handling mechanism, and a material conveying and sorting mechanism; the industrial camera is installed at the starting position of the material conveying and sorting mechanism; the feeding mechanism is used to place the NdFeB blank products to be detected; the material handling mechanism is used to clamp the NdFeB materials to be detected from the feeding mechanism to the material conveying and sorting mechanism; the industrial camera is used to detect whether the appearance of the NdFeB material is defective, and communicate to the PLC through an algorithm to control the sorting.

[0006] The technical solution adopted by the embodiment of the present invention also includes: the real-time detection result of the algorithm and the PLC communication technology: the Siemens S7-200 SMART ST60 model PLC used in the system of the present invention is set in the same local area network as the PC running the algorithm using the Siemens standard S7 protocol to realize the communication between the Python program and the PLC.

[0007] The technical solution adopted in the embodiment of the present invention also includes: it also includes a material conveying and sorting platform, the NdFeB blank product material is located above the material conveying and sorting platform, and the material conveying and sorting platform is used to drive the material to be inspected on the NdFeB blank product material carrier to run and defect sort.

[0008] The technical solution adopted by the embodiment of the present invention also includes: it also includes a YOLOX-m model algorithm, the algorithm module is connected to the industrial camera signal, and is used to analyze and output the image collected by the industrial camera through the model algorithm to complete the appearance defect detection of the NdFeB blank product to be detected; the YOLOX-m algorithm is specifically: the pre-collected data set is sent to the yolo model for training, and the model will automatically learn the features in the data set. For example, our data set is divided into normal pictures and defective pictures. The model will automatically learn the similar features between normal pictures and the similar features between defective pictures. Then we train the model by setting the corresponding number of rounds, and use the optimal model in practical applications. In practice, our camera collects a group of pictures, and the collected pictures are sent to the trained model. The model will identify the current picture according to its pre-learned knowledge, identify whether it is a normal picture or a defective picture, and send the identified results to the PLC system.

[0009] The technical solution adopted in the example of the present invention also includes: the industrial camera is a HIKROBOT MV-CH120-10GM / GC Gigabit Ethernet industrial area array camera, and the lens is a Sony IMX304 CMOS chip with low noise, high resolution and excellent image.

[0010] Another technical solution adopted by the embodiment of the present invention is: a method for detecting defects in NdFeB blank products, comprising the following steps: Step 1: Use the YOLOX-m algorithm and the industrial camera to set up in the same local area network to take appearance images of NdFeB blank products, including 222 images of normal, corner drop and scratch defects; Step 2: Use the LabelImg tool to annotate the captured NdFeB blank images, and use random flipping, random rotation, scaling, noise addition, brightness and contrast enhancement methods and traditional image processing methods to expand the annotated images and corresponding labels, and expand the original image data to 5440 images; Step 3: Resize all images to 640×640 RGB three-channel image size, use the convert_annotation method to traverse and parse the XML annotation file, extract the label information and position, and then convert this information into a specific format and write it into a txt file, and generate training set and validation set files; Step 4: Input the generated training set and validation set files into the YOLOX-m algorithm program to learn the defect characteristics of NdFeB blank products; Step 5: Based on the results learned by the algorithm, the optimal weight file best_epoch_weights.pth will be generated. By calling this file and the industrial camera interface, intelligent real-time detection with high precision and short time consumption can be achieved, and the detection results can be communicated to the PLC, so that the material transmission and sorting platform can complete the sorting of NdFeB materials.

[0011] Compared with the prior art, the beneficial effects of the present invention are as follows: the defect detection system and detection method for NdFeB blank products of the embodiments of the present invention prepare a data set according to the defect type of the NdFeB blank product to be detected, and considering that it is difficult to obtain many image data of actual defective products, the defect image is expanded by data expansion, and the NdFeB material to be detected on the material conveying and sorting platform is captured and detected by an industrial camera; the process flow of the present invention is simple and easy to be integrated into the production of the enterprise. Without increasing the additional cost of the enterprise, it is convenient for the mass production of the enterprise, which not only saves human resources, but also realizes the technical problem of realizing online intelligent defect detection with fast detection speed and high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 is a flow chart of an embodiment of the present invention; Figure 2 This is a structural diagram of the industrial camera used in the present invention; Figure 3 This is a structural diagram of the defect detection system of the present invention; Figure 4It is a structure diagram of the YOLOX-m model algorithm described in the present invention; Figure 5 It is a communication program diagram between the algorithm of the present invention and Siemens PLC; Figure 6 It is a control system structure block diagram of the defect detection system of the present invention; Figure 7 This is a diagram of the detection results of the defect detection method described in the present invention. DETAILED DESCRIPTION

[0013] In order to facilitate the understanding of the present invention, the present invention is now further and more comprehensively described in conjunction with the relevant drawings. The preferred embodiments of the present invention are given in the drawings. The following description is only used to illustrate the technical solution of the present invention and is not intended to limit it. The purpose of providing these embodiments is to make the understanding of the disclosure of the present invention clearer and more comprehensive.

[0014] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0015] like Figure 1 As shown: For the NdFeB blank product defect detection system and its detection method, the steps are as follows: 1. The YOLOX-m algorithm and the industrial camera are set in the same local area network, and the industrial camera is called by a PC to take appearance images of NdFeB blank products. A total of 222 pictures of normal, chipped corners and scratch defects are taken.

[0016] In step 1, a PC (CPU is Intel(R) Core(TM) i9-10980XE CPU @3.00GHz, GPU is NVIDIA RTX A2000), HIKROBOT's industrial camera (MV-CH120-10GM / GC Gigabit Ethernet industrial area array camera) and Python program are used to take pictures of the appearance of NdFeB blanks.

[0017] In a specific embodiment, an industrial camera is placed at the side of the starting position of the material conveying and sorting platform to take pictures of NdFeB materials from the side, including 50 pictures of normal materials, 122 pictures of chipped materials, 100 pictures of scratches, and a total of 222 pictures of defective materials.

[0018] 2. The LabelImg tool was used to annotate the captured NdFeB images. The annotated images and corresponding labels were expanded using random flipping, random rotation, scaling, noise addition, brightness and contrast enhancement, and traditional image processing methods to expand the original image data to 5440 images.

[0019] In a specific embodiment, the specific implementation steps are as follows: 2.1: Use the LabelImg tool to load the captured image data, change the output annotation format to a VOC format XML file in the tool, and annotate all captured images with defect types; 2.2: Use the Python program to read the original image path and the XML tag file path annotated by the LabelImg tool, and run the Python program to expand the data to 5440 images.

[0020] 3. Resize all images to 640×640 RGB three-channel image size, use the convert_annotation method to traverse and parse the annotation file in XML format, extract the label information and position, and then convert this information into a specific format and write it into a txt file, and generate training set and validation set files.

[0021] In step 3, the following steps are included: 3.1: In order to ensure the fast detection speed and high accuracy of the subsequent algorithm, the image size is uniformly adjusted to 640×640 size and XML tag file coordinates using Python program; 3.2: After the image size is uniformly adjusted, the program continues to generate the training set and test set files of the YOLOX-m algorithm program according to the adjusted image size and XML label file.

[0022] 4. Input the generated training set and verification set files into the YOLOX-m algorithm program to learn the defect characteristics of NdFeB blank products. 5. Based on the results learned by the algorithm, the optimal weight file best_epoch_weights.pth will be generated. By calling this file and the industrial camera interface, intelligent real-time detection with high precision and short time consumption can be achieved, and the detection results can be communicated to the PLC, so that the material transmission and sorting platform can complete the sorting of NdFeB materials.

[0023] In step 5, the following steps are included: 5.1: Set the PC running the Python program and the PLC in the same local area network and use the Siemens S7 protocol for communication; 5.2: In the Python program, use the YOLOX-m decoupling head prediction to call the generated optimal weight file best_epoch_weights.pth file, and the program detects through the capture of the industrial camera; 5.3: The detection results in step 5.2 are transmitted to the PLC bit storage area M area through the communication protocol of step 5.1 to drive the cylinder action of the material conveying and sorting platform to complete the defect detection and sorting of NdFeB products.

[0024] Through prediction, it can be found that the detection speed of the algorithm program can reach milliseconds, and the accuracy rate can reach more than 85%, and when the cylinder action of the system material conveying and sorting platform is used for sorting, the accuracy can reach 100%.

[0025] The invention provides a defect detection system and a detection method for NdFeB blank products, which greatly improves the detection accuracy and speed of NdFeB blanks.

[0026] The defect detection system and method for NdFeB blank products of the present invention use an industrial camera to shoot the material, use the LabelImg tool to label it, expand the labeled picture and label file, put the expanded data into the YOLOX-m model algorithm for training, call the trained weight file, and then use the pictures captured in real time by the industrial camera for detection, and communicate the detection results to the PLC, so as to complete the material defect detection and classification of NdFeB blank products and realize fast and efficient detection of NdFeB.

[0027] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A defect detection system and a detection method for NdFeB blank products, characterized in that: The method has fast recognition speed and high detection accuracy, and the method comprises the following steps: 1.1 Use industrial cameras to take pictures of sintered NdFeB blank products, including 222 pictures of normal, chipped and scratched materials; 1.2 The captured NdFeB blank images were labeled using the LabelImg tool, and the labeled images and corresponding labels were expanded using random flipping, random rotation, scaling, noise addition, brightness and contrast enhancement methods, and traditional image processing methods to expand the original image data to 5440 images; 1.3 Resize all images to 640×640 RGB three-channel image size, use the convert_annotation method to traverse and parse the XML annotation file, extract the label information and position, and then convert this information into a specific format and write it into a txt file, and generate training set and validation set files; 1.4 Input the generated training set and verification set files into the YOLOX-m algorithm program to learn the defect characteristics of NdFeB blank products; 1.5 Based on the results learned by the algorithm, the optimal weight file best_epoch_weights.pth will be generated. By calling this file and the industrial camera interface, intelligent real-time detection with high accuracy and short time consumption can be achieved.

2. The defect detection system and method for NdFeB blank products according to claim 1, characterized in that: In step 1.1, the industrial camera, model HIKROBOT MV-CH120-10GM / GC Gigabit Ethernet industrial area array camera, uses a Python program to capture the appearance of the NdFeB blank product material after the NdFeB material enters the starting point of the conveyor belt.

3. The defect detection system and method for NdFeB blank products according to claim 1, characterized in that: In step 1.2 The following steps are involved: 1.2.1: For the original image of the NdFeB material, read the XML file of the boundingboxes coordinates of the original image, and use ElementTree to parse the XML file to find each coordinate value; 1.2.2: Perform image enhancement on the image obtained through XML parsing and generate a transformation sequence; 1.2.3: Through the generated transformation sequence, calculate the coordinates of each box change in turn, and ensure that the adjusted coordinates do not exceed the image range or are less than 1; 1.2.4: Finally, the processed image and bounding box are saved and the information in the XML file is automatically updated. Read the bounding box information in the XML file, and its definition calculation formula is as follows: xmin=int(bndbox.find('xmin').text) (1) xmax=int(bndbox.find('xmax').text) (2) ymin=int(bndbox.find('ymin').text) (3) ymax=int(bndbox.find('ymax').text) (4) Among them: xmin, xmax, ymin, and ymax in the brackets are strings used to find the corresponding nodes in the XML (representing the upper left corner x coordinate, lower right corner x coordinate, upper left corner y coordinate, and lower right corner y coordinate of the bounding box, respectively). xmin, xmax, ymin, and ymax on the left side of the formula represent converting the obtained text content into integers and assigning them to these variables; Step 2: Change the XML file information of a single bounding box, defined as follows: xmin.text = str(new_xmin) (5) ymin.text = str(new_ymin) (6) xmax.text=str(new_xmax) (7) ymax.text = str(new_ymax) (8) Among them: new_xmin, new_xmax, new_ymin and new_ymax represent the variables assigned after rounding in the previous step; Step 3: Change the XML file information of the bounding box list, and define it as follows: new_xmin=new_target[index][0] (9) new_ymin=new_target[index][1] (10) new_xmax=new_target[index][2] (11) new_ymax=new_target[index][3] (12) Among them: the new_target list represents the coordinate information of the original image and the coordinate information in the second step. After these coordinate information are updated uniformly, they correspond to the information of the original image and the image after the data expansion algorithm.

4. The defect detection system and method for NdFeB blank products according to claim 1, characterized in that: In step 1.4 The following steps are involved: 1.4.1: This detection method mainly uses the YOLOX-m model, which consists of four parts: Input, Back-bone, Neck, Prediction. In the input part, the YOLOX-m model uses a unique data enhancement technology - Mosaic. It can greatly enrich the background of the detected object, so that the image can be fully trained and improve the training speed. 1.4.2: In the backbone part, the Focus layer can change the channels of the input image from 3 to 12, which can effectively reduce parameter calculation and improve the calculation speed. The backbone structure of the entire YOLOX-m is composed of residual blocks, including 4 CBS blocks. CBS includes convolution, batch normalization and SiLU activation functions, which can reduce the width and height of the image and expand the channels. 1.4.3: In the neck, the FPN and PAN feature extraction network structures are used. The principle is to upsample the deep image features and merge them with the shallow image features. When three valid feature layers are obtained, they are sent to the prediction part to get the prediction results. 1.4.4: In prediction, YOLOX-m replaces the three Decoupled Head decoupling heads. It can speed up the convergence of the network and improve the prediction accuracy. At the same time, YOLOX-m introduces an anchor-free frame structure, which means deleting the anchor frame. The introduction of SimOTA (Simplified Optimal Transport Allocation) can solve the problem of uneven distribution of positive and negative samples.

5. According to the defect detection system and method for NdFeB blank products described in claim 1, the best feature subset is found, characterized in that: Step 1.5 includes the following steps: for the optimal weight best_epoch_weights.pth file generated by the YOLOX-m model algorithm, the file is called in the real-time detection prediction program to communicate with the industrial camera, and the defect detection system is used to realize high-precision and short-time intelligent real-time detection, and the PC running the algorithm and the Siemens S7-200 SMART ST60 model PLC used by the defect detection system are set in the same local area network using the Siemens standard S7 protocol to realize the communication between the Python program and the PLC. After the PLC receives the signal from the Python program, it can drive the cylinder to move, so that the NdFeB blank material is photographed by the camera. After the program recognizes it, high-precision and short-time intelligent real-time detection can be realized.

Citation Information

Cited By

  • Neodymium-iron-boron magnet surface defect detection method and system

    CN119762430A

  • Method and system for detecting edge breakage of neodymium iron boron magnetic steel sheet based on polarized light

    CN122597412A

  • A method and system for detecting edge collapse of a neodymium iron boron magnetic steel sheet based on polarized light

    CN122597412B

  • A method and system for detecting corner cracks on the side surface of NdFeB green blanks

    CN123112103A