Method for separating highlights and real defects of rivet based on bright area attribution field and signed distance map

CN122948900APending Publication Date: 2026-10-20SHENYANG AEROSPACE UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611067849.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0006]鉴于此,本发明提供了一种基于亮区归属场与符号距离图的飞机铆钉高光伪迹与真实缺陷分割方法,以解决现有技术中飞机铆钉可见光检测图像内高光伪迹与真实缺陷附着时边界难以稳定分离、复检判定不稳定的问题

Benefits of technology

[0015]本发明首先在铆钉定位基础上确定铆钉判读区域,并在该区域内构建局部亮度基准、提取亮度异常连通体,生成亮区载体。相较于现有方案多在整幅图像或简单铆钉区域内直接进行阈值分割与连通域筛选、候选区域约束不稳定的方式,能够以铆钉判读区域作为统一空间约束,并以亮区载体限定后续模型的关注范围,从而提高亮区候选获取的稳定性和针对性;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention belongs to the field of machine vision image segmentation and discloses a method for segmenting specular artifacts and real defects of aircraft rivets based on the bright area attribution field and symbol distance map. The method includes: acquiring visible light images of the rivets, locating the rivets and constructing a local brightness benchmark, and screening bright area carriers; generating pixel-level bright area attribution fields by fusing prior features using a Rectified Flow model; inputting the attribution field and the original image into a symbol distance map U-Net model, and outputting a defect symbol distance map after attribution modulation and dual constraints; extracting zero-level neighborhoods to obtain a defect mask, and calculating specular determination values ​​by combining the boundary neighborhood attribution fields to remove specular artifacts; and outputting an optimized mask, specular determination values, and re-inspection markers based on the defect area and specular proportion. This method improves the boundary differentiation ability in scenarios where specular artifacts and real defects are adhered, reduces specular false detections and defect missed detections, and enhances the stability, interpretability, and re-inspection accuracy of rivet defect segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision inspection and image segmentation technology, and in particular to a method for segmenting aircraft rivet specular artifacts and real defects based on a bright area belonging field and symbol distance map. Background Technology

[0002] Under visible light inspection, aircraft rivet surfaces often exhibit localized bright spots due to specular reflection from their curved surfaces and variations in background brightness. During manufacturing and service, rivets may develop real defects such as scratches, pits, and corrosion; these defects share similar appearance and brightness characteristics with reflected highlights. To meet the demands of batch inspections, it is typically necessary to locate and segment defects within the rivet area and provide a re-inspection judgment to reduce the burden of manual interpretation and improve interpretation consistency.

[0003] Existing technical solutions typically take rivet positioning as a prerequisite, perform brightness correction or local contrast enhancement within the rivet identification area, and then combine threshold segmentation, connected component analysis, and morphological processing to extract suspicious areas, and make rule-based judgments based on features such as area, shape, and texture. Some solutions use a segmentation model based on convolutional neural networks to perform end-to-end segmentation of the identification area, output a defect mask or defect probability map, and then correct the segmentation contour after edge detection. Some solutions also combine multi-light acquisition or polarization imaging to suppress the influence of reflection, or improve the adaptability to the rivet structure area through templates and prior constraints.

[0004] In real-world scenarios, the above-mentioned solutions are easily affected by rivet highlight artifacts. When the highlight and the real defect are attached or adhered in space, it is difficult to reliably give a closed and separable defect boundary by simply relying on the brightness threshold or conventional segmentation probability map. Often, the highlight and the defect are merged into the same connected body or the boundary is broken. Due to the lack of clear expression of the bright area's attribution and constraints on the boundary closure form, the subsequent re-inspection judgment based on rules such as area is also easily interfered with, resulting in the instability of the re-inspection object.

[0005] Therefore, given the shortcomings of existing detection schemes, such as unclear attribution of bright area attributes, easy merging and breakage of adhesive topologies, and susceptibility of post-processing rules to interference from specular highlights, how to construct a method that can accurately identify the physical source of bright areas and achieve stable separation of specular artifacts from the closed boundary of real defects in the complex attachment scenario of visible light detection of aircraft rivets, thereby providing highly consistent and stable re-inspection decision support for subsequent automated inspections under strong reflection conditions, has become an urgent technical problem to be solved. Summary of the Invention

[0006] In view of this, the present invention provides a method for segmenting the specular artifacts and real defects of aircraft rivets based on the bright area belonging field and symbol distance map, so as to solve the problem that the boundary is difficult to stably separate when specular artifacts and real defects are attached in the visible light detection image of aircraft rivets, and the re-inspection judgment is unstable.

[0007] To address the above problems, this invention provides a method for segmenting aircraft rivet specular artifacts and real defects based on a bright area attribution field and symbol distance map, comprising:

[0008] S1: Acquire visible light detection images of aircraft rivets, locate rivets in the visible light detection images of aircraft rivets, and determine rivet judgment areas; construct a local brightness reference map in the rivet judgment areas, calculate a brightness anomaly map based on the local brightness reference map, and perform binarization and connected component filtering on the brightness anomaly map to generate a bright area carrier;

[0009] S2: Input the visible light detection image of the aircraft rivet, the rivet interpretation area, the bright area carrier, the specular artifact final state template, and the real defect final state template into the Rectified Flow bright area attribution model. Based on the bright area carrier, locate the internal region of the bright area and perform texture weakening to generate a visually blurred state that retains the background brightness gradient and the brightness characteristics of the rivet's curved surface reflection. Extract the constraint features of the specular artifact final state and the real defect final state through the template encoder, and fuse them with the multi-scale features obtained by the shared encoder from the visually blurred state to generate an evolutionary direction field. Aggregate the bright area attribution field through the attribution projection layer channel, and output it after spatial alignment according to the rivet interpretation area.

[0010] S3: The visible light detection image of the aircraft rivet, the rivet identification region, and the bright area belonging field aligned with the rivet identification region are concatenated to generate boundary input features, which are then input into the symbol distance map U-Net boundary model. The boundary input features are subjected to multi-level downsampling convolution through the U-Net encoder to extract multi-scale encoded features, and then the U-Net decoder is upsampled step by step and fused with skip connections to obtain multi-scale decoded features. At the same time, the bright area belonging field and boundary closure constraint parameters are input into the attribution modulation layer to calculate the modulation weight map and limit its value range. The modulation weight map and the multi-scale decoded features are multiplicatively fused pixel by pixel to generate boundary modulation features. Subsequently, the defect symbol distance map is calculated through the symbol distance output layer, and symbol consistency constraints and distance monotonicity constraints are applied in the rivet identification region. Finally, the defect symbol distance map aligned with the spatial area of ​​the rivet identification region is output.

[0011] S4: Receive the defect symbol distance map aligned with the rivet reading area, filter the set of pixels whose absolute symbol distance is less than or equal to the zero-level threshold, and combine it with the rivet reading area to perform spatial constraints to obtain the zero-level neighborhood; perform connected component aggregation and internal filling on the zero-level neighborhood to generate a defect segmentation mask; then perform contour extraction on the defect segmentation mask to calculate the boundary set corresponding to the defect segmentation mask.

[0012] S5: Expand the boundary set according to the boundary set and neighborhood width parameters to obtain the boundary set neighborhood. Sample and count the bright area attribution field within this neighborhood to generate a specular artifact determination value to characterize the dominance of specular artifacts. Compare the specular artifact determination value with the attribution threshold. When the specular artifact determination value is greater than the attribution threshold, perform threshold segmentation within the boundary set neighborhood based on the bright area attribution field to generate a specular suppression mask. Apply this mask to the defect segmentation mask to obtain the suppressed defect segmentation mask. When the specular artifact determination value is less than or equal to the attribution threshold, do not perform specular suppression and directly use the defect segmentation mask as the suppressed defect segmentation mask.

[0013] S6: Receive the suppressed defect segmentation mask and the specular artifact judgment value, and filter the suppressed defect segmentation mask according to the rivet reading area to obtain the reading defect mask; calculate the defect area value of the reading defect mask and compare it with the defect area threshold to generate a defect trigger value; then jointly judge the defect trigger value and the specular artifact judgment value. When the defect trigger value meets the defect triggering condition and the specular artifact judgment value is less than or equal to the attribution threshold, a re-inspection flag is generated for defect re-inspection; otherwise, a re-inspection flag is generated for no re-inspection; finally, output the suppressed defect segmentation mask, the specular artifact judgment value and the re-inspection flag to form defect re-inspection decision information for the rivet reading area.

[0014] The beneficial effects of the aircraft rivet specular artifact and real defect segmentation method based on bright area attribution field and symbol distance map provided by this invention are as follows:

[0015] This invention first determines the rivet identification region based on rivet positioning, and then constructs a local brightness benchmark and extracts brightness anomaly connected components within this region to generate a bright area carrier. Compared to existing solutions that often perform threshold segmentation and connected component filtering directly within the entire image or a simple rivet region, resulting in unstable candidate region constraints, this invention uses the rivet identification region as a unified spatial constraint and the bright area carrier to limit the focus of subsequent models, thereby improving the stability and targeting of bright area candidate acquisition.

[0016] Furthermore, a boundary representation method based on symbolic distance maps is adopted. This method combines symbolic consistency constraints and distance monotonicity constraints with boundary response modulation to generate a defect symbolic distance map, and then extracts the defect boundary from the zero-level neighborhood. Compared to existing solutions that directly output masks or probability maps, which are prone to boundary merging or non-closure in adhesion regions, this invention improves the closure and separability of defect boundaries, thus making it more conducive to achieving stable segmentation in scenarios where specular artifacts and real defects are attached.

[0017] Furthermore, the bright area's belonging field is sampled and statistically analyzed within the boundary set neighborhood to form a speculative artifact judgment value. Speculative artifact suppression is implemented when conditions are met, and a re-inspection flag is output in conjunction with a defect area threshold. Compared to existing solutions that often use fixed rules for filtering after segmentation, which can easily lead to false suppression or inconsistent decisions, this invention uses the same criterion throughout the post-segmentation processing and re-inspection judgment process. This reduces the interference of speculative artifacts on the actual defect segmentation results and improves the consistency and stability of the re-inspection output. Attached Figure Description

[0018] Figure 1 A flowchart of the method for segmenting aircraft rivet specular artifacts and real defects based on bright area attribution field and symbol distance map provided by the present invention;

[0019] Figure 2 Logic diagram for generating the bright area's belonging field and separating the defect boundary;

[0020] Figure 3 A comparative illustration of physical samples showing rivet defects under strong high-light occlusion conditions;

[0021] Figure 4 A magnified schematic diagram showing the separability of the boundary between specular artifacts and real defects;

[0022] Figure 5 This is a schematic diagram of the defect boundary neighborhood ring structure and specular suppression mechanism based on the symbolic distance map;

[0023] Figure 6 This is a schematic diagram illustrating the causes and imaging mechanisms of specular highlights on the rivet surface and diffuse reflection from material defects. Detailed Implementation

[0024] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0025] like Figure 1 As shown, this invention provides a method for segmenting aircraft rivet specular artifacts and real defects based on the bright area attribution field and symbol distance map, including the following steps:

[0026] S1: Acquire visible light detection images of aircraft rivets, locate rivets in the visible light detection images of aircraft rivets, and determine rivet judgment areas; construct a local brightness reference map in the rivet judgment areas, calculate a brightness anomaly map based on the local brightness reference map, and perform binarization and connected component filtering on the brightness anomaly map to generate a bright area carrier;

[0027] Step S1 outputs the rivet identification area. With bright area carrier As input objects for the Rectified Flow bright area attribution model and the symbolic distance map U-Net boundary model, they participate in subsequent mapping calculations;

[0028] In this embodiment, step S1 specifically includes:

[0029] S11: Acquire visible light detection images of aircraft rivets And extract the luminance channel ;

[0030] S12: Calculate the edge response on the brightness channel Y and extract circular candidates; obtain the rivet head position based on the center coordinates and radius; map the rivet head position to... The pixel coordinate system, based on the candidate region side length parameter Extracting an image patch containing the rivet head yields rivet candidate regions, where the set of pixel indices for the rivet candidate regions is denoted as . , Used to constrain the spatial range of the rivet identification area, so that the rivet identification area covers the possible locations of rivet head and surrounding defects;

[0031] S13: Based on the pixel index set Determine the rivet reading area R, and... Defined as with For a single-channel mask of the same size, the set of pixels within the mask is denoted as... ,in, Depend on According to the extended parameters After expansion, it was obtained and combined with Boundary clipping alignment; based on Calculate the local brightness reference map ; The calculation uses a sliding neighborhood approach: for For each pixel within the neighborhood window, the parameter is the side length of the neighborhood window. Define the neighborhood window, and within the neighborhood window... Perform statistical aggregation to obtain the baseline brightness value, and write the baseline brightness value into... The corresponding pixel position; The position of the outer pixel is Center value is zero; local brightness reference map Preserve the background brightness gradient features within the rivet interpretation area to provide a reference benchmark for brightness anomaly maps;

[0032] S14: After constructing the local brightness reference map B in S13, the brightness anomaly map D is calculated based on it. The brightness anomaly map is defined according to the pixel calculation rules. , Based on brightness threshold Binarize the brightness anomaly map to generate a brightness anomaly binary map, and denote the brightness anomaly binary map as follows: The binary image of brightness anomalies is defined according to the pixel determination rule as follows: when... hour ,when hour , ; The position of the outer pixel is The value is set to zero.

[0033] S15: For the binary image M with brightness anomalies output by S14, the eight-neighbor connectivity criterion is used to extract connected components, resulting in a set of connected components. Each connected component It is a set of pixel indices and satisfies Calculate the area value for each connected component. Area value Defined as the number of pixels in a connected volume; area value With area threshold Compare and filter to meet the requirements Connected components are combined and merged to generate bright area carriers. The bright area carrier L is defined as a single-channel mask of the same size as the visible light detection image I of the aircraft rivet. In L, the set of pixel positions with a value of 1 is the union of the sets of pixel indices of all connected components after filtering, and the remaining pixel positions have a value of 0. Reading area with rivets The output is aligned in the same pixel coordinate system and used as a spatial constraint input for constructing the visual blur state in the Rectified Flow bright area attribution model;

[0034] S2: Input the visible light detection image of the aircraft rivet, the rivet interpretation area, the bright area carrier, the specular artifact final state template, and the real defect final state template into the Rectified Flow bright area attribution model. Based on the bright area carrier, locate the internal region of the bright area and perform texture weakening to generate a visually blurred state that retains the background brightness gradient and the brightness characteristics of the rivet's curved surface reflection. Extract the constraint features of the specular artifact final state and the real defect final state through the template encoder, and fuse them with the multi-scale features obtained by the shared encoder from the visually blurred state to generate an evolutionary direction field. Aggregate the bright area attribution field through the attribution projection layer channel, and output it after spatial alignment according to the rivet interpretation area.

[0035] Step S2 uses model inference as the main attribute, employs the Rectified Flow bright area attribution model to model the spatial range defined by the bright area carrier and outputs the bright area attribution field. The bright area attribution field serves as the boundary response modulation input object for the subsequent symbol distance map U-Net boundary model.

[0036] In this embodiment, step S2 specifically includes:

[0037] S21: Record the visible light detection image of the aircraft rivets output in step S1 as... The rivet reading area is recorded as The bright area carrier is recorded as The final state template of the specular artifact is denoted as The actual defect final state template is denoted as ;

[0038] S22: Based on the variables specified in S21, , , , , Organize the input data to form the attributed input data. The attribution input data It includes image data channels, mask channels, and template channels. The image data channels are composed of... Provided, mask channel by and Provided by, template channel is and Provide; attribution input data As a unified input object for the RectifiedFlow bright area attribution model, it is used to ensure that the shared encoder, evolutionary orientation field decoder, and attribution projection layer process the bright area carrier, rivet interpretation region, and final state template constraint information in the same pixel coordinate system.

[0039] S23: Based on the bright area carrier L determined in S15, locate the internal region of the bright area carrier, and denote the pixel index set of the internal region of the bright area carrier as... , Depend on It consists of pixel positions with a value of one, and satisfies , For rivet reading area The set of pixel positions with a value of one; for Texture weakening is performed on the image patch within the image. Texture weakening uses a neighborhood aggregation method to generate a weakened texture map, which is denoted as . Weakening texture map exist The system suppresses high-frequency texture responses while preserving low-frequency brightness distribution; to retain the background brightness gradient features and rivet arc surface reflection brightness features within the rivet interpretation area in a visually blurred state, the system... The gradient magnitude map of the internal brightness channel is calculated and denoted as... , Depend on The brightness channel is calculated using a fixed convolution operator; in The distance map from the interior region of the bright area carrier to the boundary of the bright area carrier is calculated and denoted as follows. , Depend on exist The distance is calculated using distance transformation; based on , , , , , Construct a visually blurred state, and denote the visually blurred state as . Blurred vision Defined using the following formula:

[0040] ;

[0041] ;

[0042] in, Represents pixel coordinates; Indicates the color channel index; Indicates a visually blurred state at the pixel level. With channel The value at; This indicates that the rivet reading area is in pixels. The mask value at that location; Indicates the texture weakening weight; This indicates the visible light detection image of aircraft rivets at the pixel level. With channel The value at; This indicates that the texture map is weakened at the pixel level. With channel The value at; Indicates the carrier of the bright area in the pixel The mask value at that location; and This represents the texture weakening weight coefficient; Indicates the gradient magnitude map at the pixel level. The value at; Represents the gradient threshold, used for... Perform normalization; Represents the distance map in pixels The value at; This represents the boundary attenuation width parameter; This indicates that the input value will be truncated to a range. Operators; This represents the exponential operator; through this definition, the visually blurred state... exist The position of the outer pixel is determined by Achieving zero-value constraints and visually blurred states exist Internally Initiate texture weakening weight calculation, and through and Modulate texture weakening weights to create a visually blurred state. Texture weakening is performed within the bright area of ​​the carrier, while maintaining consistency in the brightness distribution trend within the rivet reading area.

[0043] S24: Convert the specular artifact final state template from S21 Compared with the actual defect final state template Input the template encoder, and denote the template encoder as... , This represents the template encoder parameters; the template encoder outputs a final-state constraint feature vector, and the final-state constraint feature vector corresponding to the specular artifact final-state template is denoted as... Let the final state constraint feature vector corresponding to the real defect final state template be denoted as ; Determine the area based on the rivets right and Spatial alignment is performed, and the spatial alignment uses a broadcast writing method to generate the final state constraint feature map. The final state constraint feature map corresponding to the specular artifact final state template is denoted as... The final state constraint feature map corresponding to the real defect final state template is denoted as... , and exist The inner part is a constant feature map and in The external value is zero; and Channel splicing is performed to obtain the final state constraint feature map, which is denoted as... Final state constraint feature map As a constraint input to the evolution orientation field decoder, it is used to provide target morphological references for the specular artifact final state template and the real defect final state template for the evolution orientation field at the pixel level;

[0044] S25: The visually blurred state constructed in S23 Input the shared encoder, and denote the shared encoder as... , This represents the parameters of the shared encoder. The shared encoder uses a multi-level downsampling convolutional structure to extract spatial and contextual features step by step, outputting a multi-scale feature set, which is denoted as . , For scale-level indexing; each multi-scale feature All with In the same pixel coordinate system and preserved Internal structural response, multi-scale feature set Provides multi-scale edge and texture evidence input for the evolutionary orientation field decoder;

[0045] S26: Based on the multi-scale feature set in S25 Final state constraint feature map in S24 Input the evolutionary orientation field decoder, and denote the evolutionary orientation field decoder as... The evolutionary orientation field decoder uses a step-by-step upsampling convolutional structure to recover spatial resolution, and at each stage, it incorporates the final state constraint feature map. Multiscale features corresponding to the scale The fusion process employs channel stitching and convolutional projection to optimize the final state constrained feature map. The feature responses are conditionally modulated at different scales; the evolutionary orientation field decoder outputs the evolutionary orientation field, which is denoted as... Evolutionary direction field exist The inner part is a multi-channel feature map, used to express the pixel-level evolution components of the internal region of the bright area carrier from a visually blurred state to the final state template of the specular artifact and the final state template of the real defect; evolution direction field exist The external value is set to zero to maintain coordinate alignment;

[0046] S27: The evolution direction field in S26 With final state constraint feature map Input the projection layer, and denote the projection layer as: Belonging to the projection layer pair and Perform channel aggregation and generate an attribution response graph, denoted as [the graph is then described]. Attribution response diagram This is a single-channel continuous value feature map; it belongs to the projection layer during the aggregation process for the bright area carrier. Apply mask constraints to make the attribution response map exist Internal output effective attribution tendency, in Internally output background suppression value; assign response map Defined as the bright area attribution field, the value range of the bright area attribution field A is [0,1]. The closer the value of A is to 1, the more likely the corresponding pixel is to be a real defect. The closer the value of A is to 0, the more likely the corresponding pixel is to be a specular artifact. The bright area attribution field is subsequently used as the input object of the symbolic distance map U-Net boundary model to participate in boundary response modulation.

[0047] S28: For the bright area belonging field A generated in S27, spatially align it according to the judgment area R. The alignment method is to... Set the outer pixel position to zero and keep it. The pixel position values ​​remain unchanged, and the bright area attribution field aligned with the rivet judgment area is obtained. The bright area attribution field aligned with the rivet judgment area is used as the output of step S2, which is used as the boundary modulation input in the symbol distance map U-Net boundary model and as the calculation object of the attribution statistics in the calculation of the specular artifact determination value.

[0048] S3: The visible light detection image of the aircraft rivet, the rivet identification region, and the bright area belonging field aligned with the rivet identification region are concatenated to generate boundary input features, which are then input into the symbol distance map U-Net boundary model. The boundary input features are subjected to multi-level downsampling convolution through the U-Net encoder to extract multi-scale encoded features, and then the U-Net decoder is upsampled step by step and fused with skip connections to obtain multi-scale decoded features. At the same time, the bright area belonging field and boundary closure constraint parameters are input into the attribution modulation layer to calculate the modulation weight map and limit its value range. The modulation weight map and the multi-scale decoded features are multiplicatively fused pixel by pixel to generate boundary modulation features. Subsequently, the defect symbol distance map is calculated through the symbol distance output layer, and symbol consistency constraints and distance monotonicity constraints are applied in the rivet identification region. Finally, the defect symbol distance map aligned with the spatial area of ​​the rivet identification region is output.

[0049] Step S3 uses model inference as the primary attribute, employing a pre-trained symbolic distance map U-Net boundary model to determine the attribution field in bright regions. A defect symbol distance map is generated under the common constraints of the boundary closure constraint parameters, and the defect symbol distance map is used as the input object for the subsequent step S4 to extract the zero-level neighborhood;

[0050] In this embodiment, step S3 specifically includes:

[0051] S31: Record the visible light detection image of the aircraft rivets output in step S1 as... The rivet reading area is recorded as The bright area output from step S2 that is aligned with the rivet identification area is denoted as the field to which it belongs. ; The rivet reading area The set of pixel positions with a value of one is denoted as . ;

[0052] S32: Regarding S31 , , Channel concatenation is performed to generate boundary input features, which are denoted as... Boundary input features In pixel coordinate system Alignment, boundary input features exist Zero-value constraints are applied to the pixel positions outside the symbolic distance map, so that the feature extraction range of the U-Net boundary model is limited by the rivet interpretation region. Constraints; Boundary Input Features exist Simultaneously carrying from Texture evidence, from Spatial constraint information and from The bright area attribution constraint information provides a basis for subsequent boundary response modulation to be performed at the pixel level.

[0053] S33: The boundary input feature constructed by S32 The U-Net encoder for the U-Net boundary model of the input symbolic distance map is denoted as U-Net encoder. , The symbolic distance map represents the boundary model parameters of U-Net; the U-Net encoder uses a multi-level downsampling convolutional structure to process the boundary input features. Encode the feature set and output a multi-scale encoded feature set, denoted as . ,in For scale-level indexing; each multi-scale encoded feature The edge response and defect texture response of the rivet structure at the corresponding scale are preserved to provide feature support for boundary detail recovery through skip connections during the decoding stage. The U-Net encoder of the symbolic distance map U-Net boundary model can be configured to include an input adaptation layer and a shared coding segment. The input adaptation layer is used to input boundary features. Mapped to the encoder's base channel space, the shared coding segment is used to maintain the same convolutional hierarchy as the shared encoder in step S2, thereby preserving the bright area home field in the end-to-end link. Coordinates with consistent feature representation between the boundary response;

[0054] S34: The set of multi-scale encoded features output from S33 The U-Net decoder for the input symbolic distance map U-Net boundary model, denoted as U-Net decoder. The U-Net decoder uses a progressively upsampled convolutional structure to restore spatial resolution, and encodes multi-scale features at each level. By performing skip connections and fusion with the decoding features at this level, a multi-scale decoding feature set is obtained, denoted as . Multi-scale decoding feature set It is used to carry boundary details near the zero-level neighborhood and symbol distribution information inside and outside the region, providing input for the distance expression of the symbol distance output layer;

[0055] S35: Assign the bright area to the field The boundary closure constraint parameters are input to the assigned modulation layer, denoted as . The boundary closure constraint parameters are denoted as... ,in, Indicates the lower bound of the modulation weight. Indicates the upper bound of the modulation weight. This represents the modulation intensity coefficient; to ensure that the modulation weight map maintains spatial continuity near the boundary of the bright area carrier and directional consistency within the bright area carrier, the corresponding attribution tendency is first determined in the rivet reading area. The inner bright area belongs to the field Perform neighborhood aggregation to obtain the smooth bright region attribution field, which is denoted as . Neighborhood aggregation uses the window side length parameter. Define a local window, and within the local window... Average polymerization was performed to obtain At the same time, The outer pixel position is set to zero; based on and Calculate the modulation weight map, denoted as . The modulation weight map is defined by the following formula:

[0056] ;

[0057] in, Indicates the modulation weight map at the pixel The value at; This indicates that the rivet reading area is in pixels. The mask value at that location; This indicates that the input value will be truncated to a range. Operators; Indicates the lower bound of the modulation weight; Indicates the upper bound of the modulation weight; This represents the sigmoid mapping operator, used to map input values ​​to the interval between zero and one; Indicates the modulation intensity coefficient; Indicates the field of the smooth bright area at the pixel. The value at; Represents pixel coordinates; through this definition, the modulation weight map is... exist external Implement zero-value constraints and modulate the weight graph. exist Internally Provide source discrimination constraints and by By limiting the range of values ​​in the modulation weight map, bright areas are assigned to specific fields. Transformed into an executable boundary response modulation weight input;

[0058] S36: Modulate the weighting map With multi-scale decoding feature set Perform pixel-wise multiplicative fusion to generate a boundary modulation feature set, denoted as . ; Pixel-wise multiplicative fusion is performed with scale alignment, making the modulation weight map Corresponding multi-scale decoding features at each scale Spatial alignment is performed before fusion to obtain boundary modulation features. Boundary modulation feature set As input to the symbolic distance output layer, the symbolic distance output process is simultaneously influenced by the visible light detection image of the aircraft rivets. Texture evidence and bright area attribution field Source discrimination constraint driving;

[0059] S37: Set of boundary modulation features from S36 The input symbol distance to the output layer is denoted as . The defect symbol distance map is calculated and denoted as . ; in the rivet reading area Internal defect symbol distance map Apply sign consistency constraints and distance monotonicity constraints. The sign consistency constraints employ connected component uniformity rules: Internal zero-value boundary pairs Perform symbol partitioning, and perform uniformity correction on the symbol values ​​within the same connected component based on the connected component area threshold. Isolated symbol regions that do not meet the area condition are removed; the distance monotonicity constraint adopts the zero-level neighborhood monotonic expansion rule: in With zero level threshold Screening defect symbol distance map The zero-level neighborhood is used to calculate the distance map from the pixel to the zero-level neighborhood and then... The distance magnitude is monotonically reassigned while retaining the sign values ​​after sign consistency constraints, thereby making the defect symbol distance map more accurate. In the rivet reading area The internal structure forms a stable distance distribution that can be used for zero-level neighborhood extraction;

[0060] S38: Determine the area based on the rivet. Defect symbol distance map in S37 Perform spatial alignment, the alignment method is to Set the outer pixel position to zero and keep it. The inner pixel position values ​​remain unchanged. Output the defect symbol distance map aligned with the rivet judgment area. Use this as the output of step S3 and input it into step S4 to extract the zero-level neighborhood.

[0061] S4: Receive the defect symbol distance map aligned with the rivet reading area, filter the set of pixels whose absolute symbol distance is less than or equal to the zero-level threshold, and combine it with the rivet reading area to perform spatial constraints to obtain the zero-level neighborhood; perform connected component aggregation and internal filling on the zero-level neighborhood to generate a defect segmentation mask; then perform contour extraction on the defect segmentation mask to calculate the boundary set corresponding to the defect segmentation mask.

[0062] Step S4 is a data construction step, which involves extracting the defect symbol distance map. The zero-level neighborhood is converted into a defect segmentation mask and a boundary set, so that the subsequent step S5 can calculate the attribution statistics of the bright area attribution field within the boundary set neighborhood.

[0063] In this embodiment, step S4 specifically includes:

[0064] S41: Receive the defect symbol distance map output from step S3, which is aligned with the rivet reading area. The defect symbol distance map is denoted as... Simultaneously receive rivet reading area With zero level threshold ; The rivet reading area The set of indices consisting of pixel positions with a value of one is denoted as . ;

[0065] S42: First, in the defect symbol distance map Extract the zero-level neighborhood; denote the set of zero-level neighborhood pixels as... And based on S41 , , Crossing the threshold at zero level Perform pixel-level filtering; filter pixels The set of eight neighboring pixel coordinates is denoted as , Used to check for sign crossings in the zero-level neighborhood to avoid pseudo-zero-level responses caused by local numerical oscillations. The filtering rules are defined using the following formula:

[0066] ;

[0067] in, Represents the set of pixels in the zero-level neighborhood; Represents pixel coordinates; This indicates that the rivet reading area is in pixels. The mask value at that location; The distance map of defect symbols in pixels The sign distance value at the location; Indicates a zero-level threshold; Represents pixels The set of eight neighboring pixel coordinates; Indicates the pixel coordinates within the eight neighboring domains; This represents the maximum value operation over the set of eight neighboring pixel coordinates; This represents the minimum value operation over the set of eight neighboring pixel coordinates; This represents the zero-level crossing threshold, used to limit the crossing range of the sign distance value within eight neighborhoods;

[0068] S43: Obtain the set of zero-level neighborhood pixels in S42. Then, the set of zero-level neighbor pixels Write the zero-level neighborhood mask, denoted as . Zero-level neighborhood mask Distance map to defect symbols A single-channel binary mask of the same size, in Set the inner pixel position to one, and in the non- Set the pixel position to zero, and in The outer pixel position maintains a zero-value constraint; to ensure the use of continuous boundaries in subsequent filling processes, a zero-level neighborhood mask is used. Input shape closure processing, which uses the closure correction window side length parameter. Define structural elements and... Performing a closure operation of first dilation and then erosion yields a closed zero-level neighborhood mask, denoted as […]. Subsequently, a closed zero-level neighborhood mask was applied. Perform connected component extraction and obtain the set of connected components using the eight-neighbor connectivity criterion. Calculate the area value of each connected component; then compare the area value of the connected component with the minimum connected component area threshold. By comparison, only connected components that satisfy the area condition are retained, and isolated connected components are removed before updating the closed zero-level neighborhood mask. ,make Only the zero-level neighborhood structure involved in closing the defect region is retained;

[0069] S44: Closed zero-level neighborhood mask based on S43 Generate a defect segmentation mask, and denote the defect segmentation mask as... , Distance map to defect symbols A single-channel binary mask of the same size is used; boundary tracking is performed on the boundary pixels corresponding to each preserved connected component to obtain an ordered sequence of boundary pixels, and the ordered sequence of boundary pixels is written into the boundary pixel mask; in the rivet judgment area... The internal region filling is performed using scan line filling rules: The vertical coordinate is fixed and the horizontal scan is performed. The intersection points of the scan line and the boundary pixel mask are recorded and sorted according to the horizontal coordinate. Pixel intervals between adjacent intersection points that satisfy the odd-even rule are determined as internal pixel intervals. These internal pixel intervals are then filled within... Centered as 1, and set the boundary pixels in The center is set to 1; boundary tracking and scan line filling are repeated for multiple connected components in the order of connected component index, and all filling results are combined to obtain a defect segmentation mask covering all candidate defect attachment areas within the rivet judgment area. Defect segmentation mask exist The outer pixel position is set to zero to maintain consistent output coordinates aligned with the rivet reading area;

[0070] S45: Defect segmentation mask based on S44. Calculate the boundary set, and denote the boundary set as... Boundary set Defect segmentation mask The boundary set consists of pixels whose values ​​are all one and whose eight neighboring pixels contain a value of zero. The extraction process uses a pixel traversal method, and S45 in Inner traversal of all For each pixel position with a value of 1, check the set of eight neighboring pixel coordinates. Does it exist inside? The pixel position with a value of zero is added to the boundary set when the condition is met. Output defect segmentation mask With boundary set and the boundary set As the input object for the subsequent step S5 to construct the boundary set neighborhood;

[0071] S5: Expand the boundary set according to the boundary set and neighborhood width parameters to obtain the boundary set neighborhood. Sample and count the bright area attribution field within this neighborhood to generate a specular artifact determination value to characterize the dominance of specular artifacts. Compare the specular artifact determination value with the attribution threshold. When the specular artifact determination value is greater than the attribution threshold, perform threshold segmentation within the boundary set neighborhood based on the bright area attribution field to generate a specular suppression mask. Apply this mask to the defect segmentation mask to obtain the suppressed defect segmentation mask. When the specular artifact determination value is less than or equal to the attribution threshold, do not perform specular suppression and directly use the defect segmentation mask as the suppressed defect segmentation mask.

[0072] Step S5 belongs to the state determination and mask update category, based on the boundary set. The determination location is limited, and the bright area is assigned to the field. Provide source discrimination constraints, output specular artifact judgment values, and generate a suppressed defect segmentation mask;

[0073] In this embodiment, step S5 specifically includes:

[0074] S51: Receive the bright area belonging field output from step S2 that is aligned with the rivet identification area. Receive the defect segmentation mask output from step S4 With boundary set and receive the rivet reading area. Neighborhood width parameter Attribution threshold Attribution segmentation threshold ; The rivet reading area The set of pixel positions with a value of one is denoted as . ;

[0075] S52: Based on the boundary set of S51 With neighborhood width parameter Construct a boundary set neighborhood, and denote the set of pixel positions in the boundary set neighborhood as . For boundary sets Perform mask dilation operation, the dilation operation uses... Using a structuring element with radius, the pixel positions covered by the expanded area are incorporated. Simultaneously, the reading area is determined based on the rivets. right To perform screening, To ensure that the attribution statistics only include pixels relevant to the defect segmentation mask, the set of pixel locations within the boundary set neighborhood and located in the foreground of the defect segmentation mask is denoted as... , The pixel position belongs to And satisfy the defect segmentation mask Composed of pixel positions with a value of one;

[0076] S53: Assigning field to bright areas within the neighborhood of the boundary set. Sampling and calculation of the attribution statistic are performed, and the attribution statistic is denoted as... ,in, The mean value of the bright area within the neighborhood of the boundary set is calculated in S52. within The values ​​are taken as samples and normalized according to the number of pixels; The percentage of bright areas belonging to a low-growth field within the boundary set's neighborhood is determined by statistical analysis. Internal satisfaction The value is less than or equal to the attribution segmentation threshold. The number of pixels divided by The number of pixels is obtained; The percentage of bright areas belonging to a given field within the boundary set's neighborhood is determined by statistical analysis. Internal satisfaction The value is greater than the attribution segmentation threshold. The number of pixels divided by The number of pixels was obtained based on the attribution statistics. Generate a specular artifact determination value, and record the specular artifact determination value as... Specular artifact determination value Using the percentage of low-level attribution in the attribution statistics Direct assignment ensures that the specular artifact determination value is consistent with the low-attributed pixel density of the bright area belonging field within the boundary set neighborhood.

[0077] S54: Specular artifact determination value generated by S53 and the attribution threshold Compare and execute branching; when Greater than the home threshold A specular suppression mask is generated and applied to the defect segmentation mask. This specular suppression mask is denoted as... Highlight suppression mask To be consistent with the bright area belonging to the field Single-channel binary mask of the same size, specular suppression mask The pixel generation rules are limited to the boundary set neighborhood. Inside: To For each pixel position within the field, if the bright area belongs to the field... The value is less than or equal to the attribution segmentation threshold. Then use a specular suppression mask. Set to 1, otherwise use the specular suppression mask. Set to zero; The inner pixel position will be a highlight suppression mask. Set to zero; set the specular suppression mask. Action on defect segmentation mask The suppressed defect segmentation mask is denoted as The operating rule is to perform pixel-by-pixel suppression update for all pixel positions: when the defect segmentation mask... The value is one and the specular suppression mask When the value is one, the defect segmentation mask after suppression will be applied. Setting it to zero will suppress the defect segmentation mask at the remaining pixel positions. Defect segmentation mask Maintain consistency; through this update, suppress the post-defect segmentation mask. Within the neighborhood of the boundary set, based on the bright area belonging field Complete the explicit removal of specular artifacts;

[0078] S55: When Less than or equal to the home threshold No specular suppression mask is generated at this time And the defect segmentation mask Directly used as a mask for post-suppression defect segmentation Output specular artifact determination value With the defect segmentation mask after suppression And maintain the output and rivet reading area. Alignment;

[0079] S6: Receive the suppressed defect segmentation mask and the specular artifact judgment value, and filter the suppressed defect segmentation mask according to the rivet reading area to obtain the reading defect mask; calculate the defect area value of the reading defect mask and compare it with the defect area threshold to generate a defect trigger value; then jointly judge the defect trigger value and the specular artifact judgment value. When the defect trigger value meets the defect triggering condition and the specular artifact judgment value is less than or equal to the attribution threshold, a re-inspection flag is generated for defect re-inspection; otherwise, a re-inspection flag is generated for no re-inspection; finally, output the suppressed defect segmentation mask, the specular artifact judgment value, and the re-inspection flag to form defect re-inspection decision information for the rivet reading area.

[0080] Step S6 belongs to the state determination step, based on The given defect candidate regions and The given risk of specular artifacts forms defect re-inspection decision information for the rivet reading area;

[0081] In this embodiment, step S6 specifically includes:

[0082] S61: Receive the suppressed defect segmentation mask and specular artifact determination value output from step S5, and record the suppressed defect segmentation mask as... The specular artifact determination value is recorded as Simultaneously receive rivet reading area Attribution threshold With defect area threshold ; The rivet reading area The set of pixel positions with a value of one is denoted as . ;

[0083] Determining the area based on rivets Defect segmentation mask after suppression After filtering, a defect mask is obtained, and the defect mask is denoted as... The filtering process uses a pixel-by-pixel masking rule: for all pixel positions... ,when season ,when season Through this screening, the defect mask can be identified. The foreground pixels only come from the rivet reading area. The foreground pixels of the defect segmentation mask within the inner area are suppressed to avoid introducing residual foreground outside the rivet judgment area into the re-inspection decision;

[0084] S62: Defect mask obtained in S61 Calculate the defect area value and compare it with the defect area threshold. Compare and generate defect trigger values; record the defect area value as... Defect area value Defined as a defect mask for interpretation The number of pixels with a value of one is counted, and only pixels whose positions belong to the specified range are counted during the calculation. The pixels; the defect trigger value is recorded as Defect trigger value For binary decision variables, the generation rule is: when Greater than or equal to the defect area threshold When Set it to a value that meets the defect triggering condition; when Less than the defect area threshold When Set to zero and determine that the defect trigger value does not meet the defect triggering condition; defect area threshold The minimum area condition used to limit the triggering of re-inspection ensures that the re-inspection decision maintains a stable judgment caliber for the scattered foreground remaining after suppression by the neighborhood of the boundary set.

[0085] S63: Defect trigger value combined with S62 Compared with the specular artifact determination value of S53 A joint judgment is performed to generate a re-inspection mark, which is then recorded as follows: Re-inspection mark This is a binary marker, a re-inspection marker. The corresponding re-inspection mark is for defect re-inspection. The corresponding re-inspection flag indicates that no re-inspection is required; the joint judgment is performed sequentially: first, the defect trigger value is determined. Does the defect triggering condition meet? Continue to determine the specular artifact judgment value. Is it less than or equal to the attribution threshold? ,when Less than or equal to the home threshold Re-inspection mark Set to one, when Greater than the home threshold Re-inspection mark Set to zero; when The re-inspection mark will be directly applied at that time. Set to zero; through this joint determination, the re-inspection mark is... Simultaneously subject to interpretation defect mask Area triggering constraint and specular artifact determination value The attribution constraint, the re-inspection decision and the bright area attribution field driving link output by step S2 are consistent with the judgment entry point;

[0086] Finally, the output is the defect segmentation mask after suppression. Specular artifact determination value With re-inspection mark This generates defect re-inspection decision information; the defect re-inspection decision information is recorded as... Defect re-inspection decision information As the input object for re-inspection of the rivet interpretation area, it enters the subsequent re-inspection process.

[0087] like Figure 3As shown, in visible light images of aircraft rivets under strong specular occlusion, the bottom structure of the rivet groove and surrounding small defects are easily obscured by specular highlights, causing the highlight area to become intertwined with the real defect in terms of brightness and spatial location. The left sample is a rivet image collected from a typical production site, with obvious specular highlights at the center of the cross groove; the right sample is a rivet image collected under stronger lighting conditions, with the central highlight appearing as a continuous strip accompanied by local saturation. For the above scenarios, traditional methods based on grayscale thresholding or ordinary segmentation models are prone to misclassifying specular artifacts as defects, or weakening the response of real defects when suppressing highlights. This invention characterizes the tendency of bright areas to belong to either the final state of specular artifacts or the final state of real defects through the bright area attribution field, and combines it with the boundary and boundary neighborhood statistics of the symbolic distance map, which is beneficial for achieving specular artifact suppression and real defect preservation under strong specular occlusion scenarios.

[0088] like Figure 4 The image shows the superimposed boundaries of the real defect and the specular artifact on the same rivet, with a magnified view on the right. (Left image) The solid green line represents the real defect boundary determined by the SDF zero-level set, and the dashed red line represents the boundary of the specular artifact. In the original image, they are close to each other but do not overlap. (Mega view on the right) A small, separable gap can be clearly seen between the two boundaries, indicating that through the attribution field modeling and fine boundary estimation of this invention, "brightness-connected" specular highlights can be separated from defects at the pixel level. This characteristic ensures that the algorithm can still achieve accurate discrimination under extreme specular conditions.

[0089] like Figure 5 The diagram illustrates the construction of a neighborhood ring zone near the defect boundary and the specular suppression process. The solid outline represents the defect boundary obtained from the SDF (Spectral Density Function), while the two dashed rings inside and outside the dashed lines represent the neighborhood ring zones formed by expansion with width w. The ring-filled texture area indicates the statistical sampling range, and the mesh texture portion represents the specular suppression area within the ring zone determined based on the home field threshold. Black dots represent sampling points participating in the statistics. This figure illustrates that the invention does not rely solely on a single-point threshold but utilizes local statistics on the boundary neighborhood to distinguish between specular highlights and defect textures, thereby preserving the true edge of the defect as much as possible while suppressing specular highlights, thus improving robustness and reliability.

[0090] like Figure 6The diagram illustrates the physical causes of the difference between specular artifacts and real defects. Incident light from the left light source passes through the rivet's curved surface, forming a specular specular highlight region near the normal that satisfies the specular reflection condition. The reflected light is received by the right camera, producing a saturated bright spot. In contrast, real defect regions disrupt the local surface structure, producing only multi-directional diffuse reflection, resulting in reduced overall brightness and weak directionality. This invention utilizes this mechanism in its algorithm design: by learning specular reflection patterns through the home field and combining geometric boundaries and neighborhood statistics, it suppresses only responses that meet the "spectral highlight characteristics," while retaining the real defects corresponding to diffuse reflection anomalies. This fundamentally solves the problem of traditional methods misclassifying highlights as defects or obscuring defects within highlights.

[0091] This invention provides a method for segmenting specular artifacts and real defects in aircraft rivets based on a bright area attribution field and a symbolic distance map. Addressing shortcomings in existing visible light detection methods for aircraft rivets, such as similar brightness patterns between specular artifacts and real defects, difficulty in separating boundaries during spatial attachment, easy merging or boundary breaks in segmentation masks, and susceptibility to specular interference during re-inspection, this invention constructs a local brightness benchmark within the rivet reading area and extracts bright area carriers. A bright area attribution field is generated using a Rectified Flow bright area attribution model, representing the tendency of bright areas to be attributed to either the final state of a specular artifact or the final state of a real defect. Simultaneously, the bright area attribution field is introduced into a symbolic distance map U-Net boundary model. A pixel-by-pixel modulation layer is used to modulate multi-scale decoding features, and a defect symbolic distance map is generated by combining symbol consistency constraints and distance monotonicity constraints, ultimately recovering the real defect boundary using a zero-level neighborhood. Furthermore, a specular artifact determination value is generated by statistically analyzing the bright area belonging field within the defect boundary set neighborhood. When specular artifacts dominate, a specular suppression mask is generated and applied to the defect segmentation mask. Finally, the suppressed defect segmentation mask, specular artifact determination value, and re-inspection flag are output. This method improves the boundary separability in scenarios where specular artifacts and real defects are adhered, reduces the risk of false detection of specular artifacts and missed detection of real defects, and enhances the stability, interpretability, and accuracy of re-inspection determination of aircraft rivet defect segmentation results. It provides a complete solution for automated visual inspection and defect re-inspection of aircraft rivets.

[0092] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0093] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0094] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0095] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0096] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0097] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for segmenting specular artifacts and real defects in aircraft rivets based on bright area attribution field and symbol distance map, characterized in that, include: S1: Acquire visible light detection images of aircraft rivets, locate rivets in the visible light detection images of aircraft rivets, and determine the rivet reading area; A local brightness reference map is constructed within the rivet interpretation area. A brightness anomaly map is calculated based on the local brightness reference map. The brightness anomaly map is then binarized and connected component filtered to generate a bright area carrier. S2: Input the visible light detection image of the aircraft rivet, the rivet interpretation area, the bright area carrier, the specular artifact final state template, and the real defect final state template into the Rectified Flow bright area attribution model. Based on the bright area carrier, locate the internal region of the bright area and perform texture weakening to generate a visually blurred state that retains the background brightness gradient and the brightness characteristics of the rivet's curved surface reflection. Extract the constraint features of the specular artifact final state and the real defect final state through the template encoder, and fuse them with the multi-scale features obtained by the shared encoder from the visually blurred state to generate an evolutionary direction field. Aggregate the bright area attribution field through the attribution projection layer channel, and output it after spatial alignment according to the rivet interpretation area. S3: The visible light detection image of the aircraft rivet, the rivet identification area, and the bright area belonging field aligned with the rivet identification area are concatenated to generate boundary input features, which are then input into the symbolic distance map U-Net boundary model. The boundary input features are subjected to multi-level downsampling convolution through the U-Net encoder to extract multi-scale encoded features, and then the U-Net decoder is upsampled step by step and fused with skip connections to obtain multi-scale decoded features. At the same time, the bright area belonging field and boundary closure constraint parameters are input into the belonging modulation layer to calculate the modulation weight map and limit its value range. The modulation weight map and the multi-scale decoded features are multiplicatively fused pixel by pixel to generate boundary modulation features. Subsequently, the defect symbol distance map is calculated by the symbol distance output layer, and symbol consistency constraints and distance monotonicity constraints are applied within the rivet interpretation area. Finally, the defect symbol distance map is output, which is spatially aligned with the rivet interpretation area. S4: Receive the defect symbol distance map aligned with the rivet reading area, filter the set of pixels whose absolute symbol distance is less than or equal to the zero-level threshold, and combine it with the rivet reading area to perform spatial constraints to obtain the zero-level neighborhood; perform connected component aggregation and internal filling on the zero-level neighborhood to generate a defect segmentation mask; then perform contour extraction on the defect segmentation mask to calculate the boundary set corresponding to the defect segmentation mask. S5: Expand the boundary set according to the boundary set and neighborhood width parameters to obtain the boundary set neighborhood. Sample and count the bright area attribution field within this neighborhood to generate a specular artifact determination value to characterize the dominance of specular artifacts. Compare the specular artifact determination value with the attribution threshold. When the specular artifact determination value is greater than the attribution threshold, perform threshold segmentation within the boundary set neighborhood based on the bright area attribution field to generate a specular suppression mask. Apply this mask to the defect segmentation mask to obtain the suppressed defect segmentation mask. When the specular artifact determination value is less than or equal to the attribution threshold, do not perform specular suppression and directly use the defect segmentation mask as the suppressed defect segmentation mask. S6: Receive the suppressed defect segmentation mask and the specular artifact judgment value, and filter the suppressed defect segmentation mask according to the rivet judgment area to obtain the judgment defect mask; Calculate the defect area value of the defect mask and compare it with the defect area threshold to generate a defect trigger value; Subsequently, the defect trigger value and the specular artifact judgment value are jointly judged. When the defect trigger value meets the defect triggering condition and the specular artifact judgment value is less than or equal to the attribution threshold, a re-inspection flag is generated for defect re-inspection; otherwise, a re-inspection flag is generated for no re-inspection. Finally, the suppressed defect segmentation mask, specular artifact judgment value and re-inspection flag are output to form defect re-inspection decision information for the rivet reading area.

2. The method for segmenting aircraft rivet specular artifacts and real defects based on the bright area attribution field and symbol distance map according to claim 1, characterized in that: Step S1 specifically includes: S11: Acquire visible light detection images of aircraft rivets And extract the luminance channel ; S12: Calculate the edge response and extract circular candidates on the brightness channel Y to obtain the rivet head position; map the rivet head position to the visible light detection image of the aircraft rivet. The pixel coordinate system, based on the candidate region side length parameter Extracting an image patch containing the rivet head yields rivet candidate regions, where the set of pixel indices for the rivet candidate regions is denoted as . ; S13: Based on the pixel index set Determine the rivet reading area R, and... Defined as with For a single-channel mask of the same size, the set of pixels within the mask is denoted as... ,in, Depend on According to the extended parameters After expansion, it was obtained and combined with Boundary clipping alignment; based on Calculate the local brightness reference map ; S14: Calculate the brightness anomaly map D based on the local brightness reference map B; based on the brightness threshold... The brightness anomaly map is binarized to generate a brightness anomaly binary map. ; S15: For the aforementioned binary image M with abnormal brightness, the eight-neighbor connectivity criterion is used to extract connected components, resulting in a set of connected components. Each connected component... It is a set of pixel indices and satisfies Calculate the area value for each connected component. Area value Defined as the number of pixels in a connected volume; area value With area threshold Compare and filter to meet the requirements Connected components are combined and merged to generate bright area carriers. The bright area carrier L is defined as a single-channel mask of the same size as the visible light detection image I of the aircraft rivet. The set of pixel positions with a value of 1 in L is the union of the set of pixel indices of each connected body after filtering, and the other pixel positions have a value of 0.

3. The method for segmenting aircraft rivet specular artifacts and real defects based on the bright area attribution field and symbol distance map according to claim 2, characterized in that: In step S13, the local brightness reference map The calculation uses a sliding neighborhood approach: for For each pixel within the neighborhood window, the parameter is the side length of the neighborhood window. Define the neighborhood window, and within the neighborhood window... Perform statistical aggregation to obtain the baseline brightness value, and write the baseline brightness value into... The corresponding pixel position; The position of the outer pixel is The middle value is zero.

4. The method for segmenting aircraft rivet specular artifacts and real defects based on the bright area attribution field and symbol distance map according to claim 1, characterized in that: Step S2 specifically includes: S21: Record the visible light detection image of the aircraft rivet as... The rivet reading area is recorded as The bright area carrier is recorded as The final state template of the specular artifact is denoted as The actual defect final state template is denoted as ; S22: Organize the visible light detection image of the aircraft rivets. Rivet reading area Bright area carrier Specular artifact final state template Real Defect Final State Template This forms the attribution input data. The attribution input data It includes image data channels, mask channels, and template channels. The image data channels are composed of... Provided, mask channel by and Provided by, template channel is and supply; S23: Locate the internal region of the bright area carrier according to the bright area carrier L, and denote the pixel index set of the internal region of the bright area carrier as... , Depend on It consists of pixel positions with a value of one, and satisfies , For rivet reading area The set of pixel positions with a value of one; for The image patch within the image is subjected to texture weakening to generate a weakened texture map. ;exist Gradient magnitude map of the internally calculated luminance channel , Depend on The brightness channel is calculated using a fixed convolution operator; in Map showing the distance from the interior region of the bright area carrier to the boundary of the bright area carrier. , Depend on exist The distance is calculated using distance transformation; based on , , , , , Constructing a visually blurred state ; S24: The final state template of the specular artifact... Compared with the actual defect final state template Input Template Encoder The final-state constraint feature vector is obtained, where the final-state constraint feature vector corresponding to the specular artifact final-state template is denoted as... The final-state constraint feature vector corresponding to the true defect final-state template is denoted as . ; Determine the area based on the rivets right and Spatial alignment is performed to obtain the final-state constraint feature map corresponding to the final-state template of the specular artifact. Final state constraint feature map corresponding to the actual defect final state template , and exist The inner part is a constant feature map and in The external value is zero; and Channel splicing is performed to obtain the final state constraint feature map. ; S25: The visually blurred state is... Input shared encoder The shared encoder employs a multi-level downsampling convolutional structure to extract spatial and contextual features step by step, outputting a multi-scale feature set. , For scale-level indexing, each multi-scale feature All with In the same pixel coordinate system and preserved Internal structural response; S26: Based on the multi-scale feature set and the final state constraint feature map Input Evolution Directional Field Decoder The evolutionary orientation field decoder uses a step-by-step upsampling convolutional structure to recover spatial resolution, and at each stage, it incorporates the final state constraint feature map. Multiscale features corresponding to the scale By fusion, the evolution direction field is obtained. Evolutionary direction field exist The inner part is a multi-channel feature map, used to express the pixel-level evolution components of the internal region of the bright area carrier from a visually blurred state to the final state template of the specular artifact and the final state template of the real defect; evolution direction field exist The external value is zero; S27: The evolution direction field With final state constraint feature map Input home projection layer Belonging to the projection layer pair and Perform channel aggregation and generate attribution response graphs Attribution response diagram This is a single-channel continuous value feature map; it belongs to the projection layer during the aggregation process for the bright area carrier. Apply mask constraints to make the attribution response map exist Internal output effective attribution tendency, in Internally output background suppression value; assign response map Defined as the field to which the bright area belongs; S28: For the bright area belonging to field A, spatial alignment is performed based on the judgment area R, and the alignment method is to... Set the outer pixel position to zero and keep it. The pixel position values ​​remain unchanged, resulting in a bright area belonging field aligned with the rivet reading area.

5. The method for segmenting aircraft rivet specular artifacts and real defects based on the bright area attribution field and symbol distance map according to claim 4, characterized in that: In step S23, the visual blurring state Defined using the following formula: ; ; in, Represents pixel coordinates; Indicates the color channel index; Indicates a visually blurred state at the pixel level. With channel The value at; This indicates that the rivet reading area is in pixels. The mask value at that location; Indicates the texture weakening weight; This indicates the visible light detection image of aircraft rivets at the pixel level. With channel The value at; This indicates that the texture map is weakened at the pixel level. With channel The value at; Indicates the carrier of the bright area in the pixel The mask value at that location; and This represents the texture weakening weight coefficient; Indicates the gradient magnitude map at the pixel level. The value at; Represents the gradient threshold, used for... Perform normalization; Represents the distance map in pixels The value at; This represents the boundary attenuation width parameter; This indicates that the input value will be truncated to a range. Operators; This represents the exponential operator.

6. The method for segmenting aircraft rivet specular artifacts and real defects based on the bright area attribution field and symbol distance map according to claim 1, characterized in that: Step S3 specifically includes: S31: Record the visible light detection image of the aircraft rivet as... The rivet reading area is recorded as The bright area aligned with the rivet reading area is denoted as the field to which it belongs. ; The rivet reading area The set of pixel positions with a value of one is denoted as . ; S32: Regarding S31 , , Channel concatenation is performed to generate boundary input features, which are denoted as... Boundary input features In pixel coordinate system Alignment, boundary input features exist Zero-value constraints are applied to the pixel positions outside the symbolic distance map, so that the feature extraction range of the U-Net boundary model is limited by the rivet interpretation region. limited; S33: The boundary input feature constructed by S32 The U-Net encoder for the U-Net boundary model of the input symbolic distance map is denoted as U-Net encoder. , The symbolic distance map represents the boundary model parameters of U-Net; the U-Net encoder uses a multi-level downsampling convolutional structure to process the boundary input features. Encode the data and output a multi-scale encoded feature set. ,in, For scale-level indexing; each multi-scale encoded feature Preserve the edge response and defect texture response of the rivet structure at the corresponding scale; S34: The set of multi-scale encoded features output from S33 U-Net decoder for input symbolic distance graph U-Net boundary model The U-Net decoder uses a progressively upsampled convolutional structure to restore spatial resolution, and encodes multi-scale features at each level. By performing skip connections and fusion with the decoding features at this level, a multi-scale decoding feature set is obtained. ; S35: Assign the bright area to the field Input of boundary closure constraint parameters to the modulation layer The boundary closure constraint parameters are denoted as... ,in, Indicates the lower bound of the modulation weight. Indicates the upper bound of the modulation weight. Indicates the modulation intensity coefficient; in the rivet reading area The inner bright area belongs to the field Perform neighborhood aggregation to obtain the field to which the smooth bright area belongs. Neighborhood aggregation uses the window side length parameter. Define a local window, and within the local window... Average polymerization was performed to obtain At the same time, The outer pixel position is set to zero; based on and Calculate the modulation weight map The modulation weight map is defined by the following formula: ; in, Indicates the modulation weight map at the pixel The value at; This indicates that the rivet reading area is in pixels. The mask value at that location; This indicates that the input value will be truncated to a range. Operators; Indicates the lower bound of the modulation weight; Indicates the upper bound of the modulation weight; This represents the sigmoid mapping operator, used to map input values ​​to the interval between zero and one; Indicates the modulation intensity coefficient; Indicates the field of the smooth bright area at the pixel. The value at; Represents pixel coordinates; S36: Modulate the weighting map With multi-scale decoding feature set Perform pixel-wise multiplicative fusion to generate a boundary modulation feature set. ; Pixel-wise multiplicative fusion is performed with scale alignment, making the modulation weight map Corresponding multi-scale decoding features at each scale Spatial alignment is performed before fusion to obtain boundary modulation features. ; S37: Set of boundary modulation features from S36 Input symbol distance to output layer The defect symbol distance map was calculated. ; in the rivet reading area Internal defect symbol distance map Apply sign consistency constraints and distance monotonicity constraints; S38: Determine the area based on the rivet. Defect symbol distance map in S37 Perform spatial alignment, the alignment method is to Set the outer pixel position to zero and keep it. The inner pixel position values ​​remain unchanged, and the output is a distance map of the defect symbol aligned with the rivet reading area.

7. The method for segmenting aircraft rivet specular artifacts and real defects based on the bright area attribution field and symbol distance map according to claim 6, characterized in that: In step S37, the symbolic consistency constraint adopts the connected component consistency rule: in Internal zero-value boundary pairs Perform symbol partitioning, and perform uniformity correction on the symbol values ​​within the same connected component based on the connected component area threshold. Isolated symbol regions that do not meet the area condition are removed; the distance monotonicity constraint adopts the zero-level neighborhood monotonic expansion rule: in With zero level threshold Screening defect symbol distance map The zero-level neighborhood is used to calculate the distance map from the pixel to the zero-level neighborhood and then... The distance magnitude is monotonically reassigned while retaining the sign values ​​after sign consistency constraints, thereby making the defect symbol distance map more accurate. In the rivet reading area The internal formation creates a stable distance distribution that can be used for zero-level neighborhood extraction.

8. The method for segmenting aircraft rivet specular artifacts and real defects based on the bright area attribution field and symbol distance map according to claim 1, characterized in that: Step S4 specifically includes: S41: Receive the defect symbol distance map aligned with the rivet reading area. Simultaneously receive rivet reading area With zero level threshold ; The rivet reading area The set of indices consisting of pixel positions with a value of one is denoted as . ; S42: First, in the defect symbol distance map Extract the zero-level neighborhood; denote the set of zero-level neighborhood pixels as... And based on S41 , , Crossing the threshold at zero level Perform pixel-level filtering; filter pixels The set of eight neighboring pixel coordinates is denoted as , Used to check for sign crossings in the zero-level neighborhood to avoid pseudo-zero-level responses caused by local numerical oscillations. The filtering rules are defined using the following formula: ; in, Represents the set of pixels in the zero-level neighborhood; Represents pixel coordinates; This indicates that the rivet reading area is in pixels. The mask value at that location; The distance map of defect symbols in pixels The sign distance value at the location; Indicates a zero-level threshold; Represents pixels The set of eight neighboring pixel coordinates; Represents the pixel coordinates within the eight neighboring domains; This represents the maximum value operation over the set of eight neighboring pixel coordinates; This represents the minimum value operation over the set of eight neighboring pixel coordinates; This represents the zero-level crossing threshold, used to limit the crossing range of the sign distance value within eight neighborhoods; S43: Set the zero-level neighborhood pixels Write to zero-level neighborhood mask Zero-level neighborhood mask Distance map to defect symbols A single-channel binary mask of the same size, in Set the inner pixel position to one, and in the non- Set the pixel position to zero, and in The outer pixel position maintains a zero-value constraint; the zero-level neighborhood mask is used. Input shape closure processing, which uses the closure correction window side length parameter. Define structural elements and... Perform a closure operation of first dilation and then erosion to obtain a closed zero-level neighborhood mask. Subsequently, a closed zero-level neighborhood mask was applied. Perform connected component extraction and obtain the set of connected components using the eight-neighbor connectivity criterion. Calculate the area value of each connected component; then compare the area value of the connected component with the minimum connected component area threshold. By comparison, only connected components that satisfy the area condition are retained, and isolated connected components are removed before updating the closed zero-level neighborhood mask. ,make Only the zero-level neighborhood structure involved in closing the defect region is retained; S44: Closed zero-level neighborhood mask based on S43 Generate a defect segmentation mask , Distance map to defect symbols A single-channel binary mask of the same size is used; boundary tracking is performed on the boundary pixels corresponding to each preserved connected component to obtain an ordered sequence of boundary pixels, and the ordered sequence of boundary pixels is written into the boundary pixel mask; in the rivet judgment area... The internal region filling is performed using scan line filling rules: The vertical coordinate is fixed and the horizontal scan is performed. The intersection points of the scan line and the boundary pixel mask are recorded and sorted according to the horizontal coordinate. Pixel intervals between adjacent intersection points that satisfy the odd-even rule are determined as internal pixel intervals. These internal pixel intervals are then filled within... Centered as 1, and set the boundary pixels in The center is set to 1; boundary tracking and scan line filling are repeated for multiple connected components in the order of connected component index, and all filling results are combined to obtain a defect segmentation mask covering all candidate defect attachment areas within the rivet judgment area. Defect segmentation mask exist The outer pixel position is set to zero to maintain consistent output coordinates aligned with the rivet reading area; S45: Defect segmentation mask based on S44. Calculate the boundary set Boundary set Defect segmentation mask The value of a pixel is 1 and there must be a pixel position with a value of 0 in its eight neighboring regions.

9. The method for segmenting aircraft rivet specular artifacts and real defects based on bright area attribution field and symbol distance map according to claim 1, characterized in that: Step S5 specifically includes: S51: Receive the bright area belonging field output from step S2 that is aligned with the rivet identification area. Defect segmentation mask output in step S4 With boundary set and receive the rivet reading area. Neighborhood width parameter Attribution threshold Attribution segmentation threshold ; The rivet reading area The set of pixel positions with a value of one is denoted as . ; S52: Based on the boundary set of S51 With neighborhood width parameter Construct a boundary set neighborhood, and denote the set of pixel positions in the boundary set neighborhood as . For boundary sets Perform mask dilation operation, the dilation operation uses... Using a structuring element with radius, the pixel positions covered by the expanded area are incorporated. Simultaneously, the reading area is determined based on the rivets. right To perform screening, The set of pixel positions within the boundary set neighborhood that are located in the foreground of the defect segmentation mask is denoted as... , The pixel position belongs to And satisfy the defect segmentation mask Composed of pixel positions with a value of one; S53: Assigning field to bright areas within the neighborhood of the boundary set. Sampling and calculation of the attribution statistic are performed, and the attribution statistic is denoted as... ,in, The mean value of the bright area within the neighborhood of the boundary set is calculated in S52. within The values ​​are taken as samples and normalized according to the number of pixels; The percentage of bright areas belonging to a low-growth field within the boundary set's neighborhood is determined by statistical analysis. Internal satisfaction The value is less than or equal to the attribution segmentation threshold. The number of pixels divided by The number of pixels is obtained; The percentage of bright areas belonging to a given field within the boundary set's neighborhood is determined by statistical analysis. Internal satisfaction The value is greater than the attribution segmentation threshold. The number of pixels divided by The number of pixels was obtained based on the attribution statistics. Generate specular artifact determination value Specular artifact determination value Using the percentage of low-level attribution in the attribution statistics Direct assignment; S54: Specular artifact determination value generated by S53 and the attribution threshold Compare and execute branching; when Greater than the home threshold Time-generated specular suppression mask It also acts on the defect segmentation mask and the specular suppression mask. To be consistent with the bright area belonging to the field Single-channel binary mask of the same size, specular suppression mask The pixel generation rules are limited to the boundary set neighborhood. Inside: To For each pixel position within the field, if the bright area belongs to the field... The value is less than or equal to the attribution segmentation threshold. Then use a specular suppression mask. Set to 1, otherwise use the specular suppression mask. Set to zero; The inner pixel position will be a highlight suppression mask. Set to zero; set the specular suppression mask. Action on defect segmentation mask The suppressed defect segmentation mask is denoted as The operating rule is to perform pixel-by-pixel suppression update for all pixel positions: when the defect segmentation mask... The value is one and the specular suppression mask When the value is one, the defect segmentation mask after suppression will be applied. Setting it to zero will suppress the defect segmentation mask at the remaining pixel positions. Defect segmentation mask Maintain consistency; S55: When Less than or equal to the home threshold No specular suppression mask is generated at this time And the defect segmentation mask Directly used as a mask for post-suppression defect segmentation Output specular artifact determination value With the defect segmentation mask after suppression And maintain the output and rivet reading area. Alignment.

10. The method for segmenting aircraft rivet specular artifacts and real defects based on the bright area attribution field and symbol distance map according to claim 1, characterized in that: Step S6 is as follows: S61: Receive the suppressed defect segmentation mask and specular artifact determination value output from step S5, and record the suppressed defect segmentation mask as... The specular artifact determination value is recorded as Simultaneously receive rivet reading area Attribution threshold With defect area threshold ; The rivet reading area The set of pixel positions with a value of one is denoted as . ; Determining the area based on rivets Defect segmentation mask after suppression After screening, a defect mask is obtained. The filtering process uses a pixel-by-pixel masking rule: for all pixel positions... ,when season ,when season ; S62: Defect mask obtained in S61 Calculate the defect area value and compare it with the defect area threshold. Compare and generate defect trigger values; The defect area value is denoted as Defect area value Defined as a defect mask for interpretation The number of pixels with a value of one is counted, and only pixels whose positions belong to the specified range are counted during the calculation. The pixels; the defect trigger value is recorded as Defect trigger value For binary decision variables, the generation rule is: when Greater than or equal to the defect area threshold When Set it to a value that meets the defect triggering condition; when Less than the defect area threshold When Set to zero and determine that the defect trigger value does not meet the defect triggering condition; defect area threshold The minimum area condition used to limit the triggering of re-inspection ensures that the re-inspection decision maintains a stable judgment caliber for the scattered foreground remaining after suppression by the neighborhood of the boundary set. S63: Combining defect trigger values With the value of specular artifact determination A joint judgment is performed to generate a re-inspection mark, which is then recorded as follows: Re-inspection mark This is a binary marker, a re-inspection marker. The corresponding re-inspection mark is for defect re-inspection. The corresponding re-inspection flag indicates that no re-inspection is required; the joint judgment is performed sequentially: first, the defect trigger value is determined. Does the defect triggering condition meet? Continue to determine the specular artifact judgment value. Is it less than or equal to the attribution threshold? ,when Less than or equal to the home threshold Re-inspection mark Set to one, when Greater than the home threshold Re-inspection mark Set to zero; when The re-inspection mark will be directly applied at that time. Set to zero.