An industrial visual inspection method for microcracks in quartz diffuser tubes
By combining multi-angle illumination image acquisition and a double-wall refraction projection model with optical path consistency diagram reasoning and conformal threshold calibration, the problem of distinguishing between real defects and optical artifacts in the detection of microcracks in quartz diffusers was solved, achieving accurate defect detection and quantification.
Patent Information
- Application Number
- CN202611195433.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-07
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies struggle to effectively distinguish between real defects and optical artifacts in quartz diffusers, and the size and location of defects are difficult to quantify. In particular, image distortion and optical artifacts caused by multiple refractions and reflections on the transparent cylindrical tube wall are difficult to handle.
A method combining multi-angle illumination image acquisition, double-wall refraction projection model, normal sample memory, optical path consistency graph inference, and conformal threshold calibration is adopted. Through a self-supervised visual feature extractor and graph attention fusion, it distinguishes real defects from optical artifacts and outputs the defect category, location, and size.
It enables accurate detection of microcracks in quartz diffuser tubes, distinguishes between real defects and optical artifacts, and outputs defect type, inner and outer wall location, axial position, circumferential angle and size, thus improving the stability and interpretability of the detection.
Smart Images

Figure CN123118469A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial visual inspection, and more particularly to an industrial visual inspection method for microcracks in quartz diffuser tubes. Background Technology
[0002] Quartz diffusion tubes are commonly used in high-temperature diffusion, deposition, and related semiconductor or photovoltaic manufacturing processes. They have transparent, cylindrical walls. During manufacturing, coating, and pre-use inspection, defects such as microcracks, bubbles, pitting, and scratches may be found on the inner wall, outer wall, or near the coating layer. If these defects are not identified, they may cause tube breakage, particulate contamination, or a decrease in product yield during subsequent high-temperature processes.
[0003] Current detection methods mostly rely on manual visual inspection, single-angle camera imaging, or fixed threshold image processing. Because the transparent wall of a quartz diffuser tube produces multiple refractions and reflections between the inner and outer walls, bright spots, ghosting, and edge distortion are prone to appear in the detection images. At the same time, the texture intensity of microcracks and fine scratches is weak, and bubbles and pits may be similar to optical artifacts in brightness and shape. It is difficult to reliably distinguish between real defects and optical artifacts under a single viewing angle or single lighting conditions.
[0004] Furthermore, different pipe diameters, wall thicknesses, coating conditions, and placement postures can alter the projection position and appearance of defects in images, making it difficult for fixed template or fixed threshold methods to adapt to multi-specification inspection tasks and output quantifiable results such as inner and outer wall positions, axial positions, circumferential angles, and dimensions.
[0005] Therefore, there is a need for an industrial visual inspection method for microcracks in quartz diffuser tubes that can overcome the shortcomings of the existing technologies. Summary of the Invention
[0006] One objective of this invention is to propose an industrial visual inspection method for microcracks in quartz diffuser tubes. Addressing the problems of optical artifacts caused by refraction and reflection from the transparent cylindrical tube wall, difficulty in identifying weak defects, and difficulty in quantifying defect size and location in existing technologies, this invention proposes a technical solution combining multi-angle illumination image acquisition, double-wall refraction projection, anomaly detection from a normal sample memory bank, optical path consistency diagram inference, and conformal threshold calibration. This invention has the technical effect of distinguishing between real defects and optical artifacts and outputting defect category, inner and outer wall positions, axial position, circumferential angle, and size.
[0007] This invention provides an industrial visual inspection method for microcracks in quartz diffuser tubes, comprising:
[0008] S1. Obtain illumination image sets and tube geometric attitude parameters of the quartz diffuser under at least two circumferential angles. The illumination image sets include at least two types of forward illumination images, backward illumination images, polarization images, and dark field images.
[0009] S2. Establish a double-wall refraction projection model based on the geometric posture parameters of the tube body, map the illumination image group into a cylindrical unfolded diagram with axial position and circumferential angle as coordinates, and generate inner wall candidate mapping, outer wall candidate mapping and optical artifact prediction mapping.
[0010] S3. Input the cylindrical unfolded diagram into the trained self-supervised visual feature extractor, retrieve the normal sample memory bank that matches the geometric posture parameters of the tube, and calculate the abnormal heat map.
[0011] S4. Extract candidate regions based on the abnormal heat map, establish a real defect hypothesis node and an optical artifact hypothesis node for each candidate region, and form an optical path consistency map based on the consistency of multi-view physical coordinates and the optical artifact prediction mapping.
[0012] S5. Perform graph attention fusion on the optical path consistency map, and output the defect category, inner and outer wall positions, axial position, circumferential angle, size and true defect confidence level using the conformal threshold calibration results.
[0013] Optionally, S1 includes:
[0014] Using the axis of the quartz diffuser tube as the attitude reference, record the outer diameter, wall thickness, camera external parameters, tube axial reference point, placement attitude category, spraying status mark, and circumferential angle during acquisition.
[0015] The illumination image group is acquired at each circumferential angle, and the different illumination images at the same circumferential angle, the spraying status indicator and the corresponding pipe geometric posture parameters are associated and stored.
[0016] Optionally, S2 includes:
[0017] The projection relationship between the incident ray from the outer wall, the refracted ray from the inner wall, and the outgoing ray is determined based on the refractive index, outer diameter, wall thickness of the quartz material, and the external parameters of the camera.
[0018] Establish a cylindrical coordinate grid according to the set axial grid spacing and circumferential grid spacing;
[0019] The pixels in the illumination image group are projected onto the cylindrical coordinate grid to obtain a cylindrical unfolded diagram;
[0020] The mirror position, ghost offset, edge distortion region, and edge distortion intensity obtained by normalizing the edge pixel offset generated by double-wall refraction are written into the optical artifact prediction map.
[0021] Optionally, S3 includes:
[0022] The cylindrical unfolded diagram is divided into patch regions, and the multi-scale visual features of each patch region are output using the trained self-supervised visual feature extractor.
[0023] Based on the outer diameter, wall thickness, coating status indicator, and placement posture category, the corresponding normal block feature set is selected from the normal sample memory.
[0024] Calculate the nearest neighbor distance between the multi-scale visual features and the normal patch feature set, and map the nearest neighbor distance back to the cylindrical coordinate grid to form an abnormal heatmap;
[0025] Furthermore, the normal sample memory includes index items established according to outer diameter specification identifier, wall thickness specification identifier, coating status identifier, and placement posture category;
[0026] Each index entry stores the set of normal patch features, feature mean, and feature dispersion generated from qualified quartz diffuser tube samples;
[0027] During detection, the corresponding index item is selected based on the pipe's geometric posture parameters and the spraying status identifier, and the nearest neighbor distance is calculated using the normal block feature set under the selected index item.
[0028] Optionally, S4 includes:
[0029] Connected regions in the abnormal heatmap whose abnormal distance exceeds the candidate threshold determined by the normal sample memory are identified as candidate regions;
[0030] Write the axial position, circumferential angle, candidate layers of inner and outer walls, anomaly distance, projection residual and morphological features for the actual defect hypothesis node. The projection residual is the distance between the center of the candidate region and the corresponding candidate mapping position of the inner wall or the candidate mapping position of the outer wall.
[0031] Write the mirror position, ghost offset, edge distortion intensity and bright spot projection residual to the optical artifact hypothesis node, where the bright spot projection residual is the distance between the candidate region center and the mirror position in the optical artifact prediction mapping.
[0032] When real defect assumption nodes at different circumferential angles fall into the same axial and circumferential grid cells, a consistent edge with consistent edge weight is established. When the candidate region falls into the prediction region of the optical artifact prediction map, a suppression edge with suppression edge weight is established.
[0033] Optionally, S5 includes:
[0034] The real defect hypothesis node, the optical artifact hypothesis node, the consistent edge, and the suppressed edge are input into the graph attention fusion module;
[0035] The graph attention fusion module generates the true defect fusion score and the artifact fusion score based on the anomaly distance, projection residual, bright spot projection residual, morphological features, consistent edge weight, and suppressed edge weight.
[0036] The actual defect fusion score is compared with the conformal threshold calibration result, and the confidence score of the actual defect, as well as the corresponding defect category, location, and size, are output.
[0037] Furthermore, the consistent edge weight is determined based on the axial mesh difference, circumferential mesh difference, and consistency flag of the candidate layers of the inner and outer walls of the actual defect assumption nodes under different circumferential angles.
[0038] The suppression edge weight is determined based on the distance between the center of the candidate region and the mirror position, the angle between the shape of the candidate region and the ghost offset direction, and the edge distortion intensity.
[0039] The normalized consistent edge weights are used to accumulate the true defect fusion score, and the normalized suppression edge weights are used to accumulate the artifact fusion score.
[0040] Furthermore, the conformal threshold calibration result is determined by inputting the candidate region corresponding to the qualified quartz diffusion tube sample in the calibration batch into the graph attention fusion module to obtain the true defect fusion score normalized to the 0 to 1 interval;
[0041] The inconsistency score is obtained by subtracting the actual defect fusion score from 1.
[0042] Quantile values are selected from the sorted sequence of the inconsistent scores according to the target coverage.
[0043] The result of subtracting the quantile value from 1 is used as the dynamic judgment threshold;
[0044] Furthermore, the defect category, location, and size are determined as follows: when the actual defect fusion score is not less than the dynamic determination threshold, the corresponding candidate region is marked as an actual defect region;
[0045] Calculate the axial position and circumferential angle based on the axial and circumferential grid numbers of the actual defect area in the cylindrical coordinate grid;
[0046] The positions of the inner and outer walls are determined based on the candidate inner wall mapping or candidate outer wall mapping corresponding to the actual defect area.
[0047] The skeleton length and average width are calculated for linear regions, and the equivalent diameter and area are calculated for point regions. Based on the morphological characteristics, the real defect regions are divided into microcracks, bubbles, pits, or scratches.
[0048] The beneficial effects of this invention are:
[0049] 1. By establishing a double-wall refraction projection model based on the tube's geometric orientation parameters and generating a cylindrical unfolded diagram, candidate mappings for the inner and outer walls, and optical artifact prediction mappings, the mirror position, ghosting offset, and edge distortion caused by the transparent cylindrical tube wall can be included in the subsequent judgment chain, thus providing physical coordinate basis for distinguishing between real defects and optical artifacts.
[0050] 2. By using a normal sample memory library that matches the outer diameter, wall thickness, coating status, and placement posture category to calculate abnormal heat maps, the normal texture differences of quartz diffuser tubes of different specifications and in different states can be absorbed by the corresponding normal patch feature set, reducing misjudgments caused by specification changes.
[0051] 3. By establishing real defect hypothesis nodes and optical artifact hypothesis nodes, and using consistent edge weights, suppression edge weights and conformal threshold calibration results for fusion judgment, real defects that recur from multiple views and candidate regions that conform to artifact prediction can be distinguished and processed, thereby outputting defect category, location, size and real defect confidence. Attached Figure Description
[0052] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0053] Figure 1 This is a flowchart of an industrial visual inspection method for microcracks in quartz diffuser tubes.
[0054] Figure 2 This is a flowchart illustrating the construction of the optical path consistency diagram in step S4 of the present invention. Detailed Implementation
[0055] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0056] refer to Figures 1-2 An industrial visual inspection method for microcracks in quartz diffuser tubes, comprising:
[0057] S1. Obtain illumination image sets and tube geometric attitude parameters of the quartz diffuser under at least two circumferential angles. The illumination image sets include at least two types of forward illumination images, backward illumination images, polarization images, and dark field images.
[0058] S2. Establish a double-wall refraction projection model based on the geometric posture parameters of the tube body, map the illumination image group into a cylindrical unfolded diagram with axial position and circumferential angle as coordinates, and generate inner wall candidate mapping, outer wall candidate mapping and optical artifact prediction mapping.
[0059] S3. Input the cylindrical unfolded diagram into the trained self-supervised visual feature extractor, retrieve the normal sample memory bank that matches the geometric posture parameters of the tube, and calculate the abnormal heat map.
[0060] S4. Extract candidate regions based on the abnormal heat map, establish a real defect hypothesis node and an optical artifact hypothesis node for each candidate region, and form an optical path consistency map based on the consistency of multi-view physical coordinates and the optical artifact prediction mapping.
[0061] S5. Perform graph attention fusion on the optical path consistency map, and output the defect category, inner and outer wall positions, axial position, circumferential angle, size and true defect confidence level using the conformal threshold calibration results.
[0062] In this specific embodiment, S1 includes:
[0063] A tube coordinate system is established using the axis of the quartz diffuser tube as the attitude reference, where the axial coordinate is defined with respect to the direction of the tube axis. The axis and circumferential angle are defined by the radial half-plane corresponding to the circumferential reference mark on the outer surface of the tube. The starting position and circumferential angle The angle is recorded by the encoder reading of the rotating mechanism and synchronized with the image trigger signal in hardware to ensure that the angle recording is consistent with the exposure time.
[0064] The quartz diffuser tube to be tested is placed on a rotary clamping mechanism with axial limiting, so that the end face of the tube is in contact with the limiting reference surface and the radial runout is constrained by V-shaped support or coaxial chuck, thereby ensuring that the tube axis is coaxial with the rotation axis.
[0065] Before data acquisition, the geometric attitude parameters of the tube were recorded and formed into a unified data structure. ,in This represents the set of geometric attitude parameters of the tube. Indicates the outer diameter of the quartz diffuser tube. This indicates that the quartz diffuser tube has a thick wall. This represents the rotation matrix from the tube coordinate system to the camera coordinate system. This represents the translation vector from the tube coordinate system to the camera coordinate system. Indicates the axial reference point of the pipe body at Zero coordinates on the axis This indicates the placement orientation and is used to distinguish whether the tube is placed upright or upside down in the clamping mechanism. It indicates the coating status and is used to distinguish between no coating and the presence of a coating layer. Indicates the circumferential angle at the time of data acquisition;
[0066] Outer diameter The wall thickness was obtained by measuring the cross-section at the middle of the pipe body with an outer diameter measuring instrument and recorded. The thickness was measured at the same cross-section using a wall thickness measuring instrument and recorded.
[0067] Camera external parameters and The calibration is obtained through a calibration plate, which is fixed on a tooling datum coaxial with the rotation axis. Calibration images are acquired within the camera's field of view. The rigid body transformation from the tube coordinate system to the camera coordinate system is obtained by solving the correspondence between the feature points of the calibration plate and the camera's imaging plane, and this transformation is recorded as a fixed extrinsic parameter for this batch of acquisitions. Axial reference points. The axial limit reference surface is defined and determined by combining linear displacement readings or end face detection results, so that subsequent images of different circumferential angles correspond to the same axial zero position.
[0068] Placement posture category label The spraying status is determined by the positioning key or end structure identification result of the clamping mechanism and locked before the acquisition begins. The process identification result is determined and locked before data collection begins.
[0069] At least two circumferential angle acquisitions are performed on the same pipe, and in this embodiment, four circumferential angles are taken as follows: , In each circumferential angle The tube is kept stationary while a group of illumination images is acquired sequentially. The illumination image group includes at least two of the following: forward illumination image, backward illumination image, polarization image, and dark field image. In this embodiment, four types of images are acquired simultaneously. The forward illumination image is provided by a ring light source on the same side of the camera and is nearly coaxial with the camera's optical axis to enhance surface scattering details. The backward illumination image is provided by the camera transmitting light from a side light source to enhance the attenuation characteristics of internal defects on transmitted light. The dark field image is provided by a low-angle obliquely incident ring light source to produce a high-contrast scattering response from slender defects such as microcracks. The polarization image is composed of a linear polarizer at the light source end and a polarizer at the camera lens end, and the polarization axis angle of the two is fixed during assembly and remains unchanged throughout the acquisition process to enhance the distinction between specular reflection and scattering components.
[0070] Each type of illumination image is acquired using the same camera intrinsic settings and with fixed exposure time, gain, and bit depth to ensure cross-angle comparability. Furthermore, the acquisition order of the four types of images is fixed at the same circumferential angle, and the axial position of the tube and the camera focal length are not changed during the acquisition period.
[0071] After the data collection is completed, the same circumferential angle will be... Different lighting images and corresponding spraying status indicators and complete tube geometry parameters The data is bound to the same record for associated storage. The associated storage uses the unique pipe body number and circumferential angle. The primary key is formed and each type of illumination image is written as a multi-channel data item under the primary key, thereby ensuring that subsequent steps can retrieve the multi-illumination image group under the same pose according to the circumferential angle and obtain the geometric pose parameters that strictly correspond to it.
[0072] In this specific embodiment, S2 includes:
[0073] Based on the geometric attitude parameters of the tube outer diameter Wall thickness Camera external parameters and Axial reference point and the circumferential angle during data collection Construct a double-walled refractive projection model, where the radius of the outer wall is set to... The inner wall radius is set to The refractive index of the external medium is set to The refractive index of quartz material is set to And using the pipe coordinate system as the calculation coordinate system, the outer wall and the inner wall are respectively defined by a radius of... and The coaxial cylindrical surface is determined;
[0074] For each circumferential angle Ray tracing is performed pixel-by-pixel on the acquired lighting image group, and the pixels are... Through camera intrinsic parameter matrix Back projection is the line-of-sight direction in the camera coordinate system and utilizes The incident ray is obtained by transforming it to the tube coordinate system. The first intersection point of the incident ray with the outer cylindrical surface is then calculated as the incident point on the outer wall, and the incident surface is determined by the outer wall normal at that point.
[0075] At the incident point on the outer wall, in vector form according to Snell's law, with refractive ratio... Calculate the refraction direction after entering the quartz and find the intersection of this direction with the inner cylindrical surface to obtain the incident point on the inner wall. Then, use the refractive index... Calculate the outgoing direction to obtain the projection relationship between the incident ray from the outer wall, the refracted ray from the inner wall, and the outgoing ray;
[0076] The tube coordinates corresponding to the incident point on the outer wall Write the candidate mapping for the outer wall, and write the tube coordinates corresponding to the incident point on the inner wall into the candidate mapping for the inner wall. Both are registered with the cylindrical development diagram using the same cylindrical coordinate grid as the index. The cylindrical coordinate grid uses an axial grid spacing. Spacing between circumferential grids The axial coverage range is determined by the effective length of the tube to be tested, and the axial zero point is determined by... Locked, circumferential coverage is ;
[0077] Intersection of any surface The index mapped to the cylindrical coordinate mesh cell is calculated using the following formula:
[0078] ,
[0079] ;
[0080] in Indicates the axial grid number, Indicates the circumferential grid number, Indicates the intersection point In the tube coordinate system coordinate, Indicates the intersection point In the tube coordinate system coordinate, Indicates the intersection point In the tube coordinate system coordinate, This indicates the zero-position coordinate of the axial reference point of the pipe body. Indicates the axial grid spacing. Indicates by Calculate the arctangent function of the circumferential angle. It represents the circumferential angle during data acquisition and is used to unify different viewpoints to the same circumferential reference. This indicates that the angle is normalized to... The modulo function, Indicates the circumferential grid spacing. This indicates the floor function;
[0081] For each type of illumination image in the illumination image group, the pixel grayscale or multi-channel intensity is determined according to the intersection of its outer walls. The cylindrical unfolding diagram is accumulated and written, and the number of accumulations for each grid cell is maintained synchronously. After the writing is completed, the unfolding intensity of the grid cell is obtained by "accumulated value / number of accumulations". Thus, a cylindrical unfolding diagram with axial position and circumferential angle as coordinates is obtained, and different lighting types are stored as different channels.
[0082] When generating optical artifact prediction maps, the mirror position generated by double-wall refraction is defined as the position of the same pixel in the inner wall candidate map. and its mapping in the outer wall candidate Establish a one-to-one correspondence, and define the ghost offset as... And write the average offset of the pixels falling into the grid cell;
[0083] The edge distortion region is defined as the incident angle at the outer wall incident point greater than... The intersection of its outer walls or the distance between the points of intersection and the circumferential angles corresponding to the tangents of the left and right contours shall not exceed [a certain value]. The region is further calculated for edge pixel offsets. The edge pixel offset is obtained by the difference between the column coordinates of the observed contour edge pixels at the same axial position and the column coordinates of the contour edge pixels predicted by the double-wall refraction projection model. The edge distortion intensity is written into the optical artifact prediction map after normalizing the absolute value of the edge pixel offset by a maximum offset of 20 pixels. This forms an optical artifact prediction map that simultaneously includes the mirror position, ghost offset, edge distortion region and edge distortion intensity, and is aligned with the cylindrical unfolded map on the same cylindrical coordinate grid.
[0084] In this specific embodiment, S3 includes:
[0085] The cylindrical development diagram is used as input data while maintaining its cylindrical coordinate grid. The cylindrical development diagram is numbered according to the axial grid. With circumferential grid number This is an index containing four channels: forward illumination, backward illumination, polarization, and dark field, stacked in channel order as a tensor. This ensures that subsequent feature extraction can jointly model multiple lighting responses at the same physical location;
[0086] The cylindrical unfolded diagram is divided into overlapping regions according to fixed block sizes, with each region covering... Each axial grid cell and A circumferential grid cell and a step size and Sliding division is performed so that each block area corresponds to a defined axial length and circumferential angle range, and overlap is maintained between adjacent blocks to reduce missed detections caused by the division of defects at the boundary.
[0087] Each patch area is normalized in intensity on four lighting channels. The channel mean and channel variance used for normalization are obtained offline from normal samples and fixed in the detection program, so that small fluctuations in exposure of different batches will not significantly change the feature distribution.
[0088] The normalized patch regions are input into a trained self-supervised visual feature extractor to obtain multi-scale visual features. The self-supervised visual feature extractor employs a defined structure consisting of a convolutional backbone network and a feature pyramid. The convolutional backbone network is ResNet-18 and outputs feature maps at three scales. The feature pyramid processes the feature maps at each of the three scales separately. Convolutional alignment of channels and global average pooling at each scale yield three scale vectors, which are then concatenated in a fixed order to form a patch feature vector. And then implement Normalization to eliminate the influence of amplitude scaling;
[0089] Self-supervised training was completed offline, and the training data used only cylindrical unfolded plot regions of qualified quartz diffusers. The training task adopted a contrastive learning approach, using two enhanced views of the same plot region as positive sample pairs and different plot regions as negative sample pairs, so that the network learned a representation that was stable for normal textures and sensitive to abnormal textures. After training, the network parameters were frozen and forward inference was performed only in online detection.
[0090] Normal sample memory banks are labeled according to their outer diameter specifications. Wall thickness specification marking Spraying status indicator With placement posture category identifier Create index entries, where and The measured outer diameter is obtained from the preset specification table. Compared with the measured wall thickness Mapped to a unique specification code, and this specification table is fixed in the production line process file, the coating status is identified. With placement posture category identifier Take directly from the value of record S1;
[0091] Each index entry stores a set of normal patch features generated from qualified quartz diffuser tube samples. and the eigenvalue vector of this set With feature discreteness vector The feature mean vector is used to center the online features, and the feature dispersion vector is used to scale the differences across dimensions. For each dimension, the standard deviation of the corresponding feature on normal samples is taken, and a minimum lower limit is set. To avoid division by zero;
[0092] During online testing, the current tube to be tested is used as the basis for detection. Select a unique index item and retrieve the corresponding normal tile feature set, then extract the feature vector of each tile to be tested. according to After unifying the dimensional scale, the nearest neighbor distance is calculated and used as the outlier distance of the tile. The nearest neighbor distance is defined by the following formula:
[0093] ;
[0094] in Indicates abnormal distance. Represents the number of nearest neighbors and takes Represents the normal tile feature set Zhongyu The Euclidean distances sorted in ascending order are the first... The nearest neighbor feature vectors, Represents the L2 norm;
[0095] The abnormal distance of each patch Backfill the anomaly heatmap according to the cylindrical coordinate grid range it covers. The maximum anomaly distance is taken on the corresponding grid cell, and when the grid cell is covered by multiple overlapping tiles, to highlight the most significant local anomaly response, thus obtaining an anomaly heatmap aligned with the cylindrical unfolded diagram on the same cylindrical coordinate grid. The output is then used in step S4 to extract candidate regions.
[0096] In this specific embodiment, S4 includes:
[0097] For each circumferential angle Corresponding abnormal heatmap Perform candidate region extraction and construct optical path consistency map Among them, abnormal heatmap With steps The cylindrical coordinate grid is consistent and numbered by axial grid. With circumferential grid number Let be the index, and let the candidate threshold be denoted as . And along with the normal sample memory index items Solidified storage and retrieval of abnormal distances of qualified sample tiles under this index item quantile values, thus allowing for the detection of all values that satisfy the criteria. A binary mask is constructed using grid cells, and an 8-connected connected component analysis is used to obtain a set of connected regions.
[0098] For each connected region, determine its candidate region center grid cell. The candidate region's central grid cell is selected from all grid cells within that connected region according to outlier values. The centroid is obtained by weighting the centroid and then taking the nearest integers for the axial and circumferential coordinates, thus ensuring that the central grid cell of the candidate region falls into a unique grid cell.
[0099] The axial position and circumferential angle of the candidate region are calculated based on the central grid cell of the candidate region, where the axial position is determined by... Obtain and and The axial reference point is taken from step S1 and the axial grid spacing is taken from step S2, respectively, and the circumferential angle is determined by... Obtain and Taken from steps circumferential grid spacing;
[0100] Subsequently, for each candidate region, both a real defect hypothesis node and an optical artifact hypothesis node are simultaneously created and their attributes are written, where the real defect hypothesis node is denoted as... And write the axial position Circumferential angle Abnormal distance Morphological characteristics and candidate layers of inner and outer walls: morphological characteristics are calculated using a binary mask of the candidate region and must at least include the region area. With principal axis direction angle The area of the region Multiply the number of grid cells contained in the candidate region by the cell area. and Taken from the outer wall radius of S2, principal axis direction angle The second-order central moments of the candidate region grid cell coordinates are calculated and normalized to... ;
[0101] The candidate layers for the inner and outer walls are jointly determined by the candidate inner wall mapping and the candidate outer wall mapping. Specifically, the predicted inner wall position grid corresponding to the center of the candidate region is read from the candidate inner wall mapping. And calculate the projection residual. Read the predicted outer wall location mesh from the outer wall candidate map. And calculate the projection residual. The projection residual is defined by the grid distance and for and Euclidean distance, for and The Euclidean distance will The inner wall markers are written into the candidate layers of both the inner and outer walls, and the projection residuals are written into the inner wall. ,Will The outer wall markers are written into the candidate layers of both the inner and outer walls, and the projection residuals are written into the outer wall markers. ;
[0102] Optical artifact hypothesis node is denoted as Furthermore, the mirror position grid corresponding to the center of the candidate region is read from the optical artifact prediction mapping in step S2. Ghost offset With edge distortion intensity Among them, the edge distortion intensity The normalized intensity written for optical artifact prediction mapping and its value range is . And calculate the bright spot projection residual. for and The Euclidean distance is used to quantify the degree of fit between the candidate region and the predicted mirror position;
[0103] Constructing an optical path consistency diagram At that time, all candidate regions' true defect hypothesis nodes and optical artifact hypothesis nodes are added to the node set. and in the edge set Establish consistent edges and suppression edges, where consistent edges only connect different circumferential angles. The following are the true defect assumption nodes and the central mesh elements of the two true defect assumption nodes satisfy: Same and When the candidate layers of the inner and outer walls are identical, a consistent edge is established, and edges connecting the actual defect hypothesis nodes in the same candidate region are suppressed. With the optical artifact hypothesis node And when the bright spot projection residual or edge distortion intensity Establish suppression edges in time;
[0104] The edge weights for consistent edges and suppression edges are calculated separately and written into the edge attributes. The edge weights are determined by the following formula:
[0105] ,
[0106] ;
[0107] in Indicates the consistent edge weight. This indicates that the candidate strata of the inner and outer walls are consistent, and the value is 1 when the strata of the two nodes are consistent and 0 when they are inconsistent. Represents an exponential function. This represents the absolute value of the difference in the axial mesh number between the center points of two hypothetical nodes of real defects. This represents the absolute value of the difference in the circumferential mesh numbers at the centers of two real defect hypothetical nodes. Indicates the axial difference attenuation coefficient and takes Represents the circumferential difference attenuation coefficient and takes Indicates the weight of the suppressed edge. Indicates the intensity of edge distortion. This represents the residual of the bright spot projection. Represents the brightness spot residual attenuation coefficient and takes Represents the cosine function. This represents the angle between the candidate region shape and the ghost offset direction, expressed as the principal axis direction angle of the candidate region. With ghost offset direction angle Subtract and fold the result to The direction angle of the ghost offset is obtained. From vector The arctangent is determined and matched with Use the same angle standard;
[0108] For all consistent edge weights Normalize the maximum value to obtain And for all suppression edge weights Normalize the maximum value to obtain ,Will and Write them as the consistency edge weights and suppression edge weights respectively into the optical path consistency map. The edge attributes are used by S5 to directly call and complete graph reasoning fusion.
[0109] In this specific embodiment, S5 includes:
[0110] Optical path consistency diagram The input image attention fusion module outputs the true defect confidence and defect quantification results for each candidate region, including the optical path consistency map. From the set of nodes With edge set The nodes are constructed and contain real defect hypothetical nodes. With the optical artifact hypothesis node Consistent edge carries consistent edge weight Suppression edge carries suppression edge weight ;
[0111] For each real defect hypothesis node Construct node feature vectors and write anomaly distances Projection residuals Axial position Circumferential angle The candidate layer markers for the inner and outer walls, and the morphological features calculated from the candidate region mask, wherein the morphological features include the region area. principal axis direction angle The skeleton length pixel count, distance transformation mean pixel count, and the aspect ratio of the bounding rectangle of the connected component are all used together with the cylindrical coordinate grid scale from step S2. and Perform physical quantity conversion; assume nodes for each optical artifact. Construct node feature vectors and write them into the bright spot projection residual. Ghost offset Edge distortion intensity and mirror position grid ;
[0112] The node features mentioned above are truncated and linearly normalized according to fixed upper and lower limits according to their dimensions to obtain input features with consistent numerical ranges. The upper limit is taken from the current index item. Corresponding normal sample candidate threshold 3 times The upper limit is 10 grid cells. The upper limit is 10 grid cells. range The normalized features are used for stable convergence of subsequent attention calculations;
[0113] The graph attention fusion module employs a two-layer graph attention network and distinguishes between consistent edges and suppression edges for message passing. The first layer performs feature aggregation between nodes of the same type that represent true defects on consistent edges to strengthen candidate responses with consistent physical coordinates across multiple circumferential angles. Simultaneously, it performs feature interaction between nodes representing true defects and nodes representing optical artifacts on suppression edges to introduce artifact explanations. The second layer performs further edge-type-discriminatory attention aggregation on the node embeddings output from the first layer to stabilize multi-view consistency and amplify suppression evidence consistent with artifact predictions. Furthermore, the weights of consistent edges are adjusted within each layer. As a multiplicative gating coefficient for consistent edge attention, it suppresses edge weights. As a multiplicative gating coefficient that suppresses edge attention, the edge weights directly affect the information fusion strength.
[0114] After a two-layer graph attention network, the embeddings of the real defect hypothesis nodes and the optical artifact hypothesis nodes corresponding to each candidate region are input into the same fully connected classification head to obtain the real defect fusion score and the artifact fusion score, respectively. Normalize the two types of fusion scores to The interval, where the true defect fusion score is denoted as The artifact fusion score is used only for internal competition suppression and is not included as a final output field, and is used as the true defect confidence score for the candidate region.
[0115] To obtain a dynamic judgment threshold independent of batch fluctuations, select the index item within the calibration batch. Using the same qualified quartz diffusion tube samples and performing steps S1 to S5 in their entirety, the true defect fusion score for each candidate region was obtained. Inconsistent scores are defined as The non-consistent scores within the calibration batch were sorted in ascending order to obtain a sequence. Then according to the target coverage rate Take the dynamic judgment threshold for in This indicates a dynamic threshold. Indicates the first position in the sorted sequence A number of inconsistent scores, This indicates the total number of candidate regions within the calibration batch. This represents the target coverage rate, set to 0.995. This indicates the rounding up operation;
[0116] During online detection, the true defect score is fused for each candidate region. With dynamic judgment threshold Compare and The candidate region is then marked as a true defect region, and the confidence level of the true defect is output as . At the same time, the axial position determined in step S4 is used. Circumferential angle The candidate layers of the inner and outer walls are used as the output field for defect location;
[0117] When quantizing the size, the candidate region mask is restricted to the actual defect area and the conversion radius is selected according to the candidate layers of the inner and outer walls. When the candidate layer of the inner and outer walls is the inner wall, then... When the candidate layer for both inner and outer walls is the outer wall, take... The physical scale of the cylindrical coordinate mesh element is defined as the axial step size. With circumferential arc length step Skeletonization is performed on the linear region to obtain the skeleton pixel chain. The skeleton length is obtained by accumulating the adjacent skeleton pixels in the axial and circumferential directions. The average width is obtained by sampling at the skeleton pixel and multiplying by 2 by the Euclidean distance transformation of the real defect region. The skeleton length and average width are then output as the defect size.
[0118] The number of mesh cells covering the actual defect area is calculated for the point-like region, and the area is obtained accordingly. At the same time, the point size is characterized by the equivalent diameter, which is obtained by converting the area and the circle area and output along with the area.
[0119] When determining the defect category, the skeleton length, average width, aspect ratio of the circumscribed rectangle, and area are used to jointly determine the category. Among them, real defect areas that meet the linear area condition are marked as microcracks when the average width is not greater than 0.15mm and scratches when the average width is greater than 0.15mm. Real defect areas that meet the point area condition are marked as bubbles when the equivalent diameter is not greater than 0.50mm and the roundness of the shape is not less than 0.70 and pitting when the equivalent diameter is not greater than 0.50mm and the roundness of the shape is less than 0.70. Thus, for each real defect area, the defect category, inner and outer wall positions, axial positions, circumferential angles, dimensions, and real defect confidence level are output.
[0120] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
[0121] This invention combines a double-walled refractive projection model, a normal sample memory bank, an optical path consistency map, and conformal threshold calibration to form a continuous technical chain in the detection process, from image acquisition, cylinder unfolding, abnormal candidate generation, competition between real defects and artifacts to defect quantification output. This allows for the processing of the imaging characteristics of transparent quartz diffusers.
[0122] This invention sets up real defect hypothesis nodes and optical artifact hypothesis nodes in the optical path consistency diagram, and uses consistent edges and suppression edges to express the consistency of physical coordinates from multiple perspectives and the consistency of optical artifact prediction. At the same time, it improves the stability and interpretability of the detection results of quartz diffuser tubes of different specifications by using a normal sample memory library of specifications and coating status indexes and conformal threshold calibration.
Claims
1. An industrial visual inspection method for microcracks in quartz diffuser tubes, characterized in that, include: S1. Obtain illumination image sets and tube geometry parameters of the quartz diffuser under at least two circumferential angles. The illumination image set includes at least two types of images: forward illumination image, backward illumination image, polarization image, and dark field image. S2. Based on the geometric attitude parameters of the tube, establish a double-wall refraction projection model, map the illumination image group into a cylindrical unfolded diagram with axial position and circumferential angle as coordinates, and generate inner wall candidate mapping, outer wall candidate mapping and optical artifact prediction mapping. S3. Input the cylinder unfolded diagram into the trained self-supervised visual feature extractor, retrieve the normal sample memory bank that matches the geometric posture parameters of the tube, and calculate the abnormal heat map. S4. Extract candidate regions based on the abnormal heat map, establish real defect hypothesis nodes and optical artifact hypothesis nodes for each candidate region, and form an optical path consistency map based on the consistency of multi-view physical coordinates and optical artifact prediction mapping. S5. Perform graph attention fusion on the optical path consistency map, and use the conformal threshold calibration results to output the defect category, inner and outer wall positions, axial position, circumferential angle, size, and confidence level of the true defect.
2. The method according to claim 1, characterized in that, S1 includes: Using the axis of the quartz diffuser tube as the attitude reference, record the outer diameter, wall thickness, camera external parameters, tube axial reference point, placement attitude category, spraying status mark, and circumferential angle at the time of acquisition; acquire the lighting image group at each circumferential angle, and associate and store the different lighting images at the same circumferential angle, the spraying status mark, and the corresponding tube geometric attitude parameters.
3. The method according to claim 1, characterized in that, S2 includes: The projection relationship between the incident ray from the outer wall, the refracted ray from the inner wall, and the outgoing ray is determined based on the refractive index, outer diameter, wall thickness of the quartz material, and camera external parameters; a cylindrical coordinate grid is established according to the set axial grid spacing and circumferential grid spacing. The pixels in the illumination image group are projected onto the cylindrical coordinate grid to obtain a cylindrical unfolded diagram; The mirror position, ghost offset, edge distortion region, and edge distortion intensity obtained by normalizing the edge pixel offset generated by double-wall refraction are written into the optical artifact prediction map.
4. The method according to claim 2, characterized in that, S3 includes: dividing the cylindrical unfolded diagram into patch regions, and using a trained self-supervised visual feature extractor to output multi-scale visual features for each patch region; selecting a corresponding normal patch feature set from the normal sample memory based on the outer diameter, wall thickness, spraying status identifier, and placement posture category; calculating the nearest neighbor distance between the multi-scale visual features and the normal patch feature set, and mapping the nearest neighbor distance back to the cylindrical coordinate grid to form an abnormal heatmap.
5. The method according to claim 4, characterized in that, S4 includes: Connected regions in the abnormal heatmap whose abnormal distance exceeds the candidate threshold determined by the normal sample memory are identified as candidate regions; Write the axial position, circumferential angle, candidate layers of inner and outer walls, anomaly distance, projection residual and morphological features for the actual defect hypothesis node. The projection residual is the distance between the center of the candidate region and the corresponding candidate mapping position of the inner wall or the candidate mapping position of the outer wall. The mirror position, ghost offset, edge distortion intensity, and bright spot projection residual are written to the optical artifact hypothesis node. The bright spot projection residual is the distance between the center of the candidate region and the mirror position in the optical artifact prediction map. When the real defect hypothesis nodes at different circumferential angles fall into the same axial grid cell and circumferential grid cell, a consistent edge with consistent edge weight is established. When the candidate region falls into the prediction region of the optical artifact prediction map, a suppression edge with suppression edge weight is established.
6. The method according to claim 5, characterized in that, S5 include: The real defect hypothesis node, the optical artifact hypothesis node, the consistent edge, and the suppressed edge are input into the graph attention fusion module; The graph attention fusion module generates a true defect fusion score and an artifact fusion score based on anomaly distance, projection residual, bright spot projection residual, morphological features, consistent edge weights, and suppression edge weights. The true defect fusion score is compared with the conformal threshold calibration result, and the true defect confidence score, as well as the corresponding defect category, location, and size, are output.
7. The method according to claim 6, characterized in that, The consistency edge weight is determined based on the axial mesh difference, circumferential mesh difference, and consistency flag of the candidate layers of the inner and outer walls of the real defect hypothetical nodes under different circumferential angles; the suppression edge weight is determined based on the distance between the center of the candidate region and the mirror position, the angle between the shape of the candidate region and the ghost offset direction, and the edge distortion intensity; the consistency edge weight is normalized and used to accumulate the real defect fusion score, and the suppression edge weight is normalized and used to accumulate the artifact fusion score.
8. The method according to claim 4, characterized in that, The normal sample memory includes index entries established according to outer diameter specification identifier, wall thickness specification identifier, coating status identifier, and placement posture category; each index entry stores the normal patch feature set, feature mean, and feature dispersion generated from qualified quartz diffusion tube samples; during detection, the corresponding index entry is selected according to the tube body geometric posture parameters and the coating status identifier, and the nearest neighbor distance is calculated using the normal patch feature set under the selected index entry.
9. The method according to claim 6, characterized in that, The conformal threshold calibration result is determined by inputting the candidate region corresponding to the qualified quartz diffusion tube sample in the calibration batch into the graph attention fusion module to obtain the true defect fusion score normalized to the 0 to 1 interval; The inconsistency score is obtained by subtracting the actual defect fusion score from 1. Quantitative values are selected from the sorted sequence of inconsistency scores according to the target coverage; the result of subtracting the quantitative value from 1 is used as the dynamic judgment threshold.
10. The method according to claim 9, characterized in that, The defect type, location, and size are determined in the following ways: When the actual defect fusion score is not less than the dynamic judgment threshold, the corresponding candidate region is marked as the actual defect region; the axial position and circumferential angle are calculated according to the axial grid number and circumferential grid number of the actual defect region in the cylindrical coordinate grid; the inner and outer wall positions are determined according to the inner wall candidate mapping or outer wall candidate mapping corresponding to the actual defect region; the skeleton length and average width are calculated for linear regions, the equivalent diameter and area are calculated for point regions, and the actual defect region is divided into microcracks, bubbles, pits or scratches according to morphological characteristics.
