Hard alloy crystal phase boundary analysis method

By combining the neural network model and the multi-level fusion attention module, efficient and accurate analysis of the crystal phase boundaries of cemented carbide images is achieved, which solves the problem of low efficiency in existing technologies and improves segmentation accuracy and processing speed.

CN120725949APending Publication Date: 2025-09-30SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410373771.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-29
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

The existing cemented carbide image crystal boundary analysis method is inefficient, especially time-consuming when there are many small grains, and lacks an efficient and accurate analysis method.

Method used

An automatic analysis method of cemented carbide crystal phase boundaries based on a neural network model is adopted. The multi-level fusion attention module (MFAM) and MF-Net of the UNet network are used, combined with a specific loss function and a deep learning algorithm to achieve automatic recognition of tungsten carbide segmentation images and accurate positioning of crystal phase boundaries.

Benefits of technology

The efficient and accurate analysis of crystal phase boundaries in cemented carbide images is achieved, and the processing speed and segmentation accuracy are improved, especially the segmentation ability in images with uneven illumination and contrast differences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004766419740000021
    Figure BDA0004766419740000021
  • Figure BDA0004766419740000051
    Figure BDA0004766419740000051
  • Figure BDA0004766419740000052
    Figure BDA0004766419740000052
Patent Text Reader

Abstract

The invention discloses a hard alloy crystal phase boundary analysis method. The method mainly comprises the following eight steps: (1) constructing a hard alloy image data set; (2) constructing a multi-level fusion attention module; (3) designing a total loss function Ltrain of the MF-Net network; (4) reasoning to obtain a tungsten carbide grain instance segmentation image based on the data set, the network model and the loss function; (5) generating a crystal phase boundary marking line Ai on the hard alloy image according to the result of the step (4); (6) calculating a key point Gi (X, Y) of each line segment Ci according to the result of the step (5); (7) enabling the key point Gi generated in the step (6) to correspond to the semantic segmentation image of the tungsten carbide crystal grains, and counting the number NR of pixels belonging to tungsten carbide in a radius R pixel taking the corresponding point as an original point; and (8) dividing a crystal boundary point and a phase boundary point according to a result of the step (7) and a crystal phase boundary threshold value. According to the method, the crystal phase boundary analysis of the hard alloy image can be quickly and accurately completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention provides a cemented carbide crystal phase boundary analysis method, in particular to a cemented carbide image crystal phase boundary analysis method, belonging to the technical field of image segmentation. Background Art

[0002] Cemented carbide is a composite material made by sintering tungsten carbide and a binder phase. It is widely used in mechanical processing, mining, oil and gas drilling, powder metallurgy, aerospace and other fields. In the initial stage of sintering, there is no continuous contact between tungsten carbides. However, during high-temperature sintering, the contact between tungsten carbides increases, forming a continuous tungsten carbide skeleton. In addition to the areas of contact with tungsten carbide, the rest of the tungsten carbide is in contact with the binder phase. The areas where tungsten carbide contacts tungsten carbide are grain boundaries, and the areas where tungsten carbide contacts the binder phase are phase boundaries. The distribution of crystal phase boundaries in cemented carbide determines the mechanical properties of cemented carbide products. Therefore, the ability to accurately and quickly analyze the distribution of crystal phase boundaries in cemented carbide images has very important practical application significance.

[0003] Currently, methods for analyzing phase boundaries in cemented carbide images primarily rely on manually demarcating grain boundaries and phase boundaries, resulting in low analysis efficiency. Furthermore, this method is time-consuming when determining phase boundaries in cemented carbide images containing numerous small grains. Current research has yet to develop a method for efficient and accurate analysis of cemented carbide images.

[0004] In response to this demand, the present invention proposes and implements an efficient and accurate analysis method. Summary of the Invention

[0005] The present invention proposes an automatic analysis method for cemented carbide crystal phase boundaries based on tungsten carbide segmentation images. The purpose is to use a neural network model to obtain a more accurate tungsten carbide segmentation image, and then combine it with the crystal phase boundary analysis method to realize the automatic identification of grain boundaries and phase boundaries in cemented carbide images.

[0006] The cemented carbide crystal phase boundary analysis method provided by the present invention comprises the following steps:

[0007] (1) Constructing a cemented carbide image dataset;

[0008] (2) In order to highlight the key features related to the segmentation target, reduce the background interference close to the target, and optimize the segmentation effect between targets, so that the segmentation model can more effectively distinguish pixels of different categories in the image, a multi-level fusion attention module (MFAM) is constructed and MF-Net based on the UNet network is designed;

[0009] (3) In order to improve the segmentation ability of MF-Net for images with uneven illumination and contrast differences, the total loss function L of the MF-Net network is designed. train ;

[0010] (4) Based on the above dataset, network model and loss function, the segmentation image of the tungsten carbide grain instance is obtained by inference;

[0011] (5) Generate a crystal boundary marking line A on the cemented carbide image based on the result of (4) i ;

[0012] (6) Calculate each line segment C based on the result of (5) i The key point G i (X,Y);

[0013] (7) The key point G generated by (6) i Corresponding to the semantic segmentation image of tungsten carbide grains, the number of pixels N belonging to tungsten carbide within the radius R pixels with the corresponding point as the origin is counted. R ;

[0014] (8) Based on the results of (7) and the crystal phase boundary threshold, the grain boundary points and phase boundary points are divided.

[0015] In the above technical solution of the present invention, the multi-level fusion attention module constructed in the step (2) is composed of channel attention, spatial attention and self-attention. ① The main function of channel attention is to compress the features of the feature map in the channel dimension, and weight each channel using the learned weight parameters; ② The main function of spatial attention is to enhance the spatial information of the feature map after the channel attention; ③ The main function of self-attention is to remodel the input sequence of Query, Key, and Value feature maps through linear transformation, and can automatically determine which information of the cemented carbide image should be paid attention to at different positions; through the effective combination of the three attention modules, the multi-level fusion attention module can highlight the key features related to the segmentation target, reduce the background interference close to the target, and optimize the segmentation effect between targets, so that the segmentation model can more effectively distinguish pixels of different categories in the image.

[0016] In the above technical solution of the present invention, the training loss function L of the MF-Net network is constructed in step (3). train , which is defined as:

[0017] L train =αL BCE +βL Dice +c (1)

[0018] Among them L BCE is the binary cross entropy loss function, LDice is the Dice loss function, c represents a small constant that aims to make the loss function more stable numerically, α and β represent the weight hyperparameters assigned to their respective loss functions; L train It can improve MF-Net's segmentation ability for images with uneven illumination and contrast differences.

[0019] In the above technical solution of the present invention, the cemented carbide image crystal phase boundary marking line A in step (5) i The generation rules are as follows:

[0020] If the marker line A i The line segment (X i ,Y j )-(X i+p ,Y j+q ) corresponds to the tungsten carbide grain in the tungsten carbide grain segmentation image, and the part marked line is B i If the marker line A i The line segment (X i ,Y j )-(X i+p ,Y j+q ) corresponds to the bonding phase in the tungsten carbide grain segmentation image, and the marking line of this part is C i .

[0021] In the above technical solution of the present invention, the calculation line segment C in step (6) is i The following methods are used:

[0022] (1) Calculate line segment C i Find the upper left corner point L(X,Y) and the lower right corner point R(X,Y) of the maximum enclosing rectangle. i For a certain marked line A i A subset of

[0023] (2) Key point G i (X,Y) is calculated as:

[0024]

[0025] where X L 、Y L is the horizontal and vertical coordinates of point L, X R 、Y R are the horizontal and vertical coordinates of point R.

[0026] The following method is preferably used in calculating the maximum circumscribed rectangle of each line segment Ci:

[0027] (1) The boundary contour information of the line segment Ci is obtained by run-length encoding of the binary image. The run-length encoding records the area of ​​the image belonging to the line segment Ci, and the area is represented as a table with tables as elements. Each row of the image is represented as a subtable, whose first element is the row number, followed by an item consisting of two vertical coordinates, the first being the vertical coordinate (column number) of the start of the run, and the second being the vertical coordinate of the end of the run. There can be several such sequence items in a row, recorded as: (y, x_start, x_end);

[0028] (2) Because the line segment Ci is a pixel rectangle, by comparing the travel information of the subtable in (1), we can obtain the point L(X,Y) with the smallest row number and the smallest column number as the upper left corner of the line segment Ci, and the point R(X,Y) with the largest row number and the largest column number as the lower right corner of the line segment Ci.

[0029] In the above technical solution of the present invention, the semantic segmentation image of the tungsten carbide grains obtained in step (8) is preferably obtained by the following method:

[0030] DeepLabV3plus based on the MobileV2 backbone is trained on the cemented carbide image dataset to obtain semantic segmentation images consisting of two categories: tungsten carbide and binder phase.

[0031] In the above technical solution of the present invention, the utilization statistics N in step (8) is R The method for dividing grain boundary points and phase boundary points based on the crystal phase boundary threshold is as follows:

[0032] (1) Key point G i In the semantic segmentation image of tungsten carbide grains, the corresponding point is the origin and the total number of pixels within the radius R is M R , where the number of pixels belonging to tungsten carbide is N R , the crystal phase boundary threshold is K (value ranges from 0 to 1); calculate N R With M R The ratio of

[0033] (2) If N R With M R The ratio of is greater than K, then the key point G in the cemented carbide image i Marked as grain boundary point;

[0034] (3) If N R With M R If the ratio is less than or equal to K, then calculate the line segment C i Whether to generate a tungsten carbide grain boundary between tungsten carbide grain instances in the segmented image. i In the tungsten carbide grain segmentation image, the line segment C is located between two tungsten carbide grains. iThe two endpoints of are marked as the phase boundary points of the cemented carbide image; if the line segment C i In the tungsten carbide grain segmentation image, the line segment C is located between the boundaries of a tungsten carbide grain. i The two endpoints are not the phase boundary points of the cemented carbide image.

[0035] In the pair of line segments C i Whether the calculation generated between a tungsten carbide grain boundary in the tungsten carbide grain instance segmentation image is preferred to use the following method:

[0036] (1) According to line segment C i The upper left corner point L(X,Y) and the lower right corner point R(X,Y) are calculated in the segment C of the tungsten carbide grain instance segmentation image. i Point L'(X-1,Y) on the tungsten carbide grain at the left endpoint, line segment C i The right endpoint is point R'(X+1,Y) on the tungsten carbide grain.

[0037] (2) Taking the left grain point L'(X-1, Y) as the growth point and the grain boundary as the constraint condition, use the breadth-first algorithm (BFS) to find the right grain point R'(X+1, Y). If the point R'(X+1, Y) is found, then the line segment C i It is generated between the boundaries of a tungsten carbide grain in the tungsten carbide grain instance segmentation image; if the point R'(X+1,Y) is not found, then the line segment C i It is located between two tungsten carbide grains in the tungsten carbide grain instance segmentation image. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a segmented image of a tungsten carbide grain example in an embodiment of the present invention;

[0039] Figure 2 is a semantic segmentation image of tungsten carbide grains in an embodiment of the present invention;

[0040] Figure 3 is a crystal phase boundary marking line of a cemented carbide image in an embodiment of the present invention;

[0041] Figure 4 is a comparison of activation maps of the multi-level fusion attention module in an embodiment of the present invention;

[0042] Figure 5 This is a network structure diagram of the multi-level fusion attention module used in the present invention;

[0043] Figure 6 MF-Net neural network structure diagram used in the present invention;

[0044] Figure 7is the crystal phase boundary analysis result of the cemented carbide image in the embodiment of the present invention;

[0045] Figure 8 It is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0046] The present invention will be further described below with reference to specific embodiments and accompanying drawings:

[0047] Example:

[0048] To make the segmentation method of the present invention easier to understand and closer to real-world applications, the following is an overall description of the entire process from constructing a cemented carbide image to completing the crystal phase boundary analysis of the cemented carbide image, including the core segmentation method of the present invention. The specific steps are as follows:

[0049] (1) Considering the current computer processing speed and video memory, the original cemented carbide microscopic images were cropped into 512×512 pixel images in the horizontal and vertical directions. Considering that the cropped boundary particles of the small image may have post-inference splicing problems, a 256-pixel buffer area was set during the translation cropping. 51 original cemented carbide images were cropped and the dataset was expanded to obtain 3620 512×512 cemented carbide tungsten carbide instance segmentation image samples. There are 4896 image samples in the training set for the semantic segmentation of tungsten carbide grains.

[0050] (2) To verify that the multi-level fusion attention module can highlight the key features related to the segmentation target, reduce the background interference close to the target, and optimize the segmentation effect between targets, so that the segmentation model can more effectively distinguish pixels of different categories in the image. An image with uneven illumination is used for verification, and the activation maps of the fourth and sixth layers in the network during the image reasoning process are visualized. The results of the image segmentation with and without the module are compared. Figure 4 (The red circles in the figure represent the differences in segmentation effects); the network structure of the multi-level fusion attention module is as follows Figure 5 ; The neural network structure of MF-Net is as follows Figure 6 ; To study the segmentation performance of MF-Net for cemented carbide images, the segmentation performance of different methods was compared, as shown in Table 1; To verify the effectiveness of the weight hyperparameter setting in the loss function Ltrain, the segmentation performance of different weights α and β was compared, as shown in Table 2.

[0051] (3) Prepare a cemented carbide image to be segmented. The image format is jpg and the size is 1024×690. Use the MF-Net network trained on the dataset and the DeepLabV3plus network based on the MobileV2 backbone to infer the image to obtain the instance segmentation image and semantic segmentation image of tungsten carbide grains respectively; the instance segmentation image of tungsten carbide grains is as follows: Figure 1 , the semantic segmentation image of tungsten carbide grains is as follows Figure 2 .

[0052] (4) Generate the crystal phase boundary marking line A on the cemented carbide image based on the example segmentation image of the tungsten carbide grains i . A i The length is the image width, which includes B i with C i There are two types of line segments. i The line segment in the instance segmentation image corresponding to the tungsten carbide grain is marked as line segment B. i ; The results are as follows Figure 3 (The white line in the figure is B i , the green line is C i ).

[0053] (5) In each line segment C i Find the largest circumscribed rectangle and calculate C by the coordinates of the upper left corner and the lower right corner i The key point G i (X,Y).

[0054] (6) Take the key point G in (5) i (X, Y) corresponds to the semantic segmentation image of tungsten carbide grains, and the number of pixels N belonging to tungsten carbide within a radius of R pixels with the corresponding point as the origin is counted. R , the total number of pixels within the radius R is M R .

[0055] (7) If N R With M R The ratio of G is greater than the crystal phase boundary threshold, then i (X, Y) is marked as the grain boundary point on the cemented carbide image; if N R With M R The ratio of is less than or equal to the crystal phase boundary threshold, then segment C is judged to be i In the tungsten carbide grain instance segmentation image, is it located between two tungsten carbide grains? If it is located between two tungsten carbide grains, then C i The two endpoints of the segment are marked as phase boundary points on the cemented carbide image; otherwise, they are not marked as phase boundary points; the results are as follows Figure 7 (The blue points in the figure are phase boundaries, and the brown points are grain boundaries).

[0056] In this embodiment, the method of the invention was used to analyze the crystal phase boundaries of actual cemented carbide images, and the analysis results were observed to verify the reliability and practicality of the invention.

[0057] The above embodiments are only preferred embodiments of the present invention and are not limitations on the technical solutions of the present invention. Any technical solution implemented on the basis of the above embodiments without creative work should be deemed to fall within the scope of protection of the patent of the present invention.

[0058] Table 1 Segmentation performance of different methods

[0059]

[0060] Table 2 Segmentation performance with different weights α and β

[0061]

Claims

1. A method for analyzing cemented carbide crystal phase boundaries, characterized by: The following steps are involved: (1) Constructing a cemented carbide image dataset; (2) In order to highlight the key features related to the segmentation target, reduce the background interference close to the target, and optimize the segmentation effect between targets, so that the segmentation model can more effectively distinguish pixels of different categories in the image, a multi-level fusion attention module (MFAM) is constructed and MF-Net based on the UNet network is designed; (3) In order to improve the segmentation ability of MF-Net for images with uneven illumination and contrast differences, the total loss function L of the MF-Net network is designed. train ; (4) Based on the above dataset, network model and loss function, the segmentation image of the tungsten carbide grain instance is obtained by inference; (5) Generate a crystal boundary marking line A on the cemented carbide image based on the result of (4) i ; (6) Calculate each line segment C based on the result of (5) i The key point G i (X,Y); (7) The key point G generated by (6) i Corresponding to the semantic segmentation image of tungsten carbide grains, the number of pixels N belonging to tungsten carbide within the radius R pixels with the corresponding point as the origin is counted. R ; (8) Based on the results of (7) and the crystal phase boundary threshold, the grain boundary points and phase boundary points are divided.

2. A cemented carbide crystal boundary analysis method according to claim 1, characterized in that: The multi-level fusion attention module described in step (2) is composed of channel attention, spatial attention and self-attention. ① The main function of channel attention is to compress the features of the feature map in the channel dimension, and weight each channel using the learned weight parameters; ② The main function of spatial attention is to enhance the spatial information of the feature map after channel attention; ③ The main function of self-attention is to remodel the input sequence of Query, Key, and Value feature maps through linear transformation, and can automatically determine which information of the cemented carbide image should be paid attention to at different positions; through the effective combination of the three attention modules, the multi-level fusion attention module can highlight the key features related to the segmentation target, reduce the background interference close to the target, and optimize the segmentation effect between targets, so that the segmentation model can more effectively distinguish pixels of different categories in the image.

3. The method for analyzing cemented carbide crystal phase boundaries according to claim 1, wherein: The training loss function L of the MF-Net network described in step (3) is train , which is defined as: L train =αL BCE +βL Dice +c (1) Among them L BCE is the binary cross entropy loss function, L Dice is the Dice loss function, c represents a small constant that aims to make the loss function more stable numerically, α and β represent the weight hyperparameters assigned to their respective loss functions; L train It can improve MF-Net's segmentation ability for images with uneven illumination and contrast differences.

4. The method for analyzing cemented carbide crystal phase boundaries according to claim 1, characterized in that: The cemented carbide image crystal phase boundary marking line A described in step (5) i The generation rules are as follows: If the marker line A i The line segment (X i ,Y j )-(X i+p ,Y j+q ) corresponds to the tungsten carbide grain in the tungsten carbide grain segmentation image, and the part marked line is B i If the marker line A i The line segment (X i ,Y j )-(X i+p ,Y j+q ) corresponds to the bonding phase in the tungsten carbide grain segmentation image, and the marking line of this part is C i .

5. The method for analyzing cemented carbide crystal phase boundaries according to claim 1, characterized in that: The calculation line segment C described in step (6) i The key points are as follows: (1) Calculate line segment C i The maximum enclosing rectangle of , find the upper left corner point L(X,Y) and the lower right corner point R(X,Y); Note that C i For a certain marked line A i A subset of (2) Key point G i (X,Y) is calculated as: where X L 、Y L is the horizontal and vertical coordinates of point L, X R 、Y R are the horizontal and vertical coordinates of point R.

6. A cemented carbide crystal boundary analysis method according to claim 5, characterized in that: The calculation method for calculating the maximum circumscribed rectangle of each line segment Ci in step (1) is as follows: (1) The boundary contour information of the line segment Ci is obtained by run-length encoding of the binary image. The run-length encoding records the area of ​​the image belonging to the line segment Ci. The area is represented as a table with tables as elements. Each row of the image is represented as a subtable. Its first element is the row number, followed by an item consisting of two ordinates. The first is the ordinate (column number) of the start of the run, and the second is the ordinate of the end of the run. There can be several such sequence items in a row, recorded as: (y, x_start, x_end); (2) Because the line segment Ci is a pixel rectangle, by comparing the travel information of the subtable in (1), we can obtain the point L(X,Y) with the smallest row number and the smallest column number as the upper left corner of the line segment Ci, and the point R(X,Y) with the largest row number and the largest column number as the lower right corner of the line segment Ci.

7. The method for analyzing cemented carbide crystal phase boundaries according to claim 1, characterized in that: The utilization statistics N described in step (8) R The method for dividing grain boundary points and phase boundary points based on the crystal phase boundary threshold is as follows: (1) Key point G i In the semantic segmentation image of tungsten carbide grains, the corresponding point is the origin and the total number of pixels within the radius R is M R , where the number of pixels belonging to tungsten carbide is N R , the crystal phase boundary threshold is K (value ranges from 0 to 1); calculate N R With M R The ratio of (2) If N R With M R The ratio of is greater than K, then the key point G in the cemented carbide image i Marked as grain boundary point; (3) If N R With M R If the ratio is less than or equal to K, then calculate the line segment C i Is it generated between a tungsten carbide grain boundary in the tungsten carbide grain instance segmentation image? i In the tungsten carbide grain segmentation image, the line segment C is located between two tungsten carbide grains. i The two endpoints of are marked as the phase boundary points of the cemented carbide image; if the line segment C i In the tungsten carbide grain segmentation image, the line segment C is located between the boundaries of a tungsten carbide grain. i The two endpoints are not the phase boundary points of the cemented carbide image.

8. A cemented carbide crystal phase boundary analysis method according to claim 7, characterized in that: Step (3) Line segment C i Whether a tungsten carbide grain boundary is generated in a tungsten carbide grain instance segmentation image is calculated as follows: (1) According to line segment C i The upper left corner point L(X,Y) and the lower right corner point R(X,Y) are calculated in the segment C of the tungsten carbide grain instance segmentation image. i Point L'(X-1,Y) on the tungsten carbide grain at the left endpoint, line segment C i Point R'(X+1,Y) on the tungsten carbide grain at the right endpoint; (2) Taking the left grain point L'(X-1, Y) as the starting point and the grain boundary as the constraint condition, use the breadth-first algorithm (BFS) to find the right grain point R'(X+1, Y); if the point R'(X+1, Y) is found, then the line segment C i It is generated between the boundaries of a tungsten carbide grain in the tungsten carbide grain instance segmentation image; if the point R'(X+1,Y) is not found, then the line segment C i It is located between two tungsten carbide grains in the tungsten carbide grain instance segmentation image.