Artificial intelligence assisted neodymium-iron-boron magnet defect detection system

By employing multi-scale texture-aware feature extraction and adaptive model generation and selection mechanisms, the problems of texture interference and model adaptation in NdFeB magnet detection are solved, achieving low false detection rate and high-efficiency defect detection, thus improving the robustness and versatility of the system.

CN121120585APending Publication Date: 2025-12-12GANZHOU LANXUAN TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511287126.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing technologies fail to effectively distinguish between surface textures and minute defects in NdFeB magnet defect detection, resulting in a high false detection rate. Furthermore, fixed recognition models cannot adapt to different process and specification detection scenarios, requiring frequent manual parameter adjustments, which limits the system's generalization ability and deployment efficiency.

Method used

By employing multi-scale texture-aware feature extraction technology and an adaptive model generation and selection mechanism, texture-enhanced features are extracted through a deep convolutional neural network, and the defect detection model is dynamically adjusted in conjunction with real-time process parameters to achieve robust adaptation to magnets of different processes.

Benefits of technology

It significantly reduced the false detection rate to below 2%, improved the robustness and versatility of the detection system, achieved a high degree of automation and intelligence in the detection of defects in NdFeB magnets, and improved the detection efficiency and product quality consistency of the production line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120585A_ABST
    Figure CN121120585A_ABST
Patent Text Reader

Abstract

The invention relates to the field of artificial intelligence, and discloses an artificial intelligence assisted neodymium-iron-boron magnet defect detection system which comprises the following steps: acquiring a magnet image and preprocessing process parameters; extracting texture enhancement features through multi-scale texture perception; adaptively generating or adjusting a defect detection model based on the process parameters; and carrying out defect classification positioning, discrimination and optimization. The system comprises an image acquisition module, a process parameter acquisition module, an image preprocessing module, a multi-scale texture perception feature extraction module, an adaptive model generation and selection module, a defect detection module, a discrimination output module and a model optimization module. Defects and background textures can be effectively distinguished, the false detection rate is greatly reduced, the robustness, universality, detection precision and stability of the system are improved, automation and intelligence are achieved, and efficiency and quality consistency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of artificial intelligence, and particularly relates to a system for detecting defects in neodymium iron boron magnets with the aid of artificial intelligence. BACKGROUND

[0002] In the field of modern industrial manufacturing, with the continuous improvement of automation and intelligence, the importance of product quality control is increasingly prominent, especially in the non-destructive testing of key components. High-performance materials such as neodymium iron boron magnets are widely used in new energy vehicles, wind power, electronic information and other high-tech fields due to their excellent magnetic properties. The presence of surface defects will seriously affect the functionality, reliability and service life of the product. Therefore, efficient and accurate defect detection of neodymium iron boron magnets has become an indispensable part of the production process.

[0003] Among them, the defect detection technology based on machine vision and artificial intelligence, with its non-contact, high speed and strong objectivity, is gradually replacing traditional manual detection and becoming the core means of neodymium iron boron magnet quality inspection. This technology collects magnet surface images and uses image processing algorithms or deep learning models to identify and classify potential defects, aiming to achieve automated discrimination of cracks, scratches, pores, inclusions and other surface abnormalities.

[0004] In the prior art, although various image recognition and machine learning methods have been widely used to assist in defect detection of neodymium iron boron magnets, these methods generally have technical bottlenecks. Traditional image recognition techniques often fail to fully consider the complex and diverse surface texture characteristics of neodymium iron boron magnets due to their special manufacturing process. These textures themselves are easily confused with small defect features, resulting in a high false detection rate during the identification process, for example, the false detection rate often exceeds 10%.

[0005] In addition, due to the differences in surface texture of neodymium iron boron magnets of different batches, different specifications and even different pressing processes, existing detection systems often use fixed or preset recognition models and parameters, lacking the ability to adapt to these changes in scene. When the model faces new processes or new specifications of products, a large amount of manpower is needed for frequent model adjustment and parameter optimization, greatly restricting the generalization ability and deployment efficiency of the detection system. These problems seriously restrict the practical application effect of the artificial intelligence assisted defect detection system in the production of neodymium iron boron magnets, and an effective solution is needed to effectively distinguish between texture and defects and adapt to changing detection scenarios. SUMMARY

[0006] To address the issues of traditional image recognition technologies failing to consider the texture differences on the surface of NdFeB magnets, which can interfere with defect identification, and the technical bottlenecks of fixed recognition models requiring frequent manual parameter adjustments to adapt to different magnet manufacturing processes, this invention provides an AI-assisted NdFeB magnet defect detection system. This system effectively distinguishes defects from background textures through multi-scale texture-aware feature extraction technology and introduces an adaptive model generation and selection mechanism. This enables the defect detection model to robustly adapt to magnets manufactured using different processes, thereby significantly reducing the false detection rate and improving the system's versatility.

[0007] According to one aspect of the present invention, an artificial intelligence-assisted method for detecting defects in neodymium iron boron magnets is provided, comprising the following steps:

[0008] Acquire optical image data of the neodymium iron boron magnet to be tested;

[0009] Obtain process parameter data related to the manufacturing batch of the NdFeB magnet to be tested;

[0010] The optical image data is preprocessed to eliminate image noise and enhance defect features;

[0011] The preprocessed optical image data is subjected to depth feature extraction by a multi-scale texture-aware feature extraction module to generate texture-enhanced feature representations.

[0012] Based on the process parameter data, the defect detection model is dynamically determined or adjusted through the adaptive model generation and selection module.

[0013] The texture-enhanced feature representation is input into the defect detection model to perform defect classification and localization, and the defect detection result is output.

[0014] Based on the defect detection results, a pass / fail determination is made;

[0015] Furthermore, the defect detection results are used to update and optimize the defect detection model in the adaptive model generation and selection module.

[0016] As one embodiment of the present invention, the acquisition of optical image data of the neodymium iron boron magnet to be detected specifically includes:

[0017] The surface image of the neodymium iron boron magnet to be tested is captured by an image acquisition device, which includes an industrial camera, a telecentric lens, and a ring light source. The industrial camera has high resolution, the telecentric lens is used to eliminate parallax, and the ring light source is used to provide uniform and shadowless illumination.

[0018] As one embodiment of the present invention, the acquisition of process parameter data related to the manufacturing batch of the NdFeB magnet to be tested specifically includes:

[0019] The parameters of the neodymium iron boron magnet, such as sintering temperature, pressing pressure, surface treatment type, and chemical composition ratio, are read in real time from the manufacturing execution system database or the production line programmable logic controller.

[0020] As one embodiment of the present invention, the preprocessing of the optical image data specifically includes:

[0021] The optical image data is subjected to Gaussian filtering to reduce random noise;

[0022] Histogram equalization is performed on the optical image data to enhance image contrast;

[0023] The optical image data is segmented using a region growing algorithm to accurately extract the effective detection area of ​​the neodymium iron boron magnet.

[0024] As one embodiment of the present invention, the step of extracting depth features from the preprocessed optical image data through a multi-scale texture-aware feature extraction module to generate a texture-enhanced feature representation specifically includes:

[0025] The deep convolutional neural network structure includes multiple parallel multi-scale convolutional kernel groups, each consisting of convolutional kernels of different sizes. The convolutional kernels of different sizes perform convolution operations on the preprocessed optical image data to capture texture features at different scales.

[0026] The output feature map of the multi-scale convolution operation is fused, and the importance of different feature channels is weighted through a self-attention mechanism to generate the texture-enhanced feature representation.

[0027] As one embodiment of the present invention, the deep convolutional neural network structure specifically adopts an architecture based on residual networks or variants of U-shaped networks.

[0028] As one embodiment of the present invention, the kernel sizes in the multi-scale convolution kernel group include 3×3, 5×5 and 7×7.

[0029] As one embodiment of the present invention, the step of dynamically determining or adjusting the defect detection model based on the process parameter data through the adaptive model generation and selection module specifically includes:

[0030] The process parameter data is input into the process parameter encoder to generate a low-dimensional process parameter vector.

[0031] The low-dimensional process parameter vector is input into the decision network, and the decision network outputs the optimal detection model index or model parameter fine-tuning strategy in the preset detection model library based on the low-dimensional process parameter vector.

[0032] Based on the optimal detection model index or model parameter fine-tuning strategy, a corresponding defect detection model is selected from the preset detection model library, or the parameters of the basic defect detection model are fine-tuned to generate the defect detection model.

[0033] As one embodiment of the present invention, the preset detection model library contains pre-trained defect detection models for different sintering temperature ranges, different pressing pressure levels, or different surface treatment types.

[0034] In one embodiment of the present invention, the decision network specifically adopts a multilayer perceptron or a shallow neural network structure.

[0035] As one embodiment of the present invention, the parameter fine-tuning of the basic defect detection model specifically adopts the model-agnostic meta-learning framework in the meta-learning algorithm.

[0036] As one embodiment of the present invention, the step of inputting the texture-enhanced feature representation into the defect detection model for defect classification and localization, and outputting the defect detection result specifically includes:

[0037] The defect detection model includes a pixel-level defect segmentation branch and a defect type classification branch;

[0038] The pixel-level defect segmentation branch performs semantic segmentation on the texture-enhanced feature representation and outputs a pixel mask of the defect region;

[0039] The defect type classification branch performs defect type discrimination on the texture-enhanced feature representation and outputs the defect category label and confidence score;

[0040] The defect detection results include the defect's pixel mask, defect category label, defect confidence score, and defect geometric parameters, including the defect's area, perimeter, and maximum length.

[0041] As one embodiment of the present invention, the defect types identified by the defect classification branch include cracks, holes, scratches and chipped corners.

[0042] As one embodiment of the present invention, the step of determining conformity based on the defect detection results specifically includes:

[0043] Based on a preset defect discrimination threshold set, the defect geometric parameters, defect type, and confidence score in the defect detection results are compared.

[0044] If the area, perimeter, or maximum length of the defect exceeds a preset threshold, or if a specific type of defect exists and the confidence score is higher than the preset threshold, the product is judged as unqualified; otherwise, it is judged as qualified.

[0045] As one embodiment of the present invention, the step of using the defect detection results to update and optimize the defect detection model in the adaptive model generation and selection module specifically includes:

[0046] The manually corrected defect detection results are used as incremental training data to perform incremental training on the preset detection model or basic defect detection model in the adaptive model generation and selection module.

[0047] The incremental training employs a transfer learning strategy to avoid model forgetting and improve the model's generalization ability.

[0048] According to another aspect of the present invention, an artificial intelligence-assisted neodymium iron boron magnet defect detection system is provided, comprising:

[0049] The image acquisition module is used to acquire optical image data of the neodymium iron boron magnet to be tested;

[0050] The process parameter acquisition module is used to acquire process parameter data related to the manufacturing batch of the neodymium iron boron magnet to be tested.

[0051] An image preprocessing module is used to preprocess the optical image data to eliminate image noise and enhance defect features;

[0052] A multi-scale texture-aware feature extraction module is used to extract depth features from the preprocessed optical image data and generate texture-enhanced feature representations.

[0053] An adaptive model generation and selection module is used to dynamically determine or adjust the defect detection model based on the process parameter data.

[0054] The defect detection module is used to input the texture-enhanced feature representation into the defect detection model, perform defect classification and localization, and output defect detection results;

[0055] The discrimination output module is used to perform a pass / fail judgment based on the defect detection results and output the judgment results;

[0056] The model optimization module is used to update and optimize the defect detection model in the adaptive model generation and selection module by using the defect detection results.

[0057] In one embodiment of the present invention, the image acquisition module includes:

[0058] An industrial camera is used to capture surface images of the neodymium iron boron magnet to be inspected, the industrial camera having an image resolution of 2.5 million pixels and a pixel size of 3.45 micrometers;

[0059] A telecentric lens, optically connected to the industrial camera, is used to eliminate parallax. The telecentric lens has a magnification of 0.5x and a working distance of 150 mm.

[0060] A ring light source is used to provide uniform, shadowless illumination, and the light intensity uniformity of the ring light source is higher than 95%.

[0061] A precision displacement platform is used to precisely adjust the relative position between the industrial camera and the neodymium iron boron magnet to be tested. The precision displacement platform has a repeatability accuracy of 0.5 micrometers.

[0062] The image acquisition module also includes an image acquisition card, which is used to transmit the image data captured by the industrial camera to the image preprocessing module. The image acquisition card adopts a CameraLink interface and the data transmission rate is 10 gigabits per second.

[0063] In one embodiment of the present invention, the process parameter acquisition module includes:

[0064] A manufacturing execution system interface is used to obtain the process parameter data from a manufacturing execution system database;

[0065] The sensor integration module is used to read physical quantities such as sintering temperature and pressing pressure on the production line in real time. The sensor integration module includes a 1000PT resistance temperature sensor and a pressure sensor with a range of 0-100 MPa.

[0066] A data bus is used to transmit the physical quantities read by the sensor integration module to the process parameter acquisition module. The data bus adopts the EtherCAT protocol.

[0067] The process parameter acquisition module is equipped with data acquisition agent software, which is used to periodically read and standardize process parameter data from the manufacturing execution system interface and the data bus.

[0068] In one embodiment of the present invention, the image preprocessing module is configured with an image processor, on which the following operations are performed:

[0069] A Gaussian filtering algorithm is used to reduce random noise in the optical image data;

[0070] Histogram equalization algorithm is used to enhance the contrast of the optical image data;

[0071] A region growing segmentation algorithm is used to accurately extract the effective detection area of ​​the neodymium iron boron magnet.

[0072] In one embodiment of the present invention, the multi-scale texture-aware feature extraction module includes:

[0073] A deep convolutional neural network processor, wherein the processor is configured with:

[0074] Multiple parallel multi-scale convolutional layers, each containing convolutional kernels of different sizes, including 3×3, 5×5 and 7×7, perform convolution operations on the preprocessed optical image data to capture texture features at different scales;

[0075] A feature fusion layer is used to fuse the output feature maps of the multi-scale convolutional layers;

[0076] A self-attention mechanism layer is used to weight the output feature map of the feature fusion layer to enhance important features and generate the texture-enhanced feature representation.

[0077] The architecture of the deep convolutional neural network processor specifically adopts an architecture based on residual networks or variants of U-shaped networks.

[0078] As one embodiment of the present invention, the adaptive model generation and selection module includes:

[0079] A process parameter encoder is used to convert the process parameter data into a low-dimensional process parameter vector. The process parameter encoder adopts a single-layer fully connected network structure.

[0080] The decision network is used to output the optimal detection model index or model parameter fine-tuning strategy in the preset detection model library based on the low-dimensional process parameter vector. The decision network adopts a multilayer perceptron structure.

[0081] The model library management unit is used to store and manage the preset detection model library, which contains pre-trained defect detection models for different sintering temperature ranges, different pressing pressure levels, or different surface treatment types.

[0082] The model loading and tuning unit is used to load the corresponding defect detection model from the model library management unit according to the optimal detection model index, or to fine-tune the parameters of the basic defect detection model according to the model parameter fine-tuning strategy to generate the defect detection model.

[0083] The model loading and tuning unit uses an algorithm based on a model-agnostic meta-learning framework to perform model fine-tuning.

[0084] In one embodiment of the present invention, the defect detection module includes:

[0085] A pixel-level defect segmentation branch processor is used to perform semantic segmentation operations on the texture-enhanced feature representation and output the pixel mask of the defect region. The processor runs a semantic segmentation algorithm based on the DeeplabV3+ architecture.

[0086] A defect type classification branch processor is used to perform defect type discrimination on the texture-enhanced feature representation, output the defect category label and confidence score, and the processor runs a multi-task learning classification algorithm.

[0087] The defect detection module further includes a defect information extraction unit, which is used to extract the geometric parameters of the defect based on the pixel mask, category label and confidence score. The geometric parameters include the area, perimeter and maximum length of the defect.

[0088] In one embodiment of the present invention, the discrimination output module includes:

[0089] A rule base for judging defects, used to store a set of preset defect judgment thresholds;

[0090] The pass / fail judgment unit is used to compare the defect detection results according to the judgment rule library and judge whether the neodymium iron boron magnet to be tested is qualified;

[0091] The result output interface is used to transmit the pass / fail judgment result to the production line control system via an industrial Ethernet interface. The result output interface adopts the Modbus TCP / IP protocol.

[0092] The discrimination output module also includes a user interface for displaying detection results, defect images, and statistical reports in real time.

[0093] As one embodiment of the present invention, the model optimization module includes:

[0094] The manual annotation platform interface is used to receive manually corrected defect detection results as incremental training data;

[0095] The incremental training unit is used to incrementally train the preset detection model or basic defect detection model in the adaptive model generation and selection module using the incremental training data. The incremental training unit adopts a transfer learning strategy and performs model update verification periodically.

[0096] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0097] The AI-assisted NdFeB magnet defect detection system of this invention introduces multi-scale texture perception feature extraction technology. Utilizing multi-scale convolutional kernel groups and self-attention mechanisms in a deep convolutional neural network structure, it can effectively capture and distinguish the complex background textures and real defect features on the surface of NdFeB magnets, significantly reducing the false detection rate caused by texture interference. Traditional image recognition technologies typically struggle to effectively handle such texture differences, resulting in false detection rates exceeding 10%, while this invention can reduce the false detection rate to below 2%.

[0098] This invention utilizes an adaptive model generation and selection module to dynamically determine or adjust the defect detection model based on real-time acquired process parameter data. This mechanism overcomes the limitations of existing fixed recognition models that cannot adapt to different process magnet detection scenarios, solves the technical bottleneck of traditional methods requiring frequent manual parameter adjustments, and improves the robustness and versatility of the defect detection system.

[0099] This invention enables continuous learning and adaptive improvement of the model through a model optimization module. Through manual correction and incremental training, it ensures that the system can be continuously optimized as production processes change and new defect types emerge, thereby improving the long-term stability and detection accuracy of the system.

[0100] This invention integrates image acquisition, preprocessing, feature extraction, model adaptation, defect detection, and discrimination output into a closed-loop, intelligent detection system. It achieves a high degree of automation and intelligence in the defect detection process of NdFeB magnets, effectively improving the detection efficiency of the production line and the consistency of product quality. Attached Figure Description

[0101] Figure 1 This is a schematic diagram of the overall technical architecture of the artificial intelligence-assisted neodymium iron boron magnet defect detection system proposed in this invention;

[0102] Figure 2 This is a schematic diagram illustrating the core principle framework of the adaptive model generation and selection mechanism in this invention;

[0103] Figure 3 This is a flowchart illustrating the logical flow of the artificial intelligence-assisted neodymium iron boron magnet defect detection method proposed in this invention.

[0104] Figure 4 This is a schematic diagram of the core principle framework of the multi-scale texture perception feature extraction module in this invention;

[0105] Figure 5 This is a schematic diagram of the multi-level interaction relationships and data flow between the various functional modules in this invention; Detailed Implementation

[0106] In the following description, specific terminology and structures are used to illustrate embodiments of the invention for ease of understanding. However, these descriptions are not intended to limit the invention, and those skilled in the art will understand that various modifications and substitutions can be made without departing from the spirit and scope of the invention. The accompanying drawings are for illustrative purposes only, are not drawn to scale, and should not be construed as limiting the invention.

[0107] Please refer to Figures 1-5 The artificial intelligence-assisted defect detection method for neodymium iron boron magnets according to an embodiment of the present invention includes the following steps:

[0108] S101, acquire image data of the neodymium iron boron magnet to be tested.

[0109] This step is the starting point of the entire defect detection process, and its goal is to acquire high-quality, high-resolution images of the surface of the NdFeB magnet to be inspected. The quality of the image data directly affects the accuracy of subsequent feature extraction and defect identification. The image acquisition process includes several sub-steps:

[0110] 1. Imaging neodymium iron boron magnets transported on the production line using an industrial-grade high-resolution digital camera system. This camera system is typically equipped with custom-designed optical lenses to ensure detailed image capture and employs a high-speed image acquisition card for real-time data transmission.

[0111] 2. To eliminate the impact of ambient light fluctuations on image quality, a highly uniform ring light source or a multi-angle shadowless light source is used to illuminate the magnet surface, ensuring uniform image brightness and highlighting the contrast of potential defects. The illumination intensity and angle are carefully calibrated to minimize surface reflections and shadows while maximizing the distinguishability of defect features.

[0112] 3. Image acquisition parameters, such as exposure time, aperture size, gain, and white balance, are dynamically adjusted based on the surface gloss and color of the magnet, as well as the production line speed. These parameters are set to avoid overexposure or underexposure, ensuring the integrity of the image information. For example, for magnets with high gloss, it may be necessary to shorten the exposure time or reduce the light source intensity to avoid specular reflection; for magnets with darker surface colors, it may be necessary to appropriately increase the exposure time to capture more detail.

[0113] The acquired image data is stored as a raw pixel value matrix, along with metadata such as timestamps, magnet batch numbers, production line identifiers, and camera pose. This metadata is crucial for subsequent data traceability and model training. Image data is typically stored in a lossless compression format, such as PNG, to avoid introducing artifacts or information loss during data transmission or storage. Data transmission is completed via a high-speed Ethernet interface, transmitting the image data in real-time to a backend data processing server for further processing.

[0114] During image acquisition, the positioning accuracy of the magnet on the conveyor belt must also be considered. A visual positioning system is used to ensure that each shot covers the complete detection area of ​​the magnet, avoiding missed detections. If image acquisition fails, for example due to camera malfunction, magnet positioning deviation, or data transmission interruption, the system will trigger an abnormal alarm mechanism and record an error log, awaiting manual intervention or automatic retry.

[0115] S102, preprocess the acquired image data to standardize the data format and enhance features.

[0116] This step aims to standardize and optimize the raw image data, providing a stable, clear, and denoised input for subsequent feature extraction. Preprocessing includes a series of cascaded or parallel image processing operations:

[0117] 1. Perform grayscale conversion on the image. Although the original image may be in color format, since defects in NdFeB magnets typically manifest as anomalies in brightness or geometry rather than color changes, converting the image to grayscale can significantly reduce data dimensionality, improve processing efficiency, and retain all necessary defect information. Grayscale conversion can be achieved using a weighted average method.

[0118] 2. Perform image denoising. In industrial production environments, image acquisition is often affected by random noise, shot noise, or Gaussian noise. This invention employs a nonlocal mean denoising algorithm, which effectively removes noise by searching for similar image patches in the image and performing a weighted average, while preserving the edge and texture details of the image to the maximum extent, avoiding image blurring caused by traditional filters such as Gaussian blur.

[0119] 3. Perform geometric correction and registration of the images. Due to camera shake, changes in magnet attitude, or optical distortion, images may have slight geometric deformations. This invention uses a preset calibration plate to calibrate the camera's intrinsic and extrinsic parameters and applies affine or perspective transformations to correct the images, ensuring the consistency of defect locations within the images and facilitating subsequent unified analysis. For example, image alignment is achieved by detecting specific marker points or magnet contour feature points in the image and calculating the transformation matrix.

[0120] 4. Perform brightness and contrast adjustments. Due to subtle fluctuations in lighting conditions or differences in the reflectivity of magnet surfaces, the overall brightness and contrast of an image may be uneven. This invention employs adaptive histogram equalization technology, dividing the image into several small regions and independently performing histogram equalization on each region. This locally enhances image contrast, making defect features more prominent, while suppressing global brightness variations. For example, the contrast of darker areas in the image will be improved, making previously inconspicuous defects clearly visible.

[0121] 5. Perform image normalization. Scale the pixel values ​​of all preprocessed images to a uniform range, such as 0-1. This is crucial for training deep learning models, preventing features with excessively large pixel value ranges from dominating the learning process and accelerating model convergence. Finally, perform image size normalization. To accommodate the fixed input size requirements of deep learning models, all images will be scaled or cropped to a preset uniform resolution, such as 512×512 pixels. The scaling process uses bicubic interpolation to maintain image smoothness and detail. These preprocessing steps collectively ensure that the image data input to subsequent modules has consistent quality and format, minimizing external interference and improving the accuracy of defective features.

[0122] S103 utilizes a multi-scale texture-aware feature extraction module to extract features from the preprocessed image data to generate texture-aware feature vectors.

[0123] This step is the core of this invention in solving the texture interference problem, aiming to extract robust features from the preprocessed image that can distinguish real defects from background textures. Traditional feature extraction methods often struggle to effectively capture the inherent structure of the complex textures on the surface of NdFeB magnets, leading to high false detection rates. This invention employs a multi-scale texture-aware feature extraction module based on a deep convolutional neural network, and its working principle includes the following sub-steps.

[0124] 1. Input preprocessed images. These images have been standardized in size and brightness, and most of the noise has been removed.

[0125] 2. The image is fed into a multi-scale feature extraction network, which consists of multiple parallel or cascaded convolutional layers. Each convolutional layer group contains several convolutional kernels, batch normalization layers, and activation functions. The convolutional kernels extract features at different levels by scanning local regions of the image. To capture multi-scale texture information, the network includes dilated convolutional layers with kernels having different dilation rates, thereby expanding the receptive field and capturing a wider range of contextual information without increasing the number of parameters. For example, a convolutional kernel with a dilation rate of two has a receptive field equivalent to a larger ordinary convolutional kernel, but the computational cost remains the same. This network design allows shallow features to capture subtle local textures, while deep features can capture global structural information and more abstract defect semantics.

[0126] 3. Introducing a texture attention mechanism. A texture attention module is integrated into a specific layer of the network. This module analyzes the texture complexity of different regions in the feature map and assigns different weights to each region. It calculates the gradient information or local binary patterns of local regions to quantify the intensity and direction of the texture. For complex and uniform background regions, the attention weight is lower to suppress their influence on defect detection; while for regions with abrupt texture changes or anomalies, the attention weight is higher to highlight their potential defect features. This mechanism effectively guides the network to focus more on defective regions rather than background texture.

[0127] 4. Feature maps extracted at different scales and levels are fused using a Feature Pyramid Network (FPN) or a similar structure. The FPN combines high-level semantic information with low-level detailed information via top-down and bottom-up paths, generating a feature pyramid with rich semantics and precise localization capabilities. This ensures that defects of any size can be effectively captured at an appropriate feature scale.

[0128] 5. Through a global average pooling layer or flattening operation, the fused multi-scale feature map is converted into a fixed-length vector, namely a texture-aware feature vector. This vector integrates multi-scale texture and shape information related to defect recognition in the image, and effectively reduces the interference of background texture through an attention mechanism.

[0129] In the multi-scale texture-aware feature extraction module, convolution operations are performed on the input image data to extract features. Let the input image be... The convolution kernel is , bias is The output feature map is The convolution operation can then be represented as:

[0130] ;

[0131] in, and These are the coordinates of the output feature map. and These are the coordinates of the convolution kernel. It's the step length.

[0132] S104, Based on the texture-aware feature vector, the optimal defect detection model for the current image data is determined through an adaptive model generation and selection mechanism.

[0133] This step is crucial for solving the problem of poor model versatility in this invention. It aims to dynamically provide the most suitable defect detection model based on the specific characteristics of the NdFeB magnet to be inspected. Traditional fixed models are difficult to adapt to magnet inspections of different batches, processes, and even customer needs. The adaptive model generation and selection mechanism of this invention includes the following core sub-steps.

[0134] 1. Establish a model knowledge base. This knowledge base stores a large number of pre-trained defect detection models, each corresponding to a specific type, specific manufacturing process, or specific defect pattern of NdFeB magnets. In addition to parameter weights, each model also includes metadata information such as magnet feature labels during training, process parameter ranges, historical detection performance indicators such as accuracy, recall, false positive rate, and adaptability score.

[0135] 2. Obtain relevant contextual information about the magnet to be inspected. This includes the magnet's product model, production batch, production line identification, manufacturing process parameters, and user-defined inspection priorities or specific defect types of concern from the Manufacturing Execution System (MES). This contextual information can be obtained through sensor acquisition or querying from the MES database. For example, laser-engraved QR codes or RFID tags can be used to automatically identify magnet batches and models.

[0136] 3. Model matching and evaluation. The currently acquired magnet context information is compared with the metadata of each model in the model knowledge base. This invention employs a multi-attribute matching algorithm, comprehensively considering model matching degree, process parameter similarity, and historical performance indicators. Pre-trained models that highly match the current magnet characteristics will receive higher matching scores. Furthermore, the system weights the model's adaptability score based on the current detection priority, such as fast detection or high-precision detection. For example, if the current task requires high accuracy, models with high historical recall rates will be prioritized, even if their speed is slightly slower.

[0137] 4. Dynamic Model Selection. Based on the matching score and adaptability score, the system selects the pre-trained model with the highest score from the model knowledge base as an initial candidate. If multiple candidate models have similar scores, the system may further conduct small-scale online testing or ensemble learning to determine the final optimal model.

[0138] 5. Model Parameter Fine-tuning and Optimization. If the initially selected model does not match the current magnet perfectly, or if the system requires higher detection performance, a model fine-tuning process will be initiated. This process incrementally trains the initially selected model using a small subset of labeled sample data from the current magnet. Fine-tuning typically employs transfer learning techniques, updating only some high-level parameters in the network to adapt to the specific defect features and texture patterns of the current magnet, while preserving the generality of the low-level feature extraction. This avoids the enormous computational overhead of training from scratch while ensuring rapid model adaptation. If there is no highly matching model in the model knowledge base, or if the performance of the existing model cannot meet the requirements, the system will trigger a "new model generation" process. This may involve using a small number of new samples for reinforcement learning or meta-learning to quickly build a base model and add it to the knowledge base. Ultimately, this mechanism outputs a validated and optimized defect detection model whose parameters have been tuned to the characteristics of the current magnet to be detected, ensuring detection accuracy and robustness.

[0139] In adaptive model generation and selection mechanisms, the fitness score of each model in the model knowledge base is used.

[0140] Based on the current magnet context information and model metadata Perform the calculation. This can be represented by a weighted function:

[0141] ;

[0142] in, It is the number of features. It is the first Feature weights It measures the current context. With model The Metadata A function for matching degree.

[0143] S105, using the determined optimal defect detection model to identify and locate defects in the texture-aware feature vector.

[0144] This step is the core computational process for performing actual defect detection. It uses the optimal defect detection model determined in S104 to analyze the texture-aware feature vector generated in S103 to identify specific defects on the magnet surface and accurately pinpoint their locations. This process is further divided into the following sub-steps.

[0145] 1. Feature Vector Input. The texture-aware feature vector output by S103 is passed as input to the optimal defect detection model determined by S104. This model has been optimized according to the characteristics of the current magnet and has the ability to distinguish between real defects and background texture.

[0146] 2. Model Inference Execution. The optimal defect detection model is typically a trained deep neural network, such as a semantic segmentation network, object detection network, or classification network based on an encoder-decoder structure. If it's a semantic segmentation network, the model performs pixel-level classification on the input feature vector, predicting whether each pixel in the image belongs to a certain defect category, and outputting a probability map or binary mask map of the same size as the original image. If it's an object detection network, such as one based on anchor-box mechanisms or without anchor-box mechanisms, the model directly predicts the bounding box coordinates, defect category, and confidence score of the defect on the feature map. If it's a classification network, it classifies the entire magnet image, determining whether a defect exists and its type, but typically does not provide precise location information. To provide accurate location information, this invention primarily employs a semantic segmentation or object detection architecture.

[0147] 3. Defect Region Extraction and Post-processing. After model inference is complete, the raw prediction results of defects are obtained, such as a probability mask or a list of bounding boxes. For the probability mask, a threshold is usually set, and pixels above the threshold are marked as defect regions, forming a binary defect mask image. For the list of bounding boxes, they are filtered based on confidence scores, and a non-maximum suppression algorithm is applied to eliminate overlapping redundant bounding boxes, ensuring that each defect is detected only once.

[0148] 4. Defect Feature Quantification and Analysis. For each identified defect region, the system extracts its geometric features, such as the defect's area, perimeter, shape factor, aspect ratio, and precise coordinates on the magnet surface. These quantitative indicators are crucial for assessing and classifying the severity of the defect. For example, scratches or cracks with excessively large areas will be classified as severe defects. Simultaneously, the system analyzes the texture features of the defect, such as the texture uniformity within the defect region, to further distinguish genuine defects from residual texture interference.

[0149] 5. Defect Classification and Severity Determination. Based on the extracted geometric and textural features of the defects, and combined with pre-defined defect standards or rule sets, each defect is classified. Examples include scratches, cracks, pores, and foreign objects. Each defect category also corresponds to a severity level, such as minor, moderate, or severe. Classification and severity determination can be based on machine learning classifiers, such as support vector machines, or simple decision tree rules. This process ensures that defect identification goes beyond simply "presence" to "what it is" and "how severe it is," providing refined data for subsequent quality control and process improvement.

[0150] S106 outputs the identified defect information.

[0151] This step is the final stage of the entire defect detection method, aiming to present the defect identification results obtained in step S105 to users or downstream production management systems in a clear, intuitive, and traceable manner. Effective defect information output is crucial for decision-making, quality control, and production line optimization. The output process includes the following sub-steps.

[0152] 1. Generate a Defect Report. Based on all defect information identified in step S105, the system automatically generates a structured defect report. This report includes the magnet's unique identifier, such as batch number, serial number, inspection time, model version used for inspection, number of identified defects, specific category of each defect (e.g., scratches, cracks, porosity), precise location coordinates of the defect, geometric dimensions (e.g., area, aspect ratio), and severity level. The report is typically in the form of a data table, log file, or an electronic document that can be exported to formats such as CSV, JSON, and XML, facilitating data exchange with other systems.

[0153] 2. Visualizing Defect Locations. The system graphically labels identified defects on the acquired raw magnet images. For example, it highlights defect areas by drawing colored bounding boxes, masks, or outlines, along with defect category and confidence score labels. The visualization interface typically allows users to zoom and pan, facilitating manual review of defect details. For magnets with multiple defects, the system can provide an overall defect overview and magnified views of each defect.

[0154] 3. Real-time Alarms and Feedback. If a serious defect is detected or the number of defects exceeds a preset threshold, the system will immediately trigger an audible and visual alarm and send notifications to production line operators, quality engineers, or relevant management personnel, such as via SMS, email, or internal enterprise communication software. Simultaneously, defect information will be fed back to the Production Management System (MES) and Quality Management System (QMS) in real time, enabling the rapid initiation of isolation, rework, or scrapping processes for defective magnets, tracing the cause of the defect, and adjusting upstream process parameters.

[0155] 4. Data Storage and Archiving. All defect detection results, including raw images, preprocessed images, feature vectors, model inference results, and the final generated defect reports, will be stored in an enterprise-level database or data warehouse. This data will be archived according to magnet batch, production date, and inspection time, forming a historical defect database. This not only facilitates long-term data analysis, trend prediction, and quality traceability, but also provides a valuable data foundation for future model iterative training and performance optimization. For example, by analyzing historical defect data, it is possible to discover an increase in the frequency of a certain defect under specific process parameters, thereby guiding process improvements. Finally, interactive query and analysis functions are provided. The system provides a user interface that allows quality engineers to query, statistically analyze, and visualize historical defect data based on various conditions such as magnet model, defect type, production batch, and time range, thereby identifying defect patterns, assessing production line stability, and continuously improving product quality.

[0156] The system mainly includes the following functional units: image acquisition unit, image preprocessing unit, multi-scale texture perception feature extraction module, adaptive model generation and selection module, defect identification and localization module, result output and display unit, control and coordination unit, and data storage unit.

[0157] Image Acquisition Unit: This unit is responsible for acquiring image data of the NdFeB magnets to be inspected in step S101. It consists of a high-resolution industrial digital camera, a custom optical lens, a high-uniformity illumination source such as a ring light source, an image acquisition card, and a precise magnet positioning mechanism. The camera is mounted above the production line, capturing images of the magnet surface in real time and transmitting the image data to the image preprocessing unit. The illumination system provides stable and uniform lighting to maximize the contrast between defects and the background. The positioning mechanism ensures that a complete and consistent view of the magnet is obtained with each shot.

[0158] Image Preprocessing Unit: This unit is responsible for preprocessing the acquired image data in step S102. It receives the raw image data from the image acquisition unit and performs a series of image processing operations. Specific functions include an image grayscale conversion module, a denoising module (e.g., using a non-local mean denoising algorithm), a geometric correction and registration module (e.g., based on affine transformation), a brightness and contrast adjustment module (e.g., adaptive histogram equalization), and an image size unification module. This unit aims to standardize image format, enhance defect features, and suppress noise and texture interference, providing high-quality input for subsequent feature extraction.

[0159] Multi-scale Texture-Aware Feature Extraction Module: This module is crucial for implementing step S103, aiming to extract robust texture-aware feature vectors from the preprocessed image. Internally, it contains a deep convolutional neural network consisting of multiple convolutional layers, batch normalization layers, activation functions, and dilated convolutional layers to achieve multi-scale feature capture. Core functionalities include a texture attention mechanism, which assigns weights to features by analyzing local texture complexity, effectively suppressing background texture interference. Furthermore, this module includes a feature pyramid network structure to fuse feature information from different scales, generating a comprehensive texture-aware feature vector.

[0160] Adaptive Model Generation and Selection Module: This module is responsible for determining the optimal defect detection model for the current image data in step S104. It contains a model knowledge base storing multiple pre-trained defect detection models and their metadata for different magnet types and processes. This module also includes a context information acquisition interface to obtain information such as the magnet's model, batch, and process parameters from the production management system or sensors. Its core functions are a multi-attribute matching algorithm and dynamic model selection logic. It compares the magnet's context information with the model's metadata, evaluates model adaptability, and selects or fine-tunes the optimal model. When no matching model is available, a new model generation process can be triggered.

[0161] Defect Identification and Localization Module: This module performs the defect identification and localization task in step S105. It receives texture-aware feature vectors from the multi-scale texture-aware feature extraction module and loads the optimal defect detection model provided by the adaptive model generation and selection module. At its core is a deep learning inference engine used to perform forward propagation of the model and generate defect predictions. Functions include a defect region extraction and post-processing module, such as threshold-based segmentation and non-maximum suppression, and a defect feature quantization and analysis module for calculating the geometric dimensions and classification features of defects. Finally, it outputs the precise location, category, and severity level of each identified defect.

[0162] Result Output and Display Unit: This unit is responsible for outputting the identified defect information in step S106. It includes a defect report generator to organize the detection results into a structured report; a visualization module to highlight the defect location and category on the original image; and an alarm and notification interface to trigger audible and visual alarms when a serious defect is detected and send notifications to relevant personnel via the network. Simultaneously, this unit provides a human-machine interface, allowing users to query historical detection data and perform statistical analysis.

[0163] Control and Coordination Unit: This unit is the central hub of the entire system, responsible for coordinating and managing the operation of all other functional units. It receives inspection task instructions from the production management system and schedules the sequential and concurrent execution of image acquisition, data preprocessing, feature extraction, model selection, and defect identification. This unit also monitors the operational status of each module, handles abnormal situations, and manages system logs. It ensures smooth data flow and dynamically adjusts resource allocation based on system status.

[0164] Data Storage Unit: This unit provides persistent data storage services. It includes a high-performance database system for storing raw image data, preprocessed images, extracted feature vectors, defect detection results, pre-trained model parameters and metadata from the model knowledge base, as well as historical detection reports and logs. This unit features data backup and recovery capabilities to ensure data security and integrity, and supports high-speed data access to meet the needs of real-time detection and offline analysis.

[0165] The aforementioned system achieves intelligent, efficient, and adaptive detection of defects in NdFeB magnets through close collaboration among its functional units. The image acquisition unit captures visual information about the magnet; the image preprocessing unit optimizes image quality; the multi-scale texture perception feature extraction module deeply understands the difference between surface texture and defects; the adaptive model generation and selection module dynamically matches the optimal detection strategy; the defect identification and localization module accurately determines the presence and location of defects; and the result output and display unit intuitively presents the detection results and links them to production management. The control and coordination unit oversees the entire system, while the data storage unit provides robust data support for the intelligent operation of the entire system. This system overcomes the limitations of traditional methods and improves the accuracy and flexibility of NdFeB magnet defect detection.

[0166] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0167] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. An artificial intelligence-assisted defect detection system for neodymium iron boron magnets, characterized in that, include: The image acquisition module is used to acquire optical image data of the neodymium iron boron magnet to be tested, and the optical image data reflects the surface information of the magnet; The process parameter acquisition module is used to acquire process parameter data related to the manufacturing batch of the NdFeB magnet to be tested, wherein the process parameter data describes the manufacturing process characteristics of the magnet. An image preprocessing module is used to preprocess the optical image data to eliminate image noise and enhance defect features; A multi-scale texture-aware feature extraction module is used to extract depth features from the preprocessed optical image data and generate texture-enhanced feature representations. An adaptive model generation and selection module is used to dynamically determine or adjust the defect detection model based on the process parameter data. The defect detection model is used to robustly detect magnets of different processes. The defect detection module is used to input the texture-enhanced feature representation into the defect detection model, perform defect classification and localization, and output defect detection results; The discrimination output module is used to perform a pass / fail judgment based on the defect detection results; The model optimization module is used to update and optimize the defect detection model in the adaptive model generation and selection module by using the defect detection results.

2. The artificial intelligence-assisted defect detection method for NdFeB magnets according to claim 1, characterized in that, The acquisition of optical image data of the neodymium iron boron magnet to be detected includes: The surface image of the neodymium iron boron magnet to be tested is captured by an image acquisition device, which includes an industrial camera, a telecentric lens, and a ring light source. The industrial camera has high resolution, the telecentric lens is used to eliminate parallax, and the ring light source is used to provide uniform and shadowless illumination.

3. The artificial intelligence-assisted defect detection method for NdFeB magnets according to claim 1, characterized in that, The acquisition of process parameter data related to the manufacturing batch of the NdFeB magnet to be tested includes: The parameters of the neodymium iron boron magnet, such as sintering temperature, pressing pressure, surface treatment type, and chemical composition ratio, are read in real time from the manufacturing execution system database or the production line programmable logic controller.

4. The artificial intelligence-assisted defect detection method for NdFeB magnets according to claim 2, characterized in that, The preprocessing of the optical image data includes: The optical image data is subjected to Gaussian filtering to reduce random noise; Histogram equalization is performed on the optical image data to enhance image contrast; The optical image data is segmented using a region growing algorithm to accurately extract the effective detection area of ​​the neodymium iron boron magnet.

5. The artificial intelligence-assisted defect detection method for NdFeB magnets according to claim 4, characterized in that, The preprocessed optical image data is subjected to depth feature extraction using a multi-scale texture-aware feature extraction module to generate texture-enhanced feature representations, including: The deep convolutional neural network structure includes multiple parallel multi-scale convolutional kernel groups, each consisting of convolutional kernels of different sizes. The convolutional kernels of different sizes perform convolution operations on the preprocessed optical image data to capture texture features at different scales. The output feature map of the multi-scale convolution operation is fused, and the importance of different feature channels is weighted through a self-attention mechanism to generate the texture-enhanced feature representation.

6. The artificial intelligence-assisted defect detection method for NdFeB magnets according to claim 3, characterized in that, The step of dynamically determining or adjusting the defect detection model based on the process parameter data through the adaptive model generation and selection module includes: The process parameter data is input into the process parameter encoder to generate a low-dimensional process parameter vector. The low-dimensional process parameter vector is input into the decision network, and the decision network outputs the optimal detection model index or model parameter fine-tuning strategy in the preset detection model library based on the low-dimensional process parameter vector. Based on the optimal detection model index or model parameter fine-tuning strategy, a corresponding defect detection model is selected from the preset detection model library, or the parameters of the basic defect detection model are fine-tuned to generate the defect detection model.

7. The artificial intelligence-assisted defect detection method for NdFeB magnets according to claim 5, characterized in that, The step of inputting the texture-enhanced feature representation into the defect detection model for defect classification and localization, and outputting defect detection results, includes: The defect detection model includes a pixel-level defect segmentation branch and a defect type classification branch; The pixel-level defect segmentation branch performs semantic segmentation on the texture-enhanced feature representation and outputs a pixel mask of the defect region. The defect type classification branch performs defect type discrimination on the texture-enhanced feature representation and outputs the defect category label and confidence score; The defect detection results include the defect's pixel mask, defect category label, defect confidence score, and defect geometric parameters, including the defect's area, perimeter, and maximum length.

8. The artificial intelligence-assisted defect detection method for NdFeB magnets according to claim 7, characterized in that, The process of determining compliance based on the defect detection results includes: Based on a preset defect discrimination threshold set, the defect geometric parameters, defect type, and confidence score in the defect detection results are compared. If the area, perimeter, or maximum length of the defect exceeds a preset threshold, or if a specific type of defect exists and the confidence score is higher than the preset threshold, the product is judged as unqualified; otherwise, it is judged as qualified.

9. The artificial intelligence-assisted defect detection method for NdFeB magnets according to claim 7, characterized in that, The step of using the defect detection results to update and optimize the defect detection model in the adaptive model generation and selection module includes: The manually corrected defect detection results are used as incremental training data to incrementally train the preset detection model or basic defect detection model in the adaptive model generation and selection module.

10. The artificial intelligence-assisted defect detection method for NdFeB magnets according to claim 7, characterized in that, The incremental training employs a transfer learning strategy to prevent model forgetting and improve the model's generalization ability.

Citation Information

Cited By

  • Soft magnetic core sintering process control method and equipment

    CN121655287A