A qualitative detection method, device and medium for small linear defects on the surface of a magnetic tile

By combining a multi-directional lighting imaging system with a deep convolutional neural network, the sensitivity and misjudgment problems in the detection of micron-level linear defects on the surface of magnetic tiles were solved, achieving efficient and accurate defect identification and reducing detection costs.

CN120635097BActive Publication Date: 2025-10-14KLEBER MOTOR (NINGBO) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511142759.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-15
Publication Date
2025-10-14
Estimated Expiration
2045-08-15

AI Technical Summary

Technical Problem

The existing technology has insufficient sensitivity and high misjudgment rate in detecting micron-level linear defects on the surface of magnetic tiles. The time-sharing multi-angle imaging solution has a long detection time, and ambient light fluctuations lead to an increase in the misdetection rate.

Method used

A multi-directional lighting imaging system is used, combined with a low-angle linear light source array and a polarization camera. Defect recognition is performed through dynamic image acquisition and a deep convolutional neural network. Gradient histogram enhancement and dual-channel convolution kernel feature extraction are combined to achieve multi-scale defect feature extraction and spatial attention weighting.

Benefits of technology

It improves the recognition sensitivity and detection efficiency of micron-level linear defects, reduces the misjudgment rate, improves the detection accuracy and actual detection rate of the production line, and reduces the detection cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635097B_ABST
    Figure CN120635097B_ABST
Patent Text Reader

Abstract

The application discloses a kind of qualitative detection method, equipment and medium of the surface micro linear defect of magnetic tile, it is related to the nondestructive testing technical field of magnetic material.The scattering characteristics of different defects are highlighted by dynamic adjustment of light source azimuth, a multi-directional illumination imaging system is constructed, which includes low-angle linear light source and high-resolution polarization camera.In the middle, in addition to the light source, the camera moves along the axial direction through a stepper motor, and dynamic image acquisition is performed.A preprocessing algorithm based on direction gradient histogram enhancement is designed, and a deep convolutional neural network is used to analyze the multi-scale feature fusion of the defect area.A lightweight classification model based on transfer learning is developed to accurately distinguish micro-cracks and pseudo-defects.The supporting equipment integrates a light source control module, an image acquisition unit, and an embedded processing platform, supporting real-time dynamic detection.The application breaks through the detection limit of sub-millimeter linear defects by traditional machine vision, and the miss rate is reduced to below 0.5%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of nondestructive testing of magnetic materials, in particular to a method, equipment and medium for qualitatively detecting tiny linear defects on the surface of a magnetic tile. Background Art

[0002] In the field of nondestructive testing of magnetic materials, particularly for surface defect detection of permanent magnet motor bearings, traditional machine vision methods face a core bottleneck: insufficient sensitivity for detecting micron-level linear defects. Existing technologies often rely on static imaging, which, due to depth of field limitations, cannot accurately image all surfaces to be inspected, impacting differentiation. Existing technologies generally employ a ring-shaped LED light source coupled with a high-resolution industrial camera architecture, using image processing algorithms to achieve defect screening. However, due to the similarity in optical properties between grain boundary texture and microcracks on the surface of ferrite materials, the detection rate for linear scratches and cracks less than 0.15 mm in width is typically less than 65%, with a false positive rate as high as 8-12%. Furthermore, these methods are insensitive to defect orientation. When the angle between the crack direction and the illumination optical axis exceeds 45°, the contrast ratio drops below 0.1 due to attenuation of scattered light intensity, resulting in a significant number of missed detections. Furthermore, image blur caused by environmental vibration in the production line further reduces the signal-to-noise ratio, forcing companies to rely on manual re-inspection, increasing inspection costs by over 30%.

[0003] Chinese patent CN108230324B discloses a "visual detection method for micro-defects on magnetic tile surfaces," which exemplifies the state of the art. The method involves reading a magnetic tile image, detecting defects in the image, obtaining a defect region K within the image, and determining whether the area of ​​defect region K is greater than a set value of 1. Furthermore, the method detects defects in the image, obtains a second-category defect rendering, and determines whether the length of the second-category defect rendering is greater than a set value of 2. Finally, the method detects defects in the image, obtains the roundness of pixels in the connected domain of the edge detection image Q', and determines whether the roundness of pixels in the connected domain of the edge detection image Q' is greater than a set value of 3. These three determination steps can determine whether a tile has three types of defects. The method is highly adaptable to changes in illumination and tile type, capable of detecting all types of defects. The defect images obtained by the method are clearer and more accurate than those obtained using traditional methods.

[0004] Based on the above prior art, the core problems to be solved by the present invention include:

[0005] (1) Sensitivity defects caused by insufficient optical capture capability.

[0006] (2) Feature confusion caused by background texture interference.

[0007] (3) Time-sharing multi-angle imaging scheme due to mechanical relay switching delay (≥ 50 ms) and software processing time (average 180 ms / frame), single piece detection time is as long as 18 seconds, which is much higher than the 200 ms beat required by the production line. At the same time, the fluctuation of ambient light (change of workshop lighting ± 15%) will make the false detection rate of traditional static threshold algorithm rise to 9.8%.

[0008] These problems are essentially caused by the traditional idea of the prior art that the optical design, signal processing and computing architecture are processed separately, and breakthrough is needed through cross-level collaborative innovation. SUMMARY

[0009] In view of the above existing problems, the present application is proposed.

[0010] Therefore, the present application provides a qualitative detection method, equipment and medium for micro linear defects on the surface of a magnetic tile, which solves the problems of low recognition sensitivity and high false detection rate of micron-level linear scratches and cracks in the existing visual detection technology.

[0011] To solve the above technical problems, the present application provides the following technical solutions:

[0012] In a first aspect, the present application provides a qualitative detection method for micro linear defects on the surface of a magnetic tile, comprising the following steps:

[0013] A multi-directional illumination imaging system is constructed, a low-angle linear light source array with a wavelength range of 630-680 nm is used to irradiate the surface of the magnetic tile at an incident angle of 35°±2°, and a high-resolution polarization camera with a polarization direction at 90° to the light source plane is used to collect dynamic images; wherein the low-angle linear light source array is composed of LED light bars arranged at equal intervals, and the center distance between adjacent light bars is 5 mm;

[0014] The camera moves along the axial direction through a stepping motor, dynamically adjusts the azimuth angle of the light source, and acquires dynamic images of defects at 18 phases in the range of 0°~180° with a step of 10°;

[0015] The collected dynamic images are subjected to histogram of oriented gradients enhancement processing, the Sobel operator is used to calculate the gradient direction of the pixel points, and nonlinear contrast stretching is performed in the gradient direction domain;

[0016] The enhanced dynamic images are input into a deep convolutional neural network, which contains parallel 3×3 and 5×5 dual-channel convolution kernels, and multi-scale defect features are extracted;

[0017] A lightweight classification model based on transfer learning performs spatial attention weighting on the feature map, and outputs the qualitative results of the defects.

[0018] As a preferred scheme of the qualitative detection method for the tiny linear defects on the surface of the magnetic shoe, the light source adjustment of the multi-directional illumination imaging system specifically comprises the following consecutive operation steps:

[0019] The light source support is directly connected with the output shaft of the stepping motor through a rigid coupling. After receiving the pulse signal, the motor starts to rotate at an interval angle of 1.8°. The camera is triggered to collect the first dynamic image at the initial 0° azimuth position.

[0020] After the collection is completed, the motor immediately rotates at a constant speed of 200 revolutions per minute. The photoelectric encoder generates a positioning signal every 10° mechanical angle. The motor is locked within 2 ms after receiving the positioning signal.

[0021] After the locking, the light source controller applies a constant current of 800 mA to the LED light bar, and the light intensity is stabilized to the range of 950±10 lux within 50 ms. At this time, the polarized camera performs single-frame collection with an exposure time of 180 μs.

[0022] After the collection is completed, the motor is immediately unlocked and rotated to the next angular phase. This process is repeated until the dynamic image acquisition of 18 phases in the range of 180° is completed.

[0023] During the entire rotation process, the embedded system dynamically monitors the environmental light interference in real time. When the dynamic detection detects that the background illumination changes by more than 5 lux, the driving current is automatically increased to 850 mA for light intensity compensation.

[0024] As a preferred scheme of the qualitative detection method for the tiny linear defects on the surface of the magnetic shoe, the direction gradient histogram enhancement processing is performed in the following specific step sequence:

[0025] First, the original input dynamic image is subjected to Gaussian filtering and noise reduction processing. A 3×3 pixel filter window and a convolution kernel with a standard deviation σ=1.5 are used. The filtered dynamic image is stored in the cache area.

[0026] Then, the fixed-parameter Sobel operator group is used to synchronously calculate the gradient components in four directions. The 0° direction uses the horizontal kernel [-1, 0, 1; -2, 0, 2; -1, 0, 1], the 45° direction uses the diagonal kernel [0, 1, 2; -1, 0, 1; -2, -1, 0], the 90° direction uses the vertical kernel [-1, -2, -1; 0, 0, 0; 1, 2, 1], and the 135° direction uses the reverse diagonal kernel [-2, -1, 0; -1, 0, 1; 0, 1, 2].

[0027] After the calculation of each pixel point is completed, the gradient amplitudes in the four directions are compared. The direction with the largest amplitude is marked as the main direction of the pixel and a direction encoding map is generated.

[0028] Then, guided by the directional coding map, local neighborhood processing is performed on each pixel in its main direction: a 3×3 pixel area is intercepted with the pixel as the center, and the grayscale values ​​of all pixels in the same main direction in the area are extracted to generate a one-dimensional array, and a histogram equalization operation is performed on this array;

[0029] The equalized pixel values ​​are gamma corrected using a lookup table, and the correction function is I'=255×(I / 255) 0.7 , where I is the input grayscale value;

[0030] The final output dynamic image is scaled to its original size through bilinear interpolation and then transmitted to the next processing module.

[0031] As a preferred solution of the qualitative detection method for tiny linear defects on the surface of a magnetic tile described in the present invention, the dual-channel convolution kernel feature extraction is implemented in the following steps in sequence:

[0032] First, the pre-processed dynamic image is simultaneously input into the dual-channel processing path. The first channel uses a 3×3 convolution kernel to extract high-frequency details. The convolution kernel weight matrix is ​​fixed to [-0.5, 1, -0.5; -0.5, 1, -0.5; -0.5, 1, -0.5], the step size is set to 2 pixels, and the border adopts a symmetrical filling mode.

[0033] The second channel uses a 5×5 convolution kernel to extract texture structure, the weight matrix is ​​[0, 0.2, 0.5, 0.2, 0; 0.2, -0.3, -0.8, -0.3, 0.2; 0.5, -0.8, 3, -0.8, 0.5; 0.2, -0.3, -0.8, -0.3, 0.2; 0, 0.2, 0.5, 0.2, 0], and the step size is set to 1 pixel;

[0034] After each channel outputs a feature map, the variance value within its 7×7 local window is calculated immediately. When the variance of the first channel feature map is greater than 1200, the fusion weight is automatically set to (0.4, 0.6), otherwise it is set to (0.6, 0.4). The two-channel feature maps are pixel-wise weighted fused before ReLU activation.

[0035] The fused feature map is batch normalized, the sliding mean β is set to 0.65, and the variance scaling factor γ is set to 1.2; the final output feature map is upsampled to the original resolution by bilinear interpolation.

[0036] As a preferred solution of the qualitative detection method for tiny linear defects on the surface of a magnetic tile of the present invention, the spatial attention weighting is implemented by the following specific process:

[0037] First, the 128×128×64-dimensional feature map output by the feature extraction module is input into a 1×1 convolutional layer. This layer contains three convolution kernels, each of which generates a single-channel weight map.

[0038] The three weight maps are superimposed and normalized into an initial weight matrix between 0 and 1 using a Sigmoid activation function. A defect area screening mechanism is then established: the mean of each 8×8 local area in the initial weight matrix is ​​calculated. When the regional mean exceeds 0.65, it is identified as a defect-sensitive area, and the weights of all pixels in that area are increased to 1.35 times their original values.

[0039] At the same time, the background area is dynamically detected: if the regional mean is lower than 0.25 and the distance to the nearest defect-sensitive area is greater than 20 pixels, the weight is reduced to 0.75 times the original value;

[0040] The adjusted weight matrix is ​​multiplied with the original feature map at the pixel level. Before multiplication, the feature map is normalized so that the mean of each channel is 0 and the standard deviation is 1.

[0041] When the final weighted feature map is input into the fully connected layer, additional computing resources are allocated to high-response pixels whose weight values ​​are in the top 10%, and their storage addresses in memory are mapped to the cache area to speed up access.

[0042] As a preferred solution of the qualitative detection method for tiny linear defects on the surface of a magnetic tile described in the present invention, the specific implementation process of the lightweight classification model is as follows:

[0043] First, the spatial attention weighted feature map is input into the MobileNetV3 base network, which retains the output feature map of the penultimate convolution layer;

[0044] The global average pooling layer at the end of the original architecture was removed and replaced with a custom feature processing layer consisting of 256 neurons. Each node receives a 1152-dimensional input vector from the previous layer in a fully connected manner. The input vector is normalized before entering the neuron by subtracting the sliding mean of 125.6 and dividing by the standard deviation of 48.3.

[0045] The activation function for each neuron uses a Leaky ReLU, with the negative slope parameter α fixed at 0.1, and the output value truncated to the range 0–6.0 to prevent gradient explosion. The 256-dimensional feature vector output by the neuron enters a two-node output layer, where the weight matrix is ​​initialized to a diagonally reinforced form of [1.8, -0.3; -0.3, 1.8], and the bias vector is set to [0.4, -0.4].

[0046] Finally, the category probability is calculated through the Softmax function, and an alarm signal is triggered when the defect category probability value is ≥0.6;

[0047] The computing load is dynamically monitored during model execution. If the single inference time exceeds 50ms, the statistics update function of the batch normalization layer is automatically disabled to increase the processing speed by 15%.

[0048] As a preferred solution of the qualitative detection device for tiny linear defects on the surface of a magnetic tile of the present invention, the specific structure of the detection device is as follows:

[0049] The closed darkroom features a 1.5mm-thick aluminum alloy frame and an anodized outer shell. The inner wall is coated with a carbon nanotube-enhanced light-absorbing coating, achieving an absorbance of 98.7% ± 0.3% at a wavelength of 650nm. An XYZ three-axis mechanical stage is mounted on top of the darkroom. The X-axis utilizes a 0.1μm resolution grating ruler for closed-loop control, the Y-axis is equipped with a linear motor with ±0.05mm positioning accuracy, and the Z-axis utilizes a harmonic reducer for motorized focusing with a range of 0 to 20mm.

[0050] The annular light source bracket is fixed to the center of the bottom surface of the dark box through a 304 stainless steel flange. There are 18 sets of LED light bar mounting positions evenly distributed around the bracket circumference. Each mounting position is equipped with a precision wedge-shaped slot with an inclination of 35°±0.1°.

[0051] The polarization camera is mounted on the side wall of the darkroom at a distance of 300 mm from the center via a carbon fiber gimbal. The surface of the CMOS sensor is coated with an antireflection coating, and the spectral response peak is strictly matched to 650 nm ± 2 nm.

[0052] The embedded processing unit's FPGA module incorporates a dedicated pipeline architecture. After dynamic image data is input via the CameraLink interface, it first enters the preprocessing pipeline to perform directional gradient enhancement calculations. The enhanced dynamic image is then directly transmitted to the ARM processor via the DMA channel. The processor then calls the classification model weights stored in LPDDR4 memory to perform real-time inference.

[0053] As a preferred solution of the qualitative detection device for tiny linear defects on the surface of a magnetic tile according to the present invention, the synchronous control of the polarization camera is implemented as follows:

[0054] The polarizing filter installed in front of the camera lens is driven to rotate by a micro harmonic reducer. The reducer output shaft and the filter holder adopt a conical interference fit to ensure that the axial runout is ≤0.005mm.

[0055] The filter's angular position is dynamically monitored in real time by a 17-bit absolute encoder, and the encoder data is transmitted to the motion controller via the RS-485 interface at a frequency of 1MHz;

[0056] When the light source bracket starts to rotate, the controller synchronously starts the closed-loop control of the polarization filter. Every time the light source rotates 9.7°, the filter is pre-accelerated to the target angle. When the light source reaches the 10° phase point, the photoelectric synchronization pulse triggers the filter to accurately position. The positioning error compensation algorithm uses quadratic polynomial fitting: if the deviation Δθ between the encoder feedback value and the target value is greater than 0.3°, the compensation angle δ=0.6Δθ+0.05(Δθ)² is immediately calculated and the correction is completed within 10ms.

[0057] The filter is locked within the target angle range of ±0.05° during dynamic image acquisition. After locking, the piezoelectric ceramic actuator applies a 15V holding voltage to suppress vibration;

[0058] After each acquisition, the filter rotates at 1200 rpm to the next target angle, which strictly follows The geometric relationship of is the current light source azimuth, ensuring that the polarization direction is always perpendicular to the incident light plane;

[0059] The system automatically performs zero-point calibration every 24 hours, driving the filter to rotate to the mechanical hard limit and then retreating 0.5° as the reference zero point.

[0060] In a second aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of a qualitative detection method for tiny linear defects on the surface of a magnetic tile as described in the first aspect of the present invention.

[0061] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of a qualitative detection method for tiny linear defects on the surface of a magnetic tile as described in the first aspect of the present invention.

[0062] Beneficial effects of the present invention:

[0063] The present invention has achieved a breakthrough in the field of micro-defect detection on the surface of magnetic tiles through the deep integration of multimodal optical collaborative enhancement and hardware processing architecture. Its core advantage is first reflected in the physical-level feature enhancement capability of the optical system: a 650nm±5nm light source array with a wavelength strictly matching the characteristics of ferrite materials, combined with a 35°±0.5° precise incident angle design, is used to increase the scattering signal intensity of a 0.05mm wide linear crack to 3.2 times that of the traditional wide-spectrum solution; combined with orthogonal polarization filter dynamic tracking technology, the contrast between microcracks and grain boundary textures is successfully improved from the industry average of 0.12 to 0.48±0.05, completely solving the problem of misjudgment caused by background interference. Secondly, the innovative dynamic scanning mechanism realizes multi-dimensional capture of defects. Through millisecond-level collaborative control of stepper motors and photoelectric encoders, high-definition imaging of 18 azimuth angles is completed within 3.6 seconds, which is 5 times more efficient than traditional time-sharing lighting solutions and completely eliminates motion blur; more importantly, the process synchronously triggers the filter to The geometric constraints of the image processing system are used to adjust the polarization direction in real time, ensuring that the signal-to-noise ratio of the crack feature remains stable at above 4.5:1 at all angles. At the signal processing level, the combined effect of gradient domain enhancement and dual-channel convolution kernels significantly optimizes feature extraction efficiency: the directional equalization of the directional gradient histogram within a 3×3 neighborhood increases the local contrast of micro-defects by 2.3 times; and the dual-channel feature fusion architecture based on dynamic variance weighting increases the feature activation value of a 0.1mm crack from 0.31 to 0.68, while suppressing the false response of pseudo-defects such as oxidation spots to below 0.2. Hardware system innovations ensure engineering practicality: the FPGA-based pre-processing pipeline achieves real-time gradient calculation at 1.8ms / frame, and the high-speed cache mapping mechanism compresses the full-process processing time to 47ms; the closed-loop light compensation system maintains dynamic detection stability when the ambient light in the workshop fluctuates by ±15%, and the overall equipment error rate is reduced to 0.38%. Ultimately, these technological advances achieved a defect detection rate of 98.7% and a classification accuracy of 99.2% in actual production line measurements, an improvement of more than 35 percentage points over existing technologies, and a 40% reduction in single-piece inspection costs, providing revolutionary protection for the reliability of permanent magnet motors. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0065] Figure 1 The figure is a flow chart of a method for qualitatively detecting tiny linear defects on the surface of magnetic tiles.

[0066] Figure 2 This is a module diagram of a device for qualitatively detecting tiny linear defects on the surface of magnetic tiles. DETAILED DESCRIPTION

[0067] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0068] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0069] Secondly, the term "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in various places throughout this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive of other embodiments.

[0070] 1 , which is an embodiment of the present invention, provides a method for qualitatively detecting minute linear defects on the surface of a magnetic tile, comprising the following steps:

[0071] A multi-directional illumination imaging system was constructed, using a low-angle linear light array with a wavelength range of 630-680 nm to illuminate the surface of the magnetic tile at an incident angle of 35°±2°. A high-resolution polarization camera with a polarization direction at 90° to the light plane was used to capture dynamic images. The low-angle linear light array consisted of equally spaced LED light strips with a center-to-center distance of 5 mm between adjacent light strips.

[0072] The camera moves along the axis through a stepper motor, dynamically adjusting the azimuth angle of the light source, and acquiring dynamic images of multi-angle scattering of defects in 18 phases within the range of 0° to 180° with a step length of 10°;

[0073] The acquired dynamic images are enhanced by using the directional gradient histogram, the Sobel operator is used to calculate the pixel gradient direction, and nonlinear contrast stretching is performed in the gradient direction domain;

[0074] The enhanced dynamic image is input into a deep convolutional neural network, which contains parallel 3×3 and 5×5 dual-channel convolution kernels to extract multi-scale defect features;

[0075] A lightweight classification model based on transfer learning performs spatial attention weighting on feature maps and outputs qualitative defect results.

[0076] The light source adjustment of the multi-directional illumination imaging system specifically includes the following consecutive operation steps:

[0077] The light source bracket is directly connected to the stepper motor output shaft through a rigid coupling. After receiving the pulse signal, the motor starts rotating at a step angle of 1.8°, triggering the camera to capture the first frame of dynamic image at the initial 0° azimuth position.

[0078] After the acquisition is completed, the motor immediately rotates at a constant speed of 200 rpm. Every time it rotates 10° mechanical angle, the photoelectric encoder is triggered to generate a positioning signal. The motor completes the brake lock within 2ms after receiving the positioning signal.

[0079] After locking, the light source controller applies an 800mA constant current drive to the LED light bar, stabilizing the light intensity to a range of 950±10lux within 50ms. At this time, the polarization camera performs single-frame acquisition with an exposure time of 180μs.

[0080] After the acquisition is completed, the motor is immediately unlocked and rotates to the next angle phase. This process is repeated until the dynamic image acquisition of 18 phases within the 180° range is completed;

[0081] During the entire rotation process, the embedded system dynamically monitors ambient light interference in real time. When it dynamically detects that the background illumination changes by more than 5 lux, it automatically increases the drive current to 850 mA for light intensity compensation.

[0082] The directional gradient histogram enhancement process is performed in the following specific steps:

[0083] First, the original input dynamic image is subjected to Gaussian filtering for noise reduction, using a 3×3 pixel filter window and a convolution kernel with a standard deviation of σ=1.5. The filtered dynamic image is then stored in a buffer.

[0084] Then, a Sobel operator group with fixed parameters is used to synchronously calculate the gradient components in four directions. The horizontal kernel [-1, 0, 1; -2, 0, 2; -1, 0, 1] is used in the 0° direction, the oblique kernel [0, 1, 2; -1, 0, 1; -2, -1, 0] is used in the 45° direction, the vertical kernel [-1, -2, -1; 0, 0, 0; 1, 2, 1] is used in the 90° direction, and the reverse oblique kernel [-2, -1, 0; -1, 0, 1; 0, 1, 2] is used in the 135° direction.

[0085] After the calculation of each pixel is completed, the gradient amplitudes in the four directions are immediately compared, the direction with the largest amplitude is marked as the main direction of the pixel and a direction coding map is generated;

[0086] Then, guided by the directional coding map, local neighborhood processing is performed on each pixel in its main direction: a 3×3 pixel area is intercepted with the pixel as the center, and the grayscale values ​​of all pixels in the same main direction in the area are extracted to generate a one-dimensional array, and a histogram equalization operation is performed on this array;

[0087] The equalized pixel values ​​are gamma corrected using a lookup table, and the correction function is I'=255×(I / 255) 0.7 , where I is the input grayscale value;

[0088] The final output dynamic image is scaled to its original size through bilinear interpolation and then transmitted to the next processing module.

[0089] The dual-channel convolution kernel feature extraction is implemented in the following steps:

[0090] First, the pre-processed dynamic image is simultaneously input into the dual-channel processing path. The first channel uses a 3×3 convolution kernel to extract high-frequency details. The convolution kernel weight matrix is ​​fixed to [-0.5, 1, -0.5; -0.5, 1, -0.5; -0.5, 1, -0.5], the step size is set to 2 pixels, and the border adopts a symmetrical filling mode.

[0091] The second channel uses a 5×5 convolution kernel to extract texture structure, the weight matrix is ​​[0, 0.2, 0.5, 0.2, 0; 0.2, -0.3, -0.8, -0.3, 0.2; 0.5, -0.8, 3, -0.8, 0.5; 0.2, -0.3, -0.8, -0.3, 0.2; 0, 0.2, 0.5, 0.2, 0], and the step size is set to 1 pixel;

[0092] After each channel outputs a feature map, the variance value within its 7×7 local window is calculated immediately. When the variance of the first channel feature map is greater than 1200, the fusion weight is automatically set to (0.4, 0.6), otherwise it is set to (0.6, 0.4). The two-channel feature maps are pixel-wise weighted fused before ReLU activation.

[0093] The fused feature map is batch normalized, the sliding mean β is set to 0.65, and the variance scaling factor γ is set to 1.2; the final output feature map is upsampled to the original resolution by bilinear interpolation.

[0094] Spatial attention weighting is achieved through the following specific process:

[0095] First, the 128×128×64-dimensional feature map output by the feature extraction module is input into a 1×1 convolutional layer. This layer contains three convolution kernels, each of which generates a single-channel weight map.

[0096] The three weight maps are superimposed and normalized into an initial weight matrix between 0 and 1 using a Sigmoid activation function. A defect area screening mechanism is then established: the mean of each 8×8 local area in the initial weight matrix is ​​calculated. When the regional mean exceeds 0.65, it is identified as a defect-sensitive area, and the weights of all pixels in that area are increased to 1.35 times their original values.

[0097] At the same time, the background area is dynamically detected: if the regional mean is lower than 0.25 and the distance to the nearest defect-sensitive area is greater than 20 pixels, the weight is reduced to 0.75 times the original value;

[0098] The adjusted weight matrix is ​​multiplied with the original feature map at the pixel level. Before multiplication, the feature map is normalized so that the mean of each channel is 0 and the standard deviation is 1.

[0099] When the final weighted feature map is input into the fully connected layer, additional computing resources are allocated to high-response pixels whose weight values ​​are in the top 10%, and their storage addresses in memory are mapped to the cache area to speed up access.

[0100] The specific implementation process of the lightweight classification model is as follows:

[0101] First, the spatial attention weighted feature map is input into the MobileNetV3 base network, which retains the output feature map of the penultimate convolution layer;

[0102] The global average pooling layer at the end of the original architecture was removed and replaced with a custom feature processing layer consisting of 256 neurons. Each node receives a 1152-dimensional input vector from the previous layer in a fully connected manner. The input vector is normalized before entering the neuron by subtracting the sliding mean of 125.6 and dividing by the standard deviation of 48.3.

[0103] The activation function for each neuron uses a Leaky ReLU, with the negative slope parameter α fixed at 0.1, and the output value truncated to the range 0–6.0 to prevent gradient explosion. The 256-dimensional feature vector output by the neuron enters a two-node output layer, where the weight matrix is ​​initialized to a diagonally reinforced form of [1.8, -0.3; -0.3, 1.8], and the bias vector is set to [0.4, -0.4].

[0104] Finally, the category probability is calculated through the Softmax function, and an alarm signal is triggered when the defect category probability value is ≥0.6;

[0105] The computing load is dynamically monitored during model execution. If the single inference time exceeds 50ms, the statistics update function of the batch normalization layer is automatically disabled to increase the processing speed by 15%.

[0106] The second embodiment of the present invention provides a method for qualitatively detecting tiny linear defects on the surface of a magnetic tile. The following is the workflow of this embodiment:

[0107] The detection process of this embodiment begins with the physical-level feature enhancement of the multi-directional optical imaging system: after the magnetic tile sample is precisely positioned at the center of the dark box by the XYZ mechanical stage, the LED linear light source array with a wavelength of 650nm±3nm illuminates the surface at an incident angle of 35°±0.5°, and the polarization camera starts the initial imaging in the orthogonal direction. The camera moves axially through the stepper motor, and the stepper motor drives the light source bracket to rotate in steps of 10°. Each phase stays for 200ms to complete the dynamic image acquisition. During this process, the light source intensity is stabilized at 950±10lux through closed-loop control, and the polarization filter is synchronously adjusted to After acquiring dynamic images at 18 azimuth angles, the raw data is fed into the FPGA preprocessing pipeline: First, a Gaussian filter (3×3 window, σ=1.5) is applied to suppress noise. A dedicated Sobel operator group is then used to calculate gradients in four directions (0° / 45° / 90° / 135°). For each pixel, the direction with the maximum gradient magnitude is selected as the primary direction, and histogram equalization is performed within the 3×3 neighborhood of that direction. The enhanced pixel values ​​are then gamma-corrected (I'=255×(I / 255)^0.7) using a lookup table (LUT) to generate a gradient-domain enhanced dynamic image. The dynamic image is then input into a two-channel convolutional neural network: the first channel uses a 3×3 vertical enhancement convolution kernel ([-0.5, 1, -0.5; -0.5, 1, -0.5; -0.5, 1, -0.5]) with a 2-pixel step size to extract high-frequency crack features, and the second channel uses a 5×5 diamond structure convolution kernel ([0, 0.2, 0.5, 0.2, 0; 0.2, -0.3, -0.8, -0.3, 0.2; 0.5, -0.8, 3, -0.8, 0.5; ...]) with a 1-pixel step size to capture the texture background; the two-channel feature maps are dynamically fused based on the variance of a 7×7 window (the weight ratio is 0.4:0.6 when the variance is > 1200, and 0.6:0.4 otherwise). The fused features are fed into the spatial attention module: a 1×1 convolution generates a three-channel weight map. After sigmoid normalization, the weight of defect-sensitive areas within an 8×8 region with a mean greater than 0.65 is increased to 1.35 times, while the weight of background areas with a mean less than 0.25 is reduced to 0.75 times. Finally, the weighted feature map is fed into a lightweight classification model (MobileNetV3 base layer + a 256-neuron custom layer). After activation with a Leaky ReLU (α=0.1), a two-node Softmax classifier with a diagonally reinforced weight matrix ([1.8, -0.3; -0.3, 1.8]) outputs the defect probability. A probability ≥ 0.6 triggers an alarm signal. The entire process takes 47ms, a five-fold speedup compared to traditional solutions.

Claims

1. A qualitative detection method for tiny linear defects on the surface of a magnetic tile, characterized in that: The following steps are involved: A multi-directional illumination imaging system was constructed, using a low-angle linear light array with a wavelength range of 630-680 nm to illuminate the surface of the magnetic tile at an incident angle of 35°±2°. A high-resolution polarization camera with a polarization direction at 90° to the light plane was used to capture dynamic images. The low-angle linear light array consisted of equally spaced LED light strips with a center-to-center distance of 5 mm between adjacent light strips. The camera moves along the axis through a stepper motor, dynamically adjusting the azimuth angle of the light source, and acquiring dynamic images of multi-angle scattering of defects in 18 phases within the range of 0° to 180° with a step length of 10°; The acquired dynamic images are enhanced by using the directional gradient histogram, the Sobel operator is used to calculate the pixel gradient direction, and nonlinear contrast stretching is performed in the gradient direction domain; The enhanced dynamic image is input into a deep convolutional neural network, which contains parallel 3×3 and 5×5 dual-channel convolution kernels to extract multi-scale defect features; A lightweight classification model based on transfer learning performs spatial attention weighting on feature maps and outputs qualitative defect results.

2. A qualitative detection method for tiny linear defects on the surface of a magnetic tile according to claim 1, characterized in that The light source adjustment of the multi-directional illumination imaging system specifically includes the following consecutive operation steps: The light source bracket is directly connected to the stepper motor output shaft through a rigid coupling. After receiving the pulse signal, the motor starts rotating at a step angle of 1.8°, triggering the camera to capture the first frame of dynamic image at the initial 0° azimuth position. After the acquisition is completed, the motor immediately rotates at a constant speed of 200 rpm. Every time it rotates 10° mechanical angle, the photoelectric encoder is triggered to generate a positioning signal. The motor completes the brake lock within 2ms after receiving the positioning signal. After locking, the light source controller applies an 800mA constant current drive to the LED light bar, stabilizing the light intensity to a range of 950±10lux within 50ms. At this time, the polarization camera performs single-frame acquisition with an exposure time of 180μs. After the acquisition is completed, the motor is immediately unlocked and rotates to the next angle phase. This process is repeated until the dynamic image acquisition of 18 phases within the 180° range is completed; During the entire rotation process, the embedded system dynamically monitors ambient light interference in real time. When it dynamically detects that the background illumination changes by more than 5 lux, it automatically increases the drive current to 850 mA for light intensity compensation.

3. A qualitative detection method for tiny linear defects on the surface of a magnetic tile according to claim 2, characterized in that The directional gradient histogram enhancement process is performed in the following specific steps: First, the original input dynamic image is subjected to Gaussian filtering for noise reduction, using a 3×3 pixel filter window and a convolution kernel with a standard deviation of σ=1.

5. The filtered dynamic image is then stored in a buffer. Then, a Sobel operator group with fixed parameters is used to synchronously calculate the gradient components in four directions. The horizontal kernel [-1, 0, 1; -2, 0, 2; -1, 0, 1] is used in the 0° direction, the oblique kernel [0, 1, 2; -1, 0, 1; -2, -1, 0] is used in the 45° direction, the vertical kernel [-1, -2, -1; 0, 0, 0; 1, 2, 1] is used in the 90° direction, and the reverse oblique kernel [-2, -1, 0; -1, 0, 1; 0, 1, 2] is used in the 135° direction. After the calculation of each pixel is completed, the gradient amplitudes in the four directions are immediately compared, the direction with the largest amplitude is marked as the main direction of the pixel and a direction coding map is generated; Then, guided by the directional coding map, local neighborhood processing is performed on each pixel in its main direction: a 3×3 pixel area is intercepted with the pixel as the center, and the grayscale values ​​of all pixels in the same main direction in the area are extracted to generate a one-dimensional array, and a histogram equalization operation is performed on this array; The equalized pixel value I' is gamma corrected by the table lookup method, and the correction function is I'=255×(I / 255) 0.7 , where I is the input grayscale value; The final output dynamic image is scaled to its original size through bilinear interpolation and then transmitted to the next processing module.

4. A qualitative detection method for tiny linear defects on the surface of a magnetic tile as claimed in claim 3, characterized in that , the dual-channel convolution kernel feature extraction is implemented in the following steps: First, the pre-processed dynamic image is simultaneously input into the dual-channel processing path. The first channel uses a 3×3 convolution kernel to extract high-frequency details. The convolution kernel weight matrix is ​​fixed to [-0.5, 1, -0.5; -0.5, 1, -0.5; -0.5, 1, -0.5], the step size is set to 2 pixels, and the border adopts a symmetrical filling mode. The second channel uses a 5×5 convolution kernel to extract texture structure, the weight matrix is ​​[0, 0.2, 0.5, 0.2, 0; 0.2, -0.3, -0.8, -0.3, 0.2; 0.5, -0.8, 3, -0.8, 0.5; 0.2, -0.3, -0.8, -0.3, 0.2; 0, 0.2, 0.5, 0.2, 0], and the step size is set to 1 pixel; After each channel outputs a feature map, the variance value within its 7×7 local window is calculated immediately. When the variance of the first channel feature map is greater than 1200, the fusion weight is automatically set to (0.4, 0.6), otherwise it is set to (0.6, 0.4). The two-channel feature maps are pixel-wise weighted fused before ReLU activation. The fused feature map is batch normalized, the sliding mean β is set to 0.65, and the variance scaling factor γ is set to 1.2; the final output feature map is upsampled to the original resolution by bilinear interpolation.

5. The method for qualitatively detecting minute linear defects on the surface of a magnetic tile according to claim 4, characterized in that: The spatial attention weighting is implemented through the following specific process: First, the 128×128×64-dimensional feature map output by the feature extraction module is input into a 1×1 convolutional layer. This layer contains three convolution kernels, each of which generates a single-channel weight map. The three weight maps are superimposed and normalized into an initial weight matrix between 0 and 1 using a Sigmoid activation function. A defect area screening mechanism is then established: the mean of each 8×8 local area in the initial weight matrix is ​​calculated. When the regional mean exceeds 0.65, it is identified as a defect-sensitive area, and the weights of all pixels in that area are increased to 1.35 times their original values. At the same time, the background area is dynamically detected: if the regional mean is lower than 0.25 and the distance to the nearest defect-sensitive area is greater than 20 pixels, the weight is reduced to 0.75 times the original value; The adjusted weight matrix is ​​multiplied with the original feature map at the pixel level. Before multiplication, the feature map is normalized so that the mean of each channel is 0 and the standard deviation is 1. When the final weighted feature map is input into the fully connected layer, additional computing resources are allocated to high-response pixels whose weight values ​​are in the top 10%, and their storage addresses in memory are mapped to the cache area to speed up access.

6. A qualitative detection method for minute linear defects on the surface of a magnetic tile according to claim 5, characterized in that ,The specific implementation process of the lightweight classification model is as follows: First, the spatial attention weighted feature map is input into the MobileNetV3 base network, which retains the output feature map of the penultimate convolution layer; The global average pooling layer at the end of the original architecture was removed and replaced with a custom feature processing layer consisting of 256 neurons. Each node receives a 1152-dimensional input vector from the previous layer in a fully connected manner. The input vector is normalized before entering the neuron by subtracting the sliding mean of 125.6 and dividing by the standard deviation of 48.

3. The activation function for each neuron uses a leaky ReLU, with the negative slope parameter α fixed at 0.1, and the output value truncated to the range of 0-6.0 to prevent gradient explosion. The 256-dimensional feature vector output by the neuron enters the two-node output layer, where the weight matrix is ​​initialized to a diagonal reinforced form of [1.8, -0.3; -0.3, 1.8], and the bias vector is set to [0.4, -0.4]. Finally, the category probability is calculated through the Softmax function, and an alarm signal is triggered when the defect category probability value is ≥0.6; The computing load is dynamically monitored during model execution. If the single inference time exceeds 50ms, the statistics update function of the batch normalization layer is automatically disabled to increase the processing speed by 15%.

7. A qualitative detection device for tiny linear defects on the surface of magnetic tiles, characterized by , the specific structure of the detection equipment: The closed darkroom features a 1.5mm-thick aluminum alloy frame and an anodized outer shell. The inner wall is coated with a carbon nanotube-enhanced light-absorbing coating, achieving an absorbance of 98.7% ± 0.3% at a wavelength of 650nm. An XYZ three-axis mechanical stage is mounted on top of the darkroom. The X-axis utilizes a 0.1μm resolution grating ruler for closed-loop control, the Y-axis is equipped with a linear motor with ±0.05mm positioning accuracy, and the Z-axis utilizes a harmonic reducer for motorized focusing with a range of 0 to 20mm. The annular light source bracket is fixed to the center of the bottom surface of the dark box through a 304 stainless steel flange. There are 18 sets of LED light bar mounting positions evenly distributed around the bracket circumference. Each mounting position is equipped with a precision wedge-shaped slot with an inclination of 35°±0.1°. The polarization camera is mounted on the side wall of the darkroom at a distance of 300 mm from the center via a carbon fiber gimbal. The surface of the CMOS sensor is coated with an antireflection coating, and the spectral response peak is strictly matched to 650 nm ± 2 nm. The embedded processing unit's FPGA module incorporates a dedicated pipeline architecture. After dynamic image data is input via the Camera Link interface, it first enters the preprocessing pipeline to perform directional gradient enhancement calculations. The enhanced dynamic image is then directly transmitted to the ARM processor via the DMA channel. The processor then calls the classification model weights stored in the LPDDR4 memory to perform real-time inference.

8. A qualitative detection device for minute linear defects on the surface of a magnetic tile according to claim 7, characterized in that , the synchronous control of the polarization camera is implemented as follows: The polarizing filter installed in front of the camera lens is driven to rotate by a micro harmonic reducer. The reducer output shaft and the filter holder adopt a conical interference fit to ensure that the axial runout is ≤0.005mm. The filter's angular position is dynamically monitored in real time by a 17-bit absolute encoder, and the encoder data is transmitted to the motion controller via the RS-485 interface at a frequency of 1MHz; When the light source bracket starts to rotate, the controller synchronously starts the closed-loop control of the polarization filter. Every time the light source rotates 9.7°, the filter is pre-accelerated to the target angle. When the light source reaches the 10° phase point, the photoelectric synchronization pulse triggers the filter to accurately position. The positioning error compensation algorithm uses quadratic polynomial fitting: if the deviation Δθ between the encoder feedback value and the target value is greater than 0.3°, the compensation angle δ=0.6Δθ+0.05(Δθ)² is immediately calculated and the correction is completed within 10ms. The filter is locked within the target angle range of ±0.05° during dynamic image acquisition. After locking, the piezoelectric ceramic actuator applies a 15V holding voltage to suppress vibration; After each acquisition, the filter rotates at 1200 rpm to the next target angle, which strictly follows The geometric relationship of is the current light source azimuth, ensuring that the polarization direction is always perpendicular to the incident light plane; The system automatically performs zero-point calibration every 24 hours, driving the filter to rotate to the mechanical hard limit and then retreating 0.5° as the reference zero point.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or a computer program stored in the memory, and when the processor executes the one or the computer program, the computer device implements the method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Visual inspection method for micro-defects on the surface of magnetic tiles

    CN108230324B

  • Magnetic shoe surface defect detection system and method

    CN110599470A

  • Optical inspection device and method

    US20210270727A1