A magnetic disc defect detection method based on improved visual attention mechanism

By improving the magnetic disk defect detection method based on the visual attention mechanism, adaptive threshold adjustment and multi-scale pyramid model are used to extract brightness, orientation and edge features and generate a global saliency map, which solves the problem of low efficiency of manual detection and achieves efficient and accurate defect detection.

CN115908399BActive Publication Date: 2025-10-03ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211722655.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-10-03
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

In the existing technology, magnetic disc defect detection relies on manual inspection, which leads to low efficiency, missed detection and false detection, and is difficult to adapt to industrial assembly line production.

Method used

A magnetic disc defect detection method based on an improved visual attention mechanism is adopted. Through adaptive threshold adjustment, brightness, orientation and edge features are extracted, a multi-scale pyramid model is constructed, a global saliency map is generated, and the defect area is marked using a maximum threshold segmentation algorithm.

Benefits of technology

The accuracy and speed of magnetic disc defect detection are improved, the impact of redundant information is reduced, and it adapts to the needs of industrial assembly line production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115908399B_ABST
    Figure CN115908399B_ABST
Patent Text Reader

Abstract

The present invention discloses a magnetic disc defect detection method based on an improved visual attention mechanism, comprising the following steps: obtaining a magnetic disc image to be detected and performing preprocessing; extracting primary features of brightness, orientation, and edge of the image; performing multi-scale sampling based on the brightness, orientation, and edge feature images to construct a multi-scale pyramid; adopting a central-peripheral difference sampling method to obtain brightness, orientation, and edge feature contrast mapping images; merging the brightness, orientation, and edge feature contrast mapping images into sub-saliency maps after normalization processing; constructing brightness, orientation, and edge saliency maps based on the brightness, orientation, and edge sub-saliency maps; performing a normalization operation based on the brightness, orientation, and edge saliency maps and linearly adding them to obtain a global total saliency map; and detecting magnetic disc defect areas based on the global total saliency map. The present invention proposes a method for obtaining magnetic disc defect areas based on the three features of brightness, orientation, and edge, which is more adaptable to low-contrast defect target detection than the traditional ITTI algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a magnetic sheet defect detection method based on an improved visual attention mechanism, which belongs to the field of image detection technology. Background Art

[0002] Magnetic disks are extremely important components in electronic information products. Detecting magnetic disk defects has always been a problem in magnetic disk production. Currently, magnetic disk defect detection still relies on traditional visual observation. However, with the industrialization of mass production, this method not only consumes a large amount of manpower and material resources, but manual inspection is also prone to low-level errors such as inefficiency, missed detections, and false detections due to non-objective factors. Therefore, the detection method proposed in the present invention, based on an improved visual attention mechanism, can not only overcome the above-mentioned shortcomings of traditional detection, but also adapt to the industrial assembly line production of magnetic disks to the greatest extent possible.

[0003] Utilizing the visual attention mechanism for object detection is currently the most common detection method. When the human visual nervous system receives a large number of sensory stimuli, it exhibits differential responses. Typically, only highly salient areas of a scene are observed and analyzed, while information outside of our focus of attention is ignored. Saliency is a characteristic that stands out from the surrounding environment in a complex visual scene, allowing it to be distinguished and extracted. It can also refer to a "point of interest" in the subjective consciousness of a specific individual. The visual attention mechanism model is a mathematical model based on the human visual neural network. It first linearly filters the input image to isolate primary features. A Gaussian pyramid is constructed using multi-scale sampling. An image feature map is extracted based on the central and peripheral sampling of the retina. Finally, the obtained feature map is normalized and linearly superimposed to form a saliency map. Compared to the input image, the saliency map can significantly suppress redundant information, highlight valid information, and significantly shorten the detection process.

[0004] The principle of the visual attention mechanism is to suppress redundant information and enhance effective information. The present invention is intended for magnetic disk defect detection. It uses an improved visual attention mechanism to enhance the contrast between defective areas and normal areas of the magnetic disk, thereby achieving detection of defective areas of the magnetic disk. Summary of the Invention

[0005] The present invention aims to overcome the above-mentioned defects of the prior art and provides a magnetic disk defect detection method based on an improved visual attention mechanism. It proposes a detection model based on three primary features: brightness, orientation, and edge. Compared with the traditional visual attention mechanism model, it has better detection effect on low-contrast targets.

[0006] To achieve the above objectives, the present invention provides a magnetic disc defect detection method based on an improved visual attention mechanism, comprising the following steps:

[0007] S1 obtains the magnetic disk image to be detected, performs adaptive threshold adjustment on its grayscale value, and enhances the image information;

[0008] S2. Extract the three underlying primary features of the magnetic disk image: brightness, orientation, and edge:

[0009] S3. Perform multi-scale sampling based on the underlying primary feature image and construct a multi-scale pyramid;

[0010] S4. Constructing a global saliency map based on a multi-scale pyramid;

[0011] S5. Process the global total saliency map based on the maximum threshold segmentation and mark the defective areas of the magnetic disk.

[0012] Wherein, step S1 includes:

[0013] Obtain the image of the magnetic disk to be detected, perform adaptive threshold adjustment on the image based on the grayscale value of the area to be detected, and reduce the proportion of background area pixels in the entire image. Use the bilateral filter kernel function to perform convolution processing on the image to be detected, eliminate the noise and useless detail information mixed in the acquisition process, and highlight the salient areas in the image.

[0014] Wherein, step S2 includes:

[0015] S21. Brightness feature extraction: Perform point-to-point multiplication on the bilaterally filtered image, maximize the grayscale value of the processed image, and invert the pixels of the processed image to obtain the brightness feature of the image.

[0016] S22. Orientation feature extraction: A Gabor filter with a convolution kernel size of 19×19 is used to convolve the magnetic disk image at four directions: 0°, 45°, 90°, and 135°. When the magnetic disk has a significant change in a certain frequency and direction, the Gabor filter will show the maximum response in that direction. The formula includes:

[0017]

[0018] x'=xcos(θ)-ysin(θ) (2)

[0019] y'=-xsin(θ)-ycos(θ) (3)

[0020] After experiments, the present invention selects a 19×19 rectangle as the convolution kernel, selects parameters γ=1, λ=7, δ=3.5, and θ∈{0°, 45°, 90°, 135°} to obtain orientation features in four directions.

[0021] S23. Edge Feature Extraction: Magnetic edge features are extracted using an improved Canny edge algorithm. A 3×3 gradient template is used to calculate the distance between pixels. A weighted sum of the vertical and diagonal gradients of the image is performed. Grayscale gradient changes in edge regions are monitored, and points with large gradient magnitudes are marked as candidate edge points.

[0022] Wherein, step S3 includes:

[0023] The feature image is used as the bottom image to construct a multi-scale pyramid. The feature image resolution is used as the 0-scale image. 2 is used as the decrement factor to process the 0-scale image. Every time the resolution decreases, the number of image layers increases by one until the 5-scale image is reached.

[0024] Wherein, step S4 includes:

[0025] S41. Use the central-peripheral difference sampling method to obtain brightness, orientation, and edge feature contrast mapping images. Select three groups of atlases (0,3), (1,4), and (2,5). Use interpolation to process the feature group images, keep the image size consistent within the group, reduce the amount of information reflected in a single pixel, and perform point-to-point difference mapping to map out the significant information in the feature image.

[0026] S42. In the absence of top-down supervision, define an image normalization operator N(.) to calculate the maximum value M and the average value m of all other local extreme values; finally, compare the entire image with (Mm) 2 Multiplying them together will fix the value range of the saliency map to a fixed range [0..255].

[0027] S43. Based on the above steps, we can obtain contrast maps of brightness, orientation, and edge features in the (0, 3), (1, 4), and (2, 5) atlases, respectively. We normalize the feature contrast maps, suppress common areas, highlight salient areas, and merge them into sub-feature saliency maps. The formula used is as follows:

[0028]

[0029]

[0030]

[0031] Among them, I f represents the brightness sub-feature saliency map, represents the sub-feature saliency map, C f Denotes the edge sub-feature saliency map, c∈{0,1,2}, s=c+3. The brightness, orientation, and edge sub-feature saliency maps are combined into a saliency map using the following formula:

[0032]

[0033]

[0034]

[0035] in, represents the brightness saliency map, represents the orientation saliency map, Represents the edge saliency map. Normalize the brightness saliency map, orientation saliency map, and edge saliency map to obtain three images with equal weights. Add them together and remove the average value to obtain the global total saliency map. The formula is as follows:

[0036]

[0037] Among them, step S5 includes: using the maximum entropy threshold to automatically obtain the segmentation threshold of the saliency map, performing binary segmentation on the saliency map based on the threshold, creating a magnetic disk defect area data set, using binary image morphological operations to track the data set, and marking the magnetic disk defect area according to different data parameters.

[0038] The working principle of the present invention is: using adaptive thresholds to adjust the overall grayscale value of the image, enhancing the information of the area to be detected, extracting three primary features of the magnetic disk image: brightness, orientation, and edge, simulating the human visual attention mechanism to construct a multi-scale Gaussian pyramid model to obtain a magnetic disk defect saliency map, creating a magnetic disk defect area data set based on the maximization threshold segmentation algorithm, using binary image morphological operations to track the data set, and marking the magnetic disk defect area according to different data parameters.

[0039] The advantages of the present invention are: using adaptive thresholds to adjust the grayscale value to reduce the proportion of white background areas, while simulating the visual attention mechanism and using brightness, orientation, and edge features to extract the global saliency map of the magnetic disk, which can eliminate the influence of irrelevant information on the central area to be inspected to the greatest extent, and help improve calculation speed and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is a flowchart of the implementation of the magnetic sheet defect detection method based on the improved visual attention mechanism disclosed in the present invention;

[0041] Figure 2 a- Figure 2 b is the gradient template of the Sobel operator, where Figure 2 a is the vertical template, Figure 2 b is the horizontal template;

[0042] Figure 3 This is a schematic diagram of the non-maximum suppression operation;

[0043] Figure 4 a- Figure 4 c is the detection result of the typical defect image of the magnetic disk, where Figure 4 a is the image to be detected, Figure 4 b is the peeling defect annotated image, Figure 4 c is the bright spot defect annotated image. DETAILED DESCRIPTION

[0044] The specific implementation methods of the present invention are further described below through specific implementation examples in conjunction with the accompanying drawings.

[0045] like Figure 1 As shown in the figure, the magnetic disc defect detection method based on the improved visual attention mechanism has the following specific steps:

[0046] S1 obtains the magnetic disk image to be detected, performs adaptive threshold adjustment on its grayscale value, and enhances the image information;

[0047] S2. Extract the three underlying primary features of the magnetic disk image: brightness, orientation, and edge:

[0048] S3. Perform multi-scale sampling based on the underlying primary feature image and construct a multi-scale pyramid;

[0049] S4. Constructing a global saliency map based on a multi-scale pyramid;

[0050] S5. Process the global total saliency map based on the maximum threshold segmentation and mark the defective areas of the magnetic disk.

[0051] Wherein, step S1 includes:

[0052] An industrial camera is used to acquire images of magnetic disks to be inspected. First, targeted grayscale adaptive threshold adjustments are performed on areas with white backgrounds in the captured image to reduce the significant proportion of background pixels in the entire image. A bilateral filter kernel function is then used to perform convolution processing on the image to be inspected, eliminating noise and useless detail information introduced during the acquisition process and highlighting the significant areas in the image.

[0053] Wherein, step S2 includes:

[0054] S21. Brightness feature extraction: Perform point-to-point multiplication on the image after bilateral filtering, then maximize the grayscale value, and use pixel inversion on the processed image to obtain the brightness feature of the image.

[0055] S22. Orientation feature extraction: A Gabor filter with a convolution kernel size of 19×19 is used to convolve the magnetic disk image at four directions: 0°, 45°, 90°, and 135°. When the magnetic disk has a significant change in a certain frequency and direction, the Gabor filter will show the maximum response in that direction. The formula includes:

[0056]

[0057] x'=xcos(θ)-ysin(θ) (2)

[0058] y'=-xsin(θ)-ycos(θ) (3)

[0059] After experiments, the present invention selects a 19×19 rectangle as the convolution kernel, selects parameters γ=1, λ=7, δ=3.5, and θ∈{0°, 45°, 90°, 135°} to obtain orientation features in four directions.

[0060] S23. Edge feature extraction: Based on an improved Canny edge algorithm, the edge features of the magnetic disk are extracted using a 3×3 gradient template, such as Figure 2 As shown in the figure, the image is convolved in both the x and y directions to calculate the distance between pixels. The gradients in the vertical and diagonal directions of the image are weighted summed to monitor the grayscale gradient changes in the edge area and perform non-maximum suppression of redundant points. Figure 3 As shown in the figure, within a 3×3 neighborhood, the pixels around the center point A(i,j) are divided into 8 directional neighborhoods. For each pixel point, if the gradient amplitude of A(i,j) is larger than the gradient amplitude of the two adjacent pixel points A1 and A2 in its gradient direction, the point is marked as a candidate edge point to obtain the image edge features.

[0061] Wherein, step S3 includes:

[0062] The feature image is used as the bottom image to construct a multi-scale pyramid. The feature image resolution is used as the 0-scale image. 2 is used as the decrement factor to process the 0-scale image. Every time the resolution decreases, the number of image layers increases by one until the 5-scale image is reached.

[0063] Wherein, step S4 includes:

[0064] S41. Use the central-peripheral difference sampling method to obtain brightness, orientation, and edge feature contrast mapping images. Select three groups of atlases (0,3), (1,4), and (2,5). Use interpolation to process the feature group images, keep the image size consistent within the group, reduce the amount of information reflected in a single pixel, and perform point-to-point difference mapping to map out the significant information in the feature image.

[0065] S42. In the absence of top-down supervision, define an image normalization operator N(.) to calculate the maximum value M and the average value m of all other local extreme values; finally, compare the entire image with (Mm) 2 Multiplying them together will fix the value range of the saliency map to a fixed range [0..255].

[0066] S43. Based on the above steps, we can obtain contrast maps of brightness, orientation, and edge features in the (0, 3), (1, 4), and (2, 5) atlases, respectively. We normalize the feature contrast maps, suppress common areas, highlight salient areas, and merge them into sub-feature saliency maps. The formula used is as follows:

[0067]

[0068]

[0069]

[0070] Among them, I f represents the brightness sub-feature saliency map, represents the sub-feature saliency map, C f Denotes the edge sub-feature saliency map, c∈{0,1,2}, s=c+3. The brightness, orientation, and edge sub-feature saliency maps are combined into a saliency map using the following formula:

[0071]

[0072]

[0073]

[0074] in, represents the brightness saliency map, represents the orientation saliency map, Represents the edge saliency map. Normalize the brightness saliency map, orientation saliency map, and edge saliency map to obtain three images with equal weights. Add them together and remove the average value to obtain the global total saliency map. The formula is as follows:

[0075]

[0076] Wherein, step S5 includes:

[0077] The maximum entropy threshold is used to automatically obtain the segmentation threshold of the saliency map. The saliency map is binary segmented based on the threshold to create a magnetic disc defect area dataset. The binary image morphological operation is used to track the dataset. The magnetic disc defect area is marked according to different data parameters. The peeling defect and bright spot defect detection effect diagrams are shown below. Figure 4 b. Figure 4 As shown in c.

Claims

1. A magnetic disc defect detection method based on an improved visual attention mechanism, characterized in that: The steps include: S1 obtains the magnetic disk image to be detected, performs adaptive threshold adjustment on its grayscale value, and enhances the image information; S2. Extract the three underlying primary features of the magnetic disk image: brightness, orientation, and edge: S3. Perform multi-scale sampling based on the underlying primary feature image and construct a multi-scale pyramid; S4. Constructing a global saliency map based on a multi-scale pyramid; Specifically include: S41. Obtain brightness, orientation, and edge feature contrast maps using a central-peripheral difference sampling method. Select three image sets (0, 3), (1, 4), and (2, 5). Interpolate the feature group images to maintain consistent image size within the group, reduce the amount of information reflected in a single pixel, and perform point-to-point difference mapping to reveal significant information in the feature images. S42. In the absence of top-down supervision, define an image normalization operator , calculate the maximum value M and the average value m of all other local extreme values; finally, compare the entire image with Multiplying, the value range of the saliency map is fixed to a range of [0..255]; S43. Based on the above steps, we can obtain contrast maps of brightness, orientation, and edge features in the (0, 3), (1, 4), and (2, 5) atlases, respectively. We normalize the feature contrast maps, suppress common areas, highlight salient areas, and merge them into sub-feature saliency maps. The formula used is as follows: (4) (5) (6) in, represents the brightness sub-feature saliency map, represents the saliency map towards the sub-feature, represents the edge sub-feature saliency map, ; The brightness, orientation, and edge sub-feature saliency maps are combined into a saliency map. The formula used is as follows: (7) (8) (9) in, represents the brightness saliency map, represents the orientation saliency map, represents the edge saliency map; the brightness saliency map, orientation saliency map, and edge saliency map are all normalized to obtain three images with equal weights. After adding them together and removing the average value, the global total saliency map is obtained. The formula is as follows: (10) S5. Process the global total saliency map based on the maximum threshold segmentation and mark the defective areas of the magnetic disk.

2. The magnetic disc defect detection method based on an improved visual attention mechanism according to claim 1, characterized in that: The adaptive threshold adjustment for its grayscale value described in step S1: first, for the white background area in the captured image, targeted grayscale value adaptive threshold adjustment is performed to reduce the significant proportion of background area pixels in the entire image; a bilateral filter kernel function is used to perform convolution processing on the image to be detected to eliminate the noise and useless detail information mixed in the acquisition process and highlight the significant areas in the image.

3. The magnetic disc defect detection method based on an improved visual attention mechanism according to claim 1, characterized in that: Step S2 includes: S21. Brightness feature extraction: Perform point-to-point multiplication on the bilaterally filtered image, maximize the grayscale value of the processed image, and invert the pixels of the processed image to obtain the image's brightness features. S22. Orientation feature extraction: A Gabor filter with a convolution kernel size of 19×19 is used to convolve the magnetic disk image at four directions: 0°, 45°, 90°, and 135°. When the magnetic disk has a significant change in a certain frequency and direction, the Gabor filter will show the maximum response in that direction. The formula includes: (1) (2) (3) Select The rectangle is used as the convolution kernel, and the parameters are selected , Obtain orientation features in four directions; S23. Edge feature extraction: Based on an improved Canny edge algorithm, the edge features of the magnetic disk are extracted; a The gradient template calculates the distance between pixels, performs weighted summation on the gradients in the vertical and diagonal directions of the image, monitors the gradient changes of the grayscale values ​​in the edge area, and marks points with large gradient amplitudes as candidate edge points.

4. The magnetic disc defect detection method based on an improved visual attention mechanism according to claim 1, characterized in that: Step S3 includes: The feature image is used as the bottom image to construct a multi-scale pyramid. The feature image resolution is used as the 0-scale image. 2 is used as the decrement factor to process the 0-scale image. Every time the resolution decreases, the number of image layers increases by one until the 5-scale image is reached.

5. The magnetic disc defect detection method based on an improved visual attention mechanism according to claim 1, characterized in that: Step S5 includes: using the maximum entropy threshold to automatically obtain the segmentation threshold of the saliency map, performing binary segmentation on the saliency map based on the threshold, creating a magnetic disk defect area data set, using binary image morphological operations to track the data set, and marking the magnetic disk defect area according to different data parameters.

Citation Information

Patent Citations

  • Vision conspicuousness-based cloth flaw detection method

    CN103871053A

  • Magnetic tile surface defect detection method based on improved machine vision attention mechanism

    CN106093066A