Mn-Zn ferrite core hole site image verification method and system

CN122966640APending Publication Date: 2026-10-23NANTONG GUANYOUDA MAGNET +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611392467.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-09
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]现有孔位检测流程多以单孔几何参数为判断依据,对多个孔位之间的空间顺序、孔心距离、孔群中心偏移和孔群排列方向考虑不足,难以准确区分孔位轻微偏移、孔距异常、孔序错位以及孔缺失不同异常类型

Benefits of technology

本发明通过将预处理磁芯图像输入包含定位模块、孔缘拓扑约束双向重建模块和预测器的改进BiRefNet,由定位模块提取多尺度定位特征得到第一分割特征图,由孔缘拓扑约束双向重建模块依据孔洞内部参考特征、孔缘外部参考特征以及标准磁芯孔位模板中的孔位拓扑约束关系进行双向一致性重建,生成第二分割特征图。在分割阶段即引入孔洞内部、孔缘外部和孔位拓扑约束三类信息,使模型不仅关注孔洞像素本身,还能利用孔缘外侧磁芯实体区域和标准孔位空间排列关系抑制烧结纹理、粉尘附着、反光边缘及局部暗影造成的伪孔响应,提高孔洞区域分割掩膜、孔缘边界响应图和磁芯主体分割掩膜之间的一致性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122966640A_ABST
    Figure CN122966640A_ABST
Patent Text Reader

Abstract

The application discloses a manganese-zinc ferrite core hole position image checking method and system, relates to the field of core hole position images, and comprises the following steps: obtaining a pretreated core image; obtaining a first segmentation feature map; generating a second segmentation feature map; outputting a hole region segmentation mask, a hole edge boundary response map and a core body segmentation mask; calculating a hole center coordinate, a hole diameter and a hole area; constructing a to-be-detected core hole position topology map; outputting a hole position topology consistency matching result; and judging whether the to-be-detected manganese-zinc ferrite core has hole position deviation, hole distance abnormality, hole sequence misplacement, hole loss or hole shape abnormality, and generating a hole position checking result. The application improves the identification integrity of the hole sequence misplacement, hole loss and overall hole group deviation problems in the multi-hole core.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of magnetic core hole position image technology, and in particular to a method and system for verifying the hole position images of manganese-zinc ferrite magnetic cores. Background Technology

[0002] Manganese-zinc ferrite cores are widely used in electronic components such as inductors, transformers, and filters. The position, diameter, spacing, and shape of the holes directly affect subsequent winding, assembly positioning, and electromagnetic performance consistency. During the core sintering, grinding, and drilling processes, quality problems such as hole position misalignment, abnormal hole spacing, misaligned hole sequence, missing holes, and abnormal hole shape can easily occur. Therefore, image verification of the hole positions in manganese-zinc ferrite cores is necessary.

[0003] Existing hole location detection methods typically rely on manual visual inspection, traditional edge detection, threshold segmentation, contour fitting, or ordinary depth segmentation models to identify hole regions in magnetic core images, and then calculate the hole center, diameter, and area based on the segmentation results. Manganese-zinc ferrite cores often exhibit sintering textures, dust adhesion, localized reflections, edge shadows, and hole edge damage. Traditional image processing methods easily misidentify background noise, core body edges, or texture cracks as hole regions, leading to unstable hole region segmentation. While ordinary segmentation models can improve region recognition capabilities, they often only focus on pixel-level segmentation results for individual holes, lacking joint constraints on the core body region, hole edge boundaries, and the spatial arrangement of hole locations.

[0004] Current hole location detection processes primarily rely on the geometric parameters of individual holes, failing to adequately consider the spatial order, center-to-center distance, center offset of hole groups, and arrangement direction of hole groups. This makes it difficult to accurately distinguish between different anomalies such as slight hole location shifts, abnormal hole spacing, misaligned hole sequences, and missing holes. When the hole segmentation results contain local fragmentation, boundary adhesion, or redundant false holes, subsequent calculations of hole center coordinates, diameters, and areas are prone to cascading errors, affecting the reliability of hole location verification results. Therefore, existing technologies still suffer from problems such as significant interference affecting hole region identification, unstable hole edge contour extraction, insufficient utilization of hole location topological relationships, and inaccurate identification of hole location anomaly types. Summary of the Invention

[0005] One objective of this invention is to provide a method and system for verifying the hole position image of a manganese-zinc ferrite core. This invention improves the completeness of identification of problems such as hole sequence misalignment, missing holes, and overall hole group offset in multi-hole magnetic cores.

[0006] A method for verifying the hole position image of a manganese-zinc ferrite core according to an embodiment of the present invention includes: The original core image of the manganese-zinc ferrite core to be tested is acquired, and preprocessing is performed to obtain the preprocessed core image; The preprocessed magnetic core image is input into the improved BiRefNet, which includes a localization module, a two-way reconstruction module for hole edge topological constraints, and a predictor. The localization module extracts multi-scale localization features to obtain the first segmentation feature map. The first segmentation feature map is reconstructed bidirectionally using the hole edge topology constraint bidirectional reconstruction module. The second segmentation feature map is generated by fusing the hole internal reference features, hole edge external reference features, and hole position topology constraint relationships in the standard magnetic core hole position template. Based on the second segmentation feature map, the predictor outputs a hole region segmentation mask, a hole edge boundary response map, and a core body segmentation mask. Based on the core body segmentation mask, the core body region of the manganese zinc ferrite core to be detected in the preprocessed core image is determined. Based on the hole region segmentation mask, each hole connected region is extracted in the core body region. Combined with the hole edge boundary response map, the hole edge contour point set corresponding to each hole connected region is determined. Based on the hole edge contour point set, the hole center coordinates, hole diameter and hole area are calculated. The topological nodes are established according to the spatial order of the core coordinate system determined by the core body segmentation mask, and the coordinates of the hole center, the hole diameter and the hole area are used as topological edge attributes to construct the topological map of the hole position of the core to be tested. Call the standard magnetic core hole position template to obtain the template hole position topology map, perform consistency matching between the test magnetic core hole position topology map and the template hole position topology map, and output the hole position topology consistency matching result; Based on the hole position topology consistency matching results, the hole region segmentation mask, hole center coordinates, hole diameter and hole area are corrected for consistency. Based on the corrected hole region segmentation mask, hole center coordinates, hole diameter and hole area and hole position topology consistency matching results, it is determined whether the manganese zinc ferrite core to be tested has hole position offset, abnormal hole spacing, misaligned hole sequence, missing hole or abnormal hole shape, and hole position verification results are generated.

[0007] Optionally, the preprocessing includes distortion correction, illumination equalization, scale normalization, and noise suppression.

[0008] Optionally, the step of inputting the preprocessed magnetic core image into the improved BiRefNet, which includes a localization module, a hole edge topological constraint bidirectional reconstruction module, and a predictor, includes: The preprocessed magnetic core image is input into the localization module of the improved BiRefNet. After normalization, image embedding and position encoding, the elements are added together to generate the initial localization features. Based on the initial positioning features, hierarchical feature extraction is performed along different spatial resolutions to obtain multi-scale positioning features at multiple positioning scales. Channel-unified processing is performed on the multi-scale positioning features to obtain channel-unified positioning features, and spatial alignment processing is performed at each positioning scale to obtain spatially aligned positioning features; Scale fusion processing is performed on spatial alignment positioning features at multiple positioning scales to obtain multi-scale fused positioning features; The multi-scale fused localization features are input into the segmentation feature mapping layer, and the mapping output is subjected to feature normalization processing to generate the first segmentation feature map.

[0009] Optionally, the bidirectional reconstruction module utilizing hole edge topological constraints performs bidirectional consistency reconstruction on the first segmentation feature map, and generates a second segmentation feature map by fusing the internal reference features of the hole, the external reference features of the hole edge, and the hole position topological constraint relationships in the standard magnetic core hole position template, including: The first segmentation feature map is input into the hole edge topological constraint bidirectional reconstruction module, and the hole internal response mapping and hole edge external response mapping are performed respectively to generate hole internal response map and hole edge external response map; Based on the first segmentation feature map, and according to the response map inside the hole and the response map outside the hole edge, reference features inside the hole and reference features outside the hole edge are generated. Based on the topological constraints of the holes in the standard magnetic core hole template, the set of standard hole core grid positions, the set of standard hole adjacent edges, and the arrangement direction of the standard hole group are determined in the two-dimensional normalized feature grid coordinate domain corresponding to the first segmentation feature map. Based on the set of standard hole center grid positions, the set of standard hole adjacent edges, and the standard hole group arrangement direction, Gaussian response map of standard hole position, response map of standard hole adjacent line, and direction consistency response map of standard hole group are generated respectively. The Gaussian response map of standard hole location, the response map of adjacent connection of standard hole location, and the directional consistency response map of standard hole group are weighted and fused to generate a hole location topological constraint weight map. Based on the topological constraint weight map of the hole, a bidirectional consistency reconstruction is performed on the internal reference features and external reference features of the hole edge to generate bidirectional reconstruction features of the hole edge topology. In Example 1, the topological constraint weight map of the hole location is multiplied element-wise with the reference feature inside the hole according to the feature mesh to obtain the topological constraint feature inside the hole.

[0010] The reconstructed features of the pore edge topology are subjected to reconstruction feature mapping and feature normalization to generate a second segmentation feature map.

[0011] Optionally, the step of outputting a hole region segmentation mask, a hole edge boundary response map, and a core body segmentation mask based on the second segmentation feature map in the predictor to form a hole region segmentation result includes: The second segmentation feature map is input into the predictor, and image size restoration processing is performed on the second segmentation feature map to obtain the size-restored segmentation feature map. Based on the size recovery segmentation feature map, the hole region segmentation mapping, hole edge boundary response mapping, and core body segmentation mapping are performed respectively to obtain the unnormalized response map of the hole region, the unnormalized response map of the hole edge boundary, and the unnormalized response map of the core body. Normalization processing was performed on the unnormalized response maps of the hole region, the hole edge boundary, and the magnetic core body, respectively, to obtain the normalized response maps of the hole region, the hole edge boundary, and the magnetic core body. A core segmentation mask is generated based on the normalized response map of the core body. A binary hard constraint is applied to the normalized response map of the hole region using the core body segmentation mask, and a continuous response constraint is applied to the normalized response map of the hole edge boundary using the core body segmentation mask, thereby generating the hole region segmentation mask and the hole edge boundary response map.

[0012] Optionally, the step of determining the main body region of the manganese-zinc ferrite core to be detected in the preprocessed core image based on the core body segmentation mask, and extracting each hole connected region within the main body region based on the hole region segmentation mask, includes: Based on the core body segmentation mask, the core body region of the manganese zinc ferrite core to be detected in the preprocessed core image is determined; Based on the mask segmentation of the hole region, extract the connected region of each hole in the main body region of the magnetic core; By combining the response map of the hole edge boundary, the set of hole edge contour points and the corresponding hole edge contour weights are determined for each hole connected region. Based on the hole edge contour point set and hole edge contour weight, calculate the hole center coordinates and hole diameter corresponding to each hole connected region; Based on the connected regions of holes, the hole area corresponding to each connected region is calculated, and the hole center coordinates, hole diameter and hole area are encapsulated accordingly.

[0013] Optionally, establishing topological nodes by assigning the hole center coordinates, hole diameter, and hole area according to the spatial order in the core coordinate system determined by the core body segmentation mask includes: Based on the core body segmentation mask, the core coordinate system is determined, and the hole center coordinates are mapped to the core coordinate system to obtain the hole center coordinates in the core coordinate system; According to the spatial order in the core coordinate system, the hole center coordinates, hole diameter and hole area in the core coordinate system are sorted to obtain the sorted hole position geometric parameters. Based on the sorted hole position geometric parameters, establish a set of topological nodes; Calculate the distance between each hole center based on the hole center coordinates in the core coordinate system of the topological node set; Based on the core coordinates of the holes in the topological node set, the offset of the hole group center and the arrangement direction of the hole group are determined. The distance between each hole center, the offset of the hole group center, and the arrangement direction of the hole group are used as topological edge attributes to construct the topological map of the hole positions of the magnetic core to be tested.

[0014] Optionally, the step of calling a standard magnetic core hole position template, obtaining a template hole position topology map, and performing consistency matching between the topology map of the magnetic core hole position to be tested and the template hole position topology map includes: Call the standard magnetic core hole position template to obtain the template hole position topology diagram; According to the spatial order in the magnetic core coordinate system, establish the node matching relationship between the topology map of the hole position of the magnetic core to be tested and the topology map of the hole position of the template, and obtain the set of node matching relationships; Based on the set of node matching relationships, determine the set of unmatched template nodes and the set of unmatched test nodes; Based on the node matching relationship, the node geometric deviation between the topology node to be tested and the template topology node is calculated to obtain the node geometric deviation set. Based on node matching relationships and topological edge attributes, the topological edge attribute deviation between the topological map of the hole position of the magnetic core to be tested and the topological map of the hole position of the template is calculated, and the set of topological edge attribute deviations is obtained. The set of matching node relationships, the set of unmatched template nodes, the set of unmatched nodes to be tested, the set of node geometric deviations, the set of edge matching relationships, and the set of topological edge attribute deviations are associated and encapsulated to generate the hole position topological consistency matching result.

[0015] Optionally, the consistency correction of the hole region segmentation mask, hole center coordinates, hole diameter, and hole area based on the hole position topology consistency matching result includes: Based on the hole location topology consistency matching results, generate consistency correction base data; Based on the set of node matching relationships and the set of node geometric deviations in the consistency correction base data, consistency correction is performed on the hole center coordinates, hole diameter and hole area to obtain the corrected hole center coordinates, corrected hole diameter and corrected hole area. Based on the node matching relationship set, the corrected hole center coordinates and the corrected hole diameter in the consistency correction base data, the hole region segmentation mask is subjected to consistency correction to obtain the corrected hole region segmentation mask. Based on the set of node geometric deviations and the set of topological edge attribute deviations in the consistency correction basic data, it is determined whether the manganese-zinc ferrite core to be tested has hole position offset, abnormal hole spacing or abnormal hole shape. Based on the node matching relationship set, unmatched template node set, and unmatched test node set in the consistency correction basic data, it is determined whether the manganese zinc ferrite core to be tested has a hole sequence misalignment or missing holes. Based on the consistency correction base data, the corrected hole region segmentation mask, the corrected hole center coordinates, the corrected hole diameter, and the corrected hole area, hole position anomaly judgment information is generated. Based on the hole position anomaly determination information, generate hole position verification results.

[0016] A manganese-zinc ferrite core hole position image verification system is used to execute the aforementioned manganese-zinc ferrite core hole position image verification method, comprising: The acquisition module is used to acquire raw magnetic core images and preprocess them to obtain preprocessed magnetic core images; The localization module is used to input the preprocessed magnetic core image into the improved BiRefNet, extract multi-scale localization features, and obtain the first segmentation feature map; The reconstruction module is used to perform bidirectional consistency reconstruction of the first segmentation feature map, and to fuse the internal reference features of the hole, the external reference features of the hole edge, and the topological constraint relationship of the hole position to generate the second segmentation feature map. The prediction module is used to output a hole region segmentation mask, a hole edge boundary response map, and a magnetic core body segmentation mask based on the second segmentation feature map; The measurement module is used to determine the main body area of ​​the magnetic core, extract the connected area of ​​the hole and the contour point set of the hole edge, and calculate the coordinates of the hole center, the hole diameter and the hole area; The mapping module is used to establish topological nodes and topological edge attributes, and construct a topological map of the bore locations in the magnetic core to be tested. The matching module is used to call the standard magnetic core hole position template, obtain the template hole position topology map, and output the hole position topology consistency matching result; The verification module is used to perform consistency correction and determine hole position offset, abnormal hole spacing, misaligned hole sequence, missing holes, or abnormal hole shape, and generate hole position verification results.

[0017] The beneficial effects of this invention are: This invention inputs a preprocessed magnetic core image into an improved BiRefNet containing a localization module, a hole edge topological constraint bidirectional reconstruction module, and a predictor. The localization module extracts multi-scale localization features to obtain a first segmentation feature map. The hole edge topological constraint bidirectional reconstruction module performs bidirectional consistency reconstruction based on the reference features inside the hole, the reference features outside the hole edge, and the hole position topological constraint relationship in the standard magnetic core hole position template to generate a second segmentation feature map. By introducing three types of information—internal hole, external hole edge, and hole position topological constraint—at the segmentation stage, the model not only focuses on the hole pixels themselves but also utilizes the magnetic core solid region outside the hole edge and the spatial arrangement relationship of the standard hole positions to suppress false hole responses caused by sintering textures, dust adhesion, reflective edges, and local shadows. This improves the consistency between the hole region segmentation mask, the hole edge boundary response map, and the magnetic core body segmentation mask.

[0018] This invention applies continuous response constraints to the normalized response map of the hole edge boundary, extracts the hole connected region within the main body of the magnetic core, and determines the hole edge contour point set and hole edge contour weights by combining the hole edge boundary response map. In the calculation of hole center coordinates and hole diameter, the hole edge contour weights are used to weight the horizontal pixel coordinates, vertical pixel coordinates, and pixel distances from the hole edge contour points to the hole center coordinates. This avoids the problems of hole center offset and unstable hole diameter estimation caused by segmenting the circumscribed contour of the connected domain of the hole region segmentation mask or ordinary geometric fitting. It combines the calculation of hole center coordinates, hole diameter, and hole area with the hole edge boundary response intensity, and can form more stable hole position geometric parameter terms in the case of local hole edge defects, hole boundary breaks, or irregular hole segmentation boundaries. 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 flowchart of a method for verifying the hole position image of a manganese-zinc ferrite core proposed in this invention; Figure 2 This is a structural diagram of the improved BiRefNet for the manganese-zinc ferrite core hole position image verification method proposed in this invention; Figure 3 This is an abnormal sample determination diagram in the manganese-zinc ferrite core hole position image verification method proposed in this invention. Detailed Implementation

[0020] Example 1: Reference Figure 1 A method for verifying the hole position image of a manganese-zinc ferrite core, comprising: The original core image of the manganese-zinc ferrite core to be tested is acquired, and preprocessing is performed to obtain the preprocessed core image.

[0021] In this embodiment, the preprocessing includes distortion correction, illumination equalization, scale normalization, and noise suppression.

[0022] The preprocessed magnetic core image is input into an improved BiRefNet containing a localization module, a two-way reconstruction module for bore edge topological constraints, and a predictor. The localization module extracts multi-scale localization features to obtain the first segmentation feature map.

[0023] This embodiment specifically includes: The preprocessed magnetic core image is input into the localization module of the improved BiRefNet. After normalization, image embedding and position encoding, the elements are added together to generate the initial localization features.

[0024] In Example 1, the preprocessed magnetic core image is input into the improved BiRefNet localization module after pixel normalization. The localization module performs image embedding processing on the normalized image tensor and adds it element-wise with the position codes corresponding to the pixel coordinates of the preprocessed magnetic core image to generate initial localization features.

[0025] Based on the initial positioning features, hierarchical feature extraction is performed along different spatial resolutions to obtain multi-scale positioning features at multiple positioning scales.

[0026] In Example 1, by performing convolutional spatial scale mapping with a stride of 2 and Transformer feature extraction on the positioning input features at the previous positioning scale, multi-scale positioning features at each positioning scale with spatial resolutions of 1 / 4, 1 / 8, 1 / 16 and 1 / 32 are obtained, wherein the zero-level positioning input features are determined by the initial positioning features.

[0027] Channel-unified processing is performed on the multi-scale positioning features to obtain channel-unified positioning features, and spatial alignment processing is performed at each positioning scale to obtain spatially aligned positioning features.

[0028] In Example 1, features at four positioning scales are uniformly mapped to the same number of target channels using 1×1 convolution to obtain channel-unified positioning features. Using the positioning scale with the highest spatial resolution as a benchmark, bilinear interpolation is used to upsample the remaining lower resolution features to the benchmark feature grid size to obtain spatially aligned positioning features at each positioning scale.

[0029] Scale fusion processing is performed on spatial alignment positioning features at multiple positioning scales to obtain multi-scale fused positioning features.

[0030] In Example 1, the spatial alignment positioning features at each positioning scale are weighted and summed according to the feature grid by using the adaptive scale fusion weights normalized by Softmax, so as to obtain multi-scale fused positioning features.

[0031] The multi-scale fused localization features are input into the segmentation feature mapping layer, and the mapping output is subjected to feature normalization processing to generate the first segmentation feature map.

[0032] In Example 1, the multi-scale fused localization features are input into the segmentation feature mapping layer consisting of 1×1 convolution and Sigmoid activation function, and mapped and normalized into the first segmentation feature map of the target channel dimension.

[0033] The first segmentation feature map is reconstructed bidirectionally using the hole edge topology constraint bidirectional reconstruction module. The second segmentation feature map is generated by fusing the hole internal reference features, hole edge external reference features, and hole position topology constraint relationships in the standard magnetic core hole position template. This embodiment specifically includes: The first segmentation feature map is input into the hole edge topological constraint bidirectional reconstruction module, and the hole internal response mapping and hole edge external response mapping are performed respectively to generate hole internal response map and hole edge external response map.

[0034] In Example 1, the hole edge topological constraint bidirectional reconstruction module performs hole internal response mapping and hole edge external response mapping on the first segmentation feature map respectively. Both are generated by sequentially aggregating local context features through convolution, performing channel compression and single-channel mapping, and normalizing by the Sigmoid activation function to generate hole internal response maps and hole edge external response maps in the 0-1 response range.

[0035] Among them, the response mapping inside the hole focuses on the inside of the hole, the shadow of the hole wall, and the low grayscale area inside the hole; the response mapping outside the hole edge focuses on the magnetic core entity, sintering texture, and dust interference area outside the hole edge.

[0036] Based on the first segmentation feature map, and according to the response map inside the hole and the response map outside the hole edge, reference features inside the hole and reference features outside the hole edge are generated.

[0037] In Example 1, the response map inside the hole and the response map outside the hole edge are spatially aligned and expanded by channel broadcasting, and then multiplied element-wise with the first segmentation feature map according to the feature grid to obtain the reference feature inside the hole and the reference feature outside the hole edge.

[0038] Based on the topological constraints of the holes in the standard magnetic core hole template, the set of standard hole core grid positions, the set of standard hole adjacent edges, and the arrangement direction of the standard hole group are determined in the two-dimensional normalized feature grid coordinate domain corresponding to the first segmentation feature map.

[0039] In Example 1, the standard hole center in the standard magnetic core hole position template is normalized and mapped to the two-dimensional normalized feature grid coordinate domain to obtain the standard hole center grid position corresponding to each standard hole center, and arranged according to the hole position order to generate a set of standard hole center grid positions.

[0040] Using each grid position in the standard hole core grid position set as a standard hole position node, and constructing node connections based on the adjacent hole position connection relationship of the standard magnetic core hole position template, a standard hole position adjacent edge set is obtained.

[0041] The center position of the standard hole group is calculated based on the set of standard hole center grid positions, and the main direction is statistically analyzed based on the spatial distribution direction of each standard hole node relative to the center of the standard hole group. The direction with the largest spatial distribution span is determined as the arrangement direction of the standard hole group.

[0042] Based on the set of standard hole center grid locations, the set of standard hole adjacent edges, and the standard hole group arrangement direction, Gaussian response diagrams of standard hole locations, response diagrams of standard hole adjacent lines, and direction consistency response diagrams of standard hole groups are generated, respectively.

[0043] In Example 1, for the two-dimensional normalized feature grid coordinate domain corresponding to the first segmentation feature map, the two-dimensional normalized Euclidean distance between each feature grid position and each standard hole center grid position in the set of standard hole center grid positions is calculated. After Gaussian decay transformation according to the dimensionless Gaussian diffusion scale using the Gaussian decay function, the maximum value is taken as the standard hole position Gaussian response value. The values ​​are arranged according to the feature grid positions to obtain the standard hole position Gaussian response map.

[0044] Calculate the dimensionless shortest distance from each feature grid position to each standard hole adjacent line segment in the standard hole adjacent edge set. After Gaussian decay transformation according to the dimensionless connection diffusion scale using the Gaussian decay function, take the maximum value as the standard hole adjacent connection response value. Arrange them according to the feature grid position to obtain the standard hole adjacent connection response map.

[0045] Calculate the dimensionless projection distance of each feature grid position relative to each standard hole center grid position in the set of standard hole center grid positions in the direction perpendicular to the standard hole group arrangement direction. After Gaussian decay transformation according to the dimensionless directional diffusion scale using the Gaussian decay function, take the maximum value as the standard hole group directional consistency response value. Arrange them according to the feature grid positions to obtain the standard hole group directional consistency response map.

[0046] The Gaussian response map of the standard hole location, the response map of the adjacent connection line of the standard hole location, and the directional consistency response map of the standard hole group are weighted and fused to generate a topological constraint weight map of the hole location.

[0047] In Example 1, dimensionless fusion weights with a sum of 1 and non-negative are set for the standard borehole Gaussian response map, the standard borehole adjacent line response map, and the standard borehole group direction consistency response map, respectively. At each feature grid position in the two-dimensional normalized feature grid coordinate domain corresponding to the first segmentation feature map, the standard borehole Gaussian response map, the standard borehole adjacent line response map, and the standard borehole group direction consistency response map are summed element-wise according to the grid position to obtain a borehole topology constraint weight map mapped to the 0-1 interval.

[0048] Based on the topological constraint weight map of the hole location, a bidirectional consistent reconstruction is performed on the internal reference features and external reference features of the hole edge to generate bidirectional reconstructed topological features of the hole edge.

[0049] In Example 1, the topological constraint weight map of the hole location is multiplied element-wise with the reference feature inside the hole according to the feature mesh to obtain the topological constraint feature inside the hole.

[0050] By subtracting the topological constraint weight map of the aperture from 1, a complementary weight map of the topological constraint weight map of the aperture is obtained. This complementary weight map is then multiplied element-wise with the external reference feature of the aperture edge according to the feature mesh to obtain the external topological constraint feature of the aperture edge.

[0051] The topological constraint features inside the hole and the topological constraint features outside the hole edge are added element by element to obtain the bidirectional topological reconstruction features of the hole edge.

[0052] The reconstructed features of the hole edge topology are subjected to reconstruction feature mapping and feature normalization to generate a second segmentation feature map.

[0053] In Example 1, the bidirectional reconstruction features of the aperture topology are input into the reconstruction feature mapping layer in the aperture topology constraint bidirectional reconstruction module to obtain the reconstruction feature mapping output. The reconstruction feature mapping output is constrained to the dimensionless feature interval of 0 to 1 by the Sigmoid activation function to generate the second segmentation feature map.

[0054] refer to Figure 2The improved BiRefNet is a hole location image segmentation network consisting of a localization module, a hole edge topological constraint bidirectional reconstruction module, and a predictor connected sequentially. The input is a pre-processed magnetic core image with a uniform size of 512×512×3. The output is a hole region segmentation mask of size 512×512×1, a hole edge boundary response map of size 512×512×1, and a magnetic core body segmentation mask of size 512×512×1. The localization module includes an image embedding layer, a location encoding layer, a 4-level hierarchical feature extraction layer, a channel unification layer, a spatial alignment layer, and a scale fusion layer, which sequentially generate 1 / 4 and 1 Multi-scale localization features at spatial resolutions of 8 / 16 and 1 / 32 are fused to obtain the first segmentation feature map. The hole edge topological constraint bidirectional reconstruction module includes a hole interior response mapping branch, a hole edge exterior response mapping branch, a hole position topological constraint weight generation branch, and a reconstruction feature mapping layer. It is used to generate the second segmentation feature map based on the hole interior reference features, the hole edge exterior reference features, and the hole position topological constraint relationship in the standard magnetic core hole position template. The predictor includes a hole region segmentation mapping layer, a hole edge boundary response mapping layer, and a magnetic core body segmentation mapping layer, which output three types of segmentation results respectively.

[0055] In this embodiment, the improved BiRefNet contains approximately 86 trainable network layers with a parameter scale of approximately 48M. During training, labeled manganese-zinc ferrite core image samples are used as training data. The training data comes from the original core images captured by industrial cameras and their manual annotation results. The annotation results include core body segmentation masks, hole region segmentation masks, hole edge boundary annotations, hole center coordinates, hole diameter, hole area, and standard core hole position templates. The training process adopts a supervised learning method, with hole region segmentation loss, hole edge boundary response loss, core body segmentation loss, and hole position topology consistency constraint loss forming a joint loss function. This function is used to perform end-to-end training on the localization module, the hole edge topology constraint bidirectional reconstruction module, and the predictor.

[0056] Unlike existing BiRefNet, which mainly relies on image region saliency and bidirectional reference reconstruction for target segmentation, the improved BiRefNet in this embodiment adds a hole edge topology constraint bidirectional reconstruction module. It introduces the standard hole center grid position set, standard hole adjacent edge set, and standard hole group arrangement direction from the standard magnetic core hole position template into the feature reconstruction process. It adds a magnetic core body segmentation branch and a hole edge boundary response branch to the predictor, so that the network can simultaneously constrain the spatial topological relationship of the hole interior, hole edge exterior, magnetic core body region, and hole position. This reduces the interference of sintering texture, dust adhesion, hole edge shadows, and local reflections on the hole region segmentation mask, and provides stable input for subsequent hole edge contour point set extraction, hole position geometric parameter calculation, and construction of the topological map of the hole position of the magnetic core to be tested.

[0057] Based on the second segmentation feature map, the predictor outputs a hole region segmentation mask, a hole edge boundary response map, and a core body segmentation mask. This embodiment specifically includes: The second segmentation feature map is input into the predictor, and image size restoration processing is performed on the second segmentation feature map to obtain the size-restored segmentation feature map.

[0058] In Example 1, the predictor receives the second segmentation feature map generated by the hole edge topological constraint bidirectional reconstruction module; based on the image height and image width of the preprocessed magnetic core image, it performs bilinear interpolation upsampling on the second segmentation feature map to restore the feature grid size to be the same as that of the preprocessed magnetic core image, thus obtaining the size-restored segmentation feature map.

[0059] Based on the size recovery segmentation feature map, the hole region segmentation mapping, hole edge boundary response mapping, and core body segmentation mapping are performed respectively to obtain the unnormalized response map of the hole region, the unnormalized response map of the hole edge boundary, and the unnormalized response map of the core body.

[0060] In Example 1, the predictor inputs the size recovery segmentation feature map into the hole region segmentation mapping layer, the hole edge boundary response mapping layer, and the magnetic core body segmentation mapping layer, respectively, and performs local context convolution, channel compression, and single-channel response mapping in sequence to obtain the unnormalized response map of the hole region, the unnormalized response map of the hole edge boundary, and the unnormalized response map of the magnetic core body.

[0061] Normalization processing was performed on the unnormalized response maps of the hole region, the hole edge boundary, and the magnetic core body, respectively, to obtain the normalized response maps of the hole region, the hole edge boundary, and the magnetic core body.

[0062] In Example 1, the predictor constrains the unnormalized response maps of the hole region, the hole edge boundary, and the magnetic core body to the dimensionless response range of 0-1 using the Sigmoid activation function, thereby obtaining the normalized response maps of the hole region, the hole edge boundary, and the magnetic core body.

[0063] A core segmentation mask is generated based on the normalized response map of the core body.

[0064] In Example 1, the normalized response map of the magnetic core body is subjected to pixel-by-pixel binarization processing based on the pixel position of the preprocessed magnetic core image, generating a magnetic core body segmentation mask with a binarization result of 0 or 1. Pixel positions with a normalized probability response not less than the preset magnetic core body response threshold are set to 1 in the magnetic core body segmentation mask, indicating that the corresponding pixel position belongs to the magnetic core body region; otherwise, they are set to 0.

[0065] The preset magnetic core body response threshold is determined by traversing the candidate response thresholds of 0-1 in the normalized response map of the magnetic core body corresponding to the labeled preprocessed magnetic core image sample, and selecting the candidate response threshold that makes the pixel-level F1 value of the corresponding region the highest. The value range is 0.35-0.75.

[0066] A binary hard constraint is applied to the normalized response map of the hole region using the core body segmentation mask, and a continuous response constraint is applied to the normalized response map of the hole edge boundary using the core body segmentation mask, thereby generating the hole region segmentation mask and the hole edge boundary response map.

[0067] In Example 1, the normalized response map of the hole region is subjected to pixel-by-pixel binarization processing based on a preset hole region response threshold at the same pixel position to obtain an initial hole region binary map. Pixel positions with a normalized probability response not less than the preset hole region response threshold are set to 1 in the initial hole region binary map, indicating that the corresponding pixel position belongs to the candidate hole region; otherwise, they are set to 0. The initial hole region binary map and the magnetic core body segmentation mask are subjected to a logical AND operation at the same pixel position to remove candidate hole regions located outside the magnetic core body region, generating a hole region segmentation mask.

[0068] The normalized response map of the aperture edge boundary is multiplied element-wise with the core body segmentation mask at the same pixel position. When the core body segmentation mask value corresponding to the same pixel position is 1, the normalized probability response of the pixel position in the normalized response map of the aperture edge boundary is retained as the aperture edge boundary response value. When the core body segmentation mask value corresponding to the same pixel position is 0, the aperture edge boundary response value of the pixel position is set to 0 to suppress the aperture edge boundary response located outside the core body region. The resulting body-constrained aperture edge boundary response map is then arranged according to the pixel position of the preprocessed core image to generate the aperture edge boundary response map.

[0069] The preset response threshold for the hole region is determined by traversing the candidate response thresholds of 0-1 in the normalized response map of the hole region corresponding to the labeled preprocessed magnetic core image sample, and selecting the candidate response threshold that makes the pixel-level F1 value of the corresponding region the highest. The value range is 0.4-0.85.

[0070] Based on the core body segmentation mask, the core body region of the manganese zinc ferrite core to be detected in the preprocessed core image is determined. Based on the hole region segmentation mask, each hole connected region is extracted in the core body region. Combined with the hole edge boundary response map, the hole edge contour point set corresponding to each hole connected region is determined. Based on the hole edge contour point set, the hole center coordinates, hole diameter and hole area are calculated. This embodiment specifically includes: Based on the core body segmentation mask, the core body region of the manganese-zinc ferrite core to be detected is determined in the preprocessed core image.

[0071] In Example 1, the pixel positions with a value of 1 in the core body segmentation mask are mapped to the pixel coordinate domain of the preprocessed core image, and the corresponding pixel position set is extracted to obtain the core body region of the manganese-zinc ferrite core to be detected in the preprocessed core image.

[0072] Based on the segmentation mask of the hole region, extract the connected region of each hole in the main body region of the magnetic core.

[0073] In Example 1, within the main body region of the magnetic core, the pixel positions with a value of 1 in the hole region segmentation mask are determined as candidate hole pixel positions. All candidate hole pixel positions are aggregated according to the pixel positions of the preprocessed magnetic core image to obtain the main body constrained hole candidate region.

[0074] Eight-neighbor connected region labeling is performed on the candidate regions of the main constraint holes. The positions of the candidate pixels of holes that are connected to each other under the eight-neighbor pixel connection relationship are divided into the same hole connected region, and the positions of the candidate pixels of holes that are not connected to each other are divided into different hole connected regions, thus obtaining a set of hole connected regions.

[0075] By combining the response map of the hole edge, the set of hole edge contour points and the corresponding hole edge contour weights are determined for each hole connected region.

[0076] In Example 1, for each hole-connected region, the pixel positions adjacent to the non-hole pixel positions in the main body region of the magnetic core are determined as candidate pixel positions of the hole edge. All candidate pixel positions of the hole edge are aggregated according to the pixel positions of the preprocessed magnetic core image to obtain the hole edge contour point set corresponding to the hole-connected region. The hole edge boundary response value of the pixel position in the corresponding hole edge contour point set in the hole edge boundary response map is determined as the hole edge contour weight.

[0077] Based on the hole edge contour point set and hole edge contour weight, calculate the hole center coordinates and hole diameter corresponding to each hole connected region.

[0078] In Example 1, for each hole-connected region, the horizontal and vertical pixel coordinates of each pixel position in the corresponding hole edge contour point set and the corresponding hole edge contour weights are extracted; the horizontal and vertical pixel coordinates are weighted and averaged according to the hole edge contour weights to obtain the horizontal and vertical pixel coordinates of the hole center corresponding to the hole-connected region, and the hole center coordinates are combined to generate the hole center coordinates corresponding to the hole-connected region.

[0079] Based on the center coordinates of the hole, calculate the pixel distance from each pixel position in the hole edge contour point set to the center coordinates of the hole; perform a weighted average calculation on each pixel distance according to the hole edge contour weight to obtain the weighted radius; multiply the weighted radius by 2 to obtain the hole diameter corresponding to the hole connected region.

[0080] Based on the connected regions of holes, the hole area corresponding to each connected region is calculated, and the hole center coordinates, hole diameter and hole area are encapsulated accordingly.

[0081] In Example 1, for each hole-connected region, the number of pixel positions contained is counted as the hole area of ​​the corresponding hole-connected region; based on the spatial order of the hole center coordinates corresponding to each hole-connected region in the main body region of the magnetic core, the hole center coordinates, hole diameter, and hole area of ​​each hole-connected region are associated and bound to generate the hole position geometric parameter items of the corresponding hole-connected region; all hole position geometric parameter items are arranged in spatial order to obtain the hole center coordinates, hole diameter, and hole area for constructing the hole position topology map of the magnetic core to be tested.

[0082] The topological nodes are established according to the spatial order of the core coordinate system determined by the core body segmentation mask, and the coordinates of the hole center, the hole diameter and the hole area are used as topological edge attributes to construct the topological map of the hole position of the core to be tested. This embodiment specifically includes: Based on the core body segmentation mask, the core coordinate system is determined, and the hole center coordinates are mapped to the core coordinate system to obtain the hole center coordinates in the core coordinate system.

[0083] In Example 1, the arithmetic mean of the horizontal and vertical pixel coordinates of all pixel positions in the main body region of the magnetic core is taken to obtain the center position of the main body region of the magnetic core, and it is determined as the origin of the magnetic core coordinate system.

[0084] The direction with the largest pixel projection span in the main area of ​​the magnetic core is determined as the horizontal axis of the magnetic core coordinate system, and the direction perpendicular to the horizontal axis of the magnetic core coordinate system is established as the vertical axis of the magnetic core coordinate system. The magnetic core coordinate system is constructed, and the projection distance of the hole center coordinates corresponding to each hole connected area relative to the origin of the magnetic core coordinate system on the horizontal axis and the vertical axis is calculated. The corresponding hole center coordinates of the magnetic core coordinate system are obtained by combining them.

[0085] According to the spatial order in the core coordinate system, the hole center coordinates, hole diameter, and hole area in the core coordinate system are sorted to obtain the sorted hole position geometric parameters.

[0086] In Example 1, based on the core coordinates of the magnetic core coordinate system corresponding to each connected region of the hole, the coordinates are arranged in ascending order according to the coordinate values ​​on the longitudinal axis of the magnetic core coordinate system. When the coordinate values ​​on the longitudinal axis of the magnetic core coordinate system corresponding to two connected regions of the hole are the same, the coordinates are arranged in ascending order according to the coordinate values ​​on the transverse axis of the magnetic core coordinate system corresponding to the two connected regions of the hole, thus determining the spatial order in the magnetic core coordinate system. The core coordinates, core coordinates of the magnetic core coordinate system, hole diameter, and hole area of ​​each connected region of the hole are arranged according to the spatial order to obtain the sorted hole position geometric parameters.

[0087] Based on the sorted hole position geometric parameters, establish a set of topological nodes.

[0088] In Example 1, according to the spatial order of the sorted hole position geometric parameters in the magnetic core coordinate system, a node number is assigned to each sorted hole position geometric parameter in turn. The hole position geometric parameter that is first in the spatial order corresponds to the first node number, and the node numbers of subsequent hole position geometric parameters are incremented sequentially according to the spatial order.

[0089] For each sorted hole position geometric parameter item, the hole center coordinates, core coordinate system hole center coordinates, hole diameter, and hole area are associated and bound with the corresponding node number to generate the corresponding topology node. After completing the node number assignment and association binding for all sorted hole position geometric parameter items, a set of topology nodes is obtained.

[0090] The distance between each hole center is calculated based on the hole center coordinates in the core coordinate system of the topological node set.

[0091] In Example 1, for any two different topological nodes in the set of topological nodes, the coordinates of the hole center in the magnetic core coordinate system corresponding to the two topological nodes are obtained respectively, and the Euclidean distance between the corresponding coordinates of the hole center in the two magnetic core coordinate systems is calculated to obtain the distance between the hole centers corresponding to the two topological nodes.

[0092] Based on the core coordinates of the holes in the topological node set, the offset of the hole group center and the arrangement direction of the hole group are determined.

[0093] In Example 1, the coordinate values ​​of the hole center coordinates of all topological nodes in the set of topological nodes in the magnetic core coordinate system on the horizontal and vertical axes of the magnetic core coordinate system are respectively calculated by performing an arithmetic mean to obtain the center position of the hole group. The Euclidean distance of the center position of the hole group relative to the origin of the magnetic core coordinate system is calculated to obtain the offset of the hole group center.

[0094] In the set of topological nodes, among all the core coordinates of the holes in the core coordinate system, compare the distance between any two core coordinates of the holes, and determine the two core coordinates of the holes with the largest distance as the end coordinates of the hole group; determine the connection direction between the end coordinates of the two hole groups, and normalize the connection direction between the end coordinates of the two hole groups to obtain the hole group arrangement direction.

[0095] The distance between each hole center, the offset of the hole group center, and the arrangement direction of the hole group are used as topological edge attributes to construct the topological map of the hole positions of the magnetic core to be tested.

[0096] In Example 1, a topological edge is established between any two different topological nodes in the topological node set to obtain a topological edge set.

[0097] For each topological edge, the distance between the centers of the holes corresponding to the two topological nodes connected by the topological edge, the offset of the hole group center, and the arrangement direction of the hole group are associated as the topological edge attributes corresponding to the topological edge, thus obtaining the topological edge attribute set.

[0098] The topology node set, topology edge set, and topology edge attribute set are associated and encapsulated to construct the topology map of the hole position of the magnetic core to be tested.

[0099] Call the standard magnetic core hole position template to obtain the template hole position topology map, perform consistency matching between the test magnetic core hole position topology map and the template hole position topology map, and output the hole position topology consistency matching result; This embodiment specifically includes: Call the standard magnetic core hole position template to obtain the template hole position topology diagram.

[0100] In Example 1, a standard core hole template corresponding to the specifications of the manganese-zinc ferrite core to be tested is called, the template hole center coordinates, template hole diameter and template hole area are extracted, and a template topology node set is constructed according to the hole position spatial order.

[0101] Establish template topology edges between any two different template topology nodes to obtain a template topology edge set. Associate the distance between the centers of each hole in the template, the offset of the center of the template hole group, and the arrangement direction of the template hole group as template topology edge attributes to obtain a template topology edge attribute set. Associate and encapsulate the template topology node set, the template topology edge set, and the template topology edge attribute set to obtain a template hole position topology map.

[0102] According to the spatial order in the magnetic core coordinate system, establish the node matching relationship between the topology map of the hole position of the magnetic core to be tested and the topology map of the hole position of the template, and obtain the set of node matching relationships.

[0103] In Example 1, based on the set of topological nodes and the set of template topological nodes, the number of topological nodes to be tested and the number of template topological nodes are determined, and the smaller of the two is determined as the number of node matches. The node numbers in the set of topological nodes to be tested and the template node numbers in the set of template topological nodes are matched sequentially, and the topological nodes to be tested with the same node number and not exceeding the number of node matches are determined as a node matching relationship with the template topological nodes, thus obtaining a set of node matching relationships.

[0104] Based on the set of node matching relationships, determine the set of unmatched template nodes and the set of unmatched test nodes.

[0105] In Example 1, when the number of template topology nodes is greater than the number of matching nodes, the template topology nodes that do not participate in the node matching relationship in the template topology node set are determined as unmatched template nodes, and all unmatched template nodes are set according to the template node sequence number to obtain the unmatched template node set.

[0106] When the number of nodes in the topology to be tested is greater than the number of nodes that are matched, the nodes in the topology to be tested that are not involved in the node matching relationship are identified as unmatched nodes. All unmatched nodes are then set according to their node numbers to obtain a set of unmatched nodes. When the number of nodes in the topology to be tested is equal to the number of template nodes, both the set of unmatched template nodes and the set of unmatched nodes are identified as empty sets.

[0107] Based on the node matching relationship, the node geometric deviation between the topology node to be tested and the template topology node is calculated to obtain the node geometric deviation set.

[0108] In Example 1, for each node matching relationship, the Euclidean distance between the core coordinates of the magnetic core coordinate system corresponding to the topological node to be tested and the template core coordinates of the template topological node is calculated to obtain the core coordinate deviation.

[0109] The absolute value of the difference between the aperture corresponding to the topology node to be tested and the template aperture corresponding to the topology node in the node matching relationship is calculated to obtain the aperture deviation corresponding to the node matching relationship.

[0110] The absolute value of the difference between the hole area corresponding to the topological node to be tested in the node matching relationship and the template hole area corresponding to the template topological node is calculated to obtain the hole area deviation corresponding to the node matching relationship.

[0111] The hole center coordinate deviation, hole diameter deviation, and hole area deviation corresponding to the same node matching relationship are associated and encapsulated to generate the node geometric deviation item corresponding to the node matching relationship; all node geometric deviation items are arranged in the order of node matching relationship to obtain the node geometric deviation set.

[0112] Based on node matching relationships and topological edge attributes, the topological edge attribute deviation between the topological map of the hole position of the magnetic core to be tested and the topological map of the hole position of the template is calculated, and the topological edge attribute deviation set is obtained.

[0113] In Example 1, edge matching relationships are established between the topological edge to be tested and the template topological edge corresponding to each pair of different node matching relationships, thus obtaining a set of edge matching relationships.

[0114] For each edge matching relationship, the absolute value of the difference between the distance between the center of the hole in the edge attribute of the test topology and the distance between the center of the template hole in the edge attribute of the template topology is calculated to obtain the distance deviation corresponding to the edge matching relationship.

[0115] The absolute value of the difference between the center offset of the hole group corresponding to the hole position topology diagram of the magnetic core to be tested and the center offset of the hole group corresponding to the hole position topology diagram of the template is calculated to obtain the deviation of the hole group center offset.

[0116] The deviation of the hole group arrangement direction is obtained by calculating the unit direction angle between the hole group arrangement direction corresponding to the hole position topology diagram of the magnetic core to be tested and the hole group arrangement direction corresponding to the hole position topology diagram of the template.

[0117] The distance deviation, hole group center offset deviation, and hole group arrangement direction deviation corresponding to the same edge matching relationship are associated and bound to generate the topological edge attribute deviation corresponding to the edge matching relationship; the topological edge attribute deviations corresponding to all edge matching relationships are arranged according to the edge matching order in the edge matching relationship set to obtain the topological edge attribute deviation set.

[0118] The set of matching node relationships, the set of unmatched template nodes, the set of unmatched nodes to be tested, the set of node geometric deviations, the set of edge matching relationships, and the set of topological edge attribute deviations are associated and encapsulated to generate the hole position topological consistency matching result.

[0119] Based on the hole position topology consistency matching results, the hole region segmentation mask, hole center coordinates, hole diameter and hole area are corrected for consistency. Based on the corrected hole region segmentation mask, hole center coordinates, hole diameter and hole area and hole position topology consistency matching results, it is determined whether the manganese zinc ferrite core to be tested has hole position offset, abnormal hole spacing, misaligned hole sequence, missing hole or abnormal hole shape, and hole position verification results are generated.

[0120] This embodiment specifically includes: Based on the hole location topology consistency matching results, generate consistency correction base data.

[0121] In Example 1, the matching set of nodes, the set of unmatched template nodes, and the set of unmatched test nodes are parsed from the hole position topology consistency matching results to determine the correspondence of matched topology nodes, unmatched template holes, and unmatched test holes.

[0122] From the set of node geometric deviations, the set of edge matching relationships, and the set of topological edge attribute deviations, extract the hole center coordinate deviation, hole diameter deviation, and hole area deviation for each node matching relationship, as well as the distance deviation, hole group center offset deviation, and hole group arrangement direction deviation for each edge matching relationship.

[0123] Based on the manufacturing tolerance ranges corresponding to the template hole center coordinates, template hole diameter, template hole area, and distance between each hole center in the standard magnetic core hole template, determine the allowable deviation ranges for the hole center coordinates, hole diameter, hole area, and hole distance.

[0124] The corresponding relationships, unmatched template hole positions, unmatched test hole positions, hole center coordinate deviation, hole diameter deviation, hole area deviation, distance deviation, hole group center offset deviation and hole group arrangement direction deviation, hole center coordinate allowable deviation range, hole diameter allowable deviation range, hole area allowable deviation range and hole spacing allowable deviation range are correlated and organized to generate basic data for consistency correction.

[0125] Based on the set of node matching relationships and the set of node geometric deviations in the consistency correction base data, consistency correction is performed on the hole center coordinates, hole diameter, and hole area to obtain the corrected hole center coordinates, corrected hole diameter, and corrected hole area.

[0126] In Example 1, for each node matching relationship, it is determined whether the hole center coordinate deviation, hole diameter deviation and hole area deviation corresponding to the node matching relationship are within the allowable deviation range of hole center coordinate, allowable deviation range of hole diameter and allowable deviation range of hole area in the consistency correction basic data.

[0127] When the deviations in the center coordinates, diameter, and area of ​​the hole corresponding to the node matching relationship are within the allowable deviation ranges for the center coordinates, diameter, and area, the center coordinates, diameter, and area of ​​the hole corresponding to the topology node to be tested are retained as the corrected center coordinates, corrected diameter, and corrected area. When the deviations in the center coordinates, diameter, and area of ​​the hole corresponding to the node matching relationship exceed the allowable deviation ranges for the center coordinates, diameter, and area, consistency correction is performed on the center coordinates, diameter, and area of ​​the hole corresponding to the topology node to be tested based on the template center coordinates, template diameter, and template area of ​​the corresponding template topology node, resulting in the corrected center coordinates, corrected diameter, and corrected area.

[0128] Based on the node matching relationship set, the corrected hole center coordinates, and the corrected hole diameter in the consistency correction base data, consistency correction is performed on the hole region segmentation mask to obtain the corrected hole region segmentation mask.

[0129] In Example 1, for each node matching relationship, the hole connection region associated with the topology node to be tested corresponding to the node matching relationship is determined as the hole connection region to be corrected; the corrected hole center coordinates are determined as the corrected hole center position, and half of the corrected hole diameter is determined as the corrected hole radius.

[0130] Within the main body region of the magnetic core, calculate the pixel distance from the connected region of the hole to be corrected and its neighboring pixel positions to the center position of the corrected hole; set the binary value of the pixel positions whose pixel distance is less than or equal to the radius of the corrected hole in the hole region segmentation mask to 1, and set the binary value of the pixel positions that belong to the connected region of the hole to be corrected and whose pixel distance is greater than the radius of the corrected hole in the hole region segmentation mask to 0; after completing the mask binary update corresponding to all node matching relationships, the corrected hole region segmentation mask is obtained.

[0131] Based on the set of node geometric deviations and the set of topological edge attribute deviations in the consistency correction base data, it is determined whether the manganese zinc ferrite core to be tested has hole position offset, hole spacing abnormality or hole shape abnormality.

[0132] In Example 1, for each node matching relationship, the hole center coordinate deviation corresponding to the node geometric deviation set is compared with the allowable deviation range of the hole center coordinate: if the hole center coordinate deviation exceeds the allowable deviation range of the hole center coordinate, the manganese zinc ferrite core to be tested is determined to have hole position offset, otherwise it is determined to have no hole position offset.

[0133] For each edge matching relationship, the distance deviation corresponding to the topological edge attribute deviation set is compared with the allowable deviation range of hole spacing: if the distance deviation exceeds the allowable deviation range of hole spacing, the manganese zinc ferrite core to be tested is determined to have an abnormal hole spacing, otherwise it is determined to not have an abnormal hole spacing.

[0134] For each node matching relationship, the corresponding aperture deviation and aperture area deviation in the node geometric deviation set are compared with the aperture allowable deviation range and aperture area allowable deviation range, respectively. If the aperture deviation or aperture area deviation exceeds the corresponding allowable deviation range, the manganese zinc ferrite core to be tested is determined to have an aperture shape abnormality, otherwise it is determined to have no aperture shape abnormality.

[0135] Based on the set of matching node relationships, the set of unmatched template nodes, and the set of unmatched nodes to be tested in the consistency correction basic data, it is determined whether the manganese zinc ferrite core to be tested has misaligned hole order or missing holes.

[0136] In Example 1, when the node number of the topological node to be tested in the node matching relationship set does not form a continuous correspondence with the template node number of the template topological node according to the spatial order in the core coordinate system, the manganese-zinc ferrite core to be tested is determined to have a hole sequence misalignment; when the unmatched template node set is not empty, the manganese-zinc ferrite core to be tested is determined to have a missing hole; when the unmatched test node set is not empty, the test hole position corresponding to the unmatched test node set is marked as a hole sequence misalignment associated hole position.

[0137] Based on the consistency correction base data, the corrected hole region segmentation mask, the corrected hole center coordinates, the corrected hole diameter, and the corrected hole area, hole position anomaly judgment information is generated.

[0138] In Example 1, for each hole-connected region, the corresponding corrected hole center coordinates, corrected hole diameter, corrected hole area, and corrected hole region segmentation mask are associated to establish a corresponding hole position anomaly marker item.

[0139] Anomaly marking is performed based on the consistency correction baseline data: For node matching relationships, when the hole center coordinate deviation triggers the hole position offset judgment result, the corresponding hole position anomaly marker is marked as hole position offset; when the hole diameter deviation or hole area deviation triggers the hole shape anomaly judgment result, it is marked as hole shape anomaly.

[0140] When the node matching relationship set triggers the hole sequence misalignment judgment result, the corresponding hole position abnormality mark item that does not satisfy the spatial sequence continuous correspondence relationship in the magnetic core coordinate system is marked as hole sequence misalignment.

[0141] For edge matching relationships, when the distance deviation triggers the hole spacing anomaly judgment result, the hole position anomaly marker item of the connected area of ​​the two holes will be marked as the hole spacing anomaly associated item.

[0142] When the set of unmatched template nodes is not empty, the corresponding template hole position is marked as missing hole; when the set of unmatched test nodes is not empty, the corresponding test hole position is marked as a hole position with misaligned hole order.

[0143] All hole position anomaly markers, missing hole markers, and misaligned hole position markers are arranged in spatial order according to the magnetic core coordinate system, and then associated and encapsulated with the consistency correction base data to generate hole position anomaly judgment information.

[0144] refer to Figure 3 Based on the hole position anomaly determination information, hole position verification results are generated.

[0145] In Example 1, when the hole position anomaly determination information does not mark hole position offset, hole spacing anomaly, hole sequence misalignment, hole missing, and hole shape anomaly, and does not mark the hole position associated with hole sequence misalignment, a hole position qualification verification result is generated.

[0146] When the hole position anomaly determination information marks at least one of the following anomalies: hole position offset, hole spacing anomaly, hole sequence misalignment, hole missing, or hole shape anomaly, or marks a hole position associated with a hole sequence misalignment, a hole position anomaly verification result is generated. The hole position qualified verification result or the hole position anomaly verification result is associated and encapsulated with the corrected hole area segmentation mask, the corrected hole center coordinates, the corrected hole diameter, the corrected hole area, the hole position topology consistency matching result, and the hole position anomaly determination information to generate a hole position verification result.

[0147] Example 2: A manganese-zinc ferrite core hole position image verification system, used to execute a manganese-zinc ferrite core hole position image verification method, including: The acquisition module is used to acquire raw magnetic core images and preprocess them to obtain preprocessed magnetic core images; The localization module is used to input the preprocessed magnetic core image into the improved BiRefNet, extract multi-scale localization features, and obtain the first segmentation feature map; The reconstruction module is used to perform bidirectional consistency reconstruction of the first segmentation feature map, and to fuse the internal reference features of the hole, the external reference features of the hole edge, and the topological constraint relationship of the hole position to generate the second segmentation feature map. The prediction module is used to output a hole region segmentation mask, a hole edge boundary response map, and a magnetic core body segmentation mask based on the second segmentation feature map; The measurement module is used to determine the main body area of ​​the magnetic core, extract the connected area of ​​the hole and the contour point set of the hole edge, and calculate the coordinates of the hole center, the hole diameter and the hole area; The mapping module is used to establish topological nodes and topological edge attributes, and construct a topological map of the bore locations in the magnetic core to be tested. The matching module is used to call the standard magnetic core hole position template, obtain the template hole position topology map, and output the hole position topology consistency matching result; The verification module is used to perform consistency correction and determine hole position offset, abnormal hole spacing, misaligned hole sequence, missing holes, or abnormal hole shape, and generate hole position verification results.

[0148] Example 3: After sintering, grinding, and drilling, the manganese-zinc ferrite core under test enters the image verification station. The core surface is dark gray, and some samples show dust adhesion, sintered particle texture, shadows at the hole edges, local reflections, and slight chipping at the hole edges. The core under test has a porous structure. The standard core hole template contains 8 holes arranged in a regular array. The template hole diameter for a single hole is approximately 86 pixels, and the hole spacing is approximately 318 pixels. In continuous batch testing, the implementers found that the traditional threshold segmentation method, when the core surface texture is heavy or the hole edge reflection is strong, will identify local dark spots as false holes and will also segment the hole edge damage location into multiple discontinuous boundaries, resulting in unstable calculation results for hole center coordinates, hole diameter, and hole area.

[0149] In this embodiment, the implementer prepared 12,800 images of manganese-zinc ferrite cores as samples, including 8,960 training samples, 1,920 verification samples, and 1,920 test samples. Among the training samples, there were 4,860 samples with normal hole positions, 1,350 samples with offset hole positions, 920 samples with abnormal hole spacing, 510 samples with misaligned hole sequences, 670 samples with missing holes, and 650 samples with abnormal hole shapes. Each training sample included the original core image, annotations of the core body area, hole area area, hole edge boundary, hole center coordinates, hole diameter, hole area, and the corresponding standard core hole position template. The training samples contained varying degrees of dust occlusion, localized reflections, hole edge shadows, and sintering textures. Approximately 28% of the samples had obvious dust particles, approximately 19% had hole edge reflections, approximately 14% had slight hole edge damage, and approximately 11% had shadows on the core body edge.

[0150] In one batch of tests, the system received a manganese-zinc ferrite core to be tested. The original core image resolution was 2448×2048 pixels. The core body was located in the lower center of the image, occupying approximately 61.7% of the entire image. In the image, a hole near the top left side of the top row showed a slight offset, and a hole near the middle of the bottom row had a localized chipping at its edge. A dust spot was present on the right side of the core body, with a grayscale level close to that of the hole's interior. Traditional methods, after grayscale thresholding and edge detection, detected 10 candidate holes, of which 8 were real holes and 2 were pseudo-holes formed by dust spots and edge breakage. The method of this invention, after core body segmentation mask constraints, hole region segmentation mask extraction, and hole edge boundary response map constraints, ultimately extracted 8 connected hole regions, consistent with the number of 8 holes in the standard core hole template.

[0151] After preprocessing, the standard deviation of the background grayscale in the original magnetic core image decreased from 23.6 to 8.9, the mean grayscale value of the main magnetic core region increased from 118.4 to 131.7, and the average grayscale difference between the internal region of the hole and the main magnetic core region increased from 42.3 to 57.8. Traditional methods achieve a Dice coefficient of 0.884 for hole region segmentation and 0.936 for the main magnetic core segmentation in the image; the method of this invention achieves a Dice coefficient of 0.963 for hole region segmentation and 0.984 for the main magnetic core segmentation in the same image. For dust-spotted areas, the candidate hole response given by traditional methods is equivalent to 73.2% of the actual hole response. After bidirectional reconstruction with topological constraints at the hole edge, the method of this invention reduces the hole response in the region to 21.5% of the actual hole response, and no connected hole regions are formed.

[0152] During sample segmentation, after the localization module outputs the first segmentation feature map, the average response of the internal reference features of the hole to the actual internal region of the hole is 0.87, and the average response of the external reference features of the hole edge to the magnetic core body region is 0.79. After the hole edge topological constraint bidirectional reconstruction module introduces the hole position topological constraint relationship in the standard magnetic core hole position template, the response of the second segmentation feature near the 8 actual hole positions remains above 0.81, while the response near the dust dark spot decreases from 0.64 to 0.18. After the predictor outputs the hole region segmentation mask, the hole edge boundary response map, and the magnetic core body segmentation mask, the area of ​​the magnetic core body segmentation mask is 1,261,480 pixels, and the areas of the 8 hole connected regions in the hole region segmentation mask are 5814, 5762, 5946, 5798, 5510, 5873, 5821, and 5905 pixels, respectively. Traditional methods yield 10 connected regions in the same image, with two pseudo-holes having areas of 1386 and 926 pixels respectively, which can easily lead to errors in subsequent hole order determination.

[0153] In the calculation of hole center coordinates, hole diameter, and hole area, the method of this invention combines the hole edge boundary response map to determine the hole edge contour point set and hole edge contour weights. The number of hole edge contour points in the eight connected regions are 274, 268, 281, 270, 263, 276, 272, and 279, respectively. Taking a hole with edge defects as an example, the traditional method, using ordinary contour fitting, deviates from the manually labeled hole center coordinates by 4.8 pixels, the hole diameter error is 5.1 pixels, and the relative error of the hole area is 8.4%. After performing a weighted average calculation of the horizontal pixel coordinates, vertical pixel coordinates, and pixel distance according to the hole edge contour weights, the deviation of the hole center coordinates is reduced to 1.2 pixels, the hole diameter error is reduced to 1.4 pixels, and the relative error of the hole area is reduced to 2.3%. On the eight holes in the entire image, the average error of the hole center coordinates of the traditional method is 3.57 pixels, while the average error of the hole center coordinates of the method of the present invention is 0.96 pixels; the average error of the hole diameter of the traditional method is 2.91 pixels, while the average error of the hole diameter of the method of the present invention is 1.07 pixels.

[0154] When constructing the topology map of the hole positions in the magnetic core under test, the method of this invention determines the magnetic core coordinate system based on the magnetic core body segmentation mask. The center position of the magnetic core body region of the sample is approximately 1227.6 pixels and 1034.2 pixels in the image coordinates. The horizontal axis of the magnetic core coordinate system makes an angle of 1.8 degrees with the horizontal direction of the image, indicating that the sample has a slight rotation in the fixture. After mapping the center coordinates of the holes corresponding to the eight hole connection regions to the magnetic core coordinate system, the system establishes eight topology nodes according to the spatial order in the magnetic core coordinate system. The distance between the center of the holes of the topology nodes under test is used as part of the topology edge attribute. The distances between adjacent holes in the upper row are 317.2 pixels, 318.5 pixels, and 322.9 pixels, respectively, and the distances between adjacent holes in the lower row are 316.8 pixels, 319.1 pixels, and 318.2 pixels, respectively. The corresponding hole distance in the standard magnetic core hole position template is 318.0 pixels, and the allowable hole distance deviation range is 3.0 pixels. It can be seen that the hole distance deviation of the third group in the upper row reaches 4.9 pixels, which exceeds the allowable hole distance deviation range.

[0155] During the hole position topology consistency matching process, the system calls the standard magnetic core hole position template corresponding to the sample specifications to obtain the template hole position topology map. The test magnetic core hole position topology map and the template hole position topology map establish a set of node matching relationships according to the spatial order in the magnetic core coordinate system. In the sample, all 8 test topology nodes form node matching relationships with 8 template topology nodes; the set of unmatched template nodes is empty, and the set of unmatched test nodes is also empty. The node geometric deviation set shows that the hole center coordinate deviation of the second test topology node is 3.6 pixels, exceeding the allowable deviation range of 2.5 pixels; the hole diameter deviation of the fifth test topology node is 2.8 pixels, exceeding the allowable deviation range of 2.0 pixels; and the hole area deviation of the fifth test topology node is 5.7%, exceeding the allowable deviation range of 4.5%. The topology edge attribute deviation set shows that the distance deviation between the third and fourth nodes is 4.9 pixels, exceeding the allowable deviation range of 3.0 pixels.

[0156] Based on the consistency matching results, the system generates basic consistency correction data and performs consistency correction on the hole center coordinates, hole diameter, hole area, and hole region segmentation mask. The second hole position is marked as hole position offset because its hole center coordinate deviation exceeds the allowable deviation range; the fifth hole position is marked as hole shape anomaly because its hole diameter and hole area deviations exceed the corresponding allowable deviation ranges; the distance between the third and fourth nodes exceeds the allowable deviation range for hole spacing and is marked as a hole spacing anomaly correlation item. After correction, the hole center coordinate deviation of the second hole position is corrected from 3.6 pixels to 1.1 pixels, the hole diameter error of the fifth hole position is corrected from 2.8 pixels to 1.0 pixel, and the relative error of the hole area of ​​the fifth hole position is corrected from 5.7% to 2.1%. The hole position verification result generated by the system is the hole position anomaly verification result, and the hole position offset, hole spacing anomaly correlation item, and hole shape anomaly are recorded in the hole position anomaly judgment information.

[0157] In another sample with missing holes, the standard core hole template contains 8 template holes, but only 7 hole-connected regions are actually formed in the image. Traditional methods, due to dust spots being misidentified as false holes, still result in 8 candidate connected regions, incorrectly outputting a qualified hole position. Using the method of this invention, dust spots within the core body region fail to pass the hole position topology consistency matching. If a template hole appears in the set of unmatched template nodes, the system will determine it as a missing hole. In this sample, the number of matched nodes for hole missing determination is 7, the number of unmatched template holes is 1, and the number of unmatched test holes is 0, ultimately outputting a hole position anomaly verification result. In a sample with misaligned hole order, the number of test topology nodes and template topology nodes are both 8, but the node numbers and template node numbers do not correspond continuously in the spatial order of the core coordinate system. The system marks the corresponding hole position anomaly as misaligned. Traditional methods only compare the single hole diameter and hole center coordinates, failing to identify samples with misaligned hole order and outputting a qualified hole position.

[0158] The comparison data between the method of this invention and the traditional method in the complete test sample are as follows: For 1000 test samples with normal hole positions, the traditional method correctly identified 921 samples, while the method of this invention correctly identified 976 samples; for 300 test samples with hole position offsets, the traditional method correctly identified 254 samples, while the method of this invention correctly identified 288 samples; for 200 test samples with abnormal hole spacing, the traditional method correctly identified 161 samples, while the method of this invention correctly identified 191 samples; for 130 test samples with misaligned hole sequences, the traditional method correctly identified 96 samples, while the method of this invention correctly identified 123 samples; for 150 test samples with missing holes, the traditional method correctly identified 128 samples, while the method of this invention correctly identified 146 samples; for 150 test samples with abnormal hole shapes, the traditional method correctly identified 117 samples, while the method of this invention correctly identified 142 samples. After comprehensive calculation, the overall anomaly identification accuracy rate of the traditional method is 83.0%, while the overall anomaly identification accuracy rate of the method of this invention is 95.7%.

[0159] Regarding segmentation and geometric measurement indicators, the Dice coefficient for hole region segmentation using the traditional method is 0.902, while that using the method of this invention is 0.961; the average positioning error of the hole edge boundary using the traditional method is 2.46 pixels, while that using the method of this invention is 0.88 pixels; the average error of the hole center coordinates using the traditional method is 3.42 pixels, while that using the method of this invention is 0.97 pixels; the average error of the hole diameter using the traditional method is 2.84 pixels, while that using the method of this invention is 1.09 pixels; and the average relative error of the hole area using the traditional method is 6.68%, while that using the method of this invention is 2.21%. In terms of misjudgment, the false hole false detection rate using the traditional method is 7.6%, while that using the method of this invention is 1.2%; the hole missed detection rate using the traditional method is 4.8%, while that using the method of this invention is 1.1%; the hole position qualification false judgment rate using the traditional method is 5.4%, while that using the method of this invention is 0.8%; and the hole position abnormality missed judgment rate using the traditional method is 6.9%, while that using the method of this invention is 1.5%.

[0160] In terms of processing efficiency, the traditional method has an average processing time of 41.3 milliseconds per image, while the method of this invention has an average processing time of 48.1 milliseconds per image. The method of this invention increases the processing time by approximately 6.8 milliseconds due to the introduction of improved BiRefNet, bidirectional reconstruction of hole edge topology constraints, construction of the topological map of the hole position in the tested magnetic core, and hole position topology consistency matching. However, in continuous verification batches, the traditional method requires an average of about 76 manual verifications per 1000 samples, while the method of this invention requires an average of about 18 manual verifications per 1000 samples, significantly reducing the number of verifications required.

[0161] 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. A method for verifying the hole position image of a manganese-zinc ferrite core, characterized in that, include: The original core image of the manganese-zinc ferrite core to be tested is acquired, and preprocessing is performed to obtain the preprocessed core image; The preprocessed magnetic core image is input into the improved BiRefNet, and the localization module extracts multi-scale localization features to obtain the first segmentation feature map. Perform bidirectional consistency reconstruction on the first segmentation feature map to generate the second segmentation feature map; Based on the second segmentation feature map, the predictor outputs a hole region segmentation mask, a hole edge boundary response map, and a core body segmentation mask. The main body region of the manganese-zinc ferrite core to be detected in the preprocessed core image is determined by the core body segmentation mask. Each hole connected region is extracted in the core body region by the hole region segmentation mask. The hole edge boundary response map is combined to determine the hole edge contour point set corresponding to each hole connected region. The hole center coordinates, hole diameter and hole area are calculated. Based on the coordinates of the hole center, the hole diameter, and the hole area, a topological map of the hole positions of the magnetic core to be tested is constructed according to the magnetic core body segmentation mask. Call the standard magnetic core hole position template to obtain the template hole position topology map, perform consistency matching between the test magnetic core hole position topology map and the template hole position topology map, and output the hole position topology consistency matching result; Based on the hole position topology consistency matching results, the hole region segmentation mask, hole center coordinates, hole diameter and hole area are corrected for consistency. The system determines whether the manganese zinc ferrite core under test has hole position offset, abnormal hole spacing, misaligned hole sequence, missing hole or abnormal hole shape, and generates hole position verification results.

2. The method for verifying the hole position image of a manganese-zinc ferrite core according to claim 1, characterized in that, The preprocessing includes distortion correction, illumination equalization, scale normalization, and noise suppression.

3. The method for verifying the hole position image of a manganese-zinc ferrite core according to claim 1, characterized in that, The improved BiRefNet, which inputs the preprocessed magnetic core image into a localization module, a hole edge topological constraint bidirectional reconstruction module, and a predictor, includes: The preprocessed magnetic core image is input into the localization module of the improved BiRefNet. After normalization, image embedding and position encoding, the elements are added together to generate the initial localization features. Based on the initial positioning features, hierarchical feature extraction is performed along different spatial resolutions to obtain multi-scale positioning features at multiple positioning scales. Channel-unified processing is performed on the multi-scale positioning features to obtain channel-unified positioning features, and spatial alignment processing is performed at each positioning scale to obtain spatially aligned positioning features; Scale fusion processing is performed on spatial alignment positioning features at multiple positioning scales to obtain multi-scale fused positioning features; The multi-scale fused localization features are input into the segmentation feature mapping layer, and the mapping output is subjected to feature normalization processing to generate the first segmentation feature map.

4. The method for verifying the hole position image of a manganese-zinc ferrite core according to claim 1, characterized in that, The bidirectional consistency reconstruction of the first segmentation feature map using the hole edge topological constraint bidirectional reconstruction module includes: The first segmentation feature map is input into the hole edge topological constraint bidirectional reconstruction module, and the hole internal response mapping and hole edge external response mapping are performed respectively to generate hole internal response map and hole edge external response map; Based on the first segmentation feature map, and according to the response map inside the hole and the response map outside the hole edge, reference features inside the hole and reference features outside the hole edge are generated. Based on the topological constraints of the holes in the standard magnetic core hole template, the set of standard hole core grid positions, the set of standard hole adjacent edges, and the arrangement direction of the standard hole group are determined in the two-dimensional normalized feature grid coordinate domain corresponding to the first segmentation feature map. Based on the set of standard hole center grid positions, the set of standard hole adjacent edges, and the standard hole group arrangement direction, Gaussian response map of standard hole position, response map of standard hole adjacent line, and direction consistency response map of standard hole group are generated respectively. The Gaussian response map of standard hole location, the response map of adjacent connection of standard hole location, and the directional consistency response map of standard hole group are weighted and fused to generate a hole location topological constraint weight map. Based on the topological constraint weight map of the hole, a bidirectional consistency reconstruction is performed on the internal reference features and external reference features of the hole edge to generate bidirectional reconstruction features of the hole edge topology. In Example 1, the topological constraint weight map of the hole location is multiplied element-wise with the reference feature inside the hole according to the feature mesh to obtain the topological constraint feature inside the hole. The reconstructed features of the pore edge topology are subjected to reconstruction feature mapping and feature normalization to generate a second segmentation feature map.

5. The method for verifying the hole position image of a manganese-zinc ferrite core according to claim 1, characterized in that, The process of outputting a hole region segmentation mask, a hole edge boundary response map, and a core body segmentation mask based on the second segmentation feature map in the predictor includes: The second segmentation feature map is input into the predictor, and image size restoration processing is performed on the second segmentation feature map to obtain the size-restored segmentation feature map. Based on the size recovery segmentation feature map, the hole region segmentation mapping, hole edge boundary response mapping, and core body segmentation mapping are performed respectively to obtain the unnormalized response map of the hole region, the unnormalized response map of the hole edge boundary, and the unnormalized response map of the core body. Normalization processing was performed on the unnormalized response maps of the hole region, the hole edge boundary, and the magnetic core body, respectively, to obtain the normalized response maps of the hole region, the hole edge boundary, and the magnetic core body. A core segmentation mask is generated based on the normalized response map of the core body. A binary hard constraint is applied to the normalized response map of the hole region using the core body segmentation mask, and a continuous response constraint is applied to the normalized response map of the hole edge boundary using the core body segmentation mask, thereby generating the hole region segmentation mask and the hole edge boundary response map.

6. The method for verifying the hole position image of a manganese-zinc ferrite core according to claim 1, characterized in that, The step of determining the main body region of the manganese-zinc ferrite core to be detected in the preprocessed core image based on the core body segmentation mask includes: Based on the core body segmentation mask, the core body region of the manganese zinc ferrite core to be detected in the preprocessed core image is determined; Based on the mask segmentation of the hole region, extract the connected region of each hole in the main body region of the magnetic core; By combining the response map of the hole edge boundary, the set of hole edge contour points and the corresponding hole edge contour weights are determined for each hole connected region. Based on the hole edge contour point set and hole edge contour weight, calculate the hole center coordinates and hole diameter corresponding to each hole connected region; Based on the connected regions of holes, the hole area corresponding to each connected region is calculated, and the hole center coordinates, hole diameter and hole area are encapsulated accordingly.

7. The method for verifying the hole position image of a manganese-zinc ferrite core according to claim 1, characterized in that, The step of establishing topological nodes by assigning the center coordinates, aperture, and area of ​​the bore according to the spatial order in the core coordinate system determined by the core body segmentation mask includes: Based on the core body segmentation mask, the core coordinate system is determined, and the hole center coordinates are mapped to the core coordinate system to obtain the hole center coordinates in the core coordinate system; According to the spatial order in the core coordinate system, the hole center coordinates, hole diameter and hole area in the core coordinate system are sorted to obtain the sorted hole position geometric parameters. Based on the sorted hole position geometric parameters, establish a set of topological nodes; Calculate the distance between each hole center based on the hole center coordinates in the core coordinate system of the topological node set; Based on the core coordinates of the holes in the topological node set, the offset of the hole group center and the arrangement direction of the hole group are determined. The distance between each hole center, the offset of the hole group center, and the arrangement direction of the hole group are used as topological edge attributes to construct the topological map of the hole positions of the magnetic core to be tested.

8. The method for verifying the hole position image of a manganese-zinc ferrite core according to claim 1, characterized in that, The step of calling the standard magnetic core hole position template and obtaining the template hole position topology map includes: Call the standard magnetic core hole position template to obtain the template hole position topology diagram; According to the spatial order in the magnetic core coordinate system, establish the node matching relationship between the topology map of the hole position of the magnetic core to be tested and the topology map of the hole position of the template, and obtain the set of node matching relationships; Based on the set of node matching relationships, determine the set of unmatched template nodes and the set of unmatched test nodes; Based on the node matching relationship, the node geometric deviation between the topology node to be tested and the template topology node is calculated to obtain the node geometric deviation set. Based on node matching relationships and topological edge attributes, the topological edge attribute deviation between the topological map of the hole position of the magnetic core to be tested and the topological map of the hole position of the template is calculated, and the set of topological edge attribute deviations is obtained. The set of matching node relationships, the set of unmatched template nodes, the set of unmatched nodes to be tested, the set of node geometric deviations, the set of edge matching relationships, and the set of topological edge attribute deviations are associated and encapsulated to generate the hole position topological consistency matching result.

9. The method for verifying the hole position image of a manganese-zinc ferrite core according to claim 1, characterized in that, The process of performing consistency correction on the hole region segmentation mask, hole center coordinates, hole diameter, and hole area based on the hole position topology consistency matching results includes: Based on the hole location topology consistency matching results, generate consistency correction base data; Based on the set of node matching relationships and the set of node geometric deviations in the consistency correction base data, consistency correction is performed on the hole center coordinates, hole diameter and hole area to obtain the corrected hole center coordinates, corrected hole diameter and corrected hole area. Based on the node matching relationship set, the corrected hole center coordinates and the corrected hole diameter in the consistency correction base data, the hole region segmentation mask is subjected to consistency correction to obtain the corrected hole region segmentation mask. Based on the set of node geometric deviations and the set of topological edge attribute deviations in the consistency correction basic data, it is determined whether the manganese-zinc ferrite core to be tested has hole position offset, abnormal hole spacing or abnormal hole shape. Based on the node matching relationship set, unmatched template node set, and unmatched test node set in the consistency correction basic data, it is determined whether the manganese zinc ferrite core to be tested has a hole sequence misalignment or missing holes. Based on the consistency correction base data, the corrected hole region segmentation mask, the corrected hole center coordinates, the corrected hole diameter, and the corrected hole area, hole position anomaly judgment information is generated. Based on the hole position anomaly determination information, generate hole position verification results.

10. A manganese-zinc ferrite core hole position image verification system, used to execute the manganese-zinc ferrite core hole position image verification method according to any one of claims 1-9, characterized in that, include: The acquisition module is used to acquire raw magnetic core images and preprocess them to obtain preprocessed magnetic core images; The localization module is used to input the preprocessed magnetic core image into the improved BiRefNet, extract multi-scale localization features, and obtain the first segmentation feature map; The reconstruction module is used to perform bidirectional consistency reconstruction of the first segmentation feature map, and to fuse the internal reference features of the hole, the external reference features of the hole edge, and the topological constraint relationship of the hole position to generate the second segmentation feature map. The prediction module is used to output a hole region segmentation mask, a hole edge boundary response map, and a magnetic core body segmentation mask based on the second segmentation feature map; The measurement module is used to determine the main body area of ​​the magnetic core, extract the connected area of ​​the hole and the contour point set of the hole edge, and calculate the coordinates of the hole center, the hole diameter and the hole area; The mapping module is used to establish topological nodes and topological edge attributes, and construct a topological map of the bore locations in the magnetic core to be tested. The matching module is used to call the standard magnetic core hole position template, obtain the template hole position topology map, and output the hole position topology consistency matching result; The verification module is used to perform consistency correction and determine hole position offset, abnormal hole spacing, misaligned hole sequence, missing holes, or abnormal hole shape, and generate hole position verification results.