An optical spectrum-based material surface defect detection system
By synchronously recording spatial coordinates and spectra with a multi-axis displacement stage and a confocal spectral probe, and combining hardware triggers and neural networks, the problem of synchronous registration and defect differentiation in spectral detection systems has been solved, realizing high-precision material surface defect detection and a fully automated process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU WEITONG INTELLIGENT MANUFACTURING TECHNOLOGY CO LTD
- Filing Date
- 2026-06-04
- Publication Date
- 2026-07-03
AI Technical Summary
Existing optical spectral detection systems cannot simultaneously register spatial coordinates and diffuse reflectance spectra, cannot distinguish between different types of defects, and lack a fully automated detection process, making it difficult to meet the needs of high-precision and batch detection.
Spatial coordinates and spectra are recorded synchronously by a multi-axis displacement stage and a confocal spectral probe. By combining hardware triggers, spectral data cleaning, characteristic peak decomposition, spiking neural networks, and a 3D reconstruction module, the spectral data is registered and defect is classified to generate a structured report.
It achieves high-precision defect detection, can distinguish between bubbles and scratches, generates 3D point cloud models and structured reports, shortens analysis time, and improves detection efficiency.
Smart Images

Figure CN122330001A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of non-destructive testing technology for material surfaces, specifically a material surface defect detection system based on optical spectroscopy. Background Technology
[0002] Non-destructive testing technology for material surfaces is widely used in the manufacturing of precision optical components and the testing of key components for high-end equipment. Optical spectroscopy testing, due to its advantages of being non-contact, non-destructive, and fast, has become one of the important methods in this field.
[0003] In the fields of precision optical component manufacturing and key component testing of high-end equipment, when the material to be tested simultaneously meets the requirements of a highly reflective curved surface structure, a surface coated with a heat-sensitive coating to prevent high-power laser excitation, and a submicron level of testing accuracy while distinguishing between different types of defects such as scratches, under-film bubbles, and internal impurities, the existing technology has the following defects or problems: 1. Existing spectral acquisition systems cannot synchronously register spatial coordinates and diffuse reflectance spectra, lack precise correspondence indexes established by hardware triggers, and cannot adaptively eliminate the cosine attenuation effect of spectral intensity caused by highly reflective curved surfaces based on the angle between the surface normal vector and the incident light direction. At the same time, they lack quality marking and weak signal interpolation mechanisms for low signal-to-noise ratio data, resulting in registration errors and intensity distortion in spectral data, with a large number of weak signal regions becoming detection blind spots. When bubbles and scratches have the exact same intrinsic spectral response, existing spectral feature analysis methods can only output the same scalar values of the intrinsic material state, and cannot use spatial gradient information to distinguish between isotropic and anisotropic defects. Existing spiking neural networks only perform spatial clustering and segmentation based on the similarity of gray values, and cannot transform spatial gradient differences into temporal distribution features of the ignition time matrix, nor can they quantify the temporal features into a single scalar entropy value for global classification through ignition entropy calculation, resulting in the complete inability to distinguish between different physical structural defects with the same spectral features. 2. Existing defect classification methods rely solely on spectral features or spatial morphological features, lacking a mechanism to fuse ignition entropy with regional geometric features for template matching and confidence assessment. Consequently, the classification results lack reliable credibility metrics. Existing detection systems lack a fully automated closed-loop process from raw spectral acquisition to structured reports and 3D model export, relying on manual intervention and failing to meet the needs of mass industrial online inspection.
[0004] It should be noted that the above content falls within the inventor's technical knowledge and does not necessarily constitute prior art. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a material surface defect detection system based on optical spectroscopy, which solves the current problems.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a material surface defect detection system based on optical spectroscopy, comprising: The defect scanning and spectral acquisition module, with its multi-axis displacement stage and confocal spectral probe, synchronously records the spatial coordinates and diffuse reflectance spectra of each scanning point through hardware triggers, and outputs registered spectral and spatial data pairs. The spectral data cleaning module is used to receive the registered spectral and spatial data pairs output by the defect scanning spectral acquisition module, preprocess the original spectrum, and output a spectral dataset with quality labels. A characteristic peak decomposition and defect encoding module is used to receive the quality-labeled spectral dataset; It can also perform peak position detection, linear fitting, overlapping peak decomposition, state mapping and neighborhood normalization on spectral datasets, and output defect-sensitive state vectors; The pulse neural network ignition module receives the defect-sensitive state vector, performs neuron ignition and entropy value calculation, and outputs a three-dimensional ignition map and ignition entropy. The defect classification module is used to receive the three-dimensional ignition map and ignition entropy, perform map maximum value projection, connected component extraction, ignition entropy and geometric feature fusion, preset template matching, confidence calculation and weak signal point interpolation, and output the defect classification map. The 3D reconstruction module is used to perform seed point growth, contour fitting and depth inversion on the defect classification map, and output quantified defect parameters and 3D point cloud model. The report output module is used to visualize and annotate the quantified defect parameters and the three-dimensional point cloud model and export them in a structured manner to output an inspection report.
[0007] In some embodiments, the process of output registration of spectral and spatial data pairs is as follows: A multi-axis displacement stage drives a confocal spectral probe to scan the surface of the material under test point by point, simultaneously acquiring the original spatial coordinate matrix and the original diffuse reflectance spectral sequence. The formula is as follows: ; ; in, Let i be the spatial coordinates of the i-th scan. This represents the spectral intensity distribution at that point. Where λ is the wavelength and N is the total number of scan points; The hardware trigger sends a synchronization pulse signal to the spectral probe every time the displacement stage moves one step. Upon receiving the pulse, the spectral probe simultaneously acquires the current frame spectrum and reads the coordinates from the displacement stage encoder. It then binds the spectral frame number, X coordinate, and Y coordinate to obtain the registered spectral and spatial data pair. Its formula is: .
[0008] In some embodiments, the process of outputting a quality-labeled spectral dataset is as follows: The original diffuse reflectance spectrum is normalized by energy and compensated for curvature. The baseline is then fitted and subtracted using an asymmetric least squares penalty function, and smoothing filtering is then performed to obtain the enhanced spectrum. Based on the enhanced spectrum, the signal-to-noise ratio is calculated. Points with a signal-to-noise ratio below a preset threshold are marked as weak signals; otherwise, they are marked as valid points. The spectral data with quality labels is output. The specific formula is as follows: ; in, Refers to the quality marker of spectral data.
[0009] In some embodiments, the process of outputting the defect-sensitive state vector is as follows: The peak position detection process is as follows: Calculate the second derivative of the enhanced spectrum, and search for local maxima locations as candidate peak positions. The formula is: ; Where K is the total number of detected peaks; The linear fitting process is as follows: For each candidate peak, fit a Lorentz-Gaussian mixture linear function L( The non-negativity constraint decomposition was solved using the constrained alternating direction multiplier method to obtain the contribution coefficients of each peak. ; The overlapping peak decomposition process is as follows: the contribution coefficient, center wavelength, full width at half maximum (FWHM), and current spatial coordinates are combined to form a five-dimensional original feature vector; The state mapping process is as follows: The built-in amorphous / crystalline material spectral database is queried, and the five-dimensional original feature vector is converted into scalar values of the material's intrinsic state table through nearest neighbor matching. ; The neighborhood normalization process is as follows: Calculate the neighborhood median deviation of the scalar values of the material's intrinsic states, using the following formula: ; in, For a 3x3 neighborhood centered at (i, j), This is the median operator; it calculates the mean of the median deviations across all medians in the neighborhood. and standard deviation Then, a normalization correction is performed, the formula of which is: ; in, For the defect-sensitive state vector, To prevent division by zero correction factor.
[0010] In some embodiments, the process of outputting the three-dimensional ignition map and ignition entropy is as follows: The magnitude of the defect-sensitive state vector is assigned as the initial internal activity term of the neuron, as shown in the following formula: ; in, Spatial location The initial internal activity term of the neuron. Let be the magnitude of the defect-sensitive state vector; Calculate the connection field input ; in, This is the connection field input for the nth iteration. For neurons in the previous iteration The ignition state, which takes the value 0 or 1, and n is the iterative deployment (n = 1, 2, ..., N_max). for The 3x3 neighborhood; The formula for updating internal activity items is: ; Define the exponential decay threshold, its formula is as follows: ; in, The ignition threshold at the nth iteration. As the initial threshold, It is the attenuation constant; Compare internal activity items with ignition thresholds, when ,otherwise This means no ignition; The iterative deployment at the first firing of each neuron is recorded using the following formula: For neurons that have never been ignited The value is assigned to the maximum number of iterations. ; Histogram analysis of the ignition time matrix is performed to calculate the frequency of each ignition time, using the following formula: ; in, Let be the neuron frequency at ignition time t. The total number of neurons is given; then the Shannon entropy is calculated using the following formula: ; Stacking the ignition maps of all iterations in time order yields a three-dimensional ignition map. .
[0011] In some embodiments, the process of outputting the defect classification map is as follows: The process of projecting the maximum value of the ignition spectrum is as follows: The maximum value of the three-dimensional ignition spectrum is projected along the time axis to obtain a two-dimensional maximum ignition density map. ; The connected component extraction process is as follows: the eight-neighbor labeling algorithm is used to extract the ignition connected region, and the area Area, eccentricity Ecc and principal axis direction Ori of each region are calculated. The fusion process of ignition entropy and geometric features is as follows: The ignition entropy H is used as a global feature and concatenated with the regional geometric features to form a joint classification feature, the formula of which is: ; Complete the matching of the preset defect template, and Input the nearest neighbor classifier, calculate the Manhattan distance with the scratch, bubble, and impurity templates, and output the defect type Type corresponding to the minimum distance; Calculate classification confidence ; If the current point is a weak signal point and there are classification results with an execution degree C > 0.7 in its neighborhood, then the inverse distance weighted interpolation method is used to assign the defect type, and weak signal point interpolation is performed accordingly. The formula is as follows: ; in, The neighborhood range of the current point. The value is the Euclidean distance from the target point to the neighboring point s; otherwise, it is marked as an undetectable region, and the final defect classification map ClassMap(x, y) is output.
[0012] In some embodiments, the process of outputting the quantized defect parameter set and the 3D point cloud model is as follows: In the final defect classification map, all pixels with a confidence level greater than 0.75 are identified as defect seed points, and region growing is performed to generate connected defect domains. The growth conditions are that the defect types are the same and the Euclidean distance is less than 1. Morphological closing operations are performed on the connected defect domains to obtain a smooth defect mask. ; Sub-pixel edge points are extracted at the mask boundary, and a closed contour curve is fitted using cubic spline interpolation, as shown in the following formula: ; Where t is the arc length parameter, For the first Undetermined techniques for segmented spline curves; extraction of the original diffuse reflectance spectra corresponding to all pixels in the defect mask at characteristic absorption wavelengths. The absorbance at a certain point is used to calculate the defect depth using Beer-Lambert's law. The formula is as follows: ; in, The molar absorptivity is 1. The equivalent defect concentration is then used; subsequently, the average defect depth is calculated using the following formula: ; The spatial coordinates of each pixel in the defect mask are combined with the corresponding defect depth, as shown in the following formula: The point clouds of all defects are merged to obtain a 3D point cloud model of the defects. ; Perform Delaunay triangulation on the point cloud and calculate the total defect volume. With total surface area Output the set of quantized defect parameters { Total number of defects}.
[0013] In some embodiments, the process of outputting the final detection report is as follows: The defect classification map is mapped to red, green, and blue pseudo-colors for scratches, bubbles, and impurities, respectively, and then weighted and fused with the original optical image. The expression is as follows: ; in, To integrate the weights, generate a defect overlay color image and save it as a PNG file; Calculate the geometric center of each defect region, label the defect type, confidence level, major axis length and average depth at the end of the lead, statistically analyze the defect area and depth distribution, generate area histogram and depth histogram, and save as PNG format; Perform Delaunay triangulation on the 3D point cloud model and export it as an STL file; Create an XML document containing metadata, summary data, defect list, image encoding, and STL file path, and save it as an XML file; When a defect area ≥ 50 μm² and an average depth ≥ 0.5 μm are present, a red warning box will be inserted on the first page of the report, and an alarm sound will be emitted via a buzzer driven by the USB interface.
[0014] Compared with existing technologies, the present invention provides a material surface defect detection system based on optical spectroscopy, which has the following advantages: This material surface defect detection system based on optical spectroscopy, through the linkage of the scanning and spectral acquisition module and the spectral cleaning module, uses hardware triggers to synchronously acquire spatial coordinates and spectral data, and then performs energy normalization, curvature compensation, baseline subtraction and smoothing filtering in sequence, eliminating the cosine attenuation effect of spectral intensity caused by highly reflective curved surfaces, making low signal-to-noise ratio spectral data usable, and providing a high-quality input basis for subsequent defect identification. Secondly, through the linkage between the peak decoupling and encoding module and the ignition module of the spiking neural network, the Lorentz-Gaussian mixture fitting and non-negative constraint decomposition transform the mixed spectrum into scalar values of the intrinsic state of the material. The self-normalized perturbation suppression normalizes and amplifies the spatial gradient difference between bubbles and scratches. The spiking neural network, through the iterative propagation of the connection field and the dynamic modulation of the exponential decay threshold, makes the isotropic gradient and anisotropic gradient show significant differences in the ignition time matrix. Finally, the temporal distribution characteristics are quantified into a single scalar entropy value through the calculation of ignition entropy, so that only one parameter is needed to globally distinguish different physical structural defects with completely identical spectral characteristics, which completely solves the technical problem that traditional spectral analysis cannot distinguish between bubbles and scratches. Finally, through the linkage of the defect classification module, the 3D reconstruction module, and the report output module, the ignition entropy and regional geometric features are fused for template matching and confidence assessment. Subpixel contour fitting and Beer-Lambert law are used to invert the defect depth, generating a set of quantitative parameters including defect type, depth, volume, and surface area, as well as a 3D point cloud model. The detection results are output in the form of XML structured reports and STL 3D models, enabling inspectors to quickly locate the defect location and type, significantly shortening the defect analysis and process adjustment time, and improving the accuracy and efficiency of micro-nano scale defect detection. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the material surface defect detection system based on optical spectroscopy according to the present invention. Detailed Implementation
[0016] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments and accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] It should be understood that the step numbers used in the text are for ease of description only and are not intended to limit the order in which the steps are performed.
[0018] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0019] The terms “comprising” and “including” indicate the presence of the described feature, whole, step, operation, element and / or component, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0020] The term “and / or” refers to any combination of one or more of the associated listed items, as well as all possible combinations, and includes these combinations.
[0021] Example 1: In this example, a sapphire hemispherical cover is used as the sample to be tested. The surface of the sample is a highly reflective curved structure and is coated with a temperature-sensitive antireflection film. The required detection accuracy is 0.3μm, and it is necessary to distinguish between three types of defects: surface scratches, bubbles under the film, and internal impurities.
[0022] A material surface defect detection system based on optical spectroscopy, comprising: The defect scanning and spectral acquisition module, with its multi-axis displacement stage and confocal spectral probe, synchronously records the spatial coordinates and diffuse reflectance spectra of each scanning point through hardware triggers, and outputs registered spectral and spatial data pairs. The process of outputting the registered spectral and spatial data pairs is as follows: A multi-axis displacement stage drives a confocal spectral probe to scan the surface of the material under test point by point, simultaneously acquiring the original spatial coordinate matrix and the original diffuse reflectance spectral sequence. The formula is as follows: ; ; in, Let i be the spatial coordinates of the i-th scan. This represents the spectral intensity distribution at that point. Where λ is the wavelength and N is the total number of scan points; The hardware trigger sends a synchronization pulse signal to the spectral probe every time the displacement stage moves one step. Upon receiving the pulse, the spectral probe simultaneously acquires the current frame spectrum and reads the coordinates from the displacement stage encoder. It then binds the spectral frame number, X coordinate, and Y coordinate to obtain the registered spectral and spatial data pair. Its formula is: ; In this embodiment, a three-axis precision displacement stage is used, with a stroke of 100mm×100mm×50mm and a repeatability of ±0.1μm. The confocal spectral probe has a spectral range of 400nm-1000nm and a resolution of 0.5nm. The scanning step size is set to 0.5μm, and the scanning area is a 10mm×10mm spherical cap region, acquiring a total of 400×400=160,000 scanning points. The hardware trigger automatically sends a TTL pulse signal to the spectral probe every time it moves one step (0.5μm), and the detector integration time is set to 100ms. The spectral data cleaning module receives the registered spectral and spatial data pairs from the defect scanning spectral acquisition module, preprocesses the raw spectra, and outputs a spectral dataset with quality labels. The process of outputting a mass-labeled spectral dataset is as follows: The original diffuse reflectance spectrum is normalized by energy and compensated for curvature. The baseline is then fitted and subtracted using an asymmetric least squares penalty function, and smoothing filtering is then performed to obtain the enhanced spectrum. Based on the enhanced spectrum, the signal-to-noise ratio is calculated. Points with a signal-to-noise ratio below a preset threshold are marked as weak signals; otherwise, they are marked as valid points. The spectral data with quality labels is output. The specific formula is as follows: ; in, A quality marker referring to spectral data; In this embodiment, the energy normalization parameter in the spectral cleaning module =100ms; The curvature compensation parameter is calculated based on the sapphire hemispherical surface equation to determine the angle between the surface normal vector and the incident light at each scanning point, with a value range of 0° to 60°; In the asymmetric least squares penalty function, the asymmetric weight coefficient is 0.01, the smoothing penalty coefficient is 10^5, and the number of iterations is set to 50; The window width of the Savitzky-Golay smoothing filter is 11 points, and the polynomial order is 3; The signal-to-noise ratio threshold is set to 15, and points below this value are marked as weak signal points, otherwise they are valid points. In this embodiment, approximately 5% of the scanning points are marked as weak signal points; The characteristic peak decomposition and defect coding module is used to receive spectral datasets with quality labels; It can also perform peak position detection, linear fitting, overlapping peak decomposition, state mapping and neighborhood normalization on spectral datasets, and output defect-sensitive state vectors; The process of outputting the defect-sensitive state vector is as follows: The peak position detection process is as follows: Calculate the second derivative of the enhanced spectrum, and search for local maxima locations as candidate peak positions. The formula is: ; Where K is the total number of detected peaks; The linear fitting process is as follows: For each candidate peak, fit a Lorentz-Gaussian mixture linear function L( The non-negativity constraint decomposition was solved using the constrained alternating direction multiplier method to obtain the contribution coefficients of each peak. ; The overlapping peak decomposition process is as follows: the contribution coefficient, center wavelength, full width at half maximum (FWHM), and current spatial coordinates are combined to form a five-dimensional original feature vector; The state mapping process is as follows: The built-in amorphous / crystalline material spectral database is queried, and the five-dimensional original feature vector is converted into scalar values of the material's intrinsic state table through nearest neighbor matching. ; The neighborhood normalization process is as follows: Calculate the neighborhood median deviation of the scalar values of the material's intrinsic states, using the following formula: ; in, For a 3x3 neighborhood centered at (i, j), This is the median operator; it calculates the mean of the median deviations across all medians in the neighborhood. and standard deviation Then, a normalization correction is performed, the formula of which is: ; in, For the defect-sensitive state vector, To prevent division by zero correction factor; In this embodiment, the difference step size for second-order derivative calculation in the characteristic peak decomposition and defect encoding module is set to two wavelength channels (corresponding to 1 nm); the Lorentz-Gaussian mixture fitting iteration count is 20, and the convergence threshold is 10^-6; the mixing coefficient η ranges from 0 to 1, with an initial value of 0.5; the non-negative constraint alternating direction multiplier method iteration count is 50, and the convergence threshold is 10^-6; the material intrinsic state mapping uses nearest neighbor matching, and the database contains five standard material states, including single-crystal sapphire and amorphous alumina; in the self-normalization perturbation suppression, the neighborhood... The window is 3×3, and the median deviation is calculated using the fast selection algorithm, with a correction coefficient ε of 10^-6. The pulse neural network ignition module receives the defect-sensitive state vector, performs neuron ignition and entropy calculation, and outputs a three-dimensional ignition map and ignition entropy. The process of outputting the three-dimensional ignition map and ignition entropy is as follows: The magnitude of the defect-sensitive state vector is assigned as the initial internal activity term of the neuron, as shown in the following formula: ; in, Spatial location The initial internal activity term of the neuron. Let be the magnitude of the defect-sensitive state vector; Calculate the connection field input ; in, This is the connection field input for the nth iteration. For neurons in the previous iteration The ignition state, which takes the value 0 or 1, and n is the iterative deployment (n = 1, 2, ..., N_max). for The 3x3 neighborhood; The formula for updating internal activity items is: ; The exponential decay threshold is defined by the following formula: ; in, The ignition threshold at the nth iteration. As the initial threshold, It is the attenuation constant; Compare internal activity items with ignition thresholds, when ,otherwise This means no ignition; The iterative deployment at the first firing of each neuron is recorded using the following formula: For neurons that have never been ignited The value is assigned to the maximum number of iterations. ; Histogram analysis of the ignition time matrix is performed to calculate the frequency of each ignition time, using the following formula: ; in, Let be the neuron frequency at ignition time t. The total number of neurons is given; then the Shannon entropy is calculated using the following formula: ; Stacking the ignition maps of all iterations in time order yields a three-dimensional ignition map. ; In this embodiment, the connection radius of the pulse neural network ignition module is 1.5, the connection coefficient is calculated based on the Gaussian kernel function, and Δx and Δy are the spatial distances between adjacent pixels in the X and Y directions, respectively; the initial internal activity term The L2 norm of the defect-sensitive state vector is taken; the initial threshold is the mean of all U_ij[0], which is approximately 0.8 in this embodiment; the attenuation constant α is 0.1; the maximum number of iterations N_max is set to 50; the ignition state is a binary variable, and the initial state is... =0; In the ignition time matrix, the value of Nmax = 50 is assigned to the unignited neurons; In the calculation of ignition entropy, the logarithmic base is 2; The defect classification module receives the three-dimensional ignition map and ignition entropy, performs maximum map projection, connected component extraction, ignition entropy and geometric feature fusion, preset template matching, confidence calculation and weak signal point interpolation, and outputs a defect classification map. The process of outputting the defect classification map is as follows: The process of projecting the maximum value of the ignition spectrum is as follows: The maximum value of the three-dimensional ignition spectrum is projected along the time axis to obtain a two-dimensional maximum ignition density map. ; The connected component extraction process is as follows: the eight-neighbor labeling algorithm is used to extract the ignition connected region, and the area Area, eccentricity Ecc and principal axis direction Ori of each region are calculated. The fusion process of ignition entropy and geometric features is as follows: The ignition entropy H is used as a global feature and concatenated with the regional geometric features to form a joint classification feature, the formula of which is: ; Complete the matching of the preset defect template, and Input the nearest neighbor classifier, calculate the Manhattan distance with the scratch, bubble, and impurity templates, and output the defect type Type corresponding to the minimum distance; Calculate classification confidence ; If the current point is a weak signal point and there are classification results with an execution degree C > 0.7 in its neighborhood, then the inverse distance weighted interpolation method is used to assign the defect type, and weak signal point interpolation is performed accordingly. The formula is as follows: ; in, The neighborhood range of the current point. The value is the Euclidean distance from the target point to the neighboring point s; otherwise, it is marked as an undetectable region, and the final defect classification map ClassMap(x, y) is output. In this embodiment, the defect classification module uses time axis maximum projection for graph dimensionality reduction, with N_max=50. In the eight-neighbor labeling algorithm, the minimum area threshold for connected regions is set to 4 pixels; joint classification features... It is a four-dimensional vector; the scratch template, bubble template, and impurity template stored in the nearest neighbor classifier are obtained by training with 100 sets of standard samples; in the confidence calculation, Minimum Manhattan distance, The second smallest Manhattan distance; weak signal interpolation, neighborhood. The radius is 5 pixels, and the distance weight function for inverse distance weighted interpolation uses the reciprocal of the Euclidean distance.
[0023] The 3D reconstruction module is used to perform seed point growth, contour fitting and depth inversion on the defect classification map, and output quantified defect parameters and 3D point cloud model. The process of outputting the quantized defect parameter set and the 3D point cloud model is as follows: In the final defect classification map, all pixels with a confidence level greater than 0.75 are identified as defect seed points, and region growing is performed to generate connected defect domains. The growth conditions are that the defect types are the same and the Euclidean distance is less than 1. Morphological closing operations are performed on the connected defect domains to obtain a smooth defect mask. ; Sub-pixel edge points are extracted at the mask boundary, and a closed contour curve is fitted using cubic spline interpolation, as shown in the following formula: ; Where t is the arc length parameter, For the first Undetermined techniques for segmented spline curves; extraction of the original diffuse reflectance spectra corresponding to all pixels in the defect mask at characteristic absorption wavelengths. The absorbance at a certain point is used to calculate the defect depth using Beer-Lambert's law. The formula is as follows: ; in, The molar absorptivity is 1. The equivalent defect concentration is then used; subsequently, the average defect depth is calculated using the following formula: ; The spatial coordinates of each pixel in the defect mask are combined with the corresponding defect depth, as shown in the following formula: The point clouds of all defects are merged to obtain a 3D point cloud model of the defects. ; Perform Delaunay triangulation on the point cloud and calculate the total defect volume. With total surface area Output the set of quantized defect parameters { Total number of defects}; In this embodiment, the seed point confidence threshold in the 3D reconstruction module is set to 0.75; in region growing, the growth threshold is set to 2 pixels, and the defect type difference threshold is set to 0; in morphological closing operations, the structuring element SE is a disk-shaped kernel with a radius of 3 pixels; subpixel edge fitting uses cubic spline interpolation, with the number of spline segments being 1 / 3 of the number of boundary points, and the boundary continuity condition being the continuity of the first derivative; in the Beer-Lambert law, the molar absorptivity of sapphire at 550 nm is set to 1.2 × 10^3 L·mol^-1·cm^-1, and the equivalent defect concentration is set to the calibrated value of 8 × 10^-5 mol / L. The maximum triangle side length of the Delaunay triangulation is limited to 5 pixels, the volume calculation uses the tetrahedral decomposition method, and the surface area calculation uses the triangle accumulation method.
[0024] The report output module is used to visualize and annotate the quantified defect parameters and the 3D point cloud model, and then export the structured data to output an inspection report. The process of outputting the final inspection report is as follows: The defect classification map is mapped to red, green, and blue pseudo-colors for scratches, bubbles, and impurities, respectively, and then weighted and fused with the original optical image. The expression is as follows: ; in, To integrate the weights, generate a defect overlay color image and save it as a PNG file; Calculate the geometric center of each defect region, label the defect type, confidence level, major axis length and average depth at the end of the lead, statistically analyze the defect area and depth distribution, generate area histogram and depth histogram, and save as PNG format; Perform Delaunay triangulation on the 3D point cloud model and export it as an STL file; Create an XML document containing metadata, summary data, defect list, image encoding, and STL file path, and save it as an XML file; When a defect area ≥ 50 μm² and an average depth ≥ 0.5 μm are present, a red warning box will be inserted on the first page of the report, and an alarm sound will be emitted via a buzzer driven by the USB interface.
[0025] It is important to note that the scanning and spectral acquisition module, spectral cleaning module, peak decoupling and encoding module, pulse neural network ignition module, defect classification module, 3D reconstruction module, and report output module operate in series. The output data of the previous module serves as the input data for the next module, thus creating a closed-loop detection process from raw spectral acquisition to defect detection report generation.
[0026] In the application, several formulas are calculated by removing dimensions and taking their numerical values. The formulas are established by collecting a large amount of data and simulating the most recent real situation. Some coefficients or weights in the formulas are set by those skilled in the art according to the actual situation, so they will not be elaborated here.
[0027] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.
[0028] 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. A material surface defect detection system based on optical spectroscopy, characterized in that, include: The defect scanning and spectral acquisition module, with its multi-axis displacement stage and confocal spectral probe, synchronously records the spatial coordinates and diffuse reflectance spectra of each scanning point through hardware triggers, and outputs registered spectral and spatial data pairs. The spectral data cleaning module is used to receive the registered spectral and spatial data pairs output by the defect scanning spectral acquisition module, preprocess the original spectrum, and output a spectral dataset with quality labels. A characteristic peak decomposition and defect encoding module is used to receive the quality-labeled spectral dataset; It can also perform peak position detection, linear fitting, overlapping peak decomposition, state mapping and neighborhood normalization on spectral datasets, and output defect-sensitive state vectors; The pulse neural network ignition module receives the defect-sensitive state vector, performs neuron ignition and entropy value calculation, and outputs a three-dimensional ignition map and ignition entropy. The defect classification module is used to receive the three-dimensional ignition map and ignition entropy, perform map maximum value projection, connected component extraction, ignition entropy and geometric feature fusion, preset template matching, confidence calculation and weak signal point interpolation, and output the defect classification map. The 3D reconstruction module is used to perform seed point growth, contour fitting and depth inversion on the defect classification map, and output quantified defect parameters and 3D point cloud model. The report output module is used to visualize and annotate the quantified defect parameters and the three-dimensional point cloud model and export them in a structured manner to output an inspection report.
2. The material surface defect detection system based on optical spectroscopy according to claim 1, characterized in that, The process of output registration of spectral and spatial data pairs is as follows: A multi-axis displacement stage drives a confocal spectral probe to scan the surface of the material under test point by point, simultaneously acquiring the original spatial coordinate matrix and the original diffuse reflectance spectral sequence. The formula is as follows: ; ; in, Let i be the spatial coordinates of the i-th scan. This represents the spectral intensity distribution at that point. Where λ is the wavelength and N is the total number of scan points; The hardware trigger sends a synchronization pulse signal to the spectral probe every time the displacement stage moves one step. Upon receiving the pulse, the spectral probe simultaneously acquires the current frame spectrum and reads the coordinates from the displacement stage encoder. It then binds the spectral frame number, X-coordinate, and Y-coordinate to obtain the registered spectral and spatial data pair. Its formula is: .
3. The material surface defect detection system based on optical spectroscopy according to claim 1, characterized in that, The process of outputting the mass-labeled spectral dataset is as follows: The original diffuse reflectance spectrum is normalized by energy and compensated for curvature. The baseline is then fitted and subtracted using an asymmetric least squares penalty function, followed by smoothing filtering to obtain the enhanced spectrum. Based on the enhanced spectrum, the signal-to-noise ratio is calculated. Points with a signal-to-noise ratio below a preset threshold are marked as weak signal points; otherwise, they are marked as valid points. The spectral data with quality labels is output. The specific formula is as follows: ; in, Refers to the quality marker of spectral data.
4. The material surface defect detection system based on optical spectroscopy according to claim 1, characterized in that, The process of outputting the defect-sensitive state vector is as follows: The peak detection process is as follows: The second derivative of the enhanced spectrum is calculated, and the location of local maxima is searched as candidate peak positions. The formula is: ; Where K is the total number of detected peaks; The linear fitting process is as follows: For each candidate peak, a Lorentz-Gaussian mixture linear function L( ) is fitted. The non-negativity constraint decomposition was solved using the constrained alternating direction multiplier method to obtain the contribution coefficients of each peak. ; The overlapping peak decomposition process is as follows: the contribution coefficient, center wavelength, full width at half maximum (FWHM), and current spatial coordinates are combined to form a five-dimensional original feature vector; The state mapping process is as follows: The built-in amorphous / crystalline material spectral database is queried, and the five-dimensional original feature vector is converted into scalar values of the material's intrinsic state table through nearest neighbor matching. ; The neighborhood normalization process is as follows: Calculate the neighborhood median deviation of the scalar value of the intrinsic state of the material, using the following formula: ; in, For a 3x3 neighborhood centered at (i, j), This is the median operator; it calculates the mean of the median deviations across all medians in the neighborhood. and standard deviation Then, a normalization correction is performed, the formula of which is: ; in, For the defect-sensitive state vector, To prevent division by zero correction factor.
5. The material surface defect detection system based on optical spectroscopy according to claim 1, characterized in that, The process of outputting the three-dimensional ignition map and ignition entropy is as follows: The magnitude of the defect-sensitive state vector is assigned as the initial internal activity term of the neuron, as shown in the following formula: ; in, For spatial location The initial internal activity term of the neuron. Let be the magnitude of the defect-sensitive state vector; Calculate the connection field input ; in, This is the connection field input for the nth iteration. For neurons in the previous iteration The ignition state, which takes the value 0 or 1, and n is the iterative deployment (n = 1, 2, ..., N_max). for The 3x3 neighborhood; The formula for updating internal activity items is: ; The exponential decay threshold is defined by the following formula: ; in, The ignition threshold at the nth iteration. As the initial threshold, It is the attenuation constant; Compare internal activity items with ignition thresholds, when ,otherwise This means no ignition; The iterative deployment at the first firing of each neuron is recorded using the following formula: For neurons that have never been ignited The value is assigned to the maximum number of iterations. ; Histogram analysis of the ignition time matrix is performed to calculate the frequency of each ignition time, using the following formula: ; in, Let be the neuron frequency at ignition time t. The total number of neurons is given; then the Shannon entropy is calculated using the following formula: ; Stacking the ignition maps of all iterations in time order yields a three-dimensional ignition map. .
6. The material surface defect detection system based on optical spectroscopy according to claim 1, characterized in that, The process of outputting the defect classification map is as follows: The process of projecting the maximum value of the ignition spectrum is as follows: The maximum value of the three-dimensional ignition spectrum is projected along the time axis to obtain a two-dimensional maximum ignition density map. ; The connected component extraction process is as follows: the eight-neighbor labeling algorithm is used to extract the ignition connected region, and the area Area, eccentricity Ecc and principal axis direction Ori of each region are calculated. The fusion process of ignition entropy and geometric features is as follows: The ignition entropy H is used as a global feature and concatenated with the regional geometric features to form a joint classification feature, the formula of which is: ; Complete the matching of the preset defect template, and Input the nearest neighbor classifier, calculate the Manhattan distance with the scratch, bubble, and impurity templates, and output the defect type Type corresponding to the minimum distance; Calculate classification confidence ; If the current point is a weak signal point and there are classification results with an execution degree C > 0.7 in its neighborhood, then the inverse distance weighted interpolation method is used to assign the defect type, and weak signal point interpolation is performed accordingly. The formula is as follows: ; in, The neighborhood range of the current point. The value is the Euclidean distance from the target point to the neighboring point s; otherwise, it is marked as an undetectable region, and the final defect classification map ClassMap(x, y) is output.
7. The material surface defect detection system based on optical spectroscopy according to claim 1, characterized in that, The process of outputting the quantized defect parameter set and the 3D point cloud model is as follows: In the final defect classification map, all pixels with a confidence level greater than 0.75 are identified as defect seed points, and region growing is performed to generate connected defect domains. The growth conditions are that the defect types are the same and the Euclidean distance is less than 1. ; Perform morphological closing operations on the connected defect domain to obtain a smooth defect mask. ; Sub-pixel edge points are extracted at the mask boundary, and a closed contour curve is fitted using cubic spline interpolation, as shown in the following formula: ; Where t is the arc length parameter, For the first Undetermined techniques for segmented spline curves; extraction of the original diffuse reflectance spectra corresponding to all pixels in the defect mask at characteristic absorption wavelengths. The absorbance at a certain point is used to calculate the defect depth using Beer-Lambert's law. The formula is as follows: ; in, The molar absorptivity is 1. The equivalent defect concentration is then used; subsequently, the average defect depth is calculated using the following formula: ; The spatial coordinates of each pixel in the defect mask are combined with the corresponding defect depth, as shown in the following formula: The point clouds of all defects are merged to obtain a 3D point cloud model of the defects. ; Perform Delaunay triangulation on the point cloud and calculate the total defect. With total surface area Output the set of quantized defect parameters { Total number of defects}.
8. The material surface defect detection system based on optical spectroscopy according to claim 1, characterized in that, The process of outputting the final detection report is as follows: The defect classification map is mapped to red, green, and blue pseudo-colors for scratches, bubbles, and impurities, respectively, and then weighted and fused with the original optical image. The expression is as follows: ; in, To integrate the weights, generate a defect overlay color image and save it as a PNG file; Calculate the geometric center of each defect region, label the defect type, confidence level, major axis length and average depth at the end of the lead, statistically analyze the defect area and depth distribution, generate area histogram and depth histogram, and save as PNG format; Perform Delaunay triangulation on the 3D point cloud model and export it as an STL file; Create an XML document containing metadata, summary data, defect list, image encoding, and STL file path, and save it as an XML file; When a defect area ≥ 50 μm² and an average depth ≥ 0.5 μm are present, a red warning box will be inserted on the first page of the report, and an alarm sound will be emitted via a buzzer driven by the USB interface.