A method for quantitatively calculating the proportion of the second phase in an alloy based on image recognition technology

By combining image recognition technology and semi-automatic labeling methods with a sample selection mechanism of stepwise separation and data screening, the problems of low universality and efficiency in the statistical analysis of the second phase of alloys are solved, and the high efficiency, accuracy and reliability of the alloy analysis model are achieved.

CN119942258BActive Publication Date: 2025-12-02CHONGQING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410338187.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-22
Publication Date
2025-12-02
Estimated Expiration
2044-03-22

AI Technical Summary

Technical Problem

Existing technologies suffer from poor versatility and low training efficiency in the statistical analysis of the second phase of alloys. In particular, when the alloy morphology is complex, the accuracy and reliability of existing network models are low, and the construction of training sample sets is time-consuming.

Method used

This paper combines a single-phase preprocessing method based on image recognition technology with a semi-automatic labeling method. By using a sample selection mechanism of step-by-step separation and data screening, the model training efficiency is improved, and the accuracy and reliability of sample labeling are enhanced through a human-machine collaborative semi-automatic labeling method.

Benefits of technology

It improves the accuracy and reliability of alloy analysis models, reduces the amount of training sample data, enhances the effectiveness and reliability of the training process, and simplifies the sample labeling process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942258B_ABST
    Figure CN119942258B_ABST
Patent Text Reader

Abstract

This invention relates to the field of alloy analysis, specifically to a method for quantitatively calculating the proportion of the second phase in an alloy based on image recognition technology. The method includes: acquiring an alloy sample image; inputting the alloy sample image into an alloy analysis model, and outputting the proportion of the second phase in the alloy sample image; the training steps of the alloy analysis model include: acquiring a first sample image of the alloy; converting the first sample image into a grayscale histogram; querying the number of target grayscale peaks in the grayscale histogram, where target grayscale peaks refer to grayscale peaks other than those of the matrix phase; determining whether separation processing of the grayscale histogram is necessary based on the number of peaks, and correspondingly acquiring a training sample set; and inputting the training sample set into a deep network learning model to obtain the alloy analysis model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of alloy analysis technology, and more specifically to a method for quantitatively calculating the proportion of the second phase in an alloy based on image recognition technology. Background Technology

[0002] The study of the second phase in an alloy is crucial for understanding its physicochemical properties. Currently, to improve the efficiency of statistically analyzing the proportion of the second phase, automated methods can be used for its identification, extraction, and quantitative analysis.

[0003] Traditional methods primarily utilize mixed-phase images as training samples to construct models. For example, CN111696632A discloses a full-field quantitative statistical distribution characterization method for the microstructure of the γ' phase in metallic materials. This characterization method includes: step a: labeling the γ' phase, cloud-like interference, and γ matrix using Labelme to create standard feature training samples; step b: establishing a deep learning-based feature recognition and extraction model using BDU-Net; step c: acquiring γ' feature maps in the metallic material under test; step d: automatic identification and extraction of the γ' phase; and step e: in-situ quantitative statistical distribution characterization of γ' phase across a large field of view.

[0004] Furthermore, CN114972300A also discloses a material image segmentation and recognition method based on computer vision and deep learning. This method uses computer vision to segment Trip steel images, and then uses deep learning to train the segmentation results to identify the microstructure of Trip steel.

[0005] However, the above traditional network training methods have two main drawbacks:

[0006] 1) Poor versatility

[0007] Because alloys exhibit highly complex morphologies (e.g., phase volume fractions, grain sizes, morphologies, and distributions), especially with significant variations in microstructure due to changes in processing conditions, existing network models suffer from low accuracy and reliability when statistically analyzing second-phase data in complex alloy images.

[0008] 2) Low training efficiency

[0009] Due to the complexity of the phase diagram morphology of alloys, manual labeling of samples is still required, making the construction of the training sample set very time-consuming. Summary of the Invention

[0010] The purpose of this invention is to provide a method for quantitatively calculating the proportion of the second phase in an alloy based on image recognition technology, which partially solves or alleviates the above-mentioned shortcomings in the prior art. It can utilize single-phase preprocessing methods in conjunction with semi-automatic labeling methods to improve the efficiency of model training and further enhance the accuracy and reliability of the alloy analysis model.

[0011] To address the aforementioned technical problems, the present invention specifically adopts the following technical solution: a method for quantitatively calculating the proportion of the second phase in an alloy based on image recognition technology, comprising:

[0012] S100 acquires an image of the alloy sample to be inspected;

[0013] S101 inputs the alloy sample image into a pre-trained alloy analysis model and outputs the proportion of the second phase of the alloy in the alloy sample image; wherein, the training steps of the alloy analysis model include:

[0014] S200 acquires a first sample image of the alloy;

[0015] S201 converts the first sample image into a grayscale histogram;

[0016] S202 queries the number of target grayscale peaks in the grayscale histogram, wherein the target grayscale peaks refer to grayscale peaks other than those in the substrate phase.

[0017] S203 determines whether the grayscale histogram needs to be separated based on the quantity, and obtains a training sample set accordingly. The training sample set includes multiple second sample images obtained by converting the grayscale histogram.

[0018] S204 Input the training sample set into the deep network learning model to obtain the alloy analysis model;

[0019] S203 includes:

[0020] S300 determines whether the current number of grayscale histograms is greater than the preset target number. If yes, proceed to S301; otherwise, proceed to S302.

[0021] S301 controls the binarization threshold of the current grayscale histogram to obtain a first separated grayscale histogram including a phase, wherein the phase in the first separated grayscale histogram corresponds to one of the target grayscale peaks, and the phase includes: at least one sub-phase of shape;

[0022] S302 Determine whether there is a sub-phase with shape difference in the phase in the currently corresponding separated gray level histogram; if so, proceed to S303.

[0023] S303 labels the type of the sub-phase in the currently corresponding separated grayscale histogram and uses the separated grayscale histogram as the second sample image.

[0024] In some embodiments, the method further includes the step of:

[0025] S304 Subtracts the first separated grayscale histogram from the current grayscale histogram to obtain the corresponding second separated grayscale histogram; returns to S300.

[0026] In some embodiments, S301 includes the step of:

[0027] Obtain the left boundary point of the rightmost target grayscale peak in the current grayscale histogram;

[0028] The binarization threshold is calculated based on the left boundary point, wherein the binarization threshold = L / 255, and L is the value of the left boundary point;

[0029] Based on the binarization threshold, the first gray-level histogram corresponding to the current target gray-level peak is separated from the gray-level histogram.

[0030] In some embodiments, the step of labeling the type of the sub-phase includes:

[0031] (1) Obtain the shape of at least one of the sub-phases;

[0032] (2) Retrieve subphase information matching the subphase in the database according to a preset first query rule; wherein, the database includes: at least one subphase graphic with a typical geometric structure, and the subphase graphic is associated with the subphase information, the subphase information including: the main phase type corresponding to the subphase, and the subphase type of the subphase; wherein, the first query rule requires that the shape of the subphase matches the subphase graphic corresponding to the subphase information, and the main phase type of the subphase matches the main phase type of the subphase graphic;

[0033] (3) If the sub-phase information that matches the first query rule is found in (2), the sub-phase is automatically marked according to the sub-phase information.

[0034] In some embodiments, the step of labeling the type of the subphase further includes:

[0035] (4) If the subphase graphic that matches the first query rule is not found in (2), then the subphase information that matches the subphase is retrieved in the database according to the second query rule; wherein the second query rule requires that the shape of the subphase matches the subphase graphic corresponding to the subphase information;

[0036] (5) If the sub-phase information that matches the second query rule is found in (4), a first prompt signal is sent to the user. The first prompt signal includes: the image of the sub-phase to be marked, the sub-phase image found, and the corresponding sub-phase information.

[0037] (6) The subphase is marked in response to a first marking signal input by the user, the first marking signal including: subphase type.

[0038] In some embodiments, the step of labeling the type of the subphase further includes:

[0039] If the subphase graphic is not found in either (2) or (4), the subphase is marked in response to a second marking signal input by the user, the second marking signal including: subphase type.

[0040] In some embodiments, the typical geometry includes one or more of the following: circle, near-circle, polygon, and near-polygon.

[0041] In some embodiments, the deep network learning model includes: the U-net resent34 model and the U-netresent18 semantic segmentation model.

[0042] In some embodiments, S200 includes:

[0043] Multiple alloy samples with different solid solution and aging states were selected;

[0044] The alloy samples were polished.

[0045] The first sample image of the alloy sample was obtained by scanning with an image acquisition device.

[0046] In some embodiments, the alloy comprises an aluminum alloy.

[0047] Beneficial technical effects:

[0048] In contrast to traditional model training approaches, this invention proposes a sample selection mechanism of stepwise separation and data screening (i.e., a single-phase processing mode). On the one hand, it rapidly marks the effective information in the samples through stepwise processing and multi-level data screening. On the other hand, it quickly screens out invalid information through the selection mechanism. This improves the effectiveness and reliability of the training process while reducing the amount of training sample data.

[0049] Furthermore, in response to the above-mentioned single-phase processing mode, this invention also provides a semi-automatic sample labeling method based on human-machine collaboration. Specifically, dual querying using the main phase type and sub-phase graph effectively improves the sample labeling efficiency in the single-phase processing mode, while the human-machine collaboration mode offers greater flexibility and reliability, thereby contributing to improved accuracy in batch sample labeling. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. The elements or parts in the drawings are not necessarily drawn to scale. Obviously, the drawings described below are some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0051] Figure 1 This is a flowchart illustrating a model training method in an exemplary embodiment of the present invention;

[0052] Figure 2 This is a flowchart illustrating a single-phase extraction method in an exemplary embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram showing the phase distribution in alloy 2024;

[0054] Figure 4 This is a schematic diagram of the segmentation results for sample image A of the alloy.

[0055] Figure 5 This is a schematic diagram of the segmentation results for sample image B of the alloy.

[0056] Figure 6 This is a schematic diagram of the segmentation results of the sample image C of the alloy;

[0057] Figure 7 This is a graph showing the first calculation results obtained based on the alloy analysis model;

[0058] Figure 8 This is a graph showing the second calculation result obtained based on the alloy analysis model;

[0059] Figure 9 This is a graph showing the third calculation result obtained based on the alloy analysis model;

[0060] Figure 10 This is a schematic diagram of the module structure of the system in an exemplary embodiment of the present invention. Detailed Implementation

[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0062] In this document, suffixes such as "module," "part," or "unit" used to denote elements are used only for the purpose of illustrative purposes and have no specific meaning in themselves. Therefore, "module," "part," or "unit" may be used interchangeably.

[0063] In this document, the terms "upper," "lower," "inner," "outer," "front," "rear," "one end," and "the other end," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the present invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the present invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0064] In this document, unless otherwise explicitly specified and limited, the terms "installed," "equipped with," "connected," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, a direct connection, or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0065] In this document, "and / or" includes any and all combinations of one or more of the listed related items.

[0066] In this article, "multiple" means two or more, that is, it includes two, three, four, five, etc.

[0067] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0068] As used in this specification, the term "about" typically means + / - 5% of the value, more typically + / - 4%, more typically + / - 3%, more typically + / - 2%, even more typically + / - 1%, even more typically + / - 0.5% of the value.

[0069] In this specification, certain embodiments may be disclosed in a range-bound format. It should be understood that this "range-bound" description is merely for convenience and brevity and should not be construed as a rigid limitation on the disclosed range. Therefore, the description of the range should be considered as having specifically disclosed all possible subranges and independent numerical values ​​within those ranges. For example, range The description should be considered as having specifically disclosed subranges such as from 1 to 3, from 1 to 4, from 1 to 5, from 2 to 4, from 2 to 6, from 3 to 6, etc., as well as individual numbers within this range, such as 1, 2, 3, 4, 5, and 6. The above rules apply regardless of the breadth of the range.

[0070] In metallic alloys, besides the main matrix phase, there exist relatively small non-matrix phases in different forms; these non-matrix phases are called second phases. Second phases are an important component of alloys and can cause various physical and chemical effects, giving the alloy more superior properties.

[0071] In this article, "secondary phase" refers to all other phases in a material that are different from the matrix phase, and they are generally discontinuously distributed in the matrix phase.

[0072] For example, the second-phase particles present in 2024 aluminum alloy in the aged state are mainly: nano-precipitated S phase (Al2CuMg) and larger T phase (Al20Cu2Mn3), see [reference]. Figure 3 As shown.

[0073] Example 1

[0074] like Figure 1 , Figure 2 As shown, this invention provides a method for quantitatively calculating the proportion of the second phase in an alloy based on image recognition technology, comprising:

[0075] S100 acquires an image of the alloy sample to be inspected;

[0076] For example, the sample image can be a high-throughput image from a SEM scan.

[0077] S101 inputs the alloy sample image into a pre-trained alloy analysis model and outputs the second phase of the alloy in the alloy sample image;

[0078] For example, in some embodiments, the alloy analysis model can automatically identify the second phase in the sample image and calculate the content of the second phase.

[0079] Among them, see Figure 1 , Figure 2 As shown, the training steps for the alloy analysis model include:

[0080] S200 acquires a first sample image of the alloy;

[0081] S201 converts the first sample image into a grayscale histogram;

[0082] S202 queries the number of target grayscale peaks in the grayscale histogram, wherein the target grayscale peaks refer to grayscale peaks other than those in the substrate phase.

[0083] S203 determines whether the grayscale histogram needs to be separated based on the quantity, and obtains a training sample set accordingly. The training sample set includes multiple second sample images obtained by converting the grayscale histogram.

[0084] S204 Input the training sample set into the deep network learning model to obtain the alloy analysis model.

[0085] Preferably, in this embodiment, a single-phase extraction method is used to extract, label, and filter sample data from the sample image.

[0086] To optimize the network training process, this invention proposes a sample selection mechanism for step-by-step separation and data screening. For example, in some embodiments, S203 includes:

[0087] S300 determines whether the current number of grayscale histograms is greater than the preset target number. If yes, proceed to S301; otherwise, proceed to S302.

[0088] S301 controls the binarization threshold of the current grayscale histogram to obtain a first separated grayscale histogram including a phase, wherein the phase in the first separated grayscale histogram corresponds to one of the target grayscale peaks, and the phase includes: at least one sub-phase of shape;

[0089] S302 determines whether there is a sub-phase with shape difference in the phase in the current corresponding gray-level histogram; if so, proceed to S303; otherwise, it is considered that the current separated gray-level histogram does not meet the sample selection mechanism and is removed from the sample data.

[0090] S303 labels the type of the sub-phase in the currently corresponding separated grayscale histogram and uses the separated grayscale histogram as the second sample image.

[0091] For example, in some embodiments, the current corresponding grayscale histogram can be the first separated grayscale histogram obtained in S301. Alternatively, the current corresponding grayscale histogram can also be a grayscale histogram in S300 with a number less than the target number.

[0092] In some embodiments, S300 further includes the step of:

[0093] S304 Subtracts the first separated grayscale histogram from the current grayscale histogram to obtain the corresponding second separated grayscale histogram; returns to S300.

[0094] Here, the first separated gray-level histogram A refers to the gray-level histogram obtained by controlling the binarization threshold. The second separated gray-level histogram B refers to the gray-level histogram obtained by image algebra calculation, that is, the image obtained by subtracting the first separated gray-level histogram from the latest gray-level histogram (where the latest gray-level histogram refers to the original gray-level histogram, or the second separated gray-level histogram obtained in the previous calculation).

[0095] In some embodiments, a phase (also referred to as a master phase, wherein one master phase corresponds to one grayscale peak) may consist of at least one subphase.

[0096] In some embodiments, when the number of target gray-level peaks in the gray-level histogram is 0 or 1, the shape differences between phases are mainly considered. If there is no second phase with a different shape in the image, the image is deleted from the sample data. Otherwise, the shape information of the relevant second phase can be obtained by consulting literature or expert experience, and then the image can be imported into Roboflow for classification and annotation.

[0097] Conversely, in some embodiments, if the grayscale histogram has at least two peaks besides the matrix phase, then it is considered that at least two second phases with different contrasts exist. In this case, the binarization threshold can be controlled to achieve separate segmentation of a certain phase, and then image algebra operations can be used to segment and obtain another phase with indistinguishable contrast (this phase may also be a mixed phase, composed of different kinds of second phases with the same contrast).

[0098] In some embodiments, when the first grayscale histogram includes two or more sub-phases with different shapes, the current first grayscale histogram is used as the second sample image, and the second sample image labeled with the sub-phase type is input into the semantic segmentation model. Otherwise, the current first grayscale histogram is deleted (i.e., the image is removed from the sample data).

[0099] The following explanation uses alloy A as an example to illustrate the sample selection mechanism for the above-mentioned step-by-step separation and data screening:

[0100] Alloy A includes a matrix phase and multiple second phases, such as phases a, b, and c. Phase a contains two sub-phases, α and β; phase b contains two sub-phases, θ and η; and phase c further contains three sub-phases, γ, s, and s'. Different sub-phases often have different geometries. In this embodiment, the target quantity is set to 1.

[0101] At this point, it is first found that the number of gray peaks in the gray-scale histogram of alloy A is 3 (that is, the number is greater than the target number). Then, the binarization threshold of the gray-scale histogram is controlled to separate and obtain the first separated gray-scale histogram A1, which only includes the a phase.

[0102] Subsequently, it is determined whether the first separated gray-level histogram A1 contains two sub-phases with different shapes. If the result is yes (i.e., histogram A1 contains two sub-phases α and β with different shapes), then the first separated gray-level histogram A1 is considered to conform to the current sample selection mechanism and can be used as training data. Conversely, if the result is no, then the current histogram A1 is considered to not conform to the selection mechanism, and the current first separated gray-level histogram A1 is deleted from the sample data.

[0103] Simultaneously, the second separated gray-level histogram B1 is obtained by subtracting the first separated gray-level histogram A1 from the original gray-level histogram. Using the same judgment rule, it is determined that the number of target gray-level peaks in the second separated gray-level histogram B1 is still greater than 1. At this point, the binarization threshold of the second separated gray-level histogram B1 is further controlled to separate a new first separated gray-level histogram A2 (i.e., a histogram containing only the b-phase). Subsequently, the new first separated gray-level histogram A2 is further processed via S302.

[0104] Finally, the current first separate grayscale histogram A2 is subtracted from the current grayscale histogram (which is the second separate grayscale histogram B1 obtained last time) to obtain a new second separate grayscale histogram B2.

[0105] Unlike traditional training methods (which typically involve acquiring various types of sample images to increase dataset diversity and thus improve model training accuracy), this invention proposes a step-by-step separation and data screening sample selection mechanism. This mechanism selects single-phase images with mixed subphases as the training dataset and filters out other sample data that do not conform to the selection mechanism. Furthermore, experimental verification shows that this sample selection mechanism effectively improves the effectiveness of the training dataset, thereby enhancing the accuracy and versatility of the resulting alloy analysis model.

[0106] In some embodiments, S301 includes the step of:

[0107] Obtain the left boundary point of the rightmost target grayscale peak in the current grayscale histogram;

[0108] The binarization threshold is calculated based on the left boundary point, wherein the binarization threshold = L / 255, and L is the value of the left boundary point;

[0109] Based on the binarization threshold, the first gray-level histogram corresponding to the current target gray-level peak is separated from the gray-level histogram.

[0110] In this embodiment, a unidirectional sequential processing from right to left is used to improve the accuracy and reliability of the obtained training data.

[0111] Below, using alloy A as an example, the above-mentioned unidirectional step-by-step processing method will be explained in detail:

[0112] The grayscale histogram RGB ranges for phases a, b, and c are 78-96 for mixed phase a, 123-166 for mixed phase b, and 203-244 for mixed phase c, respectively. A mixed phase refers to a main phase comprising two or more sub-phases. The following steps are required:

[0113] (1) The binarization threshold of the mixed phase c is 203 obtained from the original gray level histogram. After normalization (the calculation formula is: 203 / 255), the threshold is selected as 0.91. When the binarization threshold is set to 0.91, only the mixed phase c is bright, and the other two mixed phases and the substrate are transformed into dark. At this time, the result of the mixed phase c being segmented separately is obtained.

[0114] (2) Perform image algebra operations using the original grayscale histogram and the mixed phase c to obtain an image containing only the two mixed phases a and b.

[0115] (3) Repeat step (1), import the image from (2), calculate the second binarization threshold, and control the second binarization threshold to obtain the mixed phase b extraction result.

[0116] (4) Repeat (2) to obtain an image containing only the a-mixture phase.

[0117] Furthermore, in order to improve the efficiency of sample labeling, this invention also provides a semi-automatic labeling method for human-computer collaboration suitable for single-phase processing mode, which improves the efficiency of sample labeling while effectively ensuring the reliability and accuracy of automatic labeling.

[0118] In some embodiments, the step of labeling the type of the sub-phase includes:

[0119] (1) Obtain the shape of at least one of the sub-phases;

[0120] (2) Retrieve subphase information matching the subphase in the database according to a preset first query rule; wherein, the database includes: at least one subphase graphic with a typical geometric structure, and the subphase graphic is associated with the subphase information, the subphase information including: the main phase type (e.g., a, b, c) corresponding to the subphase, and the subphase type (e.g., α, β) of the subphase; wherein, the first query rule requires that the shape of the subphase matches the subphase graphic corresponding to the subphase information, and the main phase type of the subphase matches the main phase type of the subphase graphic;

[0121] (3) If the sub-phase information that matches the first query rule is found in (2), the sub-phase is automatically marked according to the sub-phase information, that is, the automatic marking is completed by default at this time.

[0122] In some embodiments, the step of labeling the type of the subphase further includes:

[0123] (4) If the subphase graphic that matches the first query rule is not found in (2), then the subphase information that matches the subphase is retrieved in the database according to the second query rule; wherein the second query rule requires that the shape of the subphase matches the subphase graphic corresponding to the subphase information;

[0124] (5) If the sub-phase information that matches the second query rule is found in (4), a first prompt signal is sent to the user. The first prompt signal includes: the image of the sub-phase to be marked, the sub-phase image found, and the corresponding sub-phase information.

[0125] (6) The sub-phase is marked in response to the first marking signal input by the user, wherein the first marking signal includes: sub-phase type. That is, manual verification is prompted at this time. At this time, the user can manually select the sub-phase type given by the prompt signal, and the sub-phase can be marked after the verification is successful. Alternatively, the user can also manually input the sub-phase type to be marked again.

[0126] In some embodiments, the step of labeling the type of the subphase further includes:

[0127] If the subphase graphic is not found in either (2) or (4), the subphase is marked in response to a second marking signal input by the user, the second marking signal including: subphase type.

[0128] In some embodiments, for subphases with typical geometric structures, a computer automatically identifies the difference between the actual subphase shape and the standard subphase pattern in the database. When the difference is less than a preset difference threshold, the two are considered to match.

[0129] In some embodiments, the typical geometry includes one or more of the following: circle, near-circular (e.g., ellipse), polygon, and near-polygon.

[0130] For example, a polygon-like shape can be a geometric shape between a square and a circle, such as a polygon-like shape where the corners are rounded, or a polygon-like shape where the adjacent edge segments near the corners are rounded. Typical polygon-like shapes can include: rectangle-like shapes, triangle-like shapes, etc.

[0131] In this embodiment, a combination of dual query rules and single-phase processing mode enables rapid semi-automatic labeling of typical subphases. The system employs three methods in tandem: default automatic labeling, manual verification labeling, and manual labeling. This approach significantly reduces the workload of manual labeling through automation while ensuring the accuracy and reliability of sample labeling through human-machine collaboration.

[0132] In some embodiments, the deep network learning model includes: the U-net resent34 model and the U-netresent18 semantic segmentation model.

[0133] For example, in some embodiments, the model training process includes:

[0134] The U-Net resent34 model is built, which adds 34 layers of residual network to the classic U-Net semantic segmentation model. This includes constructing the basic structure of the U-Net model. The U-Net model consists of an encoder (downsampling path) and a decoder (upsampling path), and the feature maps of the encoder and decoder are merged through skip connections. Here, ResNet34 is used as the encoder to extract image features. The encoder and decoder parts of U-Net are constructed. Subsequently, the training sample set (specifically, before inputting the training sample set into the semantic segmentation network, it can be preprocessed such as cropping, flipping, edge processing, and random rotation) is imported into the U-Net resent34 semantic segmentation network.

[0135] Prepare the loss function and optimizer. The loss function is calculated using the cross-entropy function, and the Adam optimizer is used to update the model parameters. The optimizer's backward() and step() methods are called to perform backpropagation and parameter update operations.

[0136] The training process runs for 50 epochs. Within each epoch, it sequentially trains, calculates the loss values ​​on the training and test sets, and stores these loss values ​​in corresponding lists. By iterating through the training process, changes in the training and test losses can be tracked through visualization to evaluate the model's performance and progress.

[0137] The `evaluate` module is used to evaluate the mean IoU. It imports the `evaluate` module, calls the `load` function from the `evaluate` module, and assigns the returned result to the `mean_iou` variable, setting the model to evaluation mode. It iterates over each batch of the test dataset, moving the image and label data to a specified device (e.g., GPU) for computation. The model's output is calculated via forward propagation. Predictions are obtained from the model's output. The maximum value and its index in the output of each sample are found. Predictions and labels are converted to NumPy arrays and stored in a list. The batch's predictions and labels are added to the `mean_iou` object. The evaluation metric is calculated. The `num_labels` parameter is the number of categories, and the `ignore_index` parameter specifies the label indices to ignore. The `result` parameter is the calculated result of the evaluation metric. Finally, `result` contains the results calculated using the evaluation metric and can be used to evaluate the model's performance on the test set.

[0138] The semantic segmentation results are visualized, allowing us to observe the differences between the predicted and actual results and present them in a visually appealing way.

[0139] In some embodiments, S200 includes:

[0140] Multiple alloy samples with different solid solution and aging states were selected;

[0141] The alloy samples were polished.

[0142] The first sample image of the alloy sample was obtained by scanning with an image acquisition device.

[0143] The following example uses 2024 aluminum alloy (see...). Figures 3-7 The second-phase statistical method of the present invention will be described as follows (as shown):

[0144] Standard aluminum alloy samples with different solution treatment and aging states were selected, polished, and high-throughput SEM images were obtained. The input RGB true-color images were read and converted to grayscale images, yielding their corresponding grayscale histograms. Normalization and binarization were performed, controlling the binarization threshold to achieve segmentation of the second phase based on different contrasts. The number of pixels representing the second phase Al2Cu in the binary image was counted pixel-by-pixel to calculate the proportion of the second phase Al2Cu. After obtaining the Al2Cu proportion, a series of morphological processing steps were performed on the image, such as etch opening, distance transformation (watershed transformation) of the binary image, and counting the number of each connected component. After obtaining all connected components, the bounding box attributes of the regions were extracted, and the `rectangle` function was used to draw red rectangles on the image to represent the bounding box of each region. Simultaneously, the region number was displayed next to the centroid coordinates of each region. Using image algebra operations, A was removed from the original image. l2 The microstructures of two second phases, Al2CuMg and an iron-containing phase, were obtained from the Cu phase. The SEM images of the two second phases, Al2CuMg and an iron-containing phase, were labeled using Roboflow software. The iron-containing phase was labeled, and 184 labeled images were exported.

[0145] Finally, a series of operations, such as cropping and image enhancement, were performed on the exported 184 images, expanding the sample from 184 to 1472. These 1472 images were then divided according to a stratified sampling principle, with the training set, test set, and validation set ratio being 6:3:1. After importing the dataset, the model was generated, the loss function and optimizer were prepared, and the model was trained and evaluated. The MIOU was evaluated using `evaluate`, and the results were visualized.

[0146] This invention also attempts to test the generalization ability of multiple models, including U-net resent18 and U-net resent34. Training data is imported into two different segmentation models to obtain two trained models. The trained models are then used for prediction, and the prediction accuracy of each model is compared. After obtaining the training results of each model, the number of pixels containing the iron phase is counted pixel by pixel, and the phase proportion is calculated. The image is binarized, and the binarization threshold is controlled to achieve the separation of the iron phase. Image algebraic operations are performed on the original image, the separated iron phase, and the Al2Cu phase to obtain the Al2CuMg phase.

[0147] Furthermore, this invention also verifies the reliability of the network training process using an Al2CuMg alloy. Among other things, Figures 4-6 The single-phase processing procedure for a portion of the training sample images is shown. Specifically, Figures 4-6Figures (a), (b), (c), and (d) in the figure represent, respectively, the original sample image, the predicted image obtained after semantic segmentation network processing, and two separated single-phase images. Furthermore, the alloy analysis model is trained using the samples processed by the single-phase network described above. Figures 7-9 The images of different Al2CuMg alloy samples are shown sequentially, with the results of automatic labeling by the alloy analysis model. Figures 7-9 This is an illustration of the training effect. Furthermore, through analysis of the original sample images and verification comparison with existing alloy data, it can be seen that... Figures 7-9 The obtained automatic labeling results have high accuracy and meet the user's analytical needs for the second phase of the alloy.

[0148] Example 2

[0149] like Figure 10 As shown, the present invention also provides a system for quantitatively calculating the proportion of the second phase in an alloy based on image recognition technology, corresponding to the above embodiment one, comprising:

[0150] Image acquisition module 10 is configured to acquire an image of the alloy sample to be detected;

[0151] Alloy analysis module 11 is configured to input the alloy sample image into a pre-trained alloy analysis model and output the proportion of the second phase of the alloy in the alloy sample image;

[0152] Sample acquisition module 20 is configured to acquire a first sample image of the alloy;

[0153] Grayscale conversion module 21 is configured to convert the first sample image into a grayscale histogram;

[0154] The grayscale peak query module 22 is configured to query the number of target grayscale peaks in the grayscale histogram, wherein the target grayscale peaks refer to grayscale peaks other than those in the substrate phase.

[0155] The sample separation processing module 23 is configured to determine whether the grayscale histogram needs to be separated based on the quantity, and accordingly obtain a training sample set, the training sample set including: multiple second sample images obtained by converting the grayscale histogram;

[0156] Network training module 24 is configured to input the training sample set into a deep network learning model to obtain the alloy analysis model;

[0157] The sample separation processing module 23 further includes:

[0158] The first judgment unit 30 is configured to determine whether the number of the current grayscale histogram is greater than the preset target number. If yes, the current grayscale histogram is input into the first separation unit 32; if no, the current grayscale histogram is input into the second judgment unit 34.

[0159] The first separation unit 31 is configured to control the binarization threshold of the current grayscale histogram to obtain a first separated grayscale histogram including a phase, wherein the phase in the first separated grayscale histogram corresponds to one of the target grayscale peaks, and the phase includes: at least one sub-phase of shape.

[0160] The second judgment unit 32 is configured to determine whether there is a sub-phase with shape difference in the phase in the currently corresponding separated grayscale histogram; if so, the current grayscale histogram is input into the sample labeling unit.

[0161] The sample labeling unit 33 is configured to label the type of the sub-phase in the currently corresponding grayscale histogram and use the separated grayscale histogram as the second sample image.

[0162] In some embodiments, the sample separation processing module 23 includes:

[0163] The second separation unit 34 is configured to subtract the first separation grayscale histogram from the current grayscale histogram to obtain a second separation grayscale histogram; and input the second separation grayscale histogram to the first judgment unit 30.

[0164] In some embodiments, the first separation unit 31 is further configured to obtain the left boundary point of the rightmost target gray level peak of the currently corresponding gray level histogram;

[0165] The binarization threshold is calculated based on the left boundary point, wherein the binarization threshold = L / 255, and L is the value of the left boundary point;

[0166] Based on the binarization threshold, the first separated gray-level histogram corresponding to the current target gray-level peak is separated from the gray-level histogram.

[0167] In some embodiments, the sample marking unit 33 includes:

[0168] Subphase acquisition subunit 33a is configured to acquire the shape of at least one of the subphases;

[0169] The first query subunit 33b is configured to retrieve subphase information matching the subphase in a database according to a preset first query rule; wherein the database includes: at least one subphase graphic with a typical geometric structure, and the subphase graphic is associated with the subphase information, the subphase information including: the main phase type corresponding to the subphase, and the subphase type of the subphase; wherein the first query rule requires that the shape of the subphase matches the subphase graphic corresponding to the subphase information, and that the main phase type of the subphase matches the main phase type of the subphase graphic;

[0170] If the first marking subunit 33c finds subphase information that matches the first query rule in the first query subunit 33b, it automatically marks the subphase according to the subphase information.

[0171] In some embodiments, it also includes:

[0172] The second query subunit 33d is configured to retrieve subphase information matching the subphase in the database according to the second query rule if the subphase graphic that matches the first query rule is not found in the first query subunit 33b; wherein the second query rule requires that the shape of the subphase matches the subphase graphic corresponding to the subphase information.

[0173] The second marking subunit 33e is configured to send a first prompt signal to the user if the subphase information that matches the second query rule is found in the second query subunit 33d. The first prompt signal includes: the image of the subphase to be marked, the subphase image found, and the corresponding subphase information; and to mark the subphase in response to the first marking signal input by the user. The first marking signal includes: the subphase type.

[0174] In some embodiments, it also includes:

[0175] The third marking subunit 33f is configured to mark the subphase in response to a second marking signal input by the user if the subphase graphic is not found in either the first query subunit 33b or the second query subunit 33d. The second marking signal includes: subphase type.

[0176] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0177] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a computer terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0178] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

[0179] References

[0180] [1] Wan Weihao et al. Identification, extraction and quantitative statistical analysis of the second phase in large-size aluminum alloys based on deep learning algorithm. Rare Metal Materials and Engineering 002(2022):051.

Claims

1. A method for quantitatively calculating the proportion of the second phase in an alloy based on image recognition technology, characterized in that, include: S100 acquires an image of the alloy sample to be inspected; S101 inputs the alloy sample image into a pre-trained alloy analysis model and outputs the proportion of the second phase of the alloy in the alloy sample image; wherein, the training steps of the alloy analysis model include: S200 acquires a first sample image of the alloy; S201 converts the first sample image into a grayscale histogram; S202 queries the number of target grayscale peaks in the grayscale histogram, wherein the target grayscale peaks refer to grayscale peaks other than those in the substrate phase. S203 determines whether the grayscale histogram needs to be separated based on the quantity, and obtains a training sample set accordingly. The training sample set includes multiple second sample images obtained by converting the grayscale histogram. S204 Input the training sample set into the deep network learning model to train the alloy analysis model; S203 includes: S300 determines whether the current number of grayscale histograms is greater than the preset target number. If yes, proceed to S301; otherwise, proceed to S302. S301 controls the binarization threshold of the current grayscale histogram to obtain a first separated grayscale histogram including a phase, wherein the phase in the first separated grayscale histogram corresponds to one of the target grayscale peaks, and the phase includes: at least one sub-phase of shape; S302 Determine whether there is a sub-phase with shape difference in the phase in the current corresponding gray level histogram; if so, proceed to S303. S303 labels the type of the sub-phase in the corresponding grayscale histogram and uses the grayscale histogram as the second sample image.

2. The method according to claim 1, characterized in that, It also includes the following steps: S304 Subtracts the first separated grayscale histogram from the current grayscale histogram to obtain the corresponding second separated grayscale histogram; returns to S300.

3. The method according to claim 2, characterized in that, S301 includes the following steps: Obtain the left boundary point of the rightmost target grayscale peak in the current corresponding grayscale histogram; The binarization threshold is calculated based on the left boundary point, wherein the binarization threshold = L / 255, and L is the value of the left boundary point; Based on the binarization threshold, the first separated gray-level histogram corresponding to the current target gray-level peak is separated from the gray-level histogram.

4. The method according to claim 2, characterized in that, The steps for labeling the type of the sub-phase include: (1) Obtain the shape of at least one of the sub-phases; (2) Retrieve subphase information matching the subphase in the database according to a preset first query rule; wherein, the database includes: at least one subphase graphic with a typical geometric structure, and the subphase graphic is associated with the subphase information, the subphase information including: the main phase type corresponding to the subphase, and the subphase type of the subphase; wherein, the first query rule requires that the shape of the subphase matches the subphase graphic corresponding to the subphase information, and the main phase type of the subphase matches the main phase type of the subphase graphic; (3) If the sub-phase information that matches the first query rule is found in (2), the sub-phase is automatically marked according to the sub-phase information.

5. The method according to claim 4, characterized in that, The step of labeling the type of the sub-phase further includes: (4) If the subphase graphic that matches the first query rule is not found in (2), the subphase information that matches the subphase is retrieved from the database according to the second query rule; wherein the second query rule requires that the shape of the subphase matches the subphase graphic corresponding to the subphase information. (5) If the sub-phase information that matches the second query rule is found in (4), a first prompt signal is sent to the user. The first prompt signal includes: the image of the sub-phase to be marked, the sub-phase graphic found, and the corresponding sub-phase information. (6) The subphase is marked in response to a first marking signal input by the user, the first marking signal including: subphase type.

6. The method according to claim 5, characterized in that, The step of labeling the type of the sub-phase further includes: If no corresponding sub-phase graphic is found in (2) or (4), the sub-phase is marked in response to a second marking signal input by the user, the second marking signal including: sub-phase type.

7. The method according to claim 4, characterized in that, The typical geometric structures include one or more of the following: circles, near-circles, polygons, and near-polygons.

8. The method according to claim 1, characterized in that, The deep network learning models include: the U-netresent34 model and the U-net resent18 semantic segmentation model.

9. The method according to claim 1, characterized in that, The alloy includes: aluminum alloy.

10. The method according to claim 1, characterized in that, S200 includes: Multiple alloy samples with different solid solution and aging states were selected; The alloy samples were polished. Multiple high-throughput images of the first sample are obtained by scanning the alloy sample using an image acquisition device.

Citation Information

Patent Citations

  • Statistical method and device for alloy precipitated phase fraction, electronic equipment and medium

    CN110334664A

  • Aluminum alloy micron-sized second phase quantitative statistical characterization method based on deep learning

    CN112489039A