A piezoelectric ceramic sheet electrode defect automatic detection system

CN122244559APending Publication Date: 2026-06-19GUANGZHOU KAILITECH ELECTRONICS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU KAILITECH ELECTRONICS
Filing Date
2026-05-07
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify minute, latent defects in piezoelectric ceramic sheet electrodes under complex imaging conditions, and the interpretability of the test results is insufficient, making it difficult to meet the requirements for highly consistent and reliable automated testing.

Method used

By employing a deep learning-based image processing method that integrates an improved Mask2Former segmentation model, multi-stage structural feature analysis, and a structural evolution trajectory discrimination mechanism, defects on the surface of piezoelectric ceramic sheet electrodes are automatically detected. Through fine segmentation, construction of a defect tendency vector field, and multi-stage structural feature extraction, accurate identification and classification of electrode defects are achieved.

Benefits of technology

It can stably detect tiny hidden electrode defects under complex surface conditions, improve detection accuracy and consistency, and has good interpretability and is suitable for automated detection in production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122244559A_ABST
    Figure CN122244559A_ABST
Patent Text Reader

Abstract

This invention discloses an automatic detection system for piezoelectric ceramic sheet electrode defects, comprising: an image acquisition and preprocessing module for obtaining standardized electrode images; an improved Mask2Former segmentation module for obtaining electrode region masks, defect candidate region masks, and their corresponding structural feature vectors; a defect tendency vector field construction module for performing spatial distribution analysis on the defect candidate region masks and constructing a defect tendency vector field; a multi-stage structural feature extraction module for extracting first-stage, second-stage, and third-stage structural features; a structural evolution trajectory construction module for combining the three-stage structural features to construct a structural evolution trajectory; and a defect judgment and result output module for outputting the electrode defect detection results. This invention achieves automatic and accurate detection of piezoelectric ceramic sheet electrode defects by integrating improved depth segmentation and structural evolution analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision and image processing technology, and in particular to an automatic detection system for defects in piezoelectric ceramic sheet electrodes. Background Technology

[0002] In the production and testing of piezoelectric ceramic devices, electrodes, as key structures for electrical signal conversion and transmission, directly affect the electrical performance and lifespan of the devices due to their integrity and reliability. Current production lines typically use manual visual inspection, regular template comparison, or traditional machine vision algorithms to detect defects on the surface of piezoelectric ceramic electrode sheets. The main defects detected include electrode breakage, missing parts, contamination, burrs, and localized printing defects. These methods were practical in the early stages when process conditions were relatively stable and defect morphologies were more obvious, but overall testing efficiency and consistency remain limited.

[0003] As piezoelectric ceramic sheets evolve towards higher precision, miniaturization, and complex wiring, the electrode surfaces exhibit characteristics such as strong reflectivity, complex textures, small-scale defects, and diverse morphologies. Existing detection methods based on fixed thresholds, edge operators, or single segmentation models struggle to reliably distinguish between real defects and background noise under complex imaging conditions, easily leading to missed or false detections. While some deep learning-based detection methods incorporate convolutional neural networks for feature extraction, most remain at the level of static segmentation or classification, lacking a deep understanding of electrode structural features, defect directionality, and their spatial relationships.

[0004] Existing technologies typically only assess a single test result, failing to comprehensively analyze the overall electrode structure, defect distribution trends, and multi-stage characteristic changes. This results in insufficient interpretability of the test results, making it difficult to support subsequent process analysis and quality traceability. Especially when defect morphology is concealed or gradually evolves along the electrode trace, traditional methods struggle to accurately reflect the structural attributes and development characteristics of the defects, failing to meet the requirements for highly consistent and reliable automated testing.

[0005] Therefore, how to provide an automatic detection system for defects in piezoelectric ceramic sheet electrodes is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] One objective of this invention is to propose an automatic detection system for piezoelectric ceramic sheet electrode defects. This invention employs a deep learning-based image processing method, integrating an improved Mask2Former segmentation model, multi-stage structural feature analysis, and a structural evolution trajectory discrimination mechanism to automatically detect defects on the surface of piezoelectric ceramic sheet electrodes. This invention achieves accurate identification and classification of electrode defects by finely segmenting the electrode region and defect candidate region, constructing a defect tendency vector field, and extracting multi-stage structural features. Further, it performs temporal organization and comparative analysis of the structural features. This method can stably detect small, hidden electrode defects under complex surface conditions and process fluctuations, possessing advantages such as high detection accuracy, good consistency, strong structural interpretability, and applicability to automated production line inspection.

[0007] An automatic detection system for defects in piezoelectric ceramic sheet electrodes according to an embodiment of the present invention includes the following modules: The image acquisition and preprocessing module is used to acquire the original image of the piezoelectric ceramic sheet surface and perform preprocessing to obtain a standardized electrode image; An improved Mask2Former segmentation module is used to construct an improved Mask2Former segmentation model, which yields electrode region masks, defect candidate region masks, and their corresponding structural feature vectors. The defect tendency vector field construction module is used to perform spatial distribution analysis on the defect candidate region mask using the electrode region mask as a spatial constraint, and construct the defect tendency vector field. The multi-stage structural feature extraction module is used to jointly analyze the electrode region mask, the defect candidate region mask, and the defect tendency vector field to extract the first-stage structural features, the second-stage structural features, and the third-stage structural features. The structural evolution trajectory construction module is used to combine the structural features of the first stage, the second stage, and the third stage to construct the structural evolution trajectory. The defect determination and result output module is used to compare the structural evolution trajectory with the normal piezoelectric ceramic sheet electrode structural evolution trajectory library and output the electrode defect detection results.

[0008] Optionally, modules can be integrated using the following methods: The original image of the piezoelectric ceramic sheet surface is acquired, and the original image is preprocessed to obtain a standardized electrode image; An improved Mask2Former segmentation model is constructed. A standardized electrode image is input and segmented to obtain an electrode region mask, a defect candidate region mask, and structural feature vectors corresponding to the electrode region mask and the defect candidate region mask, respectively. Using the electrode region mask as a spatial constraint region, spatial distribution analysis is performed on the defect candidate region mask to extract the distribution gradient information of the defect region. Based on the electrode region mask, the orientation field information of the electrode structure is extracted. The distribution gradient information and orientation field information are fused to construct the defect tendency vector field. Structural analysis is performed based on electrode region mask and defect candidate region mask, directional feature analysis is performed based on defect directional vector field, skeletonization is performed on electrode region mask, and first-stage structural features, second-stage structural features and third-stage structural features are extracted. Following the sequence of segmentation processing stage, defect tendency vector field modeling stage, and skeleton structure analysis stage, the structural features of the first stage, the structural features of the second stage, and the structural features of the third stage are combined in sequence to construct the structural evolution trajectory corresponding to the piezoelectric ceramic sheet to be tested. The structural evolution trajectory is compared with a pre-established database of normal piezoelectric ceramic sheet electrode structural evolution trajectories to determine whether there are defects in the piezoelectric ceramic sheet electrode and output the corresponding electrode defect detection results.

[0009] Optionally, the original image includes an image of the electrode region on the surface of the piezoelectric ceramic sheet, an image of the non-electrode substrate region, and an image of the electrode boundary located between the electrode region and the non-electrode substrate region. The original image is represented in the form of a pixel matrix, and each pixel contains at least brightness information to characterize the grayscale difference between the electrode material and the ceramic substrate under imaging conditions.

[0010] Optionally, the preprocessing of the original image includes performing brightness normalization processing on the original image to map the brightness of images under different acquisition conditions to a uniform brightness range, performing noise suppression processing on the image after brightness normalization processing to reduce random noise components in the image, and performing geometric alignment processing on the image after noise suppression processing to correct the positional and angular offset of the piezoelectric ceramic sheet during the imaging process, thereby obtaining a standardized electrode image.

[0011] Optionally, obtaining the electrode region mask, the defect candidate region mask, and the structural feature vectors corresponding to the electrode region mask and the defect candidate region mask respectively includes: A prior dataset containing electrode design layout, historical good product images, and typical defect images is constructed. The prior dataset is converted into a three-channel prior tensor with the same size as the standardized electrode images. The three-channel prior tensor stores the electrode region confidence, trunk routing direction information, and local edge response information in sequence. At the output of the pixel decoder in the Mask2Former architecture, a set of multi-scale feature maps generated by the pixel decoder is obtained. A first feature map with a spatial resolution higher than other scales and a second feature map with a spatial resolution lower than the first feature map are selected. These are then concatenated after the pixel decoder to form an adaptive edge cueing encoding layer, a dual-scale context aggregation layer, and a topology-aware fusion top-layer structure, where: An adaptive edge hint encoding layer receives local edge response information and a first feature map, generates an edge hint vector, and concatenates the edge hint vector with the object query vector before inputting it into the Transformer decoder. The dual-scale context aggregation layer takes the first feature map and the second feature map as input. After scale alignment of the second feature map, it fuses the features with the first feature map, preserving local detail information and global structural information. The fusion result is output to the mask prediction branch. The topology-aware fusion head receives the feature map output by the dual-scale context aggregation layer and the backbone routing information, performs electrode connectivity correction processing on the mask prediction results, and generates electrode region masks and defect candidate region masks. An improved Mask2Former segmentation model was trained end-to-end using a joint loss function, which consists of electrode mask cross-entropy loss, defect mask focus loss, and structural connectivity consistency loss. The training data input is a standardized electrode image, the auxiliary input is a three-channel prior tensor, and the supervision signals are electrode mask labels and defect mask labels. During the inference phase, the standardized electrode image and the corresponding three-channel prior tensor are synchronously input into the improved Mask2Former segmentation model, which outputs an electrode region mask, a defect candidate region mask, a first structural feature vector corresponding to the electrode region mask, and a second structural feature vector corresponding to the defect candidate region mask.

[0012] Optionally, the construction of the defect tendency vector field includes: Within the area defined by the electrode region mask, extract all pixels with a mask value of one from the defect candidate region mask, and divide the pixels into several defect connected regions according to the spatial connectivity relationship. Based on the outer boundary shape and internal pixel distribution of each defective connected region, the main extension direction, outer boundary normal direction, and local thickness direction of the defective connected region are calculated. The pixel positions are then mapped to each pixel point inside the defective connected region to form a local morphological direction description result of the defect. Skeleton extraction is performed within the area defined by the electrode region mask to obtain the electrode skeleton mesh. The local main routing direction is calculated for each skeleton point. Starting from the skeleton point, the main routing direction information is diffused to the surrounding electrode region pixels within a preset neighborhood range to construct the electrode structure direction field covering the electrode region pixels. Based on the first structural feature vector and the second structural feature vector, the weight parameters are determined. At each defect region pixel, the local morphological direction information of the defect and the direction information of the electrode structure corresponding to the pixel are weighted and synthesized according to the weight parameters to obtain the defect tendency vector. Neighborhood smoothing is performed along the skeleton direction under the constraint of the electrode skeleton net. All defect tendency vectors after neighborhood smoothing are arranged and stored according to the spatial position of the pixels in the defect region to form a defect tendency vector field.

[0013] Optionally, the extraction of the first-stage structural features, the second-stage structural features, and the third-stage structural features includes: Within the area defined by the electrode region mask, the centroid position of the electrode region is calculated. Based on the distance between each pixel in the electrode region and the centroid position, the electrode region is divided into several concentric annular regions. The number of pixels, the number of connected regions, and the boundary length of the defect candidate region mask are statistically analyzed to form the annular-level structure analysis results. Within each concentric ring region, the ring region is divided into several fan-shaped sub-regions with the centroid of the electrode region as the center and according to multiple preset angle directions. The boundary orientation, boundary tortuosity changes of the electrode region mask and the coverage ratio of the defect candidate region mask are jointly statistically analyzed, and the statistical results are combined to form the first stage structural features. All defect tendency vectors in each defect connected region are classified according to their spatial location. The components of each defect tendency vector in multiple preset directions are grouped and statistically analyzed. The amplitude distribution, dominant direction distribution and direction change range of the defect tendency vector in each defect connected region are calculated respectively. The grouped statistical results are combined to form the second stage structural features. The electrode region mask is skeletonized, shrinking the electrode region into an electrode skeleton mesh composed of skeleton pixels. Skeleton endpoints, branch nodes and skeleton segments are identified on the electrode skeleton mesh. The length, number of bends and the angle relationship between adjacent skeleton segments are statistically analyzed to form the third stage structural features. The structural features of the first stage, the second stage, and the third stage are concatenated and encoded in a preset order to generate a set of structural features.

[0014] Optionally, the construction corresponding to the structural evolution trajectory of the piezoelectric ceramic sheet to be tested includes: The structural features of the first stage, the second stage, and the third stage are categorized and organized according to the spatial location index within the electrode region. For each spatial location index, the corresponding set of structural features is arranged in the order of segmentation processing stage, defect tendency vector field modeling stage, and skeleton structure analysis stage to form a local structural evolution unit, and a unique local evolution identifier is assigned to each local structural evolution unit. Within the electrode region, all local structural evolution units are sorted by scanning the spatial position index sequentially from the inside out along a preset angle direction. The sorted local structural evolution units are then connected according to the scanning order to generate an initial structural evolution sequence. Based on local evolution identifiers and spatial adjacency relationships, the local structural evolution units in the initial structural evolution sequence are aggregated. Multiple local structural evolution units with similar structural change trends and spatial continuity are merged into structural evolution segments. Each structural evolution segment is assigned a segment-level evolution code to obtain a structural evolution code sequence. The structural evolution coding sequence, along with the corresponding spatial location index and fragment-level evolution coding, are stored together as the structural evolution trajectory of the piezoelectric ceramic sheet electrode to be detected.

[0015] Optionally, the output corresponding to the electrode defect detection result includes: The structural evolution trajectory is divided into a sequence of trajectory segments consisting of multiple structural evolution segments, and the corresponding spatial location index information is preserved between each trajectory segment; For each structural evolution segment in the structural evolution trajectory, according to the spatial location index, the normal structural evolution segment at the corresponding position is retrieved in the normal piezoelectric ceramic sheet electrode structural evolution trajectory library. The differences between the structural evolution segment to be detected and the corresponding normal structural evolution segment in terms of evolution coding, the order of stage feature changes, and the magnitude of stage feature changes are compared to generate segment-level comparison results. Based on the comparison results of all segments, a global consistency assessment of the structural evolution trajectory is performed to identify one or more structural evolution segments that are spatially continuous and have a difference exceeding a preset threshold. The spatial location index containing the structural evolution segment is marked as an anomaly location. The defect type and defect severity level of the anomaly location are determined according to the change pattern of the second-stage structural features and the third-stage structural features in the corresponding segment. Based on the determined abnormal location, defect type, and defect severity level, electrode defect detection results are generated, and the electrode defect detection results are associated and stored with the corresponding piezoelectric ceramic sheet identifier.

[0016] The beneficial effects of this invention are: This invention introduces a structure-prior-guided depth segmentation model to finely segment the electrode region and defect candidate region of a piezoelectric ceramic sheet. Even under conditions of complex reflection, uneven printing, and background texture interference, it can still consistently obtain structurally consistent segmentation results, effectively reducing the false negative and false positive rates of traditional thresholding methods and single segmentation models in detecting minute defects. By modeling the electrode region with structural constraints, this invention significantly improves the ability to identify difficult-to-detect defects such as hidden cracks, minor fractures, and edge defects.

[0017] Based on the segmentation results, this invention further constructs a defect tendency vector field and, combined with electrode structure orientation information and local defect morphological features, characterizes the propagation trend of defects in the electrode traces, thereby achieving a comprehensive analysis of defect directionality and structural properties. Compared with existing technologies that rely solely on static features for discrimination, this invention can more accurately reflect the structural characteristics of defects and their spatial relationships, improving the stability and consistency of defect analysis and providing reliable support for automatic detection under complex working conditions.

[0018] This invention extracts structural features and constructs structural evolution trajectories in multiple stages, unifying the overall morphology, defect tendency features, and skeleton topological features of the electrode, and comparing them with the normal electrode structure evolution trajectory. This makes the detection results highly interpretable and traceable. The solution not only improves the automation level and accuracy of defect detection of piezoelectric ceramic sheet electrodes, but also provides effective data support for production process optimization, quality assessment, and anomaly tracing, and has good engineering application value. Attached Figure Description

[0019] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram of the structure of an automatic detection system for defects in piezoelectric ceramic sheet electrodes proposed in this invention; Figure 2 This is a flowchart illustrating an automatic detection method for defects in piezoelectric ceramic sheet electrodes proposed in this invention. Detailed Implementation

[0020] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0021] refer to Figure 1 An automatic detection system for defects in piezoelectric ceramic sheet electrodes includes the following modules: The image acquisition and preprocessing module is used to acquire the original image of the piezoelectric ceramic sheet surface and perform preprocessing to obtain a standardized electrode image; An improved Mask2Former segmentation module is used to construct an improved Mask2Former segmentation model, which yields electrode region masks, defect candidate region masks, and their corresponding structural feature vectors. The defect tendency vector field construction module is used to perform spatial distribution analysis on the defect candidate region mask using the electrode region mask as a spatial constraint, and construct the defect tendency vector field. The multi-stage structural feature extraction module is used to jointly analyze the electrode region mask, the defect candidate region mask, and the defect tendency vector field to extract the first-stage structural features, the second-stage structural features, and the third-stage structural features. The structural evolution trajectory construction module is used to combine the structural features of the first stage, the second stage, and the third stage to construct the structural evolution trajectory. The defect determination and result output module is used to compare the structural evolution trajectory with the normal piezoelectric ceramic sheet electrode structural evolution trajectory library and output the electrode defect detection results.

[0022] refer to Figure 2 An automatic detection method for defects in piezoelectric ceramic sheet electrodes, comprising: The original image of the piezoelectric ceramic sheet surface is acquired, and the original image is preprocessed to obtain a standardized electrode image; An improved Mask2Former segmentation model is constructed. A standardized electrode image is input and segmented to obtain an electrode region mask, a defect candidate region mask, and structural feature vectors corresponding to the electrode region mask and the defect candidate region mask, respectively. Using the electrode region mask as a spatial constraint region, spatial distribution analysis is performed on the defect candidate region mask to extract the distribution gradient information of the defect region. Based on the electrode region mask, the orientation field information of the electrode structure is extracted. The distribution gradient information and orientation field information are fused to construct the defect tendency vector field. Structural analysis is performed based on electrode region mask and defect candidate region mask, directional feature analysis is performed based on defect directional vector field, skeletonization is performed on electrode region mask, and first-stage structural features, second-stage structural features and third-stage structural features are extracted. Following the sequence of segmentation processing stage, defect tendency vector field modeling stage, and skeleton structure analysis stage, the structural features of the first stage, the structural features of the second stage, and the structural features of the third stage are combined in sequence to construct the structural evolution trajectory corresponding to the piezoelectric ceramic sheet to be tested. The structural evolution trajectory is compared with a pre-established database of normal piezoelectric ceramic sheet electrode structural evolution trajectories to determine whether there are defects in the piezoelectric ceramic sheet electrode and output the corresponding electrode defect detection results.

[0023] In this embodiment, the original image includes an image of the electrode region on the surface of the piezoelectric ceramic sheet, an image of the non-electrode substrate region, and an image of the electrode boundary located between the electrode region and the non-electrode substrate region. The original image is represented in the form of a pixel matrix, and each pixel contains at least brightness information to characterize the grayscale difference between the electrode material and the ceramic substrate under imaging conditions.

[0024] In this embodiment, the preprocessing of the original image includes performing brightness normalization processing on the original image to map the brightness of images under different acquisition conditions to a uniform brightness range, performing noise suppression processing on the image after brightness normalization processing to reduce random noise components in the image, and performing geometric alignment processing on the image after noise suppression processing to correct the positional and angular offsets of the piezoelectric ceramic sheet during the imaging process, thereby obtaining a standardized electrode image.

[0025] In this embodiment, obtaining the electrode region mask, the defect candidate region mask, and the structural feature vectors corresponding to the electrode region mask and the defect candidate region mask respectively includes: A prior dataset containing electrode design layouts, historical good product images, and typical defect images is constructed. This prior dataset is then converted into a three-channel prior tensor with the same size as the standardized electrode images. The three-channel prior tensor sequentially stores electrode region confidence, main trace direction information, and local edge response information, wherein: A prior dataset containing electrode design layouts, historical images of good products, and images of typical defects is constructed, specifically as follows: Electrode design layouts, historical good product images, and typical defect images are uniformly converted into two-dimensional image data, and consistent size normalization and coordinate alignment are performed on the three types of data to maintain consistency in pixel resolution and spatial coordinate system. Historical images of good products and images of typical defects were classified and organized according to the model, production batch and process parameters of the piezoelectric ceramic sheet. The electrode design layout of the corresponding model was associated and bound with the images of the same type to form a one-to-one data group. The aligned and grouped data are organized and stored in three channels: design layout, good product samples and defective samples. A unified data index relationship is established to form a priori dataset containing electrode design layout, historical good product images and typical defective images. Electrode area confidence is obtained by spatially aligning the electrode design layout with images of historical good products from multiple batches, statistically analyzing the consistency frequency of the electrode area at the corresponding pixel position, and then forming a continuous distribution of confidence values ​​across the entire image based on the consistency frequency. The backbone routing direction information is obtained by performing skeleton extraction processing on the electrode regions in the electrode design layout and historical good product images, calculating the local routing direction on the skeleton line, and fusing the direction results of multiple batches, mapping them to spatial coordinates consistent with the standardized electrode image. Local edge response information is obtained by extracting the edge response at corresponding spatial locations from historical good product images and typical defect images, and by statistically analyzing the difference in edge response at the same location between the two types of images, thus forming an edge response intensity distribution across the entire image. At the output of the pixel decoder in the Mask2Former architecture, a set of multi-scale feature maps generated by the pixel decoder is obtained. A first feature map with a spatial resolution higher than other scales and a second feature map with a spatial resolution lower than the first feature map are selected. These are then concatenated after the pixel decoder to form an adaptive edge cueing encoding layer, a dual-scale context aggregation layer, and a topology-aware fusion top-layer structure, where: The adaptive edge hint encoding layer receives local edge response information and a first feature map, generates an edge hint vector, concatenates the edge hint vector with the object query vector, and then inputs it into the Transformer decoder. The generation of the edge hint vector specifically involves: The local edge response information is aligned and mapped according to the spatial resolution of the first feature map, and a local edge response intensity value is introduced at the pixel position corresponding to the first feature map to form a joint feature representation containing texture features and edge change information. The joint feature representation is subjected to linear mapping and normalization along the channel dimension, so that different edge response intensities are expressed at a uniform scale, and the local continuity features of edge changes are preserved in the spatial dimension. The joint feature representation after linear mapping and normalization is subjected to global convergent encoding to obtain an edge cue vector that characterizes the edge change pattern in the current feature map; The dual-scale context aggregation layer takes the first feature map and the second feature map as input. After scale alignment of the second feature map, it fuses the features with the first feature map, preserving local detail information and global structural information. The fusion result is output to the mask prediction branch. The topology-aware fusion head receives the feature map output from the dual-scale context aggregation layer and the backbone routing information. It performs electrode connectivity correction processing on the mask prediction results to generate electrode region masks and defect candidate region masks. Specifically, the electrode connectivity correction processing on the mask prediction results involves: In the mask prediction results, the main direction features of each predicted connected component in the electrode area are extracted based on the trunk routing direction information. The main direction features are compared with the routing direction of the corresponding spatial position, and the boundary regions of connected components whose direction deviation exceeds the preset range are marked. For the boundary regions of the labeled connected components, the adjacent pixel regions are searched along the trunk path in the feature map output by the dual-scale context aggregation layer. Connectivity merging is performed on the spatially continuous and oriented mask regions, and connectivity compensation processing is performed on the spatially broken but oriented regions. After completing connectivity merging and connectivity compensation, a connectivity consistency check is performed on the corrected mask prediction results to redetermine the boundary relationship between the electrode region and the non-electrode region, and generate the electrode region mask and the defect candidate region mask after connectivity correction. The three-layer structure is connected in series in sequence, with the input end connected to the multi-scale feature map output of the pixel decoder and the output end connected to both the mask classification branch and the mask prediction branch. An improved Mask2Former segmentation model was trained end-to-end using a joint loss function, which consists of electrode mask cross-entropy loss, defect mask focal loss, and structural connectivity consistency loss. The training data input was a standardized electrode image, the auxiliary input was a three-channel prior tensor, and the supervision signals were electrode mask labels and defect mask labels. Electrode mask cross-entropy loss: During the forward propagation of the network, the pixel-level probability map of the output electrode region mask is compared with the manually labeled electrode mask at the same resolution pixel by pixel. The logical probability difference of each pixel is calculated according to the cross-entropy formula, and then the average is obtained on the whole image to obtain the electrode mask cross-entropy loss. Defect Mask Focus Loss: To address the class imbalance problem where defect pixels are far fewer than background pixels, a focus modulation factor is introduced based on the pixel-wise cross-entropy of defect mask prediction probability and defect mask label. This factor attenuates the loss term for easily distinguishable samples and amplifies the loss term for difficult-to-distinguish samples. The ratio of positive and negative samples is balanced by the defect class weight coefficient, and the defect mask focus loss is obtained by summing the results across the entire image. Structural connectivity consistency loss: First, skeleton extraction and connected component analysis are performed on the electrode mask and electrode mask label output by the network, respectively. The differences between the two in skeleton connectivity, trace direction integrity and number of breakpoints are calculated. The connectivity difference, trace direction difference and breakpoint penalty term are weighted and summed according to the set weights to obtain the loss value reflecting the electrode connectivity consistency. During the inference phase, the standardized electrode image and the corresponding three-channel prior tensor are synchronously input into the improved Mask2Former segmentation model, which outputs an electrode region mask, a defect candidate region mask, a first structural feature vector corresponding to the electrode region mask, and a second structural feature vector corresponding to the defect candidate region mask.

[0026] This invention, while maintaining the Mask2Former backbone network and pixel decoder structure, introduces a three-channel prior tensor-driven edge-structure multi-level fusion mechanism: First, high and low level feature maps are selected at the pixel decoder output. An adaptive edge cue encoding layer maps the local edge response information in the prior tensor to edge cue vectors and concatenates them to the object query sequence, enabling the Transformer decoder to have built-in edge bias during the mask prediction stage. A dual-scale context aggregation layer dynamically fuses the upsampled and aligned low-resolution features with high-resolution features, taking into account both minute crack details and the global electrode morphology. A topology-aware fusion head introduces backbone routing direction information to correct electrode connectivity in the mask prediction results, achieving simultaneous optimization of mask connectivity and routing continuity. The three-layer structure is sequentially connected in series and simultaneously connects the mask classification branch and the mask prediction branch. During the training stage, a triple loss of electrode cross-entropy, defect focus, and connectivity consistency is jointly optimized to form an improved Mask2Former architecture integrating prior cueing, multi-scale aggregation, and topology correction.

[0027] In this embodiment, the construction of the defect tendency vector field includes: Within the area defined by the electrode region mask, extract all pixels with a mask value of one from the defect candidate region mask, and divide the pixels into several defect connected regions according to the spatial connectivity relationship. Based on the outer boundary shape and internal pixel distribution of each defective connected region, the principal extension direction, the outer normal direction of the boundary, and the local thickness direction of the defective connected region are calculated. These are then mapped to individual pixels within the defective connected region according to their pixel positions, forming a local morphological direction description of the defect. Main extension direction: Perform least squares ellipse fitting on the defect connected region, and take the major axis direction of the fitted ellipse as the main extension direction of the defect in the global range. If the difference between the length of the major axis and the minor axis of the fitting result is insufficient to determine the main axis, the direction of the principal moment of inertia of the connected region is used as a supplementary judgment. Outer normal direction of the boundary: Traverse the boundary pixels in clockwise order along the closed boundary of the defect connected region. For each boundary pixel, calculate the tangential direction between its two adjacent boundary pixels. Rotate the tangential direction 90 degrees to the outside to obtain the outer normal direction of the boundary at the pixel. Local thickness direction: Within the defect connected region, perform a distance transformation on each pixel to obtain the shortest distance path from the pixel to the nearest boundary. The incident direction of the shortest path is regarded as the local thickness direction at that pixel. Repeat the distance transformation operation for all internal pixels to generate a complete local thickness direction field within the connected region. Skeleton extraction is performed within the area defined by the electrode region mask to obtain the electrode skeleton mesh. For each skeleton point, the local main routing direction is calculated. Starting from the skeleton point, the main routing direction information is diffused to surrounding electrode region pixels within a preset neighborhood, constructing an electrode structure orientation field covering the electrode region pixels. The preset neighborhood is defined as a local region centered on the skeleton point with a radius of 3 pixels. The local main routing direction is calculated as follows: Centered on the current skeleton point, collect all adjacent skeleton points that still belong to the skeleton mesh in a neighborhood with a radius of three pixels, resulting in a small set of points composed of several coordinate points. Perform linear fitting on the point set, select the straight line that best represents the overall extension trend, and use the least squares method to minimize the sum of squares of the perpendicular distances between the straight line and each adjacent skeleton point. After fitting, the direction of the straight line is regarded as the local main routing direction of the skeleton point. To maintain the continuity of the direction in the entire skeleton mesh, unify the direction sign according to the skeleton connection order: if the directions of adjacent skeleton points differ by about 180 degrees, then flip the latter direction so that the skeleton point is in the same direction as the former direction, and obtain the main routing direction field that changes smoothly along the skeleton mesh. Weight parameters are determined based on the first and second structural feature vectors. At each defect region pixel, the local morphological direction information of the defect and the electrode structural direction information corresponding to the pixel are weighted and synthesized according to the weight parameters to obtain the defect tendency vector. Neighborhood smoothing is then performed along the skeleton direction under the constraint of the electrode skeleton mesh. The determination of the weight parameters is as follows: First, select three indicators from the first structural feature vector: electrode coherence, boundary clarity, and trace stability, and convert them into electrode confidence scores between zero and one according to a preset threshold. Then, three indicators—defect morphological integrity, extension consistency, and local contrast—are selected from the second structural feature vector and converted into defect credibility scores between zero and one. After adding the electrode confidence score and the defect confidence score and normalizing them, the proportion of the electrode score is the electrode direction weight, and the proportion of the defect score is the defect direction weight. The sum of the two is always one. All defect tendency vectors, after neighborhood smoothing, are arranged and stored according to the spatial position of the pixels in their respective defect regions, forming a defect tendency vector field, where: The defect tendency vector field is a set of two-dimensional vectors defined in the pixel space of the defect region, where each pixel corresponds to a defect tendency vector consisting of a direction parameter and an amplitude parameter. The defect tendency vector is spatially aligned pixel by pixel with the normalized electrode image.

[0028] In this embodiment, the extraction of the first-stage structural features, the second-stage structural features, and the third-stage structural features includes: Within the area defined by the electrode region mask, the centroid position of the electrode region is calculated. Based on the distance between each pixel within the electrode region and the centroid position, the electrode region is divided into several concentric annular regions. The number of pixels, the number of connected regions, and the boundary length of the defect candidate region mask are statistically analyzed to form annular-level structural analysis results. Specifically, the calculation of the centroid position of the electrode region is as follows: Traverse the electrode region mask, read the coordinates of all pixels with a mask value of one one by one, accumulate the sum of row coordinates and column coordinates respectively, record the total number of pixels, divide the sum of row coordinates by the total number of pixels to obtain the vertical coordinate of the centroid, divide the sum of column coordinates by the total number of pixels to obtain the horizontal coordinate of the centroid, locate the obtained horizontal and vertical coordinates in the standardized electrode image coordinate system, that is, the centroid position of the electrode region. Within each concentric annular region, the annular region is divided into several fan-shaped sub-regions with the centroid of the electrode region as the center and according to multiple preset angle directions. The boundary orientation, boundary tortuosity changes of the electrode region mask, and the coverage ratio of the defect candidate region mask are jointly statistically analyzed. The statistical results are combined to form the first-stage structural features. The multiple preset angles are 15°, 30° and 45° respectively. The angle with the highest resolution and divisibility by 360° is automatically selected according to the annular radius to divide the annular region into the corresponding number of fan-shaped sub-regions. For each defect-connected region, all defect tendency vectors are categorized according to their spatial location. The components of each defect tendency vector in multiple preset directions are grouped and statistically analyzed. The amplitude distribution, dominant direction distribution, and direction variation range of the defect tendency vectors in each defect-connected region are calculated. The grouped statistical results are combined to form the second-stage structural features. The multiple preset directions are set to 0°, 45°, 90°, 135°, 180°, 225°, 270°, and 315°, that is, the planar directions are divided into eight directions at 45° intervals. The amplitude distribution, dominant direction distribution, and direction variation range of the defect tendency vectors in each defect-connected region are calculated. Specifically: First, the defect tendency vectors are grouped into eight buckets according to eight directions: 0°, 45°, 90°, 135°, 180°, 225°, 270°, and 315°. The length of the vectors in each bucket is statistically analyzed according to the proportion of the number of vectors in the preset amplitude range, which gives the amplitude distribution of the connected region of the defect. Find the direction with the largest cumulative vector length value among the eight directional buckets and record it as the dominant direction. Record the two directions with the second largest cumulative values. The three together form the dominant direction distribution, which is used to reflect the main direction of defect extension. Select the set of directions in which the vector length in all buckets reaches a fixed percentage threshold of the maximum length in the region, calculate the length of the minimum angle interval spanned by the set, and the obtained angle interval is the range of directional changes in the connected region of the defect. The electrode region mask is skeletonized, shrinking the electrode region into an electrode skeleton mesh composed of skeleton pixels. Skeleton endpoints, branch nodes and skeleton segments are identified on the electrode skeleton mesh. The length, number of bends and the angle relationship between adjacent skeleton segments are statistically analyzed to form the third stage structural features. The structural features of the first stage, the second stage, and the third stage are concatenated and encoded in a preset order to generate a set of structural features, wherein: The structural features of the first stage, the second stage, and the third stage are all represented in the form of numerical vectors. They are sequentially concatenated in the order of the first stage, the second stage, and the third stage to form a set of structural features. The set of structural features is a one-dimensional ordered numerical array, in which the first segment of the feature dimension corresponds to the spatial distribution characteristics of the electrode and the defect, the middle segment of the feature dimension corresponds to the defect tendency and direction change characteristics, and the last segment of the feature dimension corresponds to the topological characteristics of the electrode skeleton structure.

[0029] In this embodiment, constructing the structural evolution trajectory corresponding to the piezoelectric ceramic sheet to be tested includes: The structural features of the first stage, the second stage, and the third stage are categorized and organized according to the spatial location index within the electrode region. For each spatial location index, the corresponding set of structural features is arranged in the order of segmentation processing stage, defect tendency vector field modeling stage, and skeleton structure analysis stage to form a local structural evolution unit, and a unique local evolution identifier is assigned to each local structural evolution unit. Within the electrode region, all local structural evolution units are sorted by scanning the spatial position index sequentially from the inside out along a preset angle direction. The sorted local structural evolution units are then connected according to the scanning order to generate an initial structural evolution sequence. Based on local evolutionary identifiers and spatial adjacency relationships, local structural evolutionary units in the initial structural evolution sequence are aggregated. Multiple local structural evolutionary units with similar structural change trends and spatial contiguousness are merged into structural evolutionary segments. Each structural evolutionary segment is assigned a segment-level evolutionary code, resulting in a structural evolutionary code sequence. The segment-level evolutionary code refers to: After merging multiple spatially continuous local structural evolution units with similar trends of change, a unique identifier is assigned to the merged unit set. The identifier also records the spatial index range covered by the segment, the category of stage feature change pattern, and the level of change magnitude. This is used to distinguish different structural evolution segments and track evolutionary features in the structural evolution coding sequence. The structural evolution coding sequence, along with the corresponding spatial location index and fragment-level evolution coding, are stored together as the structural evolution trajectory of the piezoelectric ceramic sheet electrode to be detected.

[0030] In this embodiment, the output of the corresponding electrode defect detection result includes: The structural evolution trajectory is divided into a sequence of trajectory segments consisting of multiple structural evolution segments, and the corresponding spatial location index information is preserved between each trajectory segment; For each structural evolution segment in the structural evolution trajectory, according to its spatial location index, the corresponding normal structural evolution segment is retrieved from the normal piezoelectric ceramic sheet electrode structural evolution trajectory library. The differences between the detected structural evolution segment and the corresponding normal structural evolution segment in terms of evolutionary coding, the order of stage feature changes, and the magnitude of stage feature changes are compared to generate segment-level comparison results. The establishment of the normal piezoelectric ceramic sheet electrode structural evolution trajectory library specifically involves: Piezoelectric ceramic sheet samples that have been manually re-inspected and confirmed to be free of electrode defects during actual production processes are selected. The same image preprocessing, segmentation, structural feature extraction, and structural evolution trajectory construction process as the sample to be tested is performed on the electrode images of the piezoelectric ceramic sheet samples to obtain the corresponding normal structural evolution trajectory. Based on the spatial location index within the electrode region, the structural evolution fragments formed by multiple normal samples at the same spatial location are aggregated and statistically analyzed. The consistency of each fragment in terms of evolutionary coding, the order of changes in stage characteristics, and the magnitude of changes is analyzed. The structural evolution fragment with the most stable changes and the highest frequency of occurrence at each spatial location is selected as the benchmark structural evolution fragment for that location. The baseline structural evolution segments and allowable fluctuation ranges corresponding to each spatial location are stored uniformly and associated with sample batches, production equipment and process conditions to form a normal piezoelectric ceramic sheet electrode structure evolution trajectory library. Based on the comparison results of all segments, a global consistency assessment of the structural evolution trajectory is performed to identify one or more structural evolution segments that are spatially continuous and have a difference exceeding a preset threshold. The spatial location index containing the structural evolution segment is marked as an anomaly location. The defect type and defect severity level of the anomaly location are determined according to the change pattern of the second-stage structural features and the third-stage structural features in the corresponding segment. Based on the determined abnormal location, defect type, and defect severity level, electrode defect detection results are generated, and the electrode defect detection results are associated and stored with the corresponding piezoelectric ceramic sheet identifier.

[0031] Example 1: To verify the feasibility of this invention in practice, it was applied to the automated production workshop of a piezoelectric ceramic device manufacturing company. This company mainly produces piezoelectric ceramic sheets for ultrasonic transducers and precision sensors. The piezoelectric ceramic sheets are 18mm × 6mm in size, and the electrodes are formed using a silver paste screen printing process. During high-temperature sintering and subsequent cleaning and handling, defects such as fine cracks, electrode edge notches, localized broken lines, and slight contamination are easily generated on the electrode surface. These defects are typically less than 0.3mm in size and are often distributed along the electrode traces. They are characterized by strong reflectivity, low contrast, and irregular shapes, representing the most common types of problems leading to missed or false detections in existing detection methods.

[0032] Prior to the introduction of this invention, the production line used traditional machine vision inspection methods, mainly based on fixed threshold segmentation and edge detection algorithms to determine electrode integrity. In actual operation, it was found that when the printing thickness fluctuated or there was slight reflection on the surface, the system easily misidentified normal electrode edges as defects; and for the fine cracks generated along the electrode traces, due to the lack of structural analysis methods, the system had difficulty in consistently identifying them, resulting in insufficient inspection consistency and a high proportion of manual re-inspection.

[0033] In this embodiment, the automatic detection system for piezoelectric ceramic sheet electrodes proposed in this invention is deployed after the sintering process. Each piezoelectric ceramic sheet enters the inspection station via a conveyor belt, where an industrial camera above captures its raw surface image. The system first preprocesses the acquired raw image, including brightness normalization, noise suppression, and geometric alignment, to obtain a standardized electrode image, thereby reducing the impact of different batches of products and variations in lighting conditions on the inspection results.

[0034] The standardized electrode images are then input into the improved Mask2Former segmentation model. This model incorporates prior information about the electrode structure during segmentation to finely segment the electrode region and defect candidate regions, stably outputting electrode region masks and defect candidate region masks, and generating structural feature vectors corresponding to these two types of masks. In this way, the system can maintain stable identification of the main electrode structure under complex backgrounds and reflective conditions.

[0035] After obtaining the segmentation results, the system uses the electrode region mask as a spatial constraint to perform spatial distribution analysis on the defect candidate region mask. It then constructs a defect trend vector field by combining this with the electrode skeleton mesh to characterize the extension trend of defects along the electrode traces, enabling the system to distinguish between random noise and structurally significant real defects. Based on the electrode region mask, defect candidate region mask, and defect trend vector field, the system performs structural analysis, trend feature analysis, and skeletonization processing to extract the structural features of the first, second, and third stages.

[0036] The system organizes multi-stage structural features according to processing stages and spatial locations, constructing a structural evolution trajectory corresponding to a single piezoelectric ceramic sheet. This trajectory is then compared and analyzed with a pre-established database of normal piezoelectric ceramic sheet electrode structural evolution trajectories. When the structural evolution trajectory deviates significantly from its intended spatial location, the system automatically identifies a defect at that location, providing the defect type and severity level. Finally, it generates electrode defect detection results and stores them in the quality management system.

[0037] Table 1 Comparison of the practical application effects of the detection system of the present invention and traditional detection methods Detection methods Number of samples tested (pieces) Actual number of defects (pieces) Correct number of pieces detected Number of missed detections (pieces) False positives (number of images) Manual visual inspection 4200 638 611 27 34 Traditional visual inspection methods 4200 638 562 76 91 The detection system of the present invention 4200 638 603 35 48 Traditional method (reflective batches) 1400 219 181 38 44 This invention system (reflective batch) 1400 219 205 14 21 Traditional method (fine crack sample) 312 312 238 74 29 The system of this invention (fine crack sample) 312 312 287 25 18 As shown in Table 1, under the same sample size, different detection methods exhibit significant differences in defect identification performance. When all 4200 piezoelectric ceramic sheets are considered for inspection, manual visual inspection, with the participation of experienced personnel, can achieve a high number of correct detections, but a certain percentage of missed and false detections still occur. Furthermore, the detection efficiency and consistency are greatly affected by the personnel's condition. Traditional visual inspection methods show significantly higher numbers of missed and false detections than manual visual inspection, especially when defect features are not obvious or imaging conditions fluctuate. Fixed thresholds and single segmentation strategies struggle to reliably distinguish between real defects and background interference.

[0038] Under the same sample conditions, the detection system of this invention achieves a significantly higher number of correct detections than traditional visual inspection methods, while both the number of missed detections and false detections decrease to varying degrees, and the overall detection results are closer to the level of human visual inspection. This indicates that by introducing structural prior segmentation, multi-stage structural feature analysis, and structural evolution trajectory discrimination mechanisms, this invention effectively improves the ability to identify real defects while maintaining automated detection efficiency, and reduces the risk of misjudgment caused by factors such as noise and reflection.

[0039] Further analysis of the reflective batch samples revealed that traditional detection methods experienced a significant increase in both false negatives and false positives under strong reflective conditions. In contrast, the detection system of this invention maintained a high level of accurate detection under the same conditions, indicating that the detection method based on electrode structure constraints and defect trend modeling has stronger adaptability to complex surface conditions. In fine crack samples, traditional methods are insufficient in identifying microcracks distributed along the electrode traces, resulting in a high rate of false negatives. However, the system of this invention can effectively capture the structural characteristics of such defects through defect trend vector field and structural evolution trajectory analysis, reducing the number of false negatives and demonstrating its advantages in detecting micro- and structural defects.

[0040] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. An automatic detection system for defects in piezoelectric ceramic sheet electrodes, characterized in that, Includes the following modules: The image acquisition and preprocessing module is used to acquire the original image of the piezoelectric ceramic sheet surface and perform preprocessing to obtain a standardized electrode image; An improved Mask2Former segmentation module is used to construct an improved Mask2Former segmentation model, which yields electrode region masks, defect candidate region masks, and their corresponding structural feature vectors. The defect tendency vector field construction module is used to perform spatial distribution analysis on the defect candidate region mask using the electrode region mask as a spatial constraint, and construct the defect tendency vector field. The multi-stage structural feature extraction module is used to jointly analyze the electrode region mask, the defect candidate region mask, and the defect tendency vector field to extract the first-stage structural features, the second-stage structural features, and the third-stage structural features. The structural evolution trajectory construction module is used to combine the structural features of the first stage, the second stage, and the third stage to construct the structural evolution trajectory. The defect determination and result output module is used to compare the structural evolution trajectory with the normal piezoelectric ceramic sheet electrode structural evolution trajectory library and output the electrode defect detection results.

2. An automatic detection method for defects in piezoelectric ceramic sheet electrodes, applied to the automatic detection system for defects in piezoelectric ceramic sheet electrodes as described in claim 1, characterized in that, include: The original image of the piezoelectric ceramic sheet surface is acquired, and the original image is preprocessed to obtain a standardized electrode image; An improved Mask2Former segmentation model is constructed. A standardized electrode image is input and segmented to obtain an electrode region mask, a defect candidate region mask, and structural feature vectors corresponding to the electrode region mask and the defect candidate region mask, respectively. Using the electrode region mask as a spatial constraint region, spatial distribution analysis is performed on the defect candidate region mask to extract the distribution gradient information of the defect region. Based on the electrode region mask, the orientation field information of the electrode structure is extracted. The distribution gradient information and orientation field information are fused to construct the defect tendency vector field. Structural analysis is performed based on electrode region mask and defect candidate region mask, directional feature analysis is performed based on defect directional vector field, skeletonization is performed on electrode region mask, and first-stage structural features, second-stage structural features and third-stage structural features are extracted. Following the sequence of segmentation processing stage, defect tendency vector field modeling stage, and skeleton structure analysis stage, the structural features of the first stage, the structural features of the second stage, and the structural features of the third stage are combined in sequence to construct the structural evolution trajectory corresponding to the piezoelectric ceramic sheet to be tested. The structural evolution trajectory is compared with a pre-established database of normal piezoelectric ceramic sheet electrode structural evolution trajectories to determine whether there are defects in the piezoelectric ceramic sheet electrode and output the corresponding electrode defect detection results.

3. The automatic detection method for defects in piezoelectric ceramic sheet electrodes according to claim 2, characterized in that, The original image includes an image of the electrode region on the surface of the piezoelectric ceramic sheet, an image of the non-electrode substrate region, and an image of the electrode boundary located between the electrode region and the non-electrode substrate region. The original image is represented in the form of a pixel matrix, and each pixel contains at least brightness information to characterize the grayscale difference between the electrode material and the ceramic substrate under imaging conditions.

4. The automatic detection method for defects in piezoelectric ceramic sheet electrodes according to claim 2, characterized in that, The preprocessing of the original image includes brightness normalization, mapping the brightness of images under different acquisition conditions to a uniform brightness range, noise suppression, reducing random noise components in the image, and geometric alignment, correcting the position and angle offset of the piezoelectric ceramic sheet during the imaging process, thereby obtaining a standardized electrode image.

5. The automatic detection method for defects in piezoelectric ceramic sheet electrodes according to claim 2, characterized in that, The process of obtaining the electrode region mask, the defect candidate region mask, and the structural feature vectors corresponding to the electrode region mask and the defect candidate region mask respectively includes: A prior dataset containing electrode design layout, historical good product images, and typical defect images is constructed. The prior dataset is converted into a three-channel prior tensor with the same size as the standardized electrode images. The three-channel prior tensor stores the electrode region confidence, trunk routing direction information, and local edge response information in sequence. At the output of the pixel decoder in the Mask2Former architecture, a set of multi-scale feature maps generated by the pixel decoder is obtained. A first feature map with a spatial resolution higher than other scales and a second feature map with a spatial resolution lower than the first feature map are selected. These are then concatenated after the pixel decoder to form an adaptive edge cueing encoding layer, a dual-scale context aggregation layer, and a topology-aware fusion top-layer structure, where: An adaptive edge hint encoding layer receives local edge response information and a first feature map, generates an edge hint vector, and concatenates the edge hint vector with the object query vector before inputting it into the Transformer decoder. The dual-scale context aggregation layer takes the first feature map and the second feature map as input. After scale alignment of the second feature map, it fuses the features with the first feature map, preserving local detail information and global structural information. The fusion result is output to the mask prediction branch. The topology-aware fusion head receives the feature map output by the dual-scale context aggregation layer and the backbone routing information, performs electrode connectivity correction processing on the mask prediction results, and generates electrode region masks and defect candidate region masks. An improved Mask2Former segmentation model was trained end-to-end using a joint loss function, which consists of electrode mask cross-entropy loss, defect mask focus loss, and structural connectivity consistency loss. The training data input is a standardized electrode image, the auxiliary input is a three-channel prior tensor, and the supervision signals are electrode mask labels and defect mask labels. During the inference phase, the standardized electrode image and the corresponding three-channel prior tensor are synchronously input into the improved Mask2Former segmentation model, which outputs an electrode region mask, a defect candidate region mask, a first structural feature vector corresponding to the electrode region mask, and a second structural feature vector corresponding to the defect candidate region mask.

6. The automatic detection method for defects in piezoelectric ceramic sheet electrodes according to claim 2, characterized in that, The construction of the defect tendency vector field includes: Within the area defined by the electrode region mask, extract all pixels with a mask value of one from the defect candidate region mask, and divide the pixels into several defect connected regions according to the spatial connectivity relationship. Based on the outer boundary shape and internal pixel distribution of each defective connected region, the main extension direction, outer boundary normal direction, and local thickness direction of the defective connected region are calculated. The pixel positions are then mapped to each pixel point inside the defective connected region to form a local morphological direction description result of the defect. Skeleton extraction is performed within the area defined by the electrode region mask to obtain the electrode skeleton mesh. The local main routing direction is calculated for each skeleton point. Starting from the skeleton point, the main routing direction information is diffused to the surrounding electrode region pixels within a preset neighborhood range to construct the electrode structure direction field covering the electrode region pixels. Based on the first structural feature vector and the second structural feature vector, the weight parameters are determined. At each defect region pixel, the local morphological direction information of the defect and the direction information of the electrode structure corresponding to the pixel are weighted and synthesized according to the weight parameters to obtain the defect tendency vector. Neighborhood smoothing is performed along the skeleton direction under the constraint of the electrode skeleton net. All defect tendency vectors after neighborhood smoothing are arranged and stored according to the spatial position of the pixels in the defect region to form a defect tendency vector field.

7. The automatic detection method for defects in piezoelectric ceramic sheet electrodes according to claim 2, characterized in that, The extraction of the first-stage structural features, the second-stage structural features, and the third-stage structural features includes: Within the area defined by the electrode region mask, the centroid position of the electrode region is calculated. Based on the distance between each pixel in the electrode region and the centroid position, the electrode region is divided into several concentric annular regions. The number of pixels, the number of connected regions, and the boundary length of the defect candidate region mask are statistically analyzed to form the annular-level structure analysis results. Within each concentric ring region, the ring region is divided into several fan-shaped sub-regions with the centroid of the electrode region as the center and according to multiple preset angle directions. The boundary orientation, boundary tortuosity changes of the electrode region mask and the coverage ratio of the defect candidate region mask are jointly statistically analyzed, and the statistical results are combined to form the first stage structural features. All defect tendency vectors in each defect connected region are classified according to their spatial location. The components of each defect tendency vector in multiple preset directions are grouped and statistically analyzed. The amplitude distribution, dominant direction distribution and direction change range of the defect tendency vector in each defect connected region are calculated respectively. The grouped statistical results are combined to form the second stage structural features. The electrode region mask is skeletonized, shrinking the electrode region into an electrode skeleton mesh composed of skeleton pixels. Skeleton endpoints, branch nodes and skeleton segments are identified on the electrode skeleton mesh. The length, number of bends and the angle relationship between adjacent skeleton segments are statistically analyzed to form the third stage structural features. The structural features of the first stage, the second stage, and the third stage are concatenated and encoded in a preset order to generate a set of structural features.

8. The automatic detection method for defects in piezoelectric ceramic sheet electrodes according to claim 2, characterized in that, The construction of the structural evolution trajectory corresponding to the piezoelectric ceramic sheet to be tested includes: The structural features of the first stage, the second stage, and the third stage are categorized and organized according to the spatial location index within the electrode region. For each spatial location index, the corresponding set of structural features is arranged in the order of segmentation processing stage, defect tendency vector field modeling stage, and skeleton structure analysis stage to form a local structural evolution unit, and a unique local evolution identifier is assigned to each local structural evolution unit. Within the electrode region, all local structural evolution units are sorted by scanning the spatial position index sequentially from the inside out along a preset angle direction. The sorted local structural evolution units are then connected according to the scanning order to generate an initial structural evolution sequence. Based on local evolution identifiers and spatial adjacency relationships, the local structural evolution units in the initial structural evolution sequence are aggregated. Multiple local structural evolution units with similar structural change trends and spatial continuity are merged into structural evolution segments. Each structural evolution segment is assigned a segment-level evolution code to obtain a structural evolution code sequence. The structural evolution coding sequence, along with the corresponding spatial location index and fragment-level evolution coding, are stored together as the structural evolution trajectory of the piezoelectric ceramic sheet electrode to be detected.

9. The automatic detection method for defects in piezoelectric ceramic sheet electrodes according to claim 2, characterized in that, The corresponding electrode defect detection results output include: The structural evolution trajectory is divided into a sequence of trajectory segments consisting of multiple structural evolution segments, and the corresponding spatial location index information is preserved between each trajectory segment; For each structural evolution segment in the structural evolution trajectory, according to the spatial location index, the normal structural evolution segment at the corresponding position is retrieved in the normal piezoelectric ceramic sheet electrode structural evolution trajectory library. The differences between the structural evolution segment to be detected and the corresponding normal structural evolution segment in terms of evolution coding, the order of stage feature changes, and the magnitude of stage feature changes are compared to generate segment-level comparison results. Based on the comparison results of all segments, a global consistency assessment of the structural evolution trajectory is performed to identify one or more structural evolution segments that are spatially continuous and whose differences exceed a preset threshold. The spatial location index containing the structural evolution segment is marked as an anomaly location. The defect type and defect severity level of the anomaly location are determined according to the change pattern of the second-stage structural features and the third-stage structural features in the corresponding segment. Based on the determined abnormal location, defect type, and defect severity level, electrode defect detection results are generated, and the electrode defect detection results are associated and stored with the corresponding piezoelectric ceramic sheet identifier.