Statistical method and statistical device for number of inclusions

The statistical model constructed through CT scanning and improved BP neural network solves the problem of large statistical errors in the quantity of manganese sulfide inclusions in easy-to-cut steel, and realizes high-precision inclusion quantity evaluation, supporting the quality control of industrial production.

CN120355702AActive Publication Date: 2025-07-22NORTH CHINA UNIVERSITY OF SCIENCE AND TECHNOLOGY +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510819967.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-07-22
Estimated Expiration
2045-06-19

AI Technical Summary

Technical Problem

In the prior art, there are large detection and statistical errors in the quantity of manganese sulfide inclusions in easy-to-cut steels, and it is impossible to accurately evaluate product quality.

Method used

The three-dimensional inclusion distribution map was reconstructed by CT scanning technology, and multiple two-dimensional sectional images were obtained through multi-position cutting. Combined with the improved BP neural network, the real number, area proportion, average area, average circumference, average spherical degree and apparent number of manganese sulfide inclusions were constructed to accurately count the number of manganese sulfide inclusions.

Benefits of technology

It improves the accuracy of the quantity statistics of manganese sulfide inclusions, can correctly evaluate the product quality of easy-to-cut steel, and is suitable for industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120355702A_ABST
    Figure CN120355702A_ABST
Patent Text Reader

Abstract

The invention discloses a statistical method and a statistical device for the number of inclusions, which are applied to statistics of manganese sulfide inclusions in free-cutting steel. The statistical method comprises the following steps: obtaining a first real number, a first area ratio, a first average area, a first average perimeter, a first average sphericity and a first apparent number of manganese sulfide inclusions in a plurality of two-dimensional section images of a training sample; constructing a statistical model based on the first real number, the first area proportion, the first average area, the first average perimeter, the first average sphericity and the first apparent number; and obtaining a second area proportion, a second average area, a second average perimeter, a second average sphericity degree and a second apparent number of the manganese sulfide inclusions in the metallographic image of the sample to be counted, and substituting the second area proportion, the second average area, the second average perimeter, the second average sphericity degree and the second apparent number into the statistical model to obtain the number of the manganese sulfide inclusions in the sample to be counted output by the statistical model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of inclusion statistics of free-cutting steel, and specifically relates to a method and device for counting the number of inclusions. Background Art

[0002] Free-cutting steel refers to alloy steel in which a certain amount of one or more free-cutting elements such as sulfur, phosphorus, lead, calcium, selenium, tellurium, etc. are added to improve its machinability. The MnS inclusions in free-cutting steel can not only make the chips in the cutting process easy to break, but also play a role in lubricating the cutting tool during the processing, thus effectively reducing tool wear. The number, shape, size and distribution of MnS inclusions are the key factors affecting the strength, impact toughness and fatigue performance of free-cutting steel. Therefore, accurate statistics of MnS inclusions is the key prerequisite for evaluating the performance of free-cutting steel.

[0003] In the related art, two-dimensional pictures of free-cutting steel are obtained through an optical microscope and a scanning electron microscope, and then the number of manganese sulfide inclusions in the two-dimensional image is counted manually or by relying on imageJ software. However, this statistical method has large detection and statistical errors, and it is impossible to accurately obtain the number of MnS inclusions in free-cutting steel in industrial production, and it is impossible to correctly evaluate the quality of free-cutting steel products. Summary of the Invention

[0004] To solve the technical problem of large statistical errors in the number of manganese sulfide inclusions in free-cutting steel at present, this application provides a method and device for counting the number of inclusions.

[0005] In the first aspect of this application, a method for counting the number of inclusions is provided, which is applied to counting manganese sulfide inclusions in free-cutting steel. The statistical method includes: Obtaining the first true number, the first area ratio, the first average area, the first average perimeter, the first average sphericity and the first apparent number of manganese sulfide inclusions in multiple two-dimensional section images of a training specimen; Constructing a statistical model based on the first true number, the first area ratio, the first average area, the first average perimeter, the first average sphericity and the first apparent number; Obtaining the second area ratio, the second average area, the second average perimeter, the second average sphericity and the second apparent number of manganese sulfide inclusions in the metallographic image of the specimen to be counted, and substituting them into the statistical model to obtain the number of manganese sulfide inclusions in the specimen to be counted output by the statistical model.

[0006] In some embodiments, obtaining the first true number of manganese sulfide inclusions in multiple two-dimensional section images of a training specimen includes: Obtain the CT scan images of the training specimens, and reconstruct the CT scan images to obtain the three-dimensional inclusion distribution map of the training specimens; Perform multi-position cutting on the three-dimensional inclusion distribution map to obtain a plurality of two-dimensional sectional images; Determine the first true quantity of manganese sulfide inclusions in the plurality of two-dimensional sectional images.

[0007] In some embodiments, each inclusion in the three-dimensional inclusion distribution map is respectively assigned a different gray value. The determining the first true quantity of manganese sulfide inclusions in the plurality of two-dimensional sectional images includes: Perform image coding on the plurality of two-dimensional sectional images and extract the gray values of the manganese sulfide inclusions to obtain the image coding of the plurality of two-dimensional sectional images and the number of gray values of the non-repeated manganese sulfide inclusions in the plurality of two-dimensional sectional images; Determine the first true quantity of manganese sulfide inclusions in the plurality of two-dimensional sectional images according to the image coding and the number of gray values in the corresponding two-dimensional sectional images.

[0008] In some embodiments, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity are obtained through the following steps: Perform feature extraction on the plurality of two-dimensional sectional images to determine the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity of the manganese sulfide inclusions in the plurality of two-dimensional sectional images.

[0009] In some embodiments, the constructing a statistical model based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity includes: Train an improved BP neural network based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity to obtain the statistical model, wherein the first layer to the fifth layer of the improved BP neural network each include a linearly transformed module and a non-linearly activated module arranged in sequence, the sixth layer is a linearly transformed layer, the output end of the second layer jumps to the input end of the fourth layer, the output end of the third layer jumps to the input end of the fifth layer, and the output end of the fourth layer jumps to the input end of the sixth layer.

[0010] In some embodiments, the training the improved BP neural network based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity includes: Input the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity into the improved BP neural network to obtain the predicted quantity output by the last layer of the improved BP neural network; Use the mean square error function to determine the deviation value between the predicted quantity and the true quantity; Calculate the derivative of the deviation value with respect to the training parameters of the improved BP neural network to obtain the gradient of the training parameters; Update the training parameters according to the gradient of the training parameters and the adaptive moment estimation optimization algorithm; Accumulate the number of training times, and return to the step of inputting the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity into the improved BP neural network until the number of training times reaches a preset threshold to terminate the training.

[0011] In some embodiments, the training specimen is a cylindrical specimen, and the diameter of the cylindrical specimen is 0.2 mm to 1 mm, and the length is 5 mm to 20 mm.

[0012] In some embodiments, in the free-cutting steel, the mass fraction of manganese is 1.20% to 1.50%, and the mass fraction of sulfur is 0.25% to 0.40%.

[0013] In some embodiments, in the free-cutting steel, the mass fraction of manganese is 1.20% to 1.30% or 1.40% to 1.50%, and the mass fraction of sulfur is 0.25% to 0.30% or 0.35% to 0.40%.

[0014] In a second aspect of the present application, there is provided an inclusion quantity statistical device based on the inclusion quantity statistical method of the first aspect, including: An acquisition module, configured to obtain the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity of manganese sulfide inclusions in a plurality of two-dimensional sectional images of a training specimen; A model construction module, configured to construct a statistical model based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity; A statistics module, configured to obtain the second area ratio, the second average area, the second average perimeter, the second average sphericity, and the second apparent quantity of manganese sulfide inclusions in a metallographic image of a specimen to be statistically analyzed, and substitute them into the statistical model to obtain the quantity of manganese sulfide inclusions in the specimen to be statistically analyzed output by the statistical model.

[0015] The inclusion quantity statistical method provided by the embodiment of the present application is applied to statistically analyze manganese sulfide inclusions in free-cutting steel. The statistical method includes: obtaining the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity of manganese sulfide inclusions in multiple two-dimensional sectional images of a training specimen; constructing a statistical model based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity; obtaining the second area ratio, the second average area, the second average perimeter, the second average sphericity, and the second apparent quantity of manganese sulfide inclusions in the metallographic image of the specimen to be statistically analyzed, and substituting them into the statistical model to obtain the quantity of manganese sulfide inclusions in the specimen to be statistically analyzed output by the statistical model.

[0016] Since the model is constructed using the true quantity, area ratio, average area, average perimeter, average sphericity, and apparent quantity of manganese sulfide inclusions in two-dimensional sectional images, each parameter is closely related to manganese sulfide inclusions, and there are many types of parameters and a very large number of two-dimensional sectional images, the statistical result of the formed statistical model has high accuracy. Therefore, after substituting the area ratio, average area, average perimeter, average sphericity, and apparent quantity of manganese sulfide inclusions in the metallographic image of the specimen to be statistically analyzed into the model, the quantity of inclusions with very small deviation can be statistically analyzed to correctly evaluate the quality of free-cutting steel in industrial production. Description of the Drawings

[0017] Figure 1 Shows the three-dimensional manganese sulfide inclusion distribution map in the free-cutting steel of the present application; Figure 2 Shows Figure 1 The sectional view at the position of X = 0.

[0018] Figure 3 Shows Figure 1 The sectional view at the position of Y = 0.

[0019] Figure 4 Shows Figure 1 One of the manganese sulfide inclusions and the sectional view.

[0020] Figure 5 Shows the step diagram of the inclusion quantity statistical method of the present application. Detailed Embodiments

[0021] In order to make the technical personnel in the technical field to which the present application belongs to understand the present application more clearly, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0022] Free-cutting steel contains sulfur and manganese, which will form manganese sulfide inclusions in free-cutting steel. Manganese sulfide inclusions have good plasticity, so during hot rolling, manganese sulfide will deform along with the matrix. Figure 1 . Figure 1 The extension direction of the coordinate axis Z is the rolling direction. The darker long strips are manganese sulfide inclusions. Some manganese sulfide inclusions will be cut off by rolling, forming more than two manganese sulfide inclusions, while some manganese sulfide inclusions are not cut off by rolling, showing a rod-like shape with a thinner middle and thicker ends (see Figure 4 ). For an inclusion that is thinner in the middle and thicker at both ends, it includes a first end, a middle portion and a second end, the first end, the middle portion and the second end are connected in sequence, and the diameter of the middle portion is smaller than the diameters of the first end and the second end.

[0023] Related technology In the process of counting manganese sulfide inclusions in free-cutting steel, the surface to be analyzed of the free-cutting steel is first photographed by an optical microscope or a scanning electron microscope to form a two-dimensional metallographic picture, and then the manganese sulfide inclusions in the two-dimensional metallographic picture are counted manually or using imageJ software to obtain the number of manganese sulfide inclusions in the free-cutting steel. Since some manganese sulfide inclusions have a relatively thin middle portion and a relatively large diameter at the first end and the second end, in order to count the number of manganese sulfide inclusions and test the size of the manganese sulfide inclusions along the rolling direction, the observed sample surfaces are mostly parallel to the rolling direction. On the surface of the sample parallel to the rolling direction, some manganese sulfide inclusions will present two closed figures (see Figures 2 to 4 ), when counting the two-dimensional metallographic images, the grayscale of the two closed figures is darker than the steel matrix, and they will be identified as two manganese sulfide inclusions. Since there are multiple inclusions on the surface to be analyzed that form two closed figures after being cut open, the number of manganese sulfide inclusions counted will be much higher than the actual value.

[0024] The first embodiment of the present application provides a method for counting the number of inclusions, which can accurately count the number of manganese sulfide inclusions in free-cutting steel to correctly evaluate the quality of free-cutting steel products.

[0025] In free-cutting steels, manganese sulfide inclusions are needed to improve the cutting performance. Therefore, sulfur and manganese elements need to be deliberately added to the steel. Generally, the mass fraction of manganese is 1.20% - 1.50%, and the mass fraction of sulfur is 0.25% - 0.40%. In some embodiments, the mass fraction of manganese is 1.20% - 1.30%, and the mass fraction of sulfur is 0.35% - 0.40%. In other embodiments, the mass fraction of manganese is 1.40% - 1.50%, and the mass fraction of sulfur is 0.25% - 0.30%.

[0026] The present application will be described below with reference to the accompanying drawings and specific embodiments: Please refer to Figure 5 , the method for counting the number of inclusions provided by the embodiment of the present application includes: S1. Obtain the first true number, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent number of manganese sulfide inclusions in a plurality of two-dimensional sectional images of the training specimen; S2. Based on the first true number, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent number, construct a statistical model; S3. Obtain the second area ratio, the second average area, the second average perimeter, the second average sphericity, and the second apparent number of manganese sulfide inclusions in the metallographic image of the specimen to be counted, and substitute them into the statistical model to obtain the number of manganese sulfide inclusions in the specimen to be counted output by the statistical model.

[0027] The apparent number, area ratio, average area, average perimeter, and average sphericity of manganese sulfide inclusions in the two-dimensional sectional image are explained as follows: The apparent number of manganese sulfide inclusions in the two-dimensional sectional image refers to the number of all closed figures with gray levels lower than the steel matrix in this two-dimensional sectional image, and can also be understood as the number of manganese sulfide inclusions identified by analyzing the two-dimensional metallographic picture using an optical microscope or a scanning electron microscope in the related art. Generally, in this two-dimensional sectional image, the apparent number of manganese sulfide inclusions is higher than the true number of manganese sulfide inclusions.

[0028] The area ratio of manganese sulfide inclusions in the two-dimensional sectional image refers to the ratio of the total area of the apparent number of manganese sulfide inclusions in this two-dimensional sectional image to the area of this two-dimensional sectional image.

[0029] The average area of manganese sulfide inclusions in the two-dimensional sectional image refers to the ratio of the total area of the apparent number of manganese sulfide inclusions in the two-dimensional sectional image to the number of apparent manganese sulfide inclusions in this two-dimensional sectional image.

[0030] The average perimeter of manganese sulfide inclusions in a two-dimensional sectional image refers to the ratio of the perimeters of all manganese sulfide inclusions (the apparent number of manganese sulfide inclusions) in the two-dimensional sectional image to the apparent number of manganese sulfide inclusions in the two-dimensional sectional image.

[0031] The average sphericity of manganese sulfide inclusions in a two-dimensional sectional image refers to the ratio of the sum of the sphericities of the manganese sulfide inclusions of the apparent number to the apparent number of manganese sulfide inclusions in the two-dimensional sectional image.

[0032] First, obtain the first true number, first area ratio, first average area, first average perimeter, first average sphericity, and first apparent number of manganese sulfide inclusions in the two-dimensional sectional image of the training specimen, and then construct a statistical model based on the first true number, first area ratio, first average area, first average perimeter, first average sphericity, and first apparent number. Therefore, the statistical model can reflect the relationships among various parameters (true number, area ratio, average area, average perimeter, average sphericity, and apparent number) in the training specimen. Substitute the second area ratio, second average area, second average perimeter, second average sphericity, and second apparent number of manganese sulfide inclusions in the metallographic image of the specimen to be statistically analyzed into the statistical model, and the number of manganese sulfide inclusions in the specimen to be statistically analyzed can be obtained.

[0033] Since the statistical model is constructed using the true number, area ratio, average area, average perimeter, average sphericity, and apparent number of manganese sulfide inclusions in the two-dimensional sectional image, each parameter is closely related to the manganese sulfide inclusions, and there are many types of parameters. Therefore, the statistical results of the formed statistical model have high accuracy. At the same time, there are multiple two-dimensional sectional images, and the number is very large. Therefore, the higher the accuracy of the statistical results of the statistical model. That is to say, using multiple parameters closely related to manganese sulfide inclusions and multiple two-dimensional sectional images makes the accuracy of the statistical model very high. Therefore, the number of manganese sulfide inclusions statistically analyzed based on the high-precision model is closer to the true number and has high accuracy.

[0034] In some embodiments, obtaining the first true number of manganese sulfide inclusions in multiple two-dimensional sectional images of the training specimen includes: S11. Obtain the CT scan image of the training specimen and reconstruct the CT scan image to obtain the three-dimensional inclusion distribution map of the training specimen; S12. Perform multi-position cutting on the three-dimensional inclusion distribution map to obtain multiple two-dimensional sectional images; S13. Determine the first true number of manganese sulfide inclusions in the multiple two-dimensional sectional images.

[0035] In step S11, CT is the abbreviation of Computed Tomography. The CT scan image is the computed tomography scan image, which can be completed by a computed tomography device. The computed tomography device utilizes computed tomography technology. Computed tomography technology is generally applied to medical examinations and can also be used for industrial inspections. Computed tomography technology uses an X-ray beam to perform tomographic scanning on the free-cutting steel sample and generates a detailed image of the internal structure of the free-cutting steel sample with the aid of computer processing. The computed tomography device includes a scanning system, a computer system, and an image display and storage system. The scanning system can perform layer-by-layer scanning on the training specimen through the X-ray beam and the detector. When the X-ray penetrates the training specimen, the steel matrix and manganese sulfide inclusions have different absorption degrees of the X-ray, and the intensity of the ray received by the detector will change. These changing ray signals are converted into electrical signals and then converted into digital signals through a digital converter, and then a CT scan image of the training specimen is generated through computer system processing and displayed and stored in the image display and storage system. A high-resolution device can be selected for the computed tomography device to improve the clarity of the CT scan image. The computed tomography device is prior art, and more content can be referred to the disclosure of the prior art, which will not be elaborated in this application.

[0036] The training specimen can be made into a column shape, with a diameter of 0.2 mm to 1 mm, such as 0.3 mm, 0.5 mm, 0.7 mm, 0.8 mm, or 0.9 mm, etc., and a length of 5 mm to 20 mm, such as 6 mm, 7 mm, 8 mm, 9 mm, 10 mm, 12 mm, 13 mm, 15 mm, 18 mm, or 19 mm, etc. Such a specimen is relatively thin and long, and the X-ray scanning is more likely to penetrate. The columnar specimen can be prepared by wire electrical discharge machining. Place the columnar specimen on the stage of the computed tomography device, and the parameters can be set according to needs. For example, the X-ray energy can be 0 to 160 kv, the exposure time can be 0.1 to 8 s, the X-ray transmittance can be 20% to 35%, the X-ray intensity can be , and the rotation angle can be , to obtain pixels or pixels of the CT scan image.

[0037] Reconstruct the CT scan image, so that a three-dimensional inclusion distribution map of the needle-shaped training specimen of the training specimen can be obtained. In some embodiments, the CT scan image can be reconstructed by three-dimensional image processing software (such as Avizo), and of course, it can also be reconstructed by other means such as multi-planar reconstruction (MPR for short).

[0038] Then, the reconstructed three-dimensional inclusion distribution map is cut at multiple positions to obtain multiple two-dimensional cross-sectional images. Here, the cutting refers to cutting the three-dimensional inclusion distribution map along the rolling direction, and multiple positions can be sequentially and evenly distributed perpendicular to the rolling direction. The content shown in the two-dimensional cross-sectional images here is basically the same as that of traditional two-dimensional metallographic pictures, both of which are closed figures distributed on the steel matrix. Since the three-dimensional inclusion distribution map has been constructed previously, it is easy to determine the true number of inclusions in the two-dimensional cross-sectional images.

[0039] In some embodiments, the true number of inclusions in the two-dimensional cross-sectional images can be obtained by the following method: First, different gray values are assigned to each inclusion in the three-dimensional inclusion distribution map, and then the three-dimensional inclusion distribution map is cut at multiple positions to obtain multiple two-dimensional cross-sectional images; image coding is performed on the multiple two-dimensional cross-sectional images and the gray values of manganese sulfide inclusions are extracted to obtain the image coding of the multiple two-dimensional cross-sectional images and the number of gray values of non-repeated manganese sulfide inclusions in the multiple two-dimensional cross-sectional images; according to the image coding and the number of gray values in the corresponding two-dimensional cross-sectional images, the first true number of manganese sulfide inclusions in the multiple two-dimensional cross-sectional images is determined.

[0040] In some other embodiments, the true number of inclusions can also be determined manually. In the two-dimensional cross-sectional image, if the same inclusion is cut to form two closed figures, then these two closed figures are linked. In the three-dimensional image processing software (Avizo), when one of the closed figures is selected, the other closed figure belonging to the same manganese sulfide inclusion will also show the same selected color or highlight, so as to know that the two belong to the same manganese sulfide inclusion.

[0041] In some embodiments, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent number are obtained through the following steps: feature extraction is performed on multiple two-dimensional cross-sectional images to determine the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent number of manganese sulfide inclusions in the multiple two-dimensional cross-sectional images. During implementation, the three-dimensional image processing software can be directly used to extract the parameters of the area ratio, average area, average perimeter, average sphericity, and apparent number of the two-dimensional cross-sectional images, or the image processing software (imageJ) can be used to extract the parameters of the area ratio, average area, average perimeter, average sphericity, and apparent number of the two-dimensional cross-sectional images. There are many types of image processing software, and only the above are listed, and one or more software can be selected according to actual needs to achieve this. Since the image processing software is prior art, more content can be referred to the prior art disclosure, and this application will not elaborate further.

[0042] In some embodiments, a statistical model is constructed based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity, including: An improved BP neural network is trained based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity to obtain a statistical model. Among them, the first layer to the fifth layer of the improved BP neural network each include a linear transformation module and a non-linear activation module arranged in sequence, the sixth layer is a linear transformation layer, the output end of the second layer is skip-connected to the input end of the fourth layer, the output end of the third layer is skip-connected to the input end of the fifth layer, and the output end of the fourth layer is skip-connected to the input end of the sixth layer.

[0043] In the implementation process, an improved BP neural network architecture can be constructed based on the PyTorch deep learning framework. The hierarchical structure and related parameters of this improved BP neural network architecture can be referred to Table 1 below: Table 1 In the embodiments of the present application, the construction method of the residual connection in the improved BP neural network architecture is: the output end of the second layer (layer index is 1) is skip-connected to the input end of the fourth layer (layer index is 3), the output end of the third layer (layer index is 2) is skip-connected to the input end of the fifth layer (layer index is 4), and the output end of the fourth layer (layer index is 3) is skip-connected to the input end of the sixth layer (layer index is 5), forming a skip-gradient transfer channel.

[0044] It should be noted that traditional residual connections are usually skip connections across two or three layers, while the residual connections established in the embodiments of the present application are cumulative layer by layer and do not span multiple layers. This connection method can increase the non-linear expression ability of the model and alleviate the problem of gradient disappearance.

[0045] In some embodiments, training the improved BP neural network based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity includes: S21. Input the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity into the improved BP neural network to obtain the predicted quantity output by the last layer of the improved BP neural network; S22. Use the mean square error function to determine the deviation value between the predicted quantity and the first true quantity; S23. Calculate the derivative of the deviation value with respect to the training parameters of the improved BP neural network to obtain the gradient of the training parameters; S24. Update the training parameters according to the gradient of the training parameters and the adaptive moment estimation optimization algorithm; S25. Accumulate the number of training times, and return the step of inputting the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity into the improved BP neural network, and terminate the training until the number of training times reaches the preset threshold.

[0046] After constructing the improved BP neural network, it can be initialized first. In the implementation process, the initialization rules can be referred to as follows: Initialization method of the weight matrix: Use the default uniform distribution initialization algorithm in PyTorch to perform parameter initialization configuration on the weight matrix of the linear transformation module. Its mathematical expression can be: ; In the formula, W i is the weight matrix, d in is the input dimension (such as d in of the first layer is 1), is the abbreviation of the uniform distribution in probability theory and statistics.

[0047] Initialization method of the bias vector: Use the zero vector to initialize the bias terms of all linear transformation modules, that is, b i = 0, where b i is the bias vector.

[0048] Configuration method of the activation function parameters: Each non-linear activation module uses the LeakyReLU activation function, and the activation function parameter α is uniformly set to 0.01.

[0049] In step S21, after inputting the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity into the improved BP neural network, the improved BP neural network realizes the forward feature extraction function through the combination of hierarchical feature transformation and residual connection.

[0050] First, input the data (N is the batch size, d in is the input dimension). When the layer index perform the following operations: In the formula, h i is the output of the i-th layer; LeakyReLU() is the activation function; (d out is the output dimension) is the weight matrix; is the output of the previous layer; is the bias vector.

[0051] Furthermore, when the layer index At this time, the output h of the current layer i and the output h of the previous layer i-1 perform feature fusion and execute the following residual connection operation: .

[0052] The final output of the improved BP neural network is generated by the computing unit of the sixth layer. When the current layer index is 5, the feature tensor of the output of the previous layer performs a linear mapping operation, and its calculation formula can be: In the formula, is the output result of the improved BP neural network, , is the predicted quantity of the output of the last layer, and its dimension is .

[0053] In step S22, the mean square error function can be used as the loss function to quantify the deviation value between the predicted quantity and the true quantity, and its mathematical expression can be:

[0054] In the formula, is the deviation value, N is the total number of batch training samples, is the predicted quantity corresponding to the i-th sample, is the true quantity corresponding to the i-th sample.

[0055] In step S23, the gradients i of the loss function L with respect to the weight matrix W i and the bias vector b and can be calculated layer by layer according to the chain rule of derivative, and its calculation formula can be: ; .

[0056] In step S24, the adaptive moment estimation optimization algorithm can be used to perform iterative update of the training parameters. Assuming the gradient is , where is W i or b i , the training parameters can be dynamically adjusted according to the following four steps: S241. First-order moment estimation calculation: Construct the first-order statistic of the gradient vector to represent the exponential moving average of the historical gradient direction, and its calculation formula can be: ; In the formula, m tis the first moment estimation vector at the t-th iteration, is the first moment decay rate, is the current training parameter gradient.

[0057] S242. Second moment estimation calculation: Generate a second moment estimator of the squared gradient to quantify the fluctuation characteristics of the gradient. Its calculation formula can be: ; In the formula, is the second moment estimation at the current time step, is the second moment decay rate.

[0058] S243. Bias correction: Compensate for the moment estimation bias in the initial stage of iteration. The correction formula can be: ; In the formula, is the corrected first moment estimation; is the corrected second moment estimation.

[0059] S244. Parameter update: Adjust the parameter update step size according to the corrected moment estimator to complete the iterative mapping of the parameter space coordinates. Its calculation formula can be: ; In the formula, is the initial learning rate (the value range is 0.01 - 0.1), is the numerical stability coefficient, is the element-wise square root operation of the second moment estimation.

[0060] In step S25, the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity of manganese sulfide inclusions in the multiple two-dimensional sectional images of the training specimens obtained in step S1 can be divided into a training subset D train and a test subset D test , where the training subset D train is used to be input into the improved BP neural network for iterative training.

[0061] In the implementation process, the improved BP neural network generates a predicted quantity through feed-forward processing, and then calculates the deviation value L between the predicted quantity Y and the true data T based on the mean square error function, where , and then calculates the gradients and of each layer of training parameters based on the chain rule backpropagation algorithm, and finally updates the set of training parameters using the Adam optimization algorithm.

[0062] The training process can be looped by the controller. When the cumulative number of training times reaches the pre-set maximum training round threshold (e.g., 1000 times), the training process is terminated and the optimized weight file (.pth file, containing the trained parameters) is solidified to the persistent storage medium.

[0063] After the improved BP neural network training is completed, the test subset D can be used test to evaluate the trained network. During the implementation process, the validation samples can be input into the trained improved BP neural network, and after being mapped by the activation function, a set of predicted quantities is output , and the relative error of each sample point can be calculated according to the following formula: ; In the formula, is the calibrated true quantity. Define the validation evaluation index as the proportion of valid predictions that satisfy : ; In the formula, M is the total number of data in the test subset, is the indicator function, which takes the value of 1 if and only if the relative error magnitude satisfies the condition .

[0064] During the implementation process, the improved BP neural network that meets the evaluation criteria can be used as a statistical model, and a statistical system program for manganese sulfide inclusions can be built based on this statistical model, and the weight file can be configured in this system. The second area ratio, second average area, second average perimeter, second average sphericity, and second apparent quantity of manganese sulfide inclusions in the metallographic image of the specimen to be statistically analyzed are input into the statistical system program for manganese sulfide inclusions, so as to realize the quantity statistics of manganese sulfide inclusions.

[0065] For the free-cutting steel of the target grade, a dataset with the steel grade identification is generated according to the above method, and then the dataset is input into the improved BP neural network for transfer learning training to obtain the weight file for manganese sulfide inclusions in the free-cutting steel of the target grade. Then, this weight file is imported into the statistical system program for manganese sulfide inclusions, and the quantity statistics of manganese sulfide inclusions in the metallographic image of the free-cutting steel of the target grade can be realized.

[0066] The improved BP neural network obtained through the above solution can quickly realize the quantity statistics of manganese sulfide inclusions in the metallographic images of free-cutting steels of different grades, improve the speed and efficiency of the quantity statistics of manganese sulfide inclusions, and reduce the statistical cost.

[0067] Based on the same technical concept as the first aspect, an embodiment of the second aspect of the present application provides an inclusion quantity statistical device.

[0068] The inclusion quantity statistical device includes an acquisition module, a model construction module, and a statistical module. Among them: The acquisition module is used to obtain the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity of manganese sulfide inclusions in a plurality of two-dimensional sectional images of a training specimen.

[0069] The model construction module is used to construct a statistical model based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity; The statistical module is used to obtain the second area ratio, the second average area, the second average perimeter, the second average sphericity, and the second apparent quantity of manganese sulfide inclusions in the metallographic image of the specimen to be statistically analyzed, and substitute them into the statistical model to obtain the quantity of manganese sulfide inclusions in the specimen to be statistically analyzed output by the statistical model.

[0070] In some embodiments, the acquisition module is further used to obtain a CT scan image of the training specimen, reconstruct the CT scan image to obtain a three-dimensional inclusion distribution map of the training specimen; perform multi-position cutting on the three-dimensional inclusion distribution map to obtain a plurality of two-dimensional sectional images; determine the first true quantity of manganese sulfide inclusions in the plurality of two-dimensional sectional images.

[0071] In some embodiments, different gray values are respectively assigned to each inclusion in the three-dimensional inclusion distribution map, and the acquisition module is further used to perform image coding on the plurality of two-dimensional sectional images and extract the gray values of manganese sulfide inclusions, to obtain the image coding of the plurality of two-dimensional sectional images and the quantity of non-repeated gray values of manganese sulfide inclusions in the plurality of two-dimensional sectional images; determine the first true quantity of manganese sulfide inclusions in the plurality of two-dimensional sectional images according to the image coding and the quantity of gray values in the corresponding two-dimensional sectional images.

[0072] In some embodiments, the acquisition module is further used to perform feature extraction on the plurality of two-dimensional sectional images to determine the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity of manganese sulfide inclusions in the plurality of two-dimensional sectional images.

[0073] In some embodiments, the model construction module is further configured to train an improved BP neural network based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity to obtain a statistical model. The first layer to the fifth layer of the improved BP neural network each sequentially include a linear transformation module and a non-linear activation module, the sixth layer is a linear transformation layer, the output end of the second layer is skip-connected to the input end of the fourth layer, the output end of the third layer is skip-connected to the input end of the fifth layer, and the output end of the fourth layer is skip-connected to the input end of the sixth layer.

[0074] In some embodiments, the model construction module is further configured to input the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity into the improved BP neural network to obtain a predicted quantity output by the last layer of the improved BP neural network; use the mean square error function to determine the deviation value between the predicted quantity and the true quantity; calculate the derivative of the deviation value with respect to the training parameters of the improved BP neural network to obtain the gradient of the training parameters; update the training parameters according to the gradient of the training parameters and the adaptive moment estimation optimization algorithm; accumulate the number of training times, and return the step of inputting the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity into the improved BP neural network until the number of training times reaches a preset threshold to terminate the training.

[0075] In some embodiments, the training specimen is a cylindrical specimen, and the diameter of the cylindrical specimen is 0.2 mm to 1 mm, and the length is 5 mm to 20 mm.

[0076] In some embodiments, in the free-cutting steel, the mass fraction of manganese is 1.20% to 1.50%, and the mass fraction of sulfur is 0.25% to 0.40%.

[0077] In some embodiments, in the free-cutting steel, the mass fraction of manganese is 1.20% to 1.30% or 1.40% to 1.50%, and the mass fraction of sulfur is 0.25% to 0.30% or 0.35% to 0.40%.

[0078] The inclusion quantity statistical method and the statistical device provided by this application at least have the following advantages: (1) Using the parameters (true quantity, area ratio, average area, average perimeter, average sphericity, and apparent quantity) of manganese sulfide inclusions in the training specimens in free-cutting steel as the data basis for constructing the model, with a large variety and quantity of parameters, the constructed statistical model has high statistical accuracy. Therefore, the deviation of the quantity of manganese sulfide inclusions statistically calculated by this statistical model is small.

[0079] After constructing the statistical model, it is only necessary to obtain the metallographic image in a conventional manner, and then extract the area ratio, average area, average sphericity, and apparent quantity of manganese sulfide inclusions, and substitute them into the statistical model to obtain the quantity of manganese sulfide inclusions. After the statistical model is constructed, it can be applied multiple times to free-cutting steels of different heats and different grades. The statistical process is simple, easy to operate, efficient, and suitable for industrial production.

[0080] In this application, unless otherwise clearly specified and defined, the first feature being "on" or "under" the second feature may include the direct contact between the first and second features, or may include the situation where the first and second features are not in direct contact but in contact through additional features therebetween. Moreover, the first feature being "above", "over" and "on top of" the second feature includes that the first feature is directly above and obliquely above the second feature, or simply means that the horizontal height of the first feature is higher than that of the second feature. The first feature being "under", "below" and "beneath" the second feature includes that the first feature is directly below and obliquely below the second feature, or simply means that the horizontal height of the first feature is lower than that of the second feature.

[0081] In the description of this application, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise" is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation to this application.

[0082] In this application, unless otherwise clearly specified and defined, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or integrated; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and can be the communication inside two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0083] In addition, in this application, descriptions such as "first", "second", etc. are only for descriptive purposes, and should not be understood as indicating or implying their relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first", "second" may explicitly or implicitly include one or more features. In the description of this application, the meaning of "a plurality" is two or more, unless otherwise clearly and specifically defined.

[0084] Although embodiments of the present application have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present application. The scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for counting the number of inclusions, which is applied to count manganese sulfide inclusions in free-cutting steel, and is characterized in that The statistical method includes: Obtaining the first true quantity, first area ratio, first average area, first average perimeter, first average sphericity, and first apparent quantity of manganese sulfide inclusions in multiple two-dimensional sectional images of a training specimen; Constructing a statistical model based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity; Obtaining the second area ratio, second average area, second average perimeter, second average sphericity, and second apparent quantity of manganese sulfide inclusions in the metallographic image of the specimen to be statistically analyzed, and substituting them into the statistical model to obtain the quantity of manganese sulfide inclusions in the specimen to be statistically analyzed output by the statistical model.

2. The inclusions quantity statistical method according to claim 1, wherein The obtaining of the first true quantity of manganese sulfide inclusions in multiple two-dimensional sectional images of a training specimen includes: Obtaining a CT scan image of the training specimen and reconstructing the CT scan image to obtain a three-dimensional inclusion distribution map of the training specimen; Performing multi-position cutting on the three-dimensional inclusion distribution map to obtain multiple two-dimensional sectional images; Determining the first true quantity of manganese sulfide inclusions in the multiple two-dimensional sectional images.

3. The method for counting the number of inclusions according to claim 2, wherein Each inclusion in the three-dimensional inclusion distribution map is assigned a different gray value. The determining of the first true quantity of manganese sulfide inclusions in the multiple two-dimensional sectional images includes: Performing image coding on the multiple two-dimensional sectional images and extracting the gray values of manganese sulfide inclusions to obtain the image coding of the multiple two-dimensional sectional images and the number of non-repeated gray values of manganese sulfide inclusions in the multiple two-dimensional sectional images; Determining the first true quantity of manganese sulfide inclusions in the multiple two-dimensional sectional images according to the image coding and the number of gray values in the corresponding two-dimensional sectional images.

4. The method for counting the number of inclusions according to claim 2, characterized in that The first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity are obtained through the following steps: Performing feature extraction on multiple two-dimensional sectional images to determine the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity of manganese sulfide inclusions in the multiple two-dimensional sectional images.

5. The inclusion quantity statistical method according to claim 1, wherein The constructing of the statistical model based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity includes: Training an improved BP neural network based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity to obtain the statistical model, wherein the first layer to the fifth layer of the improved BP neural network each include a linear transformation module and a non-linear activation module arranged in sequence, the sixth layer is a linear transformation layer, the output end of the second layer jumps to the input end of the fourth layer, the output end of the third layer jumps to the input end of the fifth layer, and the output end of the fourth layer jumps to the input end of the sixth layer.

6. The inclusion quantity statistical method according to claim 5, wherein Training an improved BP neural network based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity includes: Inputting the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity into the improved BP neural network to obtain the predicted quantity output by the last layer of the improved BP neural network; Using the mean square error function to determine the deviation value between the predicted quantity and the first true quantity; Calculating the derivative of the deviation value with respect to the training parameters of the improved BP neural network to obtain the gradient of the training parameters; Updating the training parameters according to the gradient of the training parameters and the adaptive moment estimation optimization algorithm; Accumulating the number of training times and returning to the step of inputting the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity into the improved BP neural network until the number of training times reaches a preset threshold to terminate the training.

7. The method for counting the number of inclusions according to any one of claims 1-6, characterized in that, The training specimen is a cylindrical specimen, and the diameter of the cylindrical specimen is 0.2 mm to 1 mm, and the length is 5 mm to 20 mm.

8. The inclusion quantity statistical method according to any one of claims 1-6, characterized in that, In the free-cutting steel, the mass fraction of manganese is 1.20% to 1.50%, and the mass fraction of sulfur is 0.25% to 0.40%.

9. The method for counting the number of inclusions according to claim 8, characterized in that, In the free-cutting steel, the mass fraction of manganese is 1.20% to 1.30% or 1.40% to 1.50%, and the mass fraction of sulfur is 0.25% to 0.30% or 0.35% to 0.40%.

10. An inclusion quantity statistical device based on the inclusion quantity statistical method according to any one of claims 1-9, characterized in that, Including: An acquisition module for obtaining the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity of manganese sulfide inclusions in a plurality of two-dimensional sectional images of a training specimen; A model construction module for constructing a statistical model based on the first true quantity, the first area ratio, the first average area, the first average perimeter, the first average sphericity, and the first apparent quantity; A statistics module for obtaining the second area ratio, the second average area, the second average perimeter, the second average sphericity, and the second apparent quantity of manganese sulfide inclusions in the metallographic image of a specimen to be statistically analyzed, and substituting them into the statistical model to obtain the number of manganese sulfide inclusions in the specimen to be statistically analyzed output by the statistical model.

Citation Information

Patent Citations

  • Neutral network-based molten aluminum nonmetallic inclusion online soft measurement device and method

    CN103245711A

  • Non-metallic inclusion full-view-field quantitative statistical distribution characterization method

    CN111860176A

  • Training method and detection method of impurity detection model, equipment and medium

    CN113312964A

  • Method for calculating number of non-metallic inclusions in steel

    CN113418921A

  • Method for rapidly detecting metallurgical quality of high-temperature alloy ingot

    CN118050373A