Defect detection and rating method and device, equipment and storage medium

By combining image processing technology and neural networks, defect detection and rating of inductors is solved, and a high accuracy and high efficiency detection process is achieved.

CN119963559AActive Publication Date: 2025-05-09JIHUA LAB

Patent Information

Application Number
CN202510452247.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-05-09
Estimated Expiration
2045-04-10

AI Technical Summary

Technical Problem

The prior art has difficulties in detecting in inductance defect detection, such as the variety of copper wire windings, cross-blocking leads to misjudgment or misjudgment, and the reflection of copper wire leads to inconsistent color, resulting in a significant reduction in detection accuracy.

Method used

Using diverse image processing technologies and neural networks, the specific steps include image acquisition of inductors, using semantic segmentation network to extract coil contour areas, image processing and area screening, calculating core distance data, and rating through defect level quantization of neural networks.

Benefits of technology

It significantly improves the accuracy and efficiency of defect detection, reduces misjudgment and misjudgment, realizes automated defect level assessment, and improves the integrity and reliability of the inspection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963559A_ABST
    Figure CN119963559A_ABST
Patent Text Reader

Abstract

The invention relates to the field of image processing, and discloses a defect detection and rating method, device and equipment and a storage medium, and the defect detection and rating method comprises the steps: carrying out the image collection of an inductor, so as to obtain a basic image; constructing a semantic segmentation network, and performing region extraction on the basic image by using the semantic segmentation network to obtain a coil contour region; performing image processing and region screening on the coil contour region to obtain a feature region; extracting the center coordinate of the magnetic core, and calculating the distance between the edge point of the feature region and the center coordinate of the magnetic core to obtain magnetic core distance data; constructing a defect grade quantification neural network, and rating the magnetic core distance data by using the defect grade quantification neural network to obtain a rating result; according to the method, diversified image processing technologies and neural networks are comprehensively applied, the process and precision of defect detection are comprehensively optimized, and the accuracy and efficiency of detection are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a defect detection and rating method, device, equipment and storage medium. Background Art

[0002] In the field of electronic component manufacturing, inductor is a key component and its quality inspection is of vital importance. Among them, inductor coil defect detection is a key link to ensure the performance of inductor.

[0003] However, in current industrial production, there are many difficulties in detecting inductor defects. For example, the copper wires have various winding postures and there is no unified standard. The crossed copper wires will block each other, making it difficult to determine their position and status, which can easily lead to misjudgment or missed judgment. The reflection of the copper wires causes inconsistent colors, which greatly reduces the accuracy of the detection method based on color features.

[0004] Traditional manual inspection has low inspection efficiency when faced with such a variety of inspection difficulties, and is easily interfered by subjective factors, resulting in misjudgments and missed judgments, which seriously affects the control of product quality and the improvement of production efficiency.

[0005] It can be seen that there is room for improvement in the prior art. Summary of the invention

[0006] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a defect detection and rating method, device, equipment and storage medium, which comprehensively utilizes a variety of image processing technologies and neural networks to comprehensively optimize the process and accuracy of defect detection and significantly improve the accuracy and efficiency of detection.

[0007] The first aspect of the present invention provides a defect detection and rating method, including: collecting images of inductors to obtain basic images; constructing a semantic segmentation network, and using the semantic segmentation network to perform region extraction on the basic image to obtain a coil contour area; performing image processing and region screening on the coil contour area to obtain a feature area; extracting the core center coordinates, and calculating the distance between the edge points of the feature area and the core center coordinates to obtain core distance data; constructing a defect level quantization neural network, and using the defect level quantization neural network to rate the core distance data to obtain a rating result.

[0008] Optionally, in a first implementation method of the first aspect of the present invention, the image acquisition of the inductor to obtain a basic image includes: constructing a coaxial adjustable dual-light source vision system; acquiring the image of the inductor through the coaxial adjustable dual-light source vision system to obtain a red, green, and blue image of the inductor; and performing data preprocessing on the red, green, and blue image of the inductor to obtain a basic image.

[0009] Optionally, in a second implementation of the first aspect of the present invention, constructing a semantic segmentation network and using the semantic segmentation network to extract regions of a basic image to obtain a coil contour region includes: performing preliminary classification of the basic image to obtain an unqualified inductance image; annotating connected regions of the unqualified inductance image to obtain an annotated image; constructing a semantic segmentation network; and using a language segmentation network to extract regions of interest from the annotated image to obtain a coil contour region.

[0010] Optionally, in a third implementation method of the first aspect of the present invention, constructing a semantic segmentation network includes: constructing a basic network framework; embedding a coordinate attention module into the basic network framework to obtain a first improved network; replacing the standard convolution of the first improved network with a selective convolution kernel to obtain a second improved network; training the second improved network to obtain a semantic segmentation network.

[0011] Optionally, in a fourth implementation of the first aspect of the present invention, the image processing and region screening of the coil contour area to obtain a feature area includes: performing morphological processing on the coil contour area to obtain a repair area; performing region growth processing on the repair area to obtain a connected area; and performing region screening processing on the connected area to obtain a feature area.

[0012] Optionally, in a fifth implementation of the first aspect of the present invention, the extracting of the magnetic core center coordinates and calculating the distance between the edge points of the feature area and the magnetic core center coordinates to obtain the magnetic core distance data includes: using a circle fitting algorithm to perform edge detection on the magnetic core to obtain the first magnetic core center coordinates and the second magnetic core center coordinates; calculating the distance between the edge points of the feature area and the first magnetic core center coordinates to obtain the first distance data; calculating the distance between the edge points of the feature area and the second magnetic core center coordinates to obtain the second distance data; and integrating the first distance data and the second distance data to obtain the magnetic core distance data.

[0013] Optionally, in a sixth implementation of the first aspect of the present invention, the defect level quantification neural network is constructed, and the core distance data is graded using the defect level quantification neural network to obtain a rating result, including: pre-scoring the inductor according to a preset scoring threshold to obtain control data; constructing a defect level quantification neural network; and inputting the core distance data and the control data into the defect level quantification neural network for defect rating to obtain a rating result.

[0014] The second aspect of the present invention provides a defect detection and rating device, including: an acquisition module, used to acquire images of inductors to obtain a basic image; a segmentation module, used to construct a semantic segmentation network, and use the semantic segmentation network to perform region extraction on the basic image to obtain a coil contour area; an optimization module, used to perform image processing and region screening on the coil contour area to obtain a feature area; a calculation module, used to extract the core center coordinates, and calculate the distance between the edge points of the feature area and the core center coordinates to obtain core distance data; a rating module, used to construct a defect level quantization neural network, and use the defect level quantization neural network to rate the core distance data to obtain a rating result.

[0015] A third aspect of the present invention provides a defect detection and rating device, which includes: a memory and at least one processor, wherein the memory stores instructions; at least one of the processors calls the instructions in the memory so that the defect detection and rating device performs each step of any one of the above-mentioned defect detection and rating methods.

[0016] A fourth aspect of the present invention provides a computer-readable storage medium having instructions stored thereon, and the instructions, when executed by a processor, implement the various steps of any of the above-mentioned defect detection and rating methods.

[0017] In the technical solution of the present invention, the inductor image data is first collected, and then the coil contour area is accurately extracted with the help of an advanced semantic segmentation network to achieve effective separation of the copper wire and the magnetic core on the inductor; a variety of image processing algorithms are used to deeply optimize the extracted coil contour area to screen out more accurate feature areas; based on the screened feature areas, the magnetic core distance used to judge defects is accurately calculated; finally, the magnetic core distance is input into a neural network, and the neural network completes the defect rating; the present invention comprehensively uses a variety of image processing technologies and neural networks to comprehensively optimize the process and precision of defect detection, and significantly improves the accuracy and efficiency of detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which: Figure 1 A first flow chart of a defect detection and rating method provided by an embodiment of the present invention; Figure 2 A second flow chart of the defect detection and rating method provided by an embodiment of the present invention; Figure 3 A third flow chart of the defect detection and rating method provided by an embodiment of the present invention; Figure 4A fourth flow chart of the defect detection and rating method provided by an embodiment of the present invention; Figure 5 A fifth flow chart of the defect detection and rating method provided by an embodiment of the present invention; Figure 6 A sixth flow chart of the defect detection and rating method provided by an embodiment of the present invention; Figure 7 A seventh flow chart of the defect detection and rating method provided by an embodiment of the present invention; Figure 8 A schematic diagram of the structure of a defect detection and rating device provided by an embodiment of the present invention; Fig. 9 A schematic diagram of the structure of a defect detection and rating device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The present invention provides a defect detection and rating method, device, equipment and storage medium, which first collects inductor image data, then uses an advanced semantic segmentation network to accurately extract the coil contour area, so as to achieve effective separation of the copper wire and the magnetic core on the inductor; uses a variety of image processing algorithms to deeply optimize the extracted coil contour area, and screens out more accurate feature areas; then based on the screened feature areas, accurately calculates the magnetic core distance used to judge defects; finally, inputs the magnetic core distance into a neural network, and the neural network completes the defect rating; the present invention comprehensively uses a variety of image processing technologies and neural networks to comprehensively optimize the process and precision of defect detection, and significantly improves the accuracy and efficiency of detection.

[0020] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0021] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the defect detection and rating method in the embodiment of the present invention includes: 101. Capture an image of the inductor to obtain a basic image; In this embodiment, a red, green, and blue image (RGB image) of the inductor is collected by a multimodal vision system (such as a dual-light source system), and preprocessing techniques such as denoising and normalization are used to improve the image quality. Step 101 provides raw data input for all subsequent steps, and its sampling results and preprocessing results directly affect the segmentation accuracy.

[0022] 102. Construct a semantic segmentation network, and use the semantic segmentation network to extract the region of the basic image to obtain the coil contour region; In this embodiment, an improved semantic segmentation network is constructed, and the semantic segmentation network is used to separate the copper wire and the magnetic core in the inductor image, accurately extract the coil contour area, and solve the feature ambiguity problem under complex winding postures; the semantic segmentation result of step 102 is the basis of the image processing in step 103, ensuring the accuracy of feature area extraction.

[0023] 103. Perform image processing and region screening on the coil contour region to obtain a feature region; In this embodiment, morphological processing, region growing and other algorithms are applied to the coil contour area to repair the broken area and screen the connected area, and the noise is further filtered in combination with geometric features (such as area) to obtain a feature area with defect indication significance.

[0024] 104. Extract the core center coordinates, and calculate the distance between the edge point of the feature area and the core center coordinates to obtain core distance data; In this embodiment, the core center coordinates are obtained based on a circle fitting algorithm, the distance between the edge point of the feature area and the core is quantified, and the core distance data reflecting the positional relationship between the copper wire and the core is generated, providing an objective basis for defect determination.

[0025] 105. Construct a defect grade quantification neural network, and use the defect grade quantification neural network to rate the core distance data to obtain a rating result; In this embodiment, a defect level quantification neural network is constructed, and the defect level quantification neural network is used to fuse the calculated core distance data and the scoring data of the manual control experiment, and the automatic evaluation of the defect level is achieved through nonlinear mapping.

[0026] In the embodiment of the present invention, it first collects the inductor image data, and then uses the advanced semantic segmentation network to accurately extract the coil contour area to achieve effective separation of the copper wire and the magnetic core on the inductor; uses a variety of image processing algorithms to deeply optimize the extracted coil contour area and screen out more accurate feature areas; then based on the screened feature areas, accurately calculate the magnetic core distance used to judge defects; finally, the magnetic core distance is input into the neural network, and the neural network completes the defect rating; the present invention combines the visual system with the algorithm to solve the feature fuzziness problem caused by copper wire reflection, cross occlusion, etc. under a single mode, and improves the robustness of defect recognition in complex scenes; and uses a quantitative neural network to integrate algorithm data and manual experience, reduce subjective judgment differences, and realize automatic defect grade assessment; realizes an end-to-end detection and rating process, forming a closed loop from image acquisition to rating result output, shortening the manual intervention link in traditional detection, significantly improving detection efficiency, and reducing the risk of misjudgment. The present invention comprehensively uses a variety of image processing technologies and neural networks to comprehensively optimize the process and accuracy of defect detection, and significantly improves the accuracy and efficiency of detection.

[0027] See also Figure 2 , two embodiments of the defect detection and rating method in the embodiment of the present invention include: 201. Construct a coaxial adjustable dual light source visual system; In this embodiment, the coaxial adjustable dual-light source visual system includes an industrial camera, a lens, a first annular light source, a second annular light source and a mounting frame; the industrial camera is the core device for image acquisition and is responsible for real-time observation and acquisition of red, green and blue images of the inductor and the copper wire; the first annular light source and the second annular light source have different diameters and are coaxially installed up and down, and by adjusting their brightness, the distribution and intensity of the light are changed to provide multi-angle and multi-intensity illumination for the inductor to reduce the impact of shadows on image quality; the mounting frame is used to fix the industrial camera, the lens, the first annular light source and the second annular light source to ensure the relative position between them is stable, thereby ensuring the stability and accuracy of the entire visual system; The coaxial adjustable dual-light source vision system uses two annular light sources to illuminate the inductor from different angles. By adjusting the brightness of the two annular light sources respectively, the incident angle and intensity of the light can be changed, thereby achieving flexible control of the lighting conditions on the inductor surface. This multi-angle, adjustable lighting method can effectively reduce the shadow area, making the features of the inductor surface, especially the edges of the copper wire, more clearly presented, effectively solving the image shadow problem caused by uneven lighting, and making the edges of the copper wires in the collected inductor images clearer.

[0028] 202. Capture the image of the inductor through a coaxial adjustable dual light source visual system to obtain a red, green and blue image of the inductor; In this embodiment, after the coaxial adjustable dual-light source visual system is constructed and the brightness of the light source is adjusted, the industrial camera begins to observe the inductor in real time. When the image of the inductor meets the set standard, the industrial camera automatically triggers the image acquisition function to take red, green and blue images of the inductor; the red, green and blue images contain information about the inductor in the three color channels of red, green and blue, which can comprehensively reflect the appearance characteristics of the inductor and provide rich data for subsequent image processing and analysis.

[0029] 203. Perform data preprocessing on the inductor red, green and blue images to obtain a basic image; In this embodiment, data preprocessing mainly includes operations such as denoising, normalization and image enhancement. The denoising operation removes noise interference in the image through a filtering algorithm to improve the clarity of the image. The normalization operation adjusts the pixel value of the image to a uniform range, so that different images are comparable and reduces image differences caused by factors such as light intensity. The image enhancement operation expands the diversity of the data set through methods such as flipping, translation, scaling, rotation, brightness adjustment, contrast adjustment, and saturation adjustment. By preprocessing the inductor red, green and blue images, the noise in the images can be effectively removed, the pixel range of the images can be unified, and the diversity of the data set can be expanded; a basic image with higher image quality and richer features can be obtained, thereby improving the accuracy and reliability of defect detection.

[0030] See also Figure 3 , three embodiments of the defect detection and rating method in the embodiment of the present invention include: 301. Preliminarily classify the basic image to obtain an unqualified inductance image; In this embodiment, the preliminary classification is to judge the basic image based on the preset standard, and the inductor samples are divided into OK (qualified inductor image) and NG (unqualified inductor image); the inductor is divided into a first magnetic core (inner magnetic core, generally an I-shaped magnetic core), a second magnetic core (outer magnetic core, generally a ring-shaped magnetic core) arranged outside the first magnetic core, and a copper coil wound on the first magnetic core; if the wire material of the copper coil in the inductor image visually exceeds the wire diameter of the first magnetic core by one wire, or touches the second magnetic core (regardless of whether it exceeds the wire diameter by one wire), the inductor image can be judged as an unqualified inductor image; the rest are qualified inductor images; in the subsequent model test, the missed detection rate and the false positive rate can be evaluated based on the OK image and the NG image tested; By preliminarily classifying the basic images, the inductor images that may have defects (unqualified inductor images) can be quickly screened out, and the parts that need to be focused on can be quickly located, thereby improving the efficiency of detection.

[0031] 302. Annotate the connected regions of the unqualified inductor image to obtain an annotated image; In this embodiment, connected region labeling is an image processing technology used to identify a set of interconnected pixels in an image and assign a unique label to each connected region. In an unqualified inductor image, different objects or regions such as copper wires and magnetic cores can be distinguished by analyzing the connectivity between pixels. For example, for a copper wire region, its pixels are usually interconnected. A labeling tool is used to perform pixel-level labeling on the copper wire contour and mark the connected pixels as a whole. This provides a more accurate basis for subsequent region of interest (ROI) extraction. At the same time, in order to address the problem of copper wire crossing that makes it difficult to distinguish when using traditional algorithms for detection, estimated line segments are added during annotation to connect closed areas into connected domains, ensuring that each sample is accurately labeled.

[0032] 303. Build a semantic segmentation network; In this embodiment, a U-Net architecture is used to construct a semantic segmentation network; and the semantic segmentation network is trained using partially annotated images so that it can learn the connected domain features of the copper wire.

[0033] 304. Extracting the region of interest from the annotated image using a language segmentation network to obtain a coil contour region; In this embodiment, after training, the semantic segmentation network can classify each pixel in the labeled image, filter out pixels belonging to the coil (copper wire) by analyzing the category label of each pixel, and connect them to form a complete area, namely the coil contour area; thereby more accurately analyzing the shape, position and other features of the coil, and determining whether the inductor has defects.

[0034] See also Figure 4 , four embodiments of the defect detection and rating method in the embodiments of the present invention include: 401. Build the basic network framework; In this embodiment, the basic framework of the semantic segmentation network adopts the U-Net (encoder-decoder) structure; the encoder is composed of multiple convolutional layers and pooling layers, and extracts image features through convolution operations. The pooling operation reduces the size of the feature map, reduces the amount of calculation, and increases the receptive field, allowing the network to learn more advanced features; the decoder restores the feature map to the size of the original image through upsampling layers and convolution layers to achieve pixel-level classification; the basic network framework provides a stable structural foundation for subsequent improvements and optimizations, so that the network can perform preliminary feature extraction and processing on the input image.

[0035] 402. Embed the coordinate attention module into the basic network framework to obtain a first improved network; In this embodiment, a coordinate attention module is embedded after each downsampling block of the encoder in the U-Net architecture; the core idea of ​​the coordinate attention module is to encode the horizontal and vertical position information into the channel attention, and then perform horizontal and vertical global pooling on the feature map to generate position-sensitive channel attention weights, and finally multiply the weights by the original features element by element to enhance the global position perception capability; Specifically, for the scenario of copper wire cross-region fracture, the coordinate attention module can encode global position information and connect the blocked copper wires; for the scenario of uneven color caused by reflection, the coordinate attention module can highlight the copper wire area by increasing channel attention; for the scenario of copper wire thickness diversity, the coordinate attention module can use its position perception to enhance the overall contour integrity of the copper wire; in addition, because the additional computation introduced by the coordinate attention module is relatively small, it will not have much impact on the operation efficiency of the network, and is suitable for industrial real-time detection; By adding a coordinate attention module, the first improved network has increased position perception capabilities compared to the basic network framework.

[0036] 403. Replace the standard convolution of the first improved network with the selective convolution kernel to obtain a second improved network; In this embodiment, part of the standard convolution in the convolution layer of the encoder and decoder of the first improved network is replaced by a selective convolution kernel (SKConv), and the selective convolution kernel processes the feature map in parallel through multiple convolution kernels of different sizes (such as 3×3, 5×5, etc.); each selective convolution kernel has a different receptive field and can capture feature information of different scales; when processing the feature map, the selective convolution kernel dynamically adjusts the weight of each convolution kernel according to the input features, and then fuses the outputs of different convolution kernels to obtain the final feature representation; in this way, the network can adaptively select the appropriate receptive field to process targets of different scales, enhance the perception of multi-scale features, thereby realizing multi-scale adaptation of copper wires and increasing the perception of changes in copper wire thickness; Specifically, for the scenario where the copper wires are broken at the intersection, the selective convolution kernel can use its multi-scale receptive field to capture the details of the intersection of the copper wires, thereby identifying the broken copper wire area; for the scenario where the reflection causes uneven color, the selective convolution kernel can dynamically adjust the receptive field to adapt to the grayscale changes in the reflective area of ​​the copper wire; for the scenario where the copper wires are diverse in thickness, the selective convolution kernel can use its multi-branch fusion characteristics to adapt to the characteristics of different wire diameters; By replacing the selective convolution kernel, the second improved network has increased the multi-scale feature capture capability compared to the first improved network.

[0037] 404. Training the second improved network to obtain a semantic segmentation network; In this embodiment, the labeled inductor image data set (including a large number of inductor images and their corresponding real labeling results) is used as the training set of the second improved network to train the second improved network; during the training process, the input image is input into the second improved network, and the network outputs the segmentation result of the image; then, the output result of the network is compared with the real labeling result, and the difference between the two is calculated using a loss function; the loss function usually selects a cross entropy loss function; then, an optimizer is used to update the parameters of the network according to the gradient of the loss function, so that the value of the loss function gradually decreases; through multiple iterative training, the network continuously adjusts the parameters and learns the characteristics of different objects and defects in the inductor image, thereby improving the segmentation ability of the inductor image, and can accurately identify copper wires, magnetic cores and various defect areas in practical applications.

[0038] See also Figure 5 , five embodiments of the defect detection and rating method in the embodiments of the present invention include: 501. Perform morphological processing on the coil contour area to obtain a repair area; In this embodiment, the processing of the coil contour area is divided into three processing steps, the first level of which is morphological processing to repair the holes and broken areas generated when the coil is segmented and smooth the edges of the copper wires. Specifically, an open operation is first used to eliminate isolated noise points and disconnect small adhesions, and then a closed operation is used to fill small holes inside the copper wires and connect the broken copper wires. The preliminary repair of the coil contour area is completed through morphological operations, providing a more complete foundation for subsequent area growth.

[0039] 502. Performing region growing processing on the repaired region to obtain a connected region; In this embodiment, the second level of processing of the coil contour area is region growing processing, the purpose of which is to solve the problem of breakage of crossed copper wires due to reflection, avoid regional fragmentation caused by uneven lighting or reflection, and ensure the connectivity of the segmented area; specifically, first calculate the zero-order moment (area) and first-order moment (center of mass) of the repair area, and take the center of mass as the seed point; then, according to the region growth criteria (such as grayscale difference and color difference), search and gradually expand the area through 4 neighborhoods or 8 neighborhoods (selected based on the copper wire density), and stop growing when no neighborhood point that meets the conditions can be found or the preset number of iterations is reached, and the region growing processing is completed.

[0040] 503. Performing region screening processing on the connected region to obtain a feature region; In this embodiment, the third level of processing of the coil contour area is the area screening processing, the purpose of which is to filter noise, screen out false areas with too small areas, and retain the real copper wire area; specifically, it calculates the area of ​​the coil contour by performing zero-order moment calculation on the connected area, and then screens out the area that meets the requirements according to its area size, that is, the feature area; It should be noted that the morphological processing provides a more complete repair area for the region growing processing, reducing the seed point selection bias caused by holes; the region growing repairs the residual breaks after the morphological processing by connectivity expansion, generating a connected area with a continuous copper wire contour; the region screening processing eliminates noise based on the area, filters the connected areas that do not meet the area requirements, and finally obtains the feature area; these three steps form a closed loop of "repair, connectivity, and screening", which jointly ensure the integrity and accuracy of the copper wire segmentation and provide a reliable basis for the subsequent core distance calculation.

[0041] See also Figure 6 , six embodiments of the defect detection and rating method in the embodiments of the present invention include: 601. Perform edge detection on the magnetic core using a circle fitting algorithm to obtain the center coordinates of the first magnetic core and the center coordinates of the second magnetic core; In this embodiment, the circle fitting algorithm (such as Hough circle transform) determines the edge of the magnetic core and calculates its center coordinates by detecting the circular features of the closed contour in the image. First, edge detection (such as Canny edge detection) is performed on the feature area to extract the contour line of the magnetic core; then the circumscribed circle of the magnetic core is fitted by the circle fitting algorithm, so as to obtain the center coordinates of the first magnetic core (inner magnetic core) and the second magnetic core (outer magnetic core), that is, the first magnetic core coordinates and the second magnetic core coordinates; The first magnetic core coordinate and the second magnetic core coordinate are used to determine the distance between the edge point of the copper wire and the center point of the magnetic core, and the positioning of the magnetic core center and the edge of the copper wire is completed by mathematical methods, thereby solving the problem of large errors in traditional manual positioning methods and improving the accuracy of defect judgment.

[0042] 602. Calculate the distance between the edge point of the feature area and the center coordinate of the first magnetic core to obtain first distance data; In this embodiment, based on the coordinates of the center of the first magnetic core obtained in step 601, all edge points of the feature area are traversed, the Euclidean distance from each edge point to the center of the first magnetic core is calculated, and all distance values ​​are stored as first distance data; By quantifying the distance between the edge point of the copper wire and the first magnetic core (inner magnetic core), data support is provided for judging whether the copper wire exceeds the first magnetic core by more than one wire diameter, thus solving the problem of strong subjectivity in manual measurement and improving the objectivity of detection.

[0043] 603. Calculate the distance between the edge point of the feature area and the center coordinate of the second magnetic core to obtain second distance data; In this embodiment, based on the coordinates of the center of the second magnetic core obtained in step 601, the edge points of the feature area are traversed, the Euclidean distance from each edge point to the center of the second magnetic core is calculated, and all distance values ​​are stored as second distance data; By quantifying the distance between the edge point and the second magnetic core (outer magnetic core), data support is provided for judging whether the copper wire touches the second magnetic core, which solves the problem of ambiguous contact judgment under complex winding postures and improves the sensitivity of defect detection.

[0044] 604. Integrate the first distance data and the second distance data to obtain magnetic core distance data; In this embodiment, the first distance data and the second distance data correspond to the judgment basis under two situations (the first magnetic core and the second magnetic core); the two data are integrated to form a unified defect judgment basis, which solves the one-sidedness of a single distance indicator, provides more comprehensive feature input for subsequent neural network rating, and improves the reliability of defect grade assessment.

[0045] See also Figure 7 , the seven embodiments of the defect detection and rating method in the embodiments of the present invention include: 701. Pre-score the inductance according to a preset scoring threshold to obtain comparison data; In this embodiment, a plurality of groups of inductor samples are first prepared, and then the distance thresholds of qualified, unqualified and limit samples are preset according to the wire diameter size, magnetic core parameters and production standards; a plurality of experimenters are arranged to score the degree of defect obviousness of the inductor samples under the same lighting and observation conditions (e.g., 1-5 points, 5 points for the most obvious defects, 1 point for the least defects), and finally reasonable scoring data are screened out through voting rules (e.g., taking the median or mode) to form a control data set, i.e., the control data; the scoring threshold defines the mapping relationship between the defect level and the score, which serves as the benchmark data to provide a true and reliable label for the neural network training.

[0046] 702. Construct defect level quantification neural network; In this embodiment, a multi-layer perceptron (MLP) is used to construct a neural network, and the network structure has 5 layers, including an input layer, 4 hidden layers and 1 output layer; the activation function selects the ReLU activation (Rectified Linear Unit) function, the optimizer selects the Adam optimizer, the loss function selects the L1 loss function, and the learning rate is set to 0.001; the input layer is used to receive the core distance data and the control data; the hidden layer extracts nonlinear features through the ReLU activation function, and the dimensions are 512, 256, 128 and 64 respectively; the output layer outputs 5 levels of probability values.

[0047] 703. Input the core distance data and the control data into the defect grade quantification neural network for defect grade to obtain a grade result; In this embodiment, the mapping relationship between the neural network fitting algorithm distance (core distance data) and the manual score (control data) is used to achieve automatic quantification of defect levels, which solves the problem of traditional methods relying on manual experience and improves rating efficiency and consistency.

[0048] The defect detection and rating method in the embodiment of the present invention is described above. The defect detection and rating device in the embodiment of the present invention is described below. Figure 8 , an embodiment of the defect detection and rating device in the embodiment of the present invention includes: The acquisition module 801 is used to acquire an image of the inductor to obtain a basic image; The segmentation module 802 is used to construct a semantic segmentation network and use the semantic segmentation network to extract regions from the basic image to obtain coil contour regions; The optimization module 803 is used to perform image processing and region screening on the coil contour region to obtain a feature region; A calculation module 804 is used to extract the core center coordinates and calculate the distance between the edge points of the feature area and the core center coordinates to obtain core distance data; The rating module 805 is used to construct a defect level quantification neural network, and use the defect level quantification neural network to rate the core distance data to obtain a rating result; In this embodiment, the acquisition module 801 first acquires the inductor image data, and then the segmentation module 802 accurately extracts the coil contour area to achieve effective separation of the copper wire and the magnetic core on the inductor; the optimization module 803 uses a variety of image processing algorithms to deeply optimize the extracted coil contour area and screen out more accurate feature areas; the calculation module 804 accurately calculates the magnetic core distance used to judge defects based on the screened feature areas; finally, the magnetic core distance is input into the rating module 805 to complete the defect rating; the present invention comprehensively uses a variety of image processing technologies and neural networks to comprehensively optimize the process and precision of defect detection, and significantly improves the accuracy and efficiency of detection.

[0049] Fig. 9 9 is a schematic diagram of the structure of a defect detection and rating device provided by an embodiment of the present invention. The defect detection and rating device 900 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 910 (for example, one or more processors) and a memory 920, and one or more storage media 930 (for example, one or more mass storage devices) storing application programs 933 or data 932. Among them, the memory 920 and the storage medium 930 can be temporary storage or permanent storage. The program stored in the storage medium 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the defect detection and rating device 900. Furthermore, the processor 910 may be configured to communicate with the storage medium 930, and execute a series of instruction operations in the storage medium 930 on the defect detection and rating device 900 to implement the steps of the defect detection and rating method provided by the above-mentioned method embodiments.

[0050] The defect detection and rating device 900 may also include one or more power supplies 940, one or more wired or wireless network interfaces 950, one or more input and output interfaces 960, and / or one or more operating systems 931, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Fig. 9 The defect detection and grading device structure shown does not constitute a limitation of the defect detection and grading device, and may include more or less components than shown, or combine certain components, or arrange the components differently.

[0051] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer executes the steps of the defect detection and rating method.

[0052] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device or device or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0053] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0054] Finally, it should be noted that the above description is only a preferred example of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A defect detection and rating method, characterized in that: include: Capturing images of the inductor to obtain a basic image; Construct a semantic segmentation network and use it to extract regions from the basic image to obtain the coil contour region; Perform image processing and region screening on the coil contour area to obtain a feature area; Extract the core center coordinates, and calculate the distance between the edge points of the feature area and the core center coordinates to obtain the core distance data; A defect grade quantification neural network is constructed, and the core distance data is graded using the defect grade quantification neural network to obtain a rating result.

2. The defect detection and rating method according to claim 1, characterized in that: The step of collecting an image of the inductor to obtain a basic image includes: Construct a coaxial adjustable dual light source vision system; The image of the inductor is collected through a coaxial adjustable dual light source vision system to obtain the red, green and blue images of the inductor; Data preprocessing is performed on the inductor red, green and blue images to obtain the basic image.

3. The defect detection and rating method according to claim 1, characterized in that: The step of constructing a semantic segmentation network and using the semantic segmentation network to extract regions from the basic image to obtain coil contour regions includes: Performing preliminary classification on the basic image to obtain the unqualified inductance image; Annotating the connected regions of the unqualified inductance image to obtain an annotated image; Build a semantic segmentation network; The language segmentation network is used to extract the region of interest from the annotated image to obtain the coil contour area.

4. The defect detection and rating method according to claim 3, characterized in that: The constructing of the semantic segmentation network includes: Build the basic network framework; Embed the coordinate attention module into the basic network framework to obtain the first improved network; The standard convolution of the first improved network is replaced by the selective convolution kernel to obtain the second improved network; The second improved network is trained to obtain a semantic segmentation network.

5. The defect detection and rating method according to claim 1, characterized in that: The image processing and region screening of the coil contour region to obtain a feature region includes: Performing morphological processing on the coil contour area to obtain the repair area; Performing region growing processing on the patched area to obtain a connected area; The connected regions are screened to obtain feature regions.

6. The defect detection and rating method according to claim 1, characterized in that: The extracting the core center coordinates and calculating the distance between the edge points of the feature area and the core center coordinates to obtain the core distance data includes: Perform edge detection on the magnetic core using a circle fitting algorithm to obtain the center coordinates of the first magnetic core and the center coordinates of the second magnetic core; Calculating the distance between the edge point of the feature area and the center coordinate of the first magnetic core to obtain first distance data; Calculating the distance between the edge point of the feature area and the center coordinate of the second magnetic core to obtain second distance data; The first distance data and the second distance data are integrated to obtain magnetic core distance data.

7. The defect detection and rating method according to claim 1, characterized in that: The step of constructing a defect level quantization neural network and using the defect level quantization neural network to rate the magnetic core distance data to obtain a rating result includes: Pre-scoring the inductance according to a preset scoring threshold to obtain control data; Construct defect grade quantification neural network; The core distance data and the control data are input into the defect grade quantification neural network for defect grade to obtain the grade result.

8. A defect detection and rating device, characterized in that: include: An acquisition module, used for acquiring images of the inductor to obtain a basic image; A segmentation module is used to construct a semantic segmentation network and use the semantic segmentation network to extract regions from the basic image to obtain the coil contour region; An optimization module is used to perform image processing and region screening on the coil contour area to obtain a feature area; A calculation module is used to extract the core center coordinates and calculate the distance between the edge points of the feature area and the core center coordinates to obtain the core distance data; The rating module is used to construct a defect grade quantification neural network, and use the defect grade quantification neural network to rate the core distance data to obtain a rating result.

9. A defect detection and grading device, characterized in that The defect detection and rating device includes: a memory and at least one processor, wherein the memory stores instructions; At least one of the processors calls the instructions in the memory to enable the defect detection and grading device to perform the various steps of the defect detection and grading method according to any one of claims 1 to 7.

10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by a processor, the various steps of the defect detection and rating method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Magnetic core defect detection system and method based on deep learning

    CN114549493A

  • Neural network training method, related method, device, terminal and storage medium

    CN115035032A

  • Image processing method and terminal equipment

    CN115294150A

  • Edge detection method, defect detection method and detection device

    CN115861351A

  • Method, system and equipment applied to tablet defect detection and storage medium

    CN119049021A

Cited By

  • Mud-water boundary detection method and device, computer equipment and storage medium

    CN121190513A