Micro component surface defect detection system

By designing a surface defect detection system for micro components and using industrial cameras and deep learning algorithms, the problems of low detection efficiency and low accuracy of micro electronic components in the prior art are solved, and efficient and accurate defect detection is achieved.

CN119757351APending Publication Date: 2025-04-04HUBEI ENG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411649139.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The prior art is inefficient and accurate when detecting surface defects of micro electronic components. Especially when facing precision ceramic electronic components, manual inspection is difficult to capture subtle defects, affecting product performance and safety.

Method used

A micro component surface defect detection system is designed, including image acquisition hardware and detection software. The hardware consists of an industrial camera, an XY two-dimensional precision cross slide platform and a square tube bracket. The software includes camera control, image processing and motion control modules. Defect detection is used using deep learning algorithms and Compare-Contrast algorithms.

Benefits of technology

It realizes efficient detection of small targets, improves detection accuracy and speed, ensures the accuracy and reliability of detection results, and is suitable for various small and multi-component detection applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119757351A_ABST
    Figure CN119757351A_ABST
Patent Text Reader

Abstract

The invention relates to a micro component surface defect detection system, which comprises image acquisition hardware and detection software, wherein the image acquisition hardware comprises an industrial camera, an XY two-dimensional precise cross-shaped sliding table and a square tube bracket; the industrial camera is detachably mounted on an X-axis arm of the XY two-dimensional precise cross-shaped sliding table; the detection software comprises a camera control module, a camera parameter adjustment module, an image processing module, a motion control module and a data display module. Small target defect data are collected, the practical situation that the number of defect samples is small is considered, and the method is suitable for practical application of detection of various small and many components; the stability and high efficiency of the whole detection system are ensured, and collaborative optimization of hardware and software is realized; the hardware architecture is simple and efficient, the detection speed is high, the cost is low and the use is convenient; the detection precision and speed of a tiny target are improved; the accuracy and reliability of a detection result are ensured; and user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual recognition, and in particular to a system for detecting surface defects of micro-components. Background Art

[0002] In today's ever-changing industrial era, the pursuit of excellence in product quality has become the key to the survival and development of enterprises. With the increasingly fierce market competition, industrial production has higher and higher requirements for surface defect detection of objects. The existing detection methods rely on manual detection, which is not only inefficient, time-consuming and labor-intensive, but also difficult to ensure the accuracy and consistency of detection due to its subjectivity and fatigue factors.

[0003] Especially when it comes to small, high-precision products such as precision ceramic electronic components (about 5mm*5mm*3mm in size), manual inspection is particularly inadequate in capturing subtle defects such as scratches, pits, and pitting. Although these defects are small, they are often directly related to the performance, life, and even safety of the product. Taking precision ceramic electronic components as an example, in production, surface defects will have a significant impact on their electrical performance, reliability, etc. Therefore, improving the accuracy and efficiency of surface inspection of objects has become an important issue that needs to be urgently addressed in modern industrial production.

[0004] In this context, it is particularly important to develop an intelligent system that can automatically detect subtle defects on the surface of objects. At present, the detection methods for tiny electronic components are roughly divided into two categories: metallographic (microscopic) detection method and linear array camera scanning method. Their characteristics and defects are as follows:

[0005] 1. Although the metallographic (microscopic) inspection method of the existing technology can meet the inspection needs of electronic components to a certain extent, it is powerless when facing precision ceramic electronic components. Because the components are generally placed in a tray at the quality inspection end, the number is more than 1,000, and they are placed in a messy and dense manner. The metallographic inspection needs to be placed one by one, which seriously affects the speed of quality inspection; even on the production line, the speed of metallographic inspection is far behind the speed of the production line.

[0006] 2. The existing linear array camera scanning method also has a natural disadvantage when dealing with small target detection problems. Due to the small size of precision ceramic electronic components and the limited proportion they occupy in the image, the existing neural network often finds it difficult to effectively extract their feature information. At the same time, in order to increase the detection speed, the actual production often adopts the assembly line production method, and the number of targets contained in a single picture is large and densely distributed, which further increases the difficulty of detection. Summary of the invention

[0007] In view of the above problems, the present invention provides a surface defect detection system for tiny components, which aims to collect small target defect data while taking into account the reality that the defect samples are few, and is suitable for various small and numerous component detection practical applications; ensures the stability and efficiency of the entire detection system, and realizes the coordinated optimization of hardware and software; the hardware architecture is simple and efficient, the detection speed is fast, the cost is low, and it is easy to use; improves the detection accuracy and speed of tiny targets; ensures the accuracy and reliability of the detection results and increases the user experience.

[0008] To solve the above problems, the technical solution provided by the present invention is:

[0009] A micro-component surface defect detection system includes image acquisition hardware and detection software; wherein:

[0010] The image acquisition hardware is used to acquire the original image of the components to be detected; the image acquisition hardware includes an industrial camera, an XY two-dimensional precision cross slide, and a square tube bracket; wherein:

[0011] The XY two-dimensional precision cross slide is detachably mounted on the upper end of the square tube bracket, and includes an X-axis arm and a Y-axis arm;

[0012] The industrial camera is detachably mounted on the X-axis arm of the XY two-dimensional precision cross slide, the image acquisition direction is vertically downward, and the image acquisition range is the area framed by the lower end of the square tube bracket;

[0013] The detection software is used to control the image acquisition hardware and detect defects on the components to be detected; the detection software includes a camera control module, a camera parameter adjustment module, an image processing module, a motion control module, and a data display module; wherein:

[0014] The camera control module is used to control the industrial camera;

[0015] The camera parameter adjustment module is used to adjust the front-end parameters of the industrial camera;

[0016] The image processing module is used to process the original image collected by the industrial camera and identify defects on the components to be detected;

[0017] The motion control module is used to control the movement of the X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide;

[0018] The data display module is used to display images and information on the screen.

[0019] Preferably, the square tube bracket is made of stainless steel square steel and has a rectangular frame structure with dimensions of 750 mm in length, 550 mm in width, and 15 mm in height;

[0020] The Y-axis arm of the XY two-dimensional precision cross slide is fixedly installed just above the long side on the left side of the upper end of the square tube bracket and is parallel to the long side on the left side of the upper end of the square tube bracket;

[0021] The movement range of the industrial camera in the X-axis direction is 0 to 300 mm, and the movement range in the Y-axis direction is 0 to 600 mm.

[0022] Preferably, the X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide are driven by two precision stepping motors respectively;

[0023] The XY two-dimensional precision cross slide also includes two 57-type drivers, a signal junction board, a K-type controller, and a switching power supply; wherein:

[0024] The K-type controller includes an MCU unit, a drive device, a liquid crystal display, and a fully enclosed touch-type operation keyboard; wherein: the MCU unit is a 32-bit CPU; the drive device is a stepper motor or an AC servo motor;

[0025] The K-type controller is coupled with the USB port of the control computer by electrical signals through a USB to serial port device;

[0026] The K-type controller is used to perform high-speed manual operation, low-speed manual operation, inching operation, program zero return operation, mechanical zero return operation, coordinate zero reset operation, count zero reset operation, switch output point operation, and program operation; wherein:

[0027] The jog operation includes an incremental mode and an absolute mode;

[0028] The program operations include editing, modifying, creating, reading, saving, deleting, sending programs, receiving programs, and downloading startup screens;

[0029] The motion control module issues motion control instructions to the K-type controller through the 232 serial port; the K-type controller feeds back the status information of the two 57-type drivers in real time; the motion control instructions include automatic loop traversal instructions, precise positioning instructions, and zeroing instructions; wherein:

[0030] The automatic cyclic traversal instruction is used to control the X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide to drive the industrial camera to perform cyclic traversal movement within a manually preset traversal range;

[0031] The precise positioning instruction is used to control the X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide to drive the industrial camera directly to the position specified by the manually set XY coordinate value;

[0032] The zeroing instruction is used to control the X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide to drive the industrial camera to reset.

[0033] Preferably, the camera control module sends a power-on instruction for powering on the industrial camera and an image acquisition instruction for starting to acquire the original image;

[0034] The camera control module also checks the online status of the industrial camera; the online status includes the camera online and the camera offline;

[0035] The precondition for the image acquisition instruction to be executed by the industrial camera is that the online state is that the camera is online, and the power-on instruction has been successfully executed;

[0036] The front-end parameters of the industrial camera adjusted by the camera parameter adjustment module include exposure time and gain;

[0037] The precondition for the camera parameter adjustment module to adjust the front-end parameters is that the online state is that the camera is online, and the power-on instruction has been successfully executed;

[0038] The data display module is used to display the original image collected in real time in the upper left corner of the screen, display the defect detection and identification results in the middle right side of the screen, display the enlarged image of a single component in the lower left corner of the screen, display the coordinate tree in the middle lower part of the screen, display the center point coordinates of the component to be detected in the middle upper part of the screen, display the camera parameters in the middle right side of the screen, and display the motion coordinates of the XY two-dimensional precision cross slide in the middle lower part of the screen on the right side.

[0039] Preferably, the image processing module includes a small target detection model, a defect detection process, and an image format conversion submodule; wherein:

[0040] The small target detection model is obtained by training a visual recognition machine based on few-sample learning;

[0041] The defect detection process calls the small target detection model to identify defects on the components to be detected;

[0042] The picture format conversion submodule is used to convert the formats of various pictures according to the requirements of the detection software.

[0043] Preferably, in the training phase of the small target detection model, the PP-YOLOE-SOD plus few-sample learning scheme in Paddle-Detection is used for training; wherein:

[0044] The few-shot learning solution in the Paddle-Detection framework includes the Compare-Contrast algorithm. The Compare-Contrast algorithm is obtained by fine-tuning the cross-domain Label Co-tuning algorithm and the intra-domain Contrastive Tuning algorithm according to training requirements. Among them:

[0045] The cross-domain Label Co-tuning algorithm is used to enhance the generalization ability of the small target detection model and suppress the loss of information learned by the pre-training model;

[0046] The Contrastive Tuning algorithm in the field is obtained through contrastive learning;

[0047] In the few-shot learning scheme of Paddle-Detection, the Label Co-tuning algorithm is applied on the Faster RCNN structure. When using the Label Co-tuning algorithm, a complete pre-trained model is applied, but no data set is pre-set for the training task. When using the Label Co-tuning algorithm, the relationship matrix obtains the prediction result of the ground truth area on the pre-trained classification head through the forward-backward algorithm, and then combines it with the target category labeled by itself to calculate the relationship matrix label.

[0048] Preferably, the training phase of the small target detection model specifically includes the following contents:

[0049] In the pre-processing of the training set, the strategy of randomly transforming the size and normalizing the image is adopted; FasterRCNN is used as the network structure in training; the backbone feature extraction network is composed of ResNet network; the network depth of ResNet network is 50 layers, and the regularization type is BN; specifically: first, a 7×7, 64 channel convolution kernel and a 3×3 maximum pooling layer are used, and sliding extraction is used to retain important features and filter irrelevant details; then, residual blocks of 3, 4, and 6 different channels are used to extract high-level abstract features; finally, global average pooling is used to reduce the spatial dimension of the feature map and convert it into a vector, which is used for regression tasks through a fully connected layer;

[0050] The Neck of the feature extraction network is FPN, the number of its output channels is 1024 channels, and the detection head is RPNHead, which is used to set the aspect ratio of the anchor box, the size of the anchor box, the step size, and the candidate box processing during training; the candidate box processing includes: the size of the minimum bounding box, the threshold of non-maximum suppression, the number of candidate boxes retained before the maximum suppression between the search areas, and the number of candidate boxes retained after the maximum suppression between the search areas;

[0051] Two fully connected layers are inserted between the output detection box BBoxHead and the roi extractor for further learning of features; the number of channels of the feature map output by the fully connected layer is 1024;

[0052] In the post-processing stage of the BBox frame, RCNNBox is used to decode the bounding box parameters output by the small target detection model, and MultiClassNMS is used as the non-maximum suppression method. The number of candidate boxes retained is defined by the keep_top_k parameter, and the parameters of the confidence threshold and the non-maximum suppression threshold are defined at the same time.

[0053] Preferably, the small target detection model is implemented using a Compare-Contrast algorithm; the Compare-Contrast algorithm is based on a Co-Tuning framework of transfer learning, and is used to establish a relationship from a source domain to a target domain, and calculate the relevant probability distribution from the source domain to the target domain; the Compare-Contrast algorithm uses the relationship from the source domain to the target domain as a conditional distribution;

[0054] The Co-Tuning framework fine-tunes a specific task function by computing the category relationship between the source domain and the target domain; the specific task function also brings additional supervision to the general task through back-propagation;

[0055] The Co-Tuning framework introduces an additional supervision formula in fine-tuning as follows:

[0056]

[0057] Where: y s is the source domain; t is the target area; s With y t The process of jointly supervising transfer learning; θ t is the target weight; is a general expression function; p() is a conditional probability formula box, which is used to characterize the conditional distribution; To find the minimum value of the average; is the number of another target field; is the number of target areas; Used to represent the range from i=1 to i=m t The sum of is the loss function; λ is the weight parameter; i is the counter; is a random initialization function; is the specific task function; is the weight; is the initial target weight; A starting point source weight, used to guide the parameterization process of the specific task function; is the starting point weight, which is used in the parameterization process of the general expression function;

[0058] The input parameters of the Compare-Contrast algorithm include the pre-trained model, the data of the source verification data set, and the data of the target data set;

[0059] The output parameters of the Compare-Contrast algorithm include the scaling parameters calculated by a calibration step using the pre-trained model pre-trained with DNN, expressed as follows:

[0060]

[0061] Among them, t* is the output function; f(x i ) is the input vector; t is a fixed parameter whose value is preset manually; argmint>0 is the average minimum value under the condition of t>0; The summation to i = m; y i is the target value and also the true label; cross_entropy() is the cross entropy and also the output of the softmax function; softmax() is the softmax function in deep learning;

[0062] The output parameters of the Compare-Contrast algorithm also include the training data and predicted data into which the predicted data is divided; among them:

[0063] The training data is obtained by learning a neural network, mapped to the target label, and then the conditional distribution of this data is calculated through the data obtained after the calibration algorithm steps; finally, the calculated conditional distribution relationship is used to fine-tune the small target detection model.

[0064] Preferably, the defect detection process comprises the following steps:

[0065] S100. Connect and access the industrial camera;

[0066] S200. The original image is captured by the industrial camera; and then the original image is saved;

[0067] S300. Identify the original image saved in S200 to obtain all components to be detected in the current original image;

[0068] S400. List the center position coordinates of all components to be detected identified in S300; the center position coordinates are in pixels;

[0069] S500. Create a tree with a root directory named "root node" and name the leaf as the center position coordinates of all the components to be detected that are identified;

[0070] S600. Call the small target detection model to perform defect recognition detection on each component to be detected one by one.

[0071] Preferably, the detection software is developed using C++ language on a WIN11 X64 operating system, the interface development uses visualstudio 2022MFC framework, and the image preprocessing algorithm uses opencv4.5.5;

[0072] The image acquisition function of the industrial camera is developed based on Hikvision MVSSDK, and combined with visual studio2022MFC to write the interface for display and interaction functions.

[0073] Compared with the prior art, the present invention has the following advantages:

[0074] 1. The present invention is specifically aimed at small target defect detection, determines the source of small target defect data, and conducts special development for small-volume precision ceramic electronic components (size 5mm*5mm*3mm or more). The hardware system is designed and manufactured according to actual needs to collect small target defect data, and takes into account the reality that defect samples are few in number, which is suitable for various small and large component detection practical applications;

[0075] 2. The present invention selects and improves the model according to the usage scenario, uses a deep learning algorithm to detect defects, selects the paddle-detection framework, and combines the Compare-Contrast algorithm suitable for few-sample recognition; at the same time, for small targets, the PP-YOLOE-SOD algorithm is introduced and comprehensively improved, which is suitable for small target defect detection;

[0076] 3. The software written by the present invention applies the self-developed algorithm to the defect detection of precision ceramic electronic components, optimizes the collaborative work between hardware equipment and software algorithms, ensures the stability and efficiency of the entire detection system, and realizes the collaborative optimization of hardware and software;

[0077] 4. The hardware architecture of the present invention is simple and efficient, with fast detection speed, low cost and convenient use;

[0078] 5. The algorithm used by the system of the present invention can make full use of limited sample data to train efficient models; by introducing advanced image processing and deep learning technology, the detection accuracy and speed of small targets can be improved;

[0079] 6. The system of the present invention should also have self-learning and self-adaptation capabilities, and be less affected by changes in the lighting of the production environment, so as to ensure the accuracy and reliability of the detection results;

[0080] 7. The present invention controls the XY two-dimensional precision cross slide through the serial port, uses the opencv image library to develop a tiny component search algorithm, and realizes the tiny component search and positioning function; the user can use the search function provided by the software to directly output the enlarged image of the found tiny component in the lower left window to enhance the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] Figure 1a A schematic diagram of the appearance of a hardware framework of a specific embodiment of the present invention;

[0082] Figure 1b A schematic perspective diagram of a hardware framework of a specific embodiment of the present invention;

[0083] Figure 2 The overall photo of the hardware of the specific embodiment of the present invention;

[0084] Figure 3 This is a photo of the overall connection work of the system of a specific embodiment of the present invention;

[0085] Figure 4 This is a photo of the connection of a K-type controller according to a specific embodiment of the present invention;

[0086] Figure 5 A photo of the connection of an electronic and electrical device according to a specific embodiment of the present invention;

[0087] Figure 6 A schematic diagram of the ResNet50 network structure of a specific embodiment of the present invention;

[0088] Figure 7 A schematic diagram of the training process under the Co-Tuning framework of a specific embodiment of the present invention;

[0089] Figure 8 A schematic diagram of the software logic framework of a specific embodiment of the present invention;

[0090] Fig. 9 This is a screenshot of the main interface of the software in a specific embodiment of the present invention;

[0091] Fig.10 This is a screenshot of a specific embodiment of the present invention when clicking to start collection;

[0092] Fig.11 This is a screenshot of a click-to-call model in a specific embodiment of the present invention;

[0093] Fig.12 This is a screenshot of the model calculation completed in a specific embodiment of the present invention;

[0094] Fig.13 This is a screenshot of the main interface after the model calculation of a specific embodiment of the present invention;

[0095] Fig.14 This is a screenshot of clicking the root node in a specific embodiment of the present invention;

[0096] Fig.15 This is a screenshot of clicking a leaf node in a specific embodiment of the present invention;

[0097] Fig.16 This is a screenshot of a click motion according to a specific embodiment of the present invention;

[0098] Fig.17 This is a screenshot of a specific embodiment of the present invention when clicking to return to zero;

[0099] Fig.18 This is a screenshot of a specific embodiment of the present invention before clicking on a small object to search for a loop;

[0100] Fig.19 This is a screenshot of a specific embodiment of the present invention after clicking on a small object search loop;

[0101] Fig. 20 This is a screenshot of clicking a root node according to a specific embodiment of the present invention;

[0102] Fig.21 This is a screenshot of clicking a leaf node according to a specific embodiment of the present invention;

[0103] Fig. 22 This is a screenshot of the defect detection information of the precision ceramic electronic components according to a specific embodiment of the present invention;

[0104] Fig.23 This is a screenshot of the precision ceramic electronic component defect detection frame data of a specific embodiment of the present invention;

[0105] Fig.24 This is a screenshot of the output effect of the algorithm detection of a specific embodiment of the present invention;

[0106] Fig.25 This is a screenshot of a partially enlarged portion of the algorithm detection output effect of a specific embodiment of the present invention. DETAILED DESCRIPTION

[0107] The present invention is further explained below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.

[0108] It should be noted in advance that the components to be detected in this specific embodiment are precision ceramic electronic components.

[0109] A micro-component surface defect detection system includes image acquisition hardware and detection software; wherein:

[0110] The image acquisition hardware is used to acquire the original image of the components to be inspected; the image acquisition hardware includes an industrial camera, an XY two-dimensional precision cross slide, and a square tube bracket; among which:

[0111] In this specific embodiment, the square tube bracket is made of stainless steel square steel and has a rectangular frame structure with dimensions of 750 mm in length, 550 mm in width, and 15 mm in height.

[0112] The XY two-dimensional precision cross slide is detachably mounted on the upper end of the square tube bracket, including an X-axis arm and a Y-axis arm.

[0113] In this specific embodiment, the Y-axis arm of the XY two-dimensional precision cross slide is fixedly installed just above the long side of the left upper end of the square tube bracket and is parallel to the long side of the left upper end of the square tube bracket.

[0114] It should be noted that this specific embodiment uses an XY two-dimensional precision cross slide to carry an industrial camera. In order to meet the requirements of the detection field of view and the convenience of precision ceramic electronic component detection, a stainless steel square tube bracket is designed and manufactured, and an XY two-dimensional precision cross slide is installed on the bracket.

[0115] It needs to be further explained that if Figure 1a to Figure 1b As shown, in order to ensure balance and prevent the uncontrollable factors during the movement of the XY two-dimensional precision cross slide from causing the mechanical axis to shake, resulting in blurred collected image information and further affecting the accuracy of detection, the available part of the X-axis arm is shortened, that is, installed asymmetrically.

[0116] like Figure 2-3 Shown are actual working photos of a specific embodiment of the present invention.

[0117] like Figure 4-5 As shown, in this specific embodiment, the X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide are driven by two precision stepping motors respectively.

[0118] The XY two-dimensional precision cross slide also includes two 57-type drivers, a signal junction board, a K-type controller, and a switching power supply; among them:

[0119] The K-type controller is the control core of the entire hardware system, including an MCU unit, a drive device, a liquid crystal display, and a fully enclosed touch-type operation keyboard; among them: the MCU unit is a 32-bit CPU; the drive device is a stepper motor or an AC servo motor.

[0120] The K-type controller is electrically coupled to the USB port of the control computer via a USB-to-serial device.

[0121] The K-type controller is used to set various control parameters related to the operation, and to perform high-speed manual operation, low-speed manual operation, jog operation, program zero return operation, mechanical zero return operation, coordinate zero reset operation, count zero reset operation, switch output point operation, and program operation; among which:

[0122] Jog operation includes incremental mode and absolute mode.

[0123] Program operations include editing, modifying, creating, reading, saving, deleting, sending programs, receiving programs, and downloading startup screens.

[0124] The industrial camera is detachably mounted on the X-axis arm of the XY two-dimensional precision cross slide. The image acquisition direction is vertically downward, and the image acquisition range is the area framed by the lower end of the square tube bracket.

[0125] In this specific embodiment, the movement range of the industrial camera in the X-axis direction is 0 to 300 mm, and the movement range in the Y-axis direction is 0 to 600 mm.

[0126] In this specific embodiment, the industrial camera uses an industrial camera produced by Beijing Weishi New Era Technology Co., Ltd., model Weishi RS-A14K, 14 million pixels, resolution 4384*3288, and the image acquisition function is developed based on Hikvision's MVSSDK, and combined with visual studio 2022MFC to write the interface for display and interaction functions.

[0127] The inspection software is used to control the image acquisition hardware and detect defects on the components to be inspected; the inspection software includes a camera control module, a camera parameter adjustment module, an image processing module, a motion control module, and a data display module; among which:

[0128] The camera control module is used to control industrial cameras.

[0129] The camera parameter adjustment module is used to adjust the front-end parameters of industrial cameras.

[0130] The image processing module is used to process the original images collected by the industrial camera and identify defects on the components to be inspected.

[0131] The motion control module is used to control the movement of the X-axis arm and Y-axis arm of the XY two-dimensional precision cross slide.

[0132] It should be noted that the main function of the motion control module is to use the K-type controller to control the motor track to realize the X and Y axis movement functions; clicking the "Small Object Search Loop" button will loop through every place in a certain range, identify and search for precision ceramic electronic components, and save the collected pictures in a specific path; you can also enter specific X and Y coordinate values ​​to move the industrial camera to that position; the "Return to 0" button is to return the industrial camera in the system to its original position.

[0133] The data display module is used to display images and information on the screen.

[0134] The control part of the software written by the present invention, the motion control module issues motion control instructions to the K-type controller through the 232 serial port; the K-type controller feeds back the status information of the two 57-type drivers in real time; the motion control instructions include automatic loop traversal instructions, precise positioning instructions, and zeroing instructions; wherein:

[0135] The automatic loop traversal instruction is used to control the X-axis arm and Y-axis arm of the XY two-dimensional precision cross slide to drive the industrial camera to perform a loop traversal movement within the manually preset traversal range.

[0136] The precise positioning instruction is used to control the X-axis arm and Y-axis arm of the XY two-dimensional precision cross slide to drive the industrial camera directly to the position specified by the manually set XY coordinate values.

[0137] The zeroing command is used to control the X-axis arm and Y-axis arm of the XY two-dimensional precision cross slide to drive the industrial camera to reset.

[0138] It should be noted that, through the loop search function, the industrial camera moves in a rectangle of 600mm×300mm in unit length at a unit length of 60mm each time, and a movement of 60mm is exactly 9*5=45 pictures; it traverses all places within the rectangular range; each movement will save the collected pictures in jpg format into the specified folder.

[0139] One of the key points of the present invention is that: in order to prevent missed detection, a certain overlapping area is required, 9 pictures are uniformly collected in the long axis direction, 5 pictures are uniformly collected in the horizontal axis direction, and 45 pictures are finally saved; it is set to move once per second, and it takes 45 seconds to completely scan the internal rectangular area surrounded by the stainless steel square tube bracket; according to the size of the tiny components of about 5mm*5mm*3mm, 120*60=7200 tiny components can be placed. To ensure the accuracy of detection, each tiny component needs to be separated by a little, about 2000-3000, that is, 3000 can be detected in 45 seconds, and the collection efficiency is 0.015 seconds / component; due to the use of an array camera, there are about 3000 / 45=67 in each picture, and these 67 are detected simultaneously in the algorithm, so the algorithm detection efficiency overlaps with the collection efficiency, that is, they are carried out simultaneously, and the overall detection time will not be increased.

[0140] It is important to further emphasize that: from the technical solution of the hardware part of the present invention, it can be seen that the system solution actually absorbs the advantages of metallographic detection and linear array camera scanning detection, as follows:

[0141] For a single picture, because an industrial camera with 14 million pixels and a resolution of 4384*3288 is used (higher resolution), the height of the camera lens relative to the tiny components is 150mm (relatively short), and the focal length of the lens is 12mm (similar to a telephoto lens), a high-definition image of tiny components can be obtained with a smaller field of view. This is similar to metallographic inspection, except that metallographic inspection collects images one by one, while the area array camera collects images piece by piece, which improves the collection efficiency.

[0142] For overall information acquisition, the linear scan camera needs to scan, that is, collect all areas, obtain an image with ultra-high resolution, and then perform algorithm detection; due to the high resolution and the presence of about 3,000 tiny components in the image, the calculation complexity is too high and the calculation time is too long (only for high-performance servers or workstations), which cannot be run on general performance computers; although this solution also collects the entire area, it is divided into 45 areas and collected piece by piece, and in the process of collecting the next one, the algorithm processes the previous image, which is much more efficient than the linear scan method; the resolution of each image is 14 million pixels, and there are about 67 tiny components, so general performance computers can also operate normally.

[0143] In this specific embodiment, the camera control module sends a power-on instruction for starting the industrial camera and an image acquisition instruction for starting to acquire the original image.

[0144] The camera control module also checks the online status of the industrial camera; the online status includes camera online and camera offline.

[0145] The prerequisite for the image acquisition command to be executed by the industrial camera is that the online status is that the camera is online and the power-on command has been successfully executed.

[0146] The camera parameter adjustment module adjusts the front-end parameters of the industrial camera including exposure time and gain.

[0147] The prerequisite for the camera parameter adjustment module to adjust the front-end parameters is that the camera is online and the power-on command has been successfully executed.

[0148] The data display module is used to display the original image collected in real time in the upper left corner of the screen, display the defect detection and recognition results in the middle right side of the screen, display the enlarged image of a single component in the lower left corner of the screen, display the coordinate tree in the middle lower part of the screen, display the center point coordinates of the component to be inspected in the middle upper part of the screen, display the camera parameters in the middle right side of the screen, and display the motion coordinates of the XY two-dimensional precision cross slide in the middle lower part of the screen.

[0149] In this specific embodiment, the image processing module is the core of the software part of the present invention, including a small target detection model, a defect detection process, and an image format conversion submodule; wherein:

[0150] The relevant algorithm for small target detection is the key technology used by the present invention to detect precision ceramic electronic components; the small target detection model is obtained by training a visual recognition machine based on few-sample learning.

[0151] The defect detection process calls the small target detection model to identify defects on the components to be inspected.

[0152] The image format conversion submodule is used to convert the formats of various images according to the requirements of the detection software.

[0153] It should be noted that after clicking the "Small Object Search Loop" button, the cvtColor function in the opencv library is called to convert the image into HVS format and then use GaussianBlur, Canny and dilate to process the image to identify the area where the precision ceramic electronic components are located; then, search for precision ceramic electronic components in each image, calculate the coordinates, and generate corresponding roots and leaves for the coordinates of each precision ceramic electronic component; identify defects in precision ceramic electronic components; this module can also convert image formats.

[0154] In this specific embodiment, in the training phase of the small target detection model, the PP-YOLOE-SOD plus few-sample learning scheme in Paddle-Detection is used for training; wherein:

[0155] The few-shot learning solution in the Paddle-Detection framework includes the Compare-Contrast algorithm; the Compare-Contrast algorithm is obtained by fine-tuning the cross-domain Label Co-tuning algorithm and the intra-domain Contrastive Tuning algorithm according to training requirements.

[0156] It is important to point out that

[0157] Among them: the necessary process for precision ceramic electronic component detection is to train its unique detection model. Since the number of defective electronic components is small, the defective samples collected are limited, which is a typical few-sample scenario; therefore, in the training stage of the small target detection model, the PP-YOLOE-SOD plus few-sample learning scheme in Paddle-Detection is used. This is because other algorithms will overfit when training small target detection models. Therefore, after many experiments, it was finally decided to adopt the small target detection + few-sample learning scheme.

[0158] The cross-domain Label Co-tuning algorithm is used to enhance the generalization ability of the small target detection model and suppress the loss of information learned by the pre-trained model.

[0159] It should be noted that the cross-domain Label Co-tuning algorithm solves two problems. The first problem is that there are few downstream tasks to solve, which easily leads to overfitting of the model on the target dataset, resulting in poor generalization ability of the fine-tuned model. The second problem is that during the fine-tuning process, the classification head of the pre-training task is directly discarded and reinitialized, which will cause a large amount of information learned by the pre-training model to be lost.

[0160] The in-domain Contrastive Tuning algorithm is obtained through contrastive learning.

[0161] It should be noted that some studies in the prior art have shown that the reasonable introduction of contrastive learning in conventional supervised learning tasks can improve the discrimination effect of the model. Based on this idea, the Contrastive Tuning algorithm was developed, which significantly improves the effect of few-sample target detection.

[0162] However, the original form of this algorithm in the prior art is only applicable to the two-stage Fast RCNN model, while the Paddle-Detection project of the present invention expands and improves on the principle of this algorithm and applies it to the latest PP-YOLOE series models. The combination of the two algorithms can improve the generalization ability of the training model in the case of few samples, which is also one of the innovative points of the present invention.

[0163] In the few-shot learning scheme of Paddle-Detection, the Label Co-tuning algorithm is applied on the Faster RCNN structure. When using the Label Co-tuning algorithm, a complete pre-trained model is applied, but no data set is pre-set for the training task. When using the Label Co-tuning algorithm, the relationship matrix obtains the prediction result of the ground truth area on the pre-trained classification head through the forward-backward algorithm, and then combines it with the target category labeled by itself to calculate the relationship matrix label.

[0164] In this specific embodiment, the training phase of the small target detection model specifically includes the following contents:

[0165] like Figure 6 As shown in the figure, in the pre-processing of the training set, the strategy of randomly transforming the size and normalizing the image is adopted to expand the training data set; FasterRCNN is used as the network structure in training; the backbone feature extraction network is composed of ResNet network; the network depth of ResNet network is 50 layers, and the regularization type is bn; specifically: first, a 7×7, 64 channel convolution kernel and a 3×3 maximum pooling layer are used, and sliding extraction is used to retain important features and filter irrelevant details; then, residual blocks of 3, 4, and 6 different channels are used respectively to extract high-level abstract features; finally, global average pooling is used to reduce the spatial dimension of the feature map and convert it into a vector, which is used for regression tasks through a fully connected layer.

[0166] The Neck of the feature extraction network is FPN, and its output channel number is 1024 channels. The detection head is RPNHead, which is used to set the aspect ratio of the anchor box, the size of the anchor box, the step size, and the candidate box processing during training; the candidate box processing includes: the size of the minimum bounding box, the threshold of non-maximum suppression, the number of candidate boxes retained before the maximum suppression between search areas, and the number of candidate boxes retained after the maximum suppression between search areas.

[0167] Two fully connected layers are inserted between the output detection box BBoxHead and the roi extractor for further learning of the features; the number of channels of the feature map output by the fully connected layer is 1024.

[0168] In the post-processing stage of the BBox box, the bounding box parameters output by the small target detection model are decoded using RCNNBox, and MultiClassNMS is used as the non-maximum suppression method. The number of retained candidate boxes is defined by the keep_top_k parameter, and the parameters of the confidence threshold and the non-maximum suppression threshold are defined at the same time.

[0169] In this specific embodiment, the small target detection model is implemented using the Compare-Contrast algorithm; the Compare-Contrast algorithm is based on the Co-Tuning framework of transfer learning, which is used to establish a relationship from the source domain to the target domain and calculate the relevant probability distribution from the source domain to the target domain; the Compare-Contrast algorithm uses the relationship from the source domain to the target domain as the conditional distribution.

[0170] It should be noted that if the conditional distribution is known at the same time, the label y of the target domain can also be t Mapped to source domain y s .

[0171] like Figure 7 As shown in Figure 2, the Co-Tuning framework fine-tunes the specific task function by computing the category relationship between the source domain and the target domain; the specific task function also brings additional supervision to the general task through back-propagation.

[0172] The Co-Tuning framework introduces an additional supervision formula in fine-tuning as follows:

[0173]

[0174] Where: y s is the source domain; t is the target area; s With y t The process of jointly supervising transfer learning; θ t is the target weight; is a general expression function; p() is a conditional probability formula box, which is used to characterize conditional distribution; To find the minimum value of the average; is the number of another target field; is the number of target areas; Used to represent the range from i=1 to i=m t The sum of is the loss function; λ is the weight parameter; i is the counter; is a random initialization function; For specific task functions; is the weight; is the initial target weight; The starting point source weights are used to guide the parameterization process of the specific task function; is the starting point weight, which is used in the parameterization process of the general expression function.

[0175] It should be noted that λ can still make full use of the source pre-training supervision when the target is exchanged.

[0176] It needs to be further explained that θ s The parameters of the pre-trained model Initialize so that you can make full use of the pre-trained model The advantage of parameter Co-Tuning framework is that it can be cleared at the end of training No additional inference cost is incurred.

[0177] The input parameters of the Compare-Contrast algorithm include the pre-trained model, the data of the source validation dataset, and the data of the target dataset.

[0178] The output parameters of the Compare-Contrast algorithm include the scaling parameters calculated by a calibration step using the pre-trained model pre-trained with DNN, expressed as follows:

[0179]

[0180] Among them, t* is the output function; f(x i ) is the input vector; t is a fixed parameter whose value is preset manually; argmint>0 is the average minimum value under the condition of t>0; The summation to i = m; y i is the target value and also the true label; cross_entropy() is the cross entropy and also the output of the softmax function; softmax() is the softmax function in deep learning.

[0181] The output parameters of the Compare-Contrast algorithm also include the training data and predicted data into which the predicted data is divided; among them:

[0182] The training data is obtained by learning a neural network, mapped to the target label, and then the conditional distribution of this data is calculated through the data obtained after the calibration algorithm steps; finally, the calculated conditional distribution relationship is used to fine-tune the small target detection model.

[0183] To summarize the above description, Figure 8 The figure shows the logical structure of the software part of the present invention for reference.

[0184] In this specific embodiment, the defect detection process includes the following steps:

[0185] S100. Connect and access industrial cameras via MVS.

[0186] S200. Collecting an original image by an industrial camera; and then saving the original image.

[0187] In this specific embodiment, the original image is saved in jpg format.

[0188] S300. Identify the original image saved in S200 to obtain all components to be detected in the current original image.

[0189] S400. After finding the precision ceramic electronic components, the center position coordinates of all the precision ceramic electronic components identified in S300 are listed in the upper middle text box; the center position coordinates are in pixels.

[0190] S500. Create a tree with a root directory named "root node", and name the leaves as the center position coordinates of all the components to be detected. Clicking the leaf can display the enlarged image of the corresponding precision ceramic electronic component in the lower left window.

[0191] S600. Call the small target detection model to perform defect recognition detection on each component to be detected one by one.

[0192] In this specific embodiment, the detection software is developed using C++ language on the WIN11 X64 operating system, the interface development uses the visual studio 2022MFC framework, and the image preprocessing algorithm uses opencv4.5.5.

[0193] In order to further demonstrate the technical effect of the present invention, this specific embodiment will take an actual detection process as an example in the following part:

[0194] First, start the program part of this system

[0195] like Fig. 9 As shown, run the software; this software is a dialog program, and the display window on the left is for real-time display when the camera is acquiring images; the black window on the right is used to display the image after defect recognition. If the image displayed is a search image of precision ceramic electronic components, the coordinates (pixel coordinates) of the found precision ceramic electronic components will be displayed in the text box above the window; the buttons on the far right are mainly some camera control buttons and parameter setting buttons; the window in the lower left corner has the function of enlarging the detected precision ceramic electronic components (enlarged by clicking the root node or leaf node of the tree next to it).

[0196] After the search algorithm is executed, the coordinates of all detected precision ceramic electronic components will be displayed in the directory. By clicking on the coordinates, an enlarged picture of the precision ceramic electronic components will be displayed in the window next to it; the buttons on the right are mainly some image processing buttons and motion control buttons.

[0197] Then as Fig.10As shown, click the "Start Acquisition" button to acquire pictures and display them in the first image frame.

[0198] Then as Fig.11 As shown, click the "Call Model" button, the software processes the image in the first image frame, calculates using the algorithm model inside the program, and displays the processing progress in the command line;

[0199] Then as Fig.12 As shown, wait for the calculation to be completed, and the 100% progress of the processed file and the name of the processed image will be displayed;

[0200] Then as Fig.13 As shown, after the above model calculation is completed, the command line will be automatically closed, the image after defect recognition will be displayed in the second image frame, and the tree will be displayed;

[0201] Then as Fig.14 As shown, clicking the root node of the tree will display the locations of all precision ceramic electronic components.

[0202] Then as Fig.15 As shown, click on any leaf node and the local image of the precision ceramic electronic component corresponding to this leaf node will be displayed in the third image frame.

[0203] In addition, during the image acquisition process, motion control can be performed as required:

[0204] like Fig.16 As shown in the figure, enter the X and Y coordinates in the X and Y text boxes, and then click Move; the K-type controller will operate the XY two-dimensional precision cross slide to move to the specified coordinate position, and the maximum X value is 600mm and the maximum Y value is 300mm. If this value is exceeded, the default value of X is 600mm and Y is 300mm.

[0205] like Fig.17 As shown: On this interface, there is a one-key setting to return to the starting point.

[0206] In addition, this system also has a small target search function:

[0207] like Fig.18As shown, click the "Small Object Search Loop" button, the XY two-dimensional precision cross slide moves to the origin and starts a cyclic search with a block size of 9*5, and takes an image for each unit of movement and saves the image in a local folder, continuing until the end; after the movement is completed, the last image containing the object will be displayed, and the center coordinates of all identified precision ceramic electronic components will be displayed in the top text box, and a tree with the camera shooting position coordinates as the root directory and the center coordinates of all precision ceramic electronic components in each photo (in pixels) as leaves will be created in the list below; click a leaf to display the enlarged image of the identified precision ceramic electronic component in the left window.

[0208] Then as Fig.19 As shown, after clicking "Small Object Search Loop", wait for the K-type controller to complete the job and get a tree containing the positions of all small objects.

[0209] Then as Fig. 20 As shown, click the root node to get the coordinates of all precision ceramic electronic components.

[0210] Then as Fig.21 As shown, click on any leaf node to display the local image of the precision ceramic electronic component corresponding to this leaf node in the lower left image frame.

[0211] Finally, after completing the above operations, if you want to collect a new set of pictures, the applicant recommends clicking the "Delete Tree" button first to clear the existing tree; this can reduce the impact of old picture data on newly collected picture data; then, click "Small Object Search Loop".

[0212] In order to further demonstrate that the technical effects of the present invention have significant technical progress compared with the prior art, this specific embodiment is also verified from the perspective of data:

[0213] In order to address the shortcomings of the prior art methods for detecting precision ceramic electronic components, the software designed by the present invention is based on computer vision technology and related algorithms of deep learning, which can effectively solve the problems of poor model generalization ability under few samples and difficulty in extracting features in small targets, while improving the detection speed and accuracy of workpieces; compared with the prior art, the algorithm used in the present invention has higher detection speed and detection accuracy when the image is large and the target body is small.

[0214] like Fig. 22 As shown, the algorithm performs inference detection on the images collected by the software, and the defect detection module pops up a detection box to display the detection category (whether there are defects), defect probability, and coordinates of the two diagonal corners of each precision ceramic electronic component detection box that has been inspected.

[0215] like Fig.23As shown in the figure, the relevant data of the detection box during the detection process is stored in the ".json" file under the ". / data / bbox / " path in the project root directory.

[0216] like Fig.24 The output effect of the algorithm of the present invention is shown in FIG.

[0217] Fig.25 The image is partially enlarged and displayed; the red frame represents precision ceramic electronic components without defects, and the blue frame represents defective components; from the effect, it can be seen that the algorithm has good adaptability and can correctly identify even in an environment with complex background, uneven lighting and weak illumination; if the black background in the software is used and the lighting is enhanced, the effect will be better.

[0218] From the above, we can see that in the field of target detection based on deep learning, the average detection accuracy mAp value is a very important parameter; the applicant prepared a test set to verify the algorithm; the test set has a total of 200 images. Considering that the purpose of detection is to find defective samples, the average detection accuracy mAP when the IOU (the degree of overlap between the predicted box and the real box) is 0.5 is taken as the detection accuracy of this system. After actual measurement, the average detection accuracy of this system is 0.988.

[0219] The applicant compared this method with the prior art, and the comparison is as follows:

[0220] (1) Before the technical transformation, the parts manufacturer used the metallographic detection method, so it was first compared with the metallographic detection method. At the same time, referring to the relevant literature on metallographic detection of target defects, "F38MnVS bar defect analysis and improvement" and "Common problems and solutions in metallographic detection of metal materials", the main advantages of this method are:

[0221] The average detection speed is fast. According to field tests, this method can detect 3,000 parts every 45 seconds, with a collection efficiency of 0.015 seconds per part. Since we only need to accurately find defective parts, the accuracy of the bounding box is not high, so the average detection accuracy when IOU=0.5 can be taken as the detection accuracy of defective targets, that is, the accuracy can reach 98.8%. The metallographic detection method requires manual observation one by one and subjective judgment, and the detection efficiency is extremely low. Usually, only random sampling of the entire batch can be carried out, and full inspection cannot be carried out. In addition, the accuracy rate will be affected by the subjective influence of the quality inspector, and there is no authoritative detection accuracy data.

[0222] This method realizes the intelligentization of manufacturing industry, without direct human intervention, and can automatically detect defects of parts in large quantities, greatly reducing labor costs. However, the metallographic method requires professional technicians to carefully observe and analyze each part to obtain results, which is time-consuming and laborious.

[0223] (2) Compared with the method of detecting small targets with linear array cameras, the area array camera has a speed advantage. According to the results of the literature "Research on high-speed small target extraction algorithm based on linear array cameras", the average detection time of linear array cameras is 0.860 seconds, while the average detection time of this system is 0.015 seconds.

[0224] (3) Compared with similar papers on detecting small targets with array cameras, the speed is similar, but the detection accuracy is significantly improved. The targets detected in this paper are tiny targets with very few defective samples, and there are only 20 defective samples in the training data set. Conventional target detection algorithms are prone to overfitting during training, so we only compared the performance with two classic few-sample target detection algorithms (Reference 1: Co-tuning for transfer learning, Reference 2: Supervised contrastive learning). The applicant calculated the average detection accuracy mAP when the IOU was 0.5 and 0.75 respectively, and the quantitative comparison results are shown in Table 1; compared with the small target detection method in the prior art, the mAP of the algorithm of the present invention has been significantly improved.

[0225] Table 1. mAp quantitative comparison results

[0226]

[0227] Fig.25 The qualitative experimental results shown in the figure and the quantitative experimental results in Table 1 indicate that the algorithm disclosed in the present invention can significantly improve the average detection accuracy of defect detection of precision ceramic electronic components.

[0228] In addition, the present invention can also be extended to various fields of tiny target defect detection to improve detection accuracy.

[0229] This provides two advantages of the algorithm of the present invention:

[0230] Firstly, the fine defect recognition and detection algorithm disclosed in the present invention is used to detect fine scratches, pits, pits and other defects on the surface of tiny precision ceramic electronic components, where the fine defects are less than or equal to 1 mm.

[0231] like Figure 22-25 As shown, in Fig.25 It can be seen that pitting and contamination defects are correctly detected. If you want to detect other defects such as subtle scratches and pits, you only need to collect the corresponding data and train the model according to this algorithm process.

[0232] Secondly, the present invention writes a fine defect recognition and detection software, which can give the coordinates of the defect location such as Fig.14 The root node of the coordinate tree shows the defect geometry. Fig.23As shown in the json file, the defect type can be identified and the inspection report can be automatically issued. Fig. 22 shown.

[0233] In summary, it can be concluded that the present invention, based on advanced artificial intelligence machine learning and computer vision technology, can achieve high-precision detection of subtle surface defects of various materials such as metals, ceramics, and plastics. Its detection accuracy can reach the sub-millimeter level, that is, less than 1mm, which is far higher than the level that can be achieved by manual detection; at the same time, the present invention also has powerful data analysis and processing capabilities, which can automatically mark the specific location coordinates and geometric dimensions of the defects, and intelligently identify the defect type, providing operators with comprehensive and accurate detection reports.

[0234] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.

[0235] The disclosed embodiments are described above to enable any person skilled in the art to implement or use the present invention. Various modifications of these embodiments are obvious to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.

[0236] The above description includes examples of one or more embodiments. Of course, it is not possible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".

[0237] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A micro-component surface defect detection system, characterized in that: Contains image acquisition hardware and detection software; among which: The image acquisition hardware is used to acquire the original image of the components to be detected; the image acquisition hardware includes an industrial camera, an XY two-dimensional precision cross slide, and a square tube bracket; wherein: The XY two-dimensional precision cross slide is detachably mounted on the upper end of the square tube bracket, and includes an X-axis arm and a Y-axis arm; The industrial camera is detachably mounted on the X-axis arm of the XY two-dimensional precision cross slide, the image acquisition direction is vertically downward, and the image acquisition range is the area framed by the lower end of the square tube bracket; The detection software is used to control the image acquisition hardware and detect defects on the components to be detected; the detection software includes a camera control module, a camera parameter adjustment module, an image processing module, a motion control module, and a data display module; wherein: The camera control module is used to control the industrial camera; The camera parameter adjustment module is used to adjust the front-end parameters of the industrial camera; The image processing module is used to process the original image collected by the industrial camera and identify defects on the components to be detected; The motion control module is used to control the movement of the X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide; The data display module is used to display images and information on the screen.

2. The micro-component surface defect detection system according to claim 1 is characterized in that: The square tube bracket is made of stainless steel square steel and has a rectangular frame structure with dimensions of 750mm in length, 550mm in width and 15mm in height; The Y-axis arm of the XY two-dimensional precision cross slide is fixedly installed just above the long side on the left side of the upper end of the square tube bracket and is parallel to the long side on the left side of the upper end of the square tube bracket; The movement range of the industrial camera in the X-axis direction is 0 to 300 mm, and the movement range in the Y-axis direction is 0 to 600 mm.

3. The micro-component surface defect detection system according to claim 2 is characterized in that: The X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide are driven by two precision stepping motors respectively; The XY two-dimensional precision cross slide also includes two 57-type drivers, a signal junction board, a K-type controller, and a switching power supply; wherein: The K-type controller includes an MCU unit, a drive device, a liquid crystal display, and a fully enclosed touch-type operation keyboard; wherein: the MCU unit is a 32-bit CPU; the drive device is a stepper motor or an AC servo motor; The K-type controller is coupled with the USB port of the control computer by electrical signals through a USB to serial port device; The K-type controller is used to perform high-speed manual operation, low-speed manual operation, inching operation, program zero return operation, mechanical zero return operation, coordinate zero reset operation, count zero reset operation, switch output point operation, and program operation; wherein: The jog operation includes an incremental mode and an absolute mode; The program operations include editing, modifying, creating, reading, saving, deleting, sending programs, receiving programs, and downloading startup screens; The motion control module issues motion control instructions to the K-type controller through the 232 serial port; the K-type controller feeds back the status information of the two 57-type drivers in real time; the motion control instructions include automatic loop traversal instructions, precise positioning instructions, and zeroing instructions; wherein: The automatic cyclic traversal instruction is used to control the X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide to drive the industrial camera to perform cyclic traversal movement within a manually preset traversal range; The precise positioning instruction is used to control the X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide to drive the industrial camera directly to the position specified by the manually set XY coordinate value; The zeroing instruction is used to control the X-axis arm and the Y-axis arm of the XY two-dimensional precision cross slide to drive the industrial camera to reset.

4. The micro-component surface defect detection system according to claim 3 is characterized in that: The camera control module sends a power-on instruction for starting the industrial camera and an image acquisition instruction for starting to acquire the original image; The camera control module also checks the online status of the industrial camera; the online status includes the camera online and the camera offline; The precondition for the image acquisition instruction to be executed by the industrial camera is that the online state is that the camera is online, and the power-on instruction has been successfully executed; The front-end parameters of the industrial camera adjusted by the camera parameter adjustment module include exposure time and gain; The precondition for the camera parameter adjustment module to adjust the front-end parameters is that the online state is that the camera is online, and the power-on instruction has been successfully executed; The data display module is used to display the original image collected in real time in the upper left corner of the screen, display the defect detection and identification results in the middle right side of the screen, display the enlarged image of a single component in the lower left corner of the screen, display the coordinate tree in the middle lower part of the screen, display the center point coordinates of the component to be detected in the middle upper part of the screen, display the camera parameters in the middle right side of the screen, and display the motion coordinates of the XY two-dimensional precision cross slide in the middle lower part of the screen on the right side.

5. The micro-component surface defect detection system according to claim 4 is characterized in that: The image processing module includes a small target detection model, a defect detection process, and an image format conversion submodule; wherein: The small target detection model is obtained by training a visual recognition machine based on few-sample learning; The defect detection process calls the small target detection model to identify defects on the components to be detected; The picture format conversion submodule is used to convert the formats of various pictures according to the requirements of the detection software.

6. The micro-component surface defect detection system according to claim 5, characterized in that: In the training phase of the small target detection model, the PP-YOLOE-SOD plus few-sample learning scheme in Paddle-Detection is used for training; wherein: The few-shot learning solution in the Paddle-Detection framework includes the Compare-Contrast algorithm. The Compare-Contrast algorithm is obtained by fine-tuning the cross-domain Label Co-tuning algorithm and the intra-domain Contrastive Tuning algorithm according to training requirements. Among them: The cross-domain Label Co-tuning algorithm is used to enhance the generalization ability of the small target detection model and suppress the loss of information learned by the pre-training model; The Contrastive Tuning algorithm in the field is obtained through contrastive learning; In the few-shot learning scheme of Paddle-Detection, the Label Co-tuning algorithm is applied on the Faster RCNN structure. When using the Label Co-tuning algorithm, a complete pre-trained model is applied, but no data set is pre-set for the training task. When using the Label Co-tuning algorithm, the relationship matrix obtains the prediction result of the ground truth area on the pre-trained classification head through the forward-backward algorithm, and then combines it with the target category labeled by itself to calculate the relationship matrix label.

7. The micro-component surface defect detection system according to claim 6, characterized in that: The training phase of the small target detection model specifically includes the following contents: In the pre-processing of the training set, the strategy of randomly transforming the size and normalizing the image is adopted; FasterRCNN is used as the network structure in training; the backbone feature extraction network is composed of ResNet network; the network depth of ResNet network is 50 layers, and the regularization type is BN; specifically: first, a 7×7, 64 channel convolution kernel and a 3×3 maximum pooling layer are used, and sliding extraction is used to retain important features and filter irrelevant details; then, residual blocks of 3, 4, and 6 different channels are used to extract high-level abstract features; finally, global average pooling is used to reduce the spatial dimension of the feature map and convert it into a vector, which is used for regression tasks through a fully connected layer; The Neck of the feature extraction network is FPN, the number of its output channels is 1024 channels, and the detection head is RPNHead, which is used to set the aspect ratio of the anchor box, the size of the anchor box, the step size, and the candidate box processing during training; the candidate box processing includes: the size of the minimum bounding box, the threshold of non-maximum suppression, the number of candidate boxes retained before the maximum suppression between the search areas, and the number of candidate boxes retained after the maximum suppression between the search areas; Two fully connected layers are inserted between the output detection box BBoxHead and the roi extractor for further learning of features; the number of channels of the feature map output by the fully connected layer is 1024; In the post-processing stage of the BBox frame, RCNNBox is used to decode the bounding box parameters output by the small target detection model, and MultiClassNMS is used as the non-maximum suppression method. The number of candidate boxes retained is defined by the keep_top_k parameter, and the parameters of the confidence threshold and the non-maximum suppression threshold are defined at the same time.

8. The micro-component surface defect detection system according to claim 7, characterized in that: The small target detection model is implemented using a Compare-Contrast algorithm; the Compare-Contrast algorithm is based on a Co-Tuning framework of transfer learning, and is used to establish a relationship from a source domain to a target domain, and calculate the relevant probability distribution from the source domain to the target domain; The Compare-Contrast algorithm uses the relationship from the source domain to the target domain as a conditional distribution; The Co-Tuning framework fine-tunes a specific task function by computing the category relationship between the source domain and the target domain; the specific task function also brings additional supervision to the general task through back-propagation; The Co-Tuning framework introduces an additional supervision formula in fine-tuning as follows: Where: y s is the source domain; t is the target area; s With y t The process of jointly supervising transfer learning; θ t is the target weight; is a general expression function; p() is a conditional probability formula box, which is used to characterize the conditional distribution; To find the minimum value of the average; is the number of another target field; is the number of target areas; Used to represent the range from i=1 to i=m t The sum of ; l is the loss function; λ is the weight parameter; i is the counter; is a random initialization function; is the specific task function; is the weight; is the initial target weight; A starting point source weight, used to guide the parameterization process of the specific task function; is the starting point weight, which is used in the parameterization process of the general expression function; The input parameters of the Compare-Contrast algorithm include the pre-trained model, the data of the source verification data set, and the data of the target data set; The output parameters of the Compare-Contrast algorithm include the scaling parameters calculated by a calibration step using the pre-trained model pre-trained with DNN, expressed as follows: Where t* is the output function; f(xi) is the input vector; t is a fixed parameter whose value is preset manually; argmint>0 is the average minimum value under the condition of t>0; The summation to i = m; y i is the target value and also the true label; cross_entropy() is the cross entropy and also the output of the softmax function; softmax() is the softmax function in deep learning; The output parameters of the Compare-Contrast algorithm also include the training data and predicted data into which the predicted data is divided; among them: The training data is obtained by learning a neural network, mapped to the target label, and then the conditional distribution of this data is calculated through the data obtained after the calibration algorithm steps; finally, the calculated conditional distribution relationship is used to fine-tune the small target detection model.

9. The micro-component surface defect detection system according to claim 8, characterized in that: The defect detection process includes the following steps: S100. Connect and access the industrial camera; S200. The original image is captured by the industrial camera; and then the original image is saved; S300. Identify the original image saved in S200 to obtain all components to be detected in the current original image; S400. List the center position coordinates of all components to be detected identified in S300; the center position coordinates are in pixels; S500. Create a tree with a root directory named "root node" and name the leaf as the center position coordinates of all components to be detected; S600. Call the small target detection model to perform defect recognition detection on each component to be detected one by one.

10. The micro-component surface defect detection system according to claim 9, characterized in that: The detection software is developed using C++ language on a WIN11 X64 operating system, the interface development uses the visual studio 2022MFC framework, and the image preprocessing algorithm uses opencv4.5.5; The image acquisition function of the industrial camera is developed based on Hikvision MVSSDK, and combined with visual studio2022MFC to write the interface for display and interaction functions.