A cold heading steel wire rod structure evaluation method and system

By employing multi-scale fusion U-shaped network and multi-dimensional particle screening technology, the problem of identifying effective pearlite particles in non-annealed cold heading steel wire rod was solved, achieving efficient and accurate microstructure rating, reducing the risk of cracking during cold heading, and supporting efficient quality control and process optimization of the production line.

CN121838140BActive Publication Date: 2026-07-03JIANGSU YONGGANG GROUP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU YONGGANG GROUP CO LTD
Filing Date
2026-03-12
Publication Date
2026-07-03

Smart Images

  • Figure CN121838140B_ABST
    Figure CN121838140B_ABST
Patent Text Reader

Abstract

The application discloses a cold upsetting steel wire rod organization structure rating method and system, relates to the technical field of organization structure detection, and comprises the following steps: taking a plurality of non-overlapping fields of view for metallographic samples by means of microscopic imaging, and acquiring original images; preprocessing the original images to generate metallographic images; performing semantic segmentation on the metallographic images by adopting a multi-scale fusion U-shaped network, and outputting a binary mask of pearlite regions to calculate the total coverage area of the pearlite; performing morphological screening and gray scale verification based on the connected domains in the binary mask to screen effective spheroidization particles in the metallographic images; calculating the weighted total area of all effective spheroidization particles in each metallographic image, dividing the total coverage area of the pearlite, and performing percentage conversion to obtain the effective spheroidization rate of each metallographic image. The application discards the traditional extensive mode of only judging the proportion of the pearlite region by constructing a four-dimensional quantitative judgment standard of the effective spheroidization particles, and provides core technical support for cold upsetting product quality guarantee.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of microstructure testing technology, and in particular to a method and system for rating the microstructure of cold heading steel wire rod. Background Technology

[0002] Anneal-free cold heading steel, which eliminates the need for subsequent spheroidizing annealing, can be directly cold-headed, significantly reducing processing energy consumption and production cycle time, and has become the mainstream development direction for cold heading steel. The core advantage of anneal-free cold heading steel lies in its direct cold heading capability, eliminating the spheroidizing annealing process. In practical applications, it can reduce energy consumption by 15%-18% and shorten the production cycle by more than 30%. As of 2024, the penetration rate of anneal-free types in the domestic 8.8-10.9 grade cold heading steel market has reached 34%, widely used in key applications such as automotive fasteners and engineering machinery bolts. The cold heading formability of anneal-free cold heading steel depends entirely on the "effective spheroidization quality" of granular pearlite. Only when the pearlite particles exhibit independent and rounded morphology can stress concentration caused by cutting the ferrite matrix be avoided. If the particles are aggregated or irregularly shaped, the risk of cracking during cold heading will directly increase.

[0003] However, in actual production and application, it has been found that the standard has a key flaw: it does not distinguish between "independent effective spheroidized particles" and "aggregated ineffective particles". Aggregated granular pearlite will cut the ferrite matrix, leading to stress concentration. Even if the product is judged to be qualified according to the existing standard, the cold heading cracking rate is still as high as 3%-5%.

[0004] In addition, existing rating methods rely on manual or semi-automatic analysis, which has problems such as strong subjectivity, low efficiency and insufficient accuracy, and cannot meet the precise quality control needs of large-scale production of non-annealed cold heading steel.

[0005] The application of existing image processing technology in pearlite rating mainly focuses on the detection of material degradation in steel. It only analyzes the degree of spheroidization through grayscale features, without involving the quantification of "particle morphology + aggregation state" of non-annealed cold heading steel, nor establishing a direct correlation with cold heading performance, thus failing to solve the above-mentioned technical pain points.

[0006] Therefore, there is an urgent need to develop an accurate rating method based on effective spheroidized particle identification for non-annealed cold heading steel wire rod. Summary of the Invention

[0007] Therefore, it is necessary to provide a method and system for rating the microstructure of cold heading steel wire rod to address the aforementioned technical problems.

[0008] In a first aspect, the present invention provides a method for rating the microstructure of cold heading steel wire rod, the method comprising:

[0009] S1. Use microscopic imaging to take several non-overlapping fields of view for the metallographic sample to obtain the original image; the metallographic sample is taken from the surface, middle and core of the cold heading steel wire rod and has undergone sample preparation operation.

[0010] S2. Preprocess the original image to generate a metallographic image to enhance the grayscale difference between pearlite and ferrite; the preprocessing includes dynamic window local adaptive contrast enhancement, median filtering for noise reduction, and morphological opening operation.

[0011] S3. A multi-scale fusion U-shaped network is used to perform semantic segmentation on the metallographic image to capture particle features and output a binary mask of the pearlite region to calculate the total pearlite coverage area.

[0012] S4. Based on the connected components in the binary mask, perform morphological screening and grayscale verification to screen effective spheroidized particles in the metallographic image and calculate the weighted total area of ​​all effective spheroidized particles.

[0013] S5. Calculate the weighted total area of ​​all effective spheroidized particles in each metallographic image, divide it by the total pearlite coverage area and convert it to a percentage to obtain the effective spheroidization rate of each metallographic image.

[0014] S6. Integrate the effective spheroidization rate calculation results of metallographic images at different locations contained in all metallographic samples, match them according to the preset rating rules, and output the microstructure rating results of cold heading steel wire rod.

[0015] Furthermore, preprocessing the original image to generate a metallographic image includes:

[0016] S21. Convert the original image to an eight-bit grayscale image, calculate the average size of the particles in the current original image, and dynamically adjust the size of the sliding window according to the average size; traverse each pixel in the original image with the sliding window, calculate the local mean and local variance within the sliding window, and use the adaptive enhancement formula to perform contrast enhancement processing to obtain a contrast-enhanced image.

[0017] S22. Use a preset value window to traverse the contrast enhancement image, select the median value of all pixels in the value window as the new pixel value of each pixel, and obtain the median image.

[0018] S23. Erosion is performed on square structuring elements with pixel values ​​of one to remove bright spots smaller than the square structuring elements in the median image. The original morphology of pearlite particles in the median image is restored by dilation operation to obtain the pre-processed metallographic image.

[0019] Furthermore, a multi-scale fusion U-shaped network is used to perform semantic segmentation on the metallographic image to capture particle features and output a binary mask of the pearlite region. The total pearlite coverage area is calculated as follows:

[0020] S31. Construct a multi-scale fusion U-shaped network with five layers: input layer, encoding path, bottleneck layer, decoding path and output layer, and introduce particle enhancement branch and attention mechanism to capture particle features and feature weights of pearlite regions in metallographic images.

[0021] S32. Construct a dedicated dataset for non-annealed cold heading steel, pre-train and fine-tune the multi-scale fusion U-shaped network to obtain the trained multi-scale fusion U-shaped network;

[0022] S33. Input the metallographic image into the trained multi-scale fusion U-shaped network, perform feature extraction, feature fusion and semantic segmentation through multiple hierarchical structures, and output a binary mask of the pearlite region.

[0023] S34. Perform pixel statistics on the binary mask, count the number of pixels with a value of 1, multiply the number of pixels by the actual area of ​​a single pixel, and calculate the total coverage area of ​​the pearlite.

[0024] Furthermore, a dedicated training dataset for non-annealed cold heading steel is constructed, and the multi-scale fusion U-shaped network is pre-trained and fine-tuned to obtain the trained multi-scale fusion U-shaped network, which includes:

[0025] S321. Construct a dedicated dataset containing several sets of metallographic images of non-annealed cold heading steel for training a multi-scale fusion U-shaped network; the dedicated dataset includes the same number of metallographic images of cold heading steel from different brands as well as several sets of mixed interference images.

[0026] S322. Pre-label the pearlite regions in the metallographic images of the dedicated dataset;

[0027] S323. The multi-scale fusion U-shaped network is pre-trained on a general metallographic image dataset, and then fine-tuned using a dedicated dataset. The fine-tuning process uses granular weighted loss, and the loss weight of the granular region of the preset size is increased by a preset factor.

[0028] S324. Set training parameters, loss function and optimizer to solve the sample imbalance problem between pearlitic and non-pearlitic regions in metallographic images;

[0029] S325. Validate the multi-scale fusion U-shaped network using the test set, and retain the multi-scale fusion U-shaped network that meets the performance standards based on the evaluation results of precision, recall and crossover ratio.

[0030] Furthermore, morphological screening and grayscale verification are performed based on connected components in the binary mask to filter effective spheroidized particles in the metallographic image, and the weighted total area of ​​all effective spheroidized particles is calculated, including:

[0031] S41. Calculate the ratio of the total pearlite coverage area to the total area of ​​the metallographic image field of view as the pearlite coverage rate of a single field of view; if the pearlite coverage rate is less than the preset coverage rate threshold, the metallographic sample is determined to be insufficiently spheroidized; if the pearlite coverage rate is greater than the preset coverage rate threshold, then execute S42.

[0032] S42. Perform connected component analysis on the pearlite binary mask and perform multi-dimensional morphological screening of the connected components to identify effective particle clusters within the connected components; the morphological screening includes dynamic particle size calibration, size screening, sphericity screening and multi-threshold aggregation state determination.

[0033] S43. Extract the gray value distribution and gray gradient of the connected components selected by morphology in the original eight-bit grayscale image, perform two-dimensional verification on the effective spherical particles, and retain the final effective spherical particles.

[0034] S44. Based on the sampling location of the metallographic sample where the effective spheroidized particles are located, assign different position weights, multiply the actual area of ​​a single effective spheroidized particle by the corresponding position weight, calculate the weighted area of ​​the effective spheroidized particles, and then calculate the total weighted area of ​​all effective spheroidized particles.

[0035] Furthermore, connected component analysis was performed on the pearlite binary mask, and multi-dimensional morphological screening was conducted on the connected components to identify effective particle clusters within the connected components, including:

[0036] S421. The eight-neighborhood connectivity criterion is used to perform connected component analysis on the pearlite binary mask, and each independent connected component in the metallographic image is marked.

[0037] S422. Calculate the actual area of ​​each marked connected region, calculate the equivalent diameter of the connected region using the area equivalent diameter formula, and fit the particle edge curve using the least squares method to calculate the edge curvature. Select connected regions whose equivalent diameter is within the preset diameter range and whose edge curvature is greater than the preset curvature threshold to exclude pseudo-effective spherical particles with excessive size or uneven edges.

[0038] S423. Calculate the connected components that pass the size screening, calculate the perimeter of the connected components, and substitute it into the sphericity formula to calculate the sphericity. Screen out the connected components whose sphericity is greater than the preset sphericity threshold to exclude irregularly shaped spherical particles.

[0039] S424. For connected components that pass shape filtering, set three distance thresholds to generate multiple sets of distance maps. Automatically select the optimal marker point based on the grayscale uniformity of the particle cluster, segment the particle cluster, and count the number of particles within the particle cluster. If the shortest distance between the edges of particles within the particle cluster is greater than the maximum distance threshold, it is determined to be an independent particle and marked as a valid spherical particle. If the distance between the edges of particles within the particle cluster is less than the maximum distance threshold and the number of particles is less than the preset maximum number threshold, it is marked as a valid spherical particle. If the number of particles within the particle cluster is greater than or equal to the preset maximum number threshold, it is determined to be an invalid particle cluster.

[0040] Furthermore, the grayscale value distribution and grayscale gradient of the morphologically filtered connected components in the original 8-bit grayscale image are extracted, and a two-dimensional verification is performed on the effective spherical particles, including:

[0041] S431. Calculate the ratio of the number of pixels whose gray values ​​belong to the preset gray range within the connected component to the total number of pixels in the connected component. If the ratio is greater than or equal to the preset gray-level qualified percentage threshold, then mark it as a candidate particle.

[0042] S432. The Sobel operator is used to calculate the gray-level gradient in the connected domain. If the gray-level gradient is less than or equal to the preset gray-level gradient threshold, it is marked as a candidate particle.

[0043] S433. If both dimensions of verification pass simultaneously, the candidate particle will be retained as the final output valid spheroidized particle; if any dimension of verification fails, it will be determined as an incomplete spheroidized particle.

[0044] Secondly, a microstructure rating system for cold heading steel wire rod, the system comprising:

[0045] The image acquisition module is used to capture several non-overlapping fields of view for metallographic specimens using microscopic imaging to obtain original images; the metallographic specimens are cut from the surface, middle and core of cold heading steel wire rods and have undergone sample preparation operations.

[0046] The preprocessing module is used to preprocess the original image to generate a metallographic image, thereby enhancing the grayscale difference between pearlite and ferrite. The preprocessing includes dynamic window local adaptive contrast enhancement, median filtering for noise reduction, and morphological opening operation.

[0047] The feature extraction module is used to perform semantic segmentation on metallographic images using a multi-scale fusion U-shaped network to capture particle features and output a binary mask of the pearlite region to calculate the total pearlite coverage area.

[0048] The particle recognition module is used to perform morphological screening and grayscale verification based on connected components in a binary mask, to screen effective spheroidized particles in metallographic images, and to calculate the weighted total area of ​​all effective spheroidized particles.

[0049] The spheroidization rate calculation module is used to calculate the weighted total area of ​​all effective spheroidized particles in each metallographic image, divide it by the total pearlite coverage area and perform a percentage conversion to obtain the effective spheroidization rate of each metallographic image.

[0050] The integrated rating module integrates the effective spheroidization rate calculation results of metallographic images from different locations in all metallographic specimens, matches them according to preset rating rules, and outputs the microstructure rating results of cold heading steel wire rod.

[0051] Thirdly, the present invention provides an electronic device including a processor, a storage medium and a computer program, wherein the computer program is stored in the storage medium and, when executed by the processor, implements the above-described device control method.

[0052] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described device control method.

[0053] The beneficial effects of this invention are as follows:

[0054] 1. By constructing a four-dimensional quantitative judgment standard for effective spherical particles, particles beneficial to cold heading are accurately screened from multiple dimensions such as size, shape, aggregation state and internal quality. This abandons the traditional crude mode of judging solely by the proportion of pearlite area. It can accurately distinguish between effective and ineffective pearlite particles, ensuring that the rating results directly match the cold heading performance. This provides core technical support for the quality assurance of cold heading products and reduces the risk of cracking in the cold heading process from the source.

[0055] 2. By using a customized multi-scale fusion network, precise and automated segmentation of the pearlite region is achieved. Combined with automated processes such as dynamic window adaptive preprocessing and multi-dimensional particle screening, it eliminates the reliance on operator experience in traditional manual or semi-automatic grading, reduces errors caused by human intervention, and significantly shortens the testing time for a single batch. It can quickly complete the testing tasks of batches of non-annealed cold heading steel wire rods, meeting the high efficiency requirements of online quality control on the production line.

[0056] 3. A dynamic rating standard is established based on the characteristics of different grades of cold heading steel, and the rating results are directly linked to the application scenarios of cold heading. At the same time, customized process adjustment plans are automatically generated for unqualified products, realizing full-link control from organizational rating to performance prediction to process optimization. This solves the limitation of traditional rating methods that can only determine the organizational status and cannot guide production practice, helping enterprises to accurately adjust production processes and improve product qualification rate and production efficiency. Attached Figure Description

[0057] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0058] Figure 1 This is a flowchart of a method for rating the microstructure of cold heading steel wire rod according to an embodiment of the present invention;

[0059] Figure 2 This is a flowchart illustrating the screening of effective spheroidized particles in a metallographic image during a method for rating the microstructure of cold heading steel wire rod according to an embodiment of the present invention.

[0060] Figure 3 This is a flowchart illustrating the process of multi-dimensional morphological screening of connected domains and identification of effective particle clusters in a cold heading steel wire rod microstructure rating method according to an embodiment of the present invention.

[0061] Figure 4 This is a schematic diagram of a cold heading steel wire rod microstructure rating system according to an embodiment of the present invention;

[0062] Figure 5 This is a schematic diagram of an electronic device according to an embodiment of the present invention.

[0063] The reference numerals are as follows: 1. Image acquisition module; 2. Preprocessing module; 3. Feature extraction module; 4. Particle recognition module; 5. Sphericity calculation module; 6. Integrated rating module. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0065] Please see Figure 1 A method for rating the microstructure of cold heading steel wire rod is provided, the method comprising:

[0066] S1. Using microscopic imaging, several non-overlapping fields of view are captured to obtain the original images of the metallographic specimen. The metallographic specimens are taken from the surface, middle, and core of cold-headed steel wire rods and have undergone sample preparation operations.

[0067] Specifically, the sampling targets are non-annealed cold-heading steel wire rods with diameters of 6-20mm, covering all mainstream specifications. Three key locations must be selected for sampling: 1. Surface: 1-2mm from the wire rod surface; this area cools rapidly and the microstructure is easily refined. 2. Middle: At half the radius of the wire rod, the microstructure is most uniform and reflects the overall quality. 3. Core: The central area of ​​the wire rod; the cooling rate is slow, and aggregated particles are prone to occur, making it a weak point in quality. One sample should be taken from each location. The sample size is set at 10mm × 10mm × 15mm, and the length direction of the sample must be consistent with the rolling direction of the wire rod to avoid affecting the test results due to differences in microstructure orientation.

[0068] Sample preparation is fundamental to ensuring testing accuracy. It strictly follows the process of "cutting, mounting, grinding, polishing, etching, and post-treatment." The specific operations, parameters, and principles of each step are as follows: 1. Cutting: Wire cutting is preferred over abrasive wheel cutting. During operation, the wire rod is fixed on the wire cutting equipment and cut at a speed of 5 mm / min. 2. Mounting: Resin cold mounting is used. During mounting, the temperature is controlled to ≤25℃, the mounting pressure is 0.3MPa, and the temperature is maintained for 15 minutes. 3. Grinding: Grinding is performed sequentially using sandpaper grades "240#, 400#, 600#, 800#, 1000#, 1200#", with each grade grinding for 2 minutes. The grinding direction of each subsequent grade must be perpendicular to the previous grade. 240# sandpaper is used to remove cutting marks, and the sandpaper grit is gradually increased until 1200# sandpaper is used to ensure that the sample surface roughness Ra < 1μm. 4. Polishing Process: Two-stage polishing is performed using a diamond suspension. First, polish with a 1μm diamond suspension for 3 minutes, then polish with a 0.25μm diamond suspension for 3 minutes. The polishing machine speed is controlled at 130 rpm. The 1μm suspension is used to remove scratches generated during grinding, while the 0.25μm suspension achieves a mirror finish. 5. Etching Process: A 4% nitric acid-alcohol solution (4 mL nitric acid + 96 mL anhydrous ethanol) is used. Etching is performed at room temperature (20-25℃) for 10 seconds. 6. Post-treatment Process: After etching, the sample is rinsed three times with anhydrous ethanol and then dried with cold air at a speed of 3 m / s.

[0069] This invention employs a metallurgical microscope with a magnification of 500× (50× objective lens + 10× eyepiece) and a numerical aperture (NA) of 0.85, capable of clearly revealing particle details larger than 1μm, meeting the requirements for effective particle identification. The camera is a 5-megapixel CMOS camera with a pixel size of 2.2μm × 2.2μm, outputting in RGB format with 8-bit grayscale depth (pixel value 0-255), ensuring that the image resolution and grayscale levels accurately reflect particle morphology and internal quality. Illumination uses Köhler illumination, adjusting the light source intensity to 5000 lux while simultaneously performing white balance calibration to avoid grayscale distortion due to color temperature differences, ensuring consistent illumination conditions across different fields of view.

[0070] Imaging must adhere to the principles of multiple fields of view, non-overlapping, and full coverage. Specific procedures are as follows: For each metallographic sample (one each from the surface, middle, and core), 10 non-overlapping fields of view must be captured, with a spacing of ≥0.5mm between fields of view to avoid duplicate shots. The actual area of ​​a single field of view is 0.5mm², corresponding to dimensions of 0.707mm × 0.707mm. The total coverage area of ​​the 10 fields of view is 5mm², thus ensuring the representativeness of the test results and avoiding misjudgments due to insufficient sampling.

[0071] S2. Preprocess the original image to generate a metallographic image to enhance the grayscale difference between pearlite and ferrite. Preprocessing includes dynamic window local adaptive contrast enhancement, median filtering for noise reduction, and morphological opening operations.

[0072] In the description of this invention, preprocessing the original image to generate a metallographic image includes:

[0073] S21. Convert the original image to an eight-bit grayscale image, calculate the average size of the particles in the current original image, and dynamically adjust the size of the sliding window according to the average size; traverse each pixel in the original image with the sliding window, calculate the local mean and local variance within the sliding window, and use the adaptive enhancement formula to perform contrast enhancement processing to obtain a contrast-enhanced image.

[0074] Specifically, by using dynamic window-based local adaptive contrast enhancement, the problems of small grayscale differences and blurred boundaries between pearlite and ferrite can be solved, while avoiding excessive enhancement that could amplify noise. The specific operation procedure is as follows:

[0075] The original RGB image is converted to an 8-bit grayscale image with pixel values ​​ranging from 0 to 255. The average particle size in the current image is automatically calculated, and the sliding window size is dynamically adjusted based on this average size: a 3×3 window is used when the average particle size is 1-2 μm, and a 5×5 window is used when the average particle size is 2-3 μm. Then, this window is used to iterate through each pixel in the image. Calculate the local mean within each window. It is used to reflect the average gray level of pixels within the window; and the local variance. This is used to reflect the grayscale dispersion of pixels within the window, and then substituted into the optimized adaptive enhancement formula:

[0076] ;

[0077] In the formula, This represents the grayscale value of the original image at pixel (x, y); D represents the enhancement coefficient, with a value of 2.0, verified through experiments. When the value is 1.5, the enhancement effect is insufficient, and it is still difficult to distinguish between pearlite and ferrite. The noise will be excessively amplified. It can improve contrast by 30% while keeping noise below 5%; This represents the grayscale entropy of the current window. The enhancement intensity is dynamically adjusted based on the grayscale entropy to avoid over-enhancing low-entropy areas (noise concentration areas). This represents the minimum value, which is 0.01, and its purpose is to avoid local variance. The denominator may be 0 at times, but this does not affect the normal calculation result; This represents the enhanced pixel value. If the calculated result exceeds the range of 0-255, it needs to be truncated to 0 (below 0) or 255 (above 255).

[0078] S22. Use a preset value window to traverse the contrast enhancement image, select the median value of all pixels in the value window as the new pixel value of each pixel, and obtain the median image.

[0079] Specifically, after contrast enhancement, residual erosion spots and camera noise may remain in the image, requiring removal through median filtering. The process involves traversing the enhanced image using a 3×3 window, with each pixel's new value being the median of all pixels within the window. The 3×3 window was chosen because: a 2×2 window's denoising effect is incomplete, leaving some noise; a 4×4 window causes blurred grain edges, affecting subsequent morphological analysis; and a 3×3 window achieves the optimal balance between denoising and detail preservation.

[0080] S23. Erosion is performed on square structuring elements with pixel values ​​of one to remove bright spots smaller than the square structuring elements in the median image. The original morphology of pearlite particles in the median image is restored by dilation operation to obtain the pre-processed metallographic image.

[0081] Specifically, the purpose of morphological opening is to remove bright spots (such as erosion residues and tiny impurities) smaller than the structuring element in an image, without destroying the original morphology of the pearlite particles. The specific operation is "erosion first, then dilation," using a 3×3 square structuring element (all pixel values ​​are 1). The calculation formula is as follows:

[0082] ;

[0083] In the formula, The preprocessed metallographic image obtained after morphological opening operation is processed at the pixel level. The grayscale value at that location; This represents the gray value at pixel (x,y) of the metallographic image before morphological opening processing. Represents structural elements. For corrosion operation, This is an expansion operation. While etching can remove bright spots smaller than structural elements, expansion can restore the original morphology of pearlite particles and prevent particle size reduction caused by etching.

[0084] S3. A multi-scale fusion U-shaped network is used to perform semantic segmentation on the metallographic image to capture particle features and output a binary mask of the pearlite region to calculate the total pearlite coverage area.

[0085] In order to achieve automated and accurate segmentation of the pearlite region, this invention adopts a customized multi-scale fusion U-Net network. Because the traditional general network is not optimized for the microstructure characteristics of cold heading steel pearlite, such as "blurred edges, dense small particles, and easy confusion with ferrite", the small particle recognition accuracy is insufficient. However, the customized multi-scale fusion U-Net can accurately capture effective particle features by adding a dedicated module.

[0086] In the description of this invention, a multi-scale fusion U-shaped network is used to perform semantic segmentation on metallographic images to capture particle features and output a binary mask of the pearlite region. The calculation of the total pearlite coverage area includes:

[0087] S31. Construct a multi-scale fusion U-shaped network with five layers: input layer, encoding path, bottleneck layer, decoding path and output layer. Introduce particle enhancement branches and attention mechanisms to capture particle features and feature weights of pearlite regions in metallographic images.

[0088] Specifically, the overall structure of the customized multi-scale fusion U-Net is divided into five parts: input layer, encoding path (downsampling), bottleneck layer, decoding path (upsampling), and output layer. The structural parameters, operation process and functions of each layer are shown in Table 1.

[0089] Table 1. Parameters of Multi-Scale Fusion U-Shaped Network Structure

[0090]

[0091]

[0092] S32. Construct a dedicated dataset for non-annealed cold heading steel, pre-train and fine-tune the multi-scale fusion U-shaped network to obtain the trained multi-scale fusion U-shaped network.

[0093] In the description of this invention, a training dataset specifically for non-annealed cold heading steel is constructed, and a multi-scale fusion U-shaped network is pre-trained and specifically fine-tuned to obtain the trained multi-scale fusion U-shaped network, including:

[0094] S321. Construct a dedicated dataset containing several sets of metallographic images of non-annealed cold-heading steel for training a multi-scale fusion U-shaped network. The dedicated dataset includes the same number of metallographic images of cold-heading steel from different brands, as well as several sets of mixed interference images.

[0095] Specifically, a dedicated dataset containing 500 sets of metallographic images of non-annealed cold heading steel was constructed, covering three mainstream grades: SWRCH35K, ML40Cr, and SCM435, with a spheroidization rate ranging from 30% to 98%, covering different quality levels. Each grade has 150 sets, and the remaining 50 sets are mixed interference images, including inclusions, scratches, over-corrosion, and other conditions.

[0096] S322. Pre-label the pearlite regions in the metallographic images of the dedicated dataset.

[0097] S323. The multi-scale fusion U-shaped network is pre-trained on a general metallographic image dataset, and then fine-tuned using a dedicated dataset. The fine-tuning process uses granular weighted loss, and the loss weight of the granular region of the preset size is increased by a preset factor.

[0098] Specifically, a pre-training and dedicated fine-tuning mode is adopted. First, it is pre-trained on a general metallographic image dataset of 1000 sets to learn basic tissue features and iterates for 50 epochs. Then, it is fine-tuned using a dedicated dataset of non-annealed cold heading steel and iterates for 100 epochs. During fine-tuning, a granular weighted loss is adopted, and the loss weight of the 1-3μm particle region is increased by 2 times.

[0099] S324. Set training parameters, loss function, and optimizer to solve the sample imbalance problem between pearlitic and non-pearlitic regions in metallographic images.

[0100] Specifically, the training parameters are set as follows: batch size is set to 8, initial learning rate is 1e-4, and a cosine annealing decay strategy is adopted, with a 10% decay every 10 epochs. The loss function is a combination of Dice Loss and cross-entropy loss with a weight ratio of 1:1 to address the sample imbalance problem between pearlitic and non-pearlitic regions. The optimizer is Adam, with parameters set to β1=0.9, β2=0.999, and ε=1e-8.

[0101] S325. Validate the multi-scale fusion U-shaped network using the test set, and retain the multi-scale fusion U-shaped network that meets the performance standards based on the evaluation results of precision, recall and crossover ratio.

[0102] Specifically, the validation was performed on a test set containing 100 images. The results showed that: precision represents the proportion of objects predicted as pearlite that are actually pearlite; recall represents the proportion of objects that are actually pearlite and are predicted as pearlite; and intersection-union ratio represents the degree of overlap between the segmented region and the real region.

[0103] S33. Input the metallographic image into the trained multi-scale fusion U-shaped network, perform feature extraction, feature fusion and semantic segmentation through multiple hierarchical structures, and output a binary mask of the pearlite region.

[0104] S34. Perform pixel statistics on the binary mask, count the number of pixels with a value of 1, multiply the number of pixels by the actual area of ​​a single pixel, and calculate the total coverage area of ​​the pearlite.

[0105] Specifically, after segmentation, pixel counting is performed on the output binary mask, counting the number of pixels with a value of 1, denoted as . The total pearlite coverage area The calculation formula is:

[0106] ;

[0107] in, The total coverage area of ​​pearlite; The actual area of ​​a single pixel is calculated as follows: the actual area of ​​a single field of view is 0.5 mm², and the number of image pixels is 512 × 512 = 262144. Therefore... .

[0108] S4. Based on the connected components in the binary mask, perform morphological screening and grayscale verification to screen effective spheroidized particles in the metallographic image and calculate the weighted total area of ​​all effective spheroidized particles.

[0109] In the description of this invention, as Figure 2 As shown, morphological screening and grayscale verification are performed based on connected components in a binary mask to filter effective spheroidized particles in metallographic images, and the weighted total area of ​​all effective spheroidized particles is calculated, including:

[0110] S41. Calculate the ratio of the total pearlite coverage area to the total area of ​​the metallographic image field of view, and use this as the pearlite coverage rate of a single field of view. If the pearlite coverage rate is less than the preset coverage rate threshold, the metallographic sample is determined to be insufficiently spheroidized; if the pearlite coverage rate is greater than the preset coverage rate threshold, proceed to S42.

[0111] Specifically, first calculate the pearlite coverage R of a single field of view, which is the total pearlite coverage area. With the total field of view The ratio. If the calculated R < 5%, the sample is directly judged as "severely under-spheroidized", corresponding to level 5 in the subsequent rating, and no further screening steps are required.

[0112] The basis for the judgment is experimental verification: when the pearlite coverage is less than 5%, even if all particles are effective spheroidized particles, the cold upsetting deformation will be less than 50%, which cannot meet the basic requirements of cold heading, and subsequent screening is meaningless; if R≥5%, then it enters the morphological screening stage.

[0113] S42. Perform connected component analysis on the pearlite binary mask and perform multi-dimensional morphological screening on the connected components to identify effective particle clusters within the connected components; the morphological screening includes dynamic particle size calibration, size screening, sphericity screening and multi-threshold aggregation state determination.

[0114] In the description of this invention, as Figure 3 As shown, connected component analysis was performed on the pearlite binary mask, and multi-dimensional morphological screening was conducted on the connected components to identify effective particle clusters within the connected components, including:

[0115] S421. The eight-neighbor connectivity criterion is used to perform connected component analysis on the pearlite binary mask, and each independent connected component in the metallographic image is marked.

[0116] Specifically, connected component analysis is performed on the pearlite binary mask using the 8-neighborhood connectivity criterion, which determines that adjacent pixels with a distance of ≤1 pixel are considered to be in the same connected component. This operation marks each independent connected component in the image, which may be a single particle or a cluster of particles.

[0117] S422. Calculate the actual area of ​​each marked connected region, calculate the equivalent diameter of the connected region using the area equivalent diameter formula, and fit the particle edge curve using the least squares method to calculate the edge curvature. Select connected regions whose equivalent diameter is within the preset diameter range and whose edge curvature is greater than the preset curvature threshold to exclude pseudo-effective spherical particles with excessive size or uneven edges.

[0118] Specifically, for each labeled connected component, first calculate its actual area A (number of pixels contained in the connected component × actual area of ​​a single pixel). Then, the equivalent diameter of the connected region is calculated using the area-equivalent diameter formula. : Then, the least squares method was used to fit the particle edge curve, and the edge curvature (curvature = 1 / radius of curvature) was calculated to screen out the " Furthermore, connected regions with curvature ≥ 0.8" exclude pseudo-effective spherical particles that are out of size or have uneven edges.

[0119] S423. Calculate the connected components that pass the size screening, calculate the perimeter of the connected components, and substitute it into the sphericity formula to calculate the sphericity. Screen out the connected components whose sphericity is greater than the preset sphericity threshold to exclude irregularly shaped spherical particles.

[0120] Specifically, for connected components that pass the size screening, their perimeter P is calculated (the edges of the connected components are extracted using chain code, the number of pixels contained in the edges is counted, and then multiplied by the pixel resolution of 1.38 μm / pixel to obtain the actual perimeter), and then substituted into the sphericity formula to calculate the sphericity. : Connected domains with sphericity S≥0.7 are selected, while particles with irregular shapes (S<0.7) are excluded.

[0121] S424. For connected components filtered by shape, set three distance thresholds to generate multiple sets of distance maps. Automatically select the optimal marker point based on the grayscale uniformity of the particle cluster, segment the particle cluster, and count the number of particles within the cluster. If the shortest distance between the edges of particles within a particle cluster is greater than the maximum distance threshold, it is determined to be an independent particle and marked as a valid spherical particle; if the distance between the edges of particles within a particle cluster is less than the maximum distance threshold and the number of particles is less than the preset maximum number threshold, it is marked as a valid spherical particle; if the number of particles within a particle cluster is greater than or equal to the preset maximum number threshold, it is determined to be an invalid particle cluster.

[0122] Specifically, for connected components filtered by size and shape, a multi-threshold distance transformation and adaptive labeling watershed algorithm are used to determine the clustering state: First, three distance thresholds (0.3μm, 0.7μm, 1μm) are set to generate multiple sets of distance maps. Then, the optimal label point is automatically selected based on the gray-scale uniformity of the particle clusters to segment the clusters and count the number of particles n within each cluster. If the shortest distance between the edges of particles within a cluster is ≥1μm, it is determined to be an independent particle and counted as a valid particle; if the distance is <1μm and n≤3, it is counted as a valid particle; if n≥4, it is determined to be an invalid particle cluster and is excluded.

[0123] S43. Extract the gray value distribution and gray gradient of the connected components selected by morphology in the original eight-bit grayscale image, perform two-dimensional verification on the effective spherical particles, and retain the final effective spherical particles.

[0124] In the description of this invention, the extraction of grayscale value distribution and grayscale gradient of connected components selected through morphological screening in the original eight-bit grayscale image, and the performance of two-dimensional verification on effective spherical particles, includes:

[0125] S431. Calculate the ratio of the number of pixels whose gray values ​​belong to the preset gray range within the connected component to the total number of pixels in the connected component. If the ratio is greater than or equal to the preset gray-level qualified percentage threshold, then mark it as a candidate particle.

[0126] Specifically, count the number of pixels (N) with gray values ​​∈ [0, 10] within the connected component. valid ) and the total number of pixels in the connected components (N) total The ratio of grayscale qualification rate to N is: valid / N total ×100%, with a required ratio ≥80%;

[0127] S432. The Sobel operator is used to calculate the gray-level gradient in the connected domain. If the gray-level gradient is less than or equal to the preset gray-level gradient threshold, it is marked as a candidate particle.

[0128] Specifically, the Sobel operator is used to calculate the gray-level gradient within this connected region. G x G and Gᵧ are the gradient components in the x and y directions, respectively, and the maximum gray-level gradient is required to be ≤2.

[0129] S433. If both dimensions of verification pass simultaneously, the candidate particle will be retained as the final output valid spheroidized particle; if any dimension of verification fails, it will be determined as an incomplete spheroidized particle.

[0130] S44. Based on the sampling location of the metallographic sample where the effective spheroidized particles are located, assign different position weights, multiply the actual area of ​​a single effective spheroidized particle by the corresponding position weight, calculate the weighted area of ​​the effective spheroidized particles, and then calculate the total weighted area of ​​all effective spheroidized particles.

[0131] Specifically, different location weights are assigned based on the sampling location of the particles: surface particles = 1.2, middle particles = 1.0, and core particles = 1.3. The weighted area of ​​each effective particle is then calculated. ,in The actual area of ​​a single effective particle. The corresponding position weight.

[0132] Then calculate the weighted total area of ​​all valid particles: , where n is the total number of effective particles.

[0133] S5. Calculate the weighted total area of ​​all effective spheroidized particles in each metallographic image, divide it by the total pearlite coverage area, and perform a percentage conversion to obtain the effective spheroidization rate of each metallographic image.

[0134] Specifically, the total coverage area of ​​pearlite Weighted total area of ​​effective particles Substitute the effective sphericity Formula calculation:

[0135] ;

[0136] The calculation result is rounded to one decimal place (e.g., 94.3%) to ensure quantization accuracy.

[0137] S6. Integrate the effective spheroidization rate calculation results of metallographic images at different locations contained in all metallographic samples, match them according to the preset rating rules, and output the microstructure rating results of cold heading steel wire rod.

[0138] Specifically, based on 100 sets of cold heading test data and the compositional characteristics of different grades of cold heading steel, a dynamic rating standard was formulated. The rating results are directly linked to the cold heading performance and application scenarios, as shown in Table 2. The dynamic rating standard of this invention does not use a fixed threshold, but rather dynamically adjusts the rating threshold within ±2% based on the real-time process context, making the correlation between the rating results and the final cold heading performance stronger and more reliable. Table 3 shows the dynamic threshold calibration simulation results using the "Good / Level 4" lower limit as an example.

[0139] Table 2 Rating Results

[0140]

[0141] Table 3. Dynamic threshold calibration simulation (taking the lower limit of "Good / Level 4" as an example)

[0142]

[0143] The dynamic threshold is determined based on the carbon content and alloy element content of different grades, establishing a regression model of "effective spheroidization rate - yield strength" (regression coefficient R²≥0.95). For medium carbon steel, due to the stronger particle strengthening effect, the effective spheroidization rate threshold is appropriately reduced to ensure the consistency of cold heading performance of different grades of steel.

[0144] Because the microstructure of the surface, middle, and core of the wire rod differs, the final rating requires a comprehensive assessment of the test results from all three locations: First, the effective spheroidization rate R of the surface, middle, and core samples must be calculated separately. eff,表层 R eff,中部 R eff,心部 Then, substitute the values ​​into the arithmetic mean formula to calculate the final effective sphericity: R eff,最终 =(R eff,表层 +R eff,中部 +R eff,心部 ) / 3.

[0145] The rating levels are determined based on the final effective spheroidization rate and the dynamic threshold of the corresponding grade: Level 1 is for low carbon steel ≥90% and medium carbon steel ≥88%; Level 2 is for low carbon steel 80%-89.9% and medium carbon steel 78%-87.9%; and Level 3 is for steel below the above thresholds.

[0146] Please see Figure 4 A microstructure rating system for cold heading steel wire rod is provided, the system comprising:

[0147] The image acquisition module is used to capture several non-overlapping fields of view for metallographic specimens using microscopic imaging to obtain raw images. The metallographic specimens are taken from the surface, middle, and core of cold-heading steel wire rods and have undergone sample preparation operations.

[0148] The preprocessing module is used to preprocess the original image to generate a metallographic image, thereby enhancing the grayscale difference between pearlite and ferrite. Preprocessing includes dynamic window local adaptive contrast enhancement, median filtering for noise reduction, and morphological opening operations.

[0149] The feature extraction module is used to perform semantic segmentation on metallographic images using a multi-scale fusion U-shaped network to capture particle features and output a binary mask of the pearlite region to calculate the total pearlite coverage area.

[0150] The particle recognition module is used to perform morphological screening and grayscale verification based on connected components in a binary mask, to screen effective spheroidized particles in metallographic images, and to calculate the weighted total area of ​​all effective spheroidized particles.

[0151] The spheroidization rate calculation module is used to calculate the weighted total area of ​​all effective spheroidized particles in each metallographic image, divide it by the total pearlite coverage area, and perform a percentage conversion to obtain the effective spheroidization rate of each metallographic image.

[0152] The integrated rating module integrates the effective spheroidization rate calculation results of metallographic images from different locations in all metallographic specimens, matches them according to preset rating rules, and outputs the microstructure rating results of cold heading steel wire rod.

[0153] The following detailed description, in conjunction with specific embodiments, further illustrates the method and system for rating the microstructure of cold heading steel wire rod designed in this invention.

[0154] This invention applies to all 8.8-10.9 grade non-annealed cold heading steels, including but not limited to: low carbon steel: SWRCH18A, SWRCH22A, SWRCH35K; medium carbon steel: ML40Cr, ML35CrMo; alloy structural steel: SCM435, SCM440. For different grades of steel, only the dynamic threshold of the effective spheroidization rate needs to be adjusted according to its carbon content and alloy element content through a regression model. Other indicators, such as sphericity, aggregation state, grayscale requirements, and model structure, remain unchanged, without the need for significant modifications to the process.

[0155] The effective spherical particles defined in this invention refer to granular pearlites that simultaneously meet the following four conditions: 1. Size condition: using the area equivalent diameter, the diameter of the non-circumscribed circle, the diameter d is required to be between 1μm and 3μm (i.e., 1≤d≤3μm), and the particle edge curvature ≥0.8; 2. Shape condition: sphericity S≥0.7, the higher the sphericity, the more rounded the particles; 3. Aggregation condition: if multiple particles form a particle cluster, the number of particles n in the cluster must be ≤3, and the criterion for determining aggregation is "the shortest distance between the edges of particles in the cluster <1μm"; 4. Internal quality condition: in an 8-bit grayscale image (pixel value range 0-255), the proportion of pixels with grayscale values ​​in the range of 0-10 in the particle area is ≥80%, and the grayscale gradient inside the particle is ≤2.

[0156] Effective sphericity R e ff refers to the ratio of the weighted total area of ​​effective spheroidized particles to the total coverage area of ​​pearlite.

[0157] Furthermore, it should be noted that the design basis for equivalent diameters of 1-3 μm and edge curvatures ≥0.8 is as follows: To determine the optimal particle size and edge condition, samples with equivalent diameters of 0.5 μm, 1 μm, 2 μm, 3 μm, 4 μm, and 5 μm were prepared from SWRCH35K steel. Ten samples in each group underwent cold upsetting tests with 65% deformation. The results showed that when the diameter was <1 μm, the strengthening was insufficient, and the yield strength was <350 MPa; when the diameter was >3 μm, the stress concentration factor increased significantly, with k=1.1 for 3 μm and k=2.5 for 5 μm, and the cracking rate increased from 0.3% to 4.2%. Simultaneously, finite element simulation verified that "quasi-spherical particles" (with uneven edges) with edge curvatures <0.8 had an interface stress concentration factor 1.3 times higher than those with curvatures ≥0.8, and the cold upsetting cracking rate increased by 2.3 percentage points. Therefore, the curvature threshold requirement was supplemented.

[0158] Design basis for sphericity ≥ 0.7: Sphericity is calculated using the internationally accepted formula for roundness. A is the actual area of ​​the particle, and P is the perimeter. Experimental verification shows that the cracking rate is 2.8% when S=0.6, decreases to 0.5% when S=0.7, and stabilizes below 0.3% when S=0.8, indicating diminishing marginal benefits. Therefore, S≥0.7 is taken as the threshold.

[0159] The design basis for aggregated particle clusters with n≤3 is as follows: A cluster model containing 1-5 particles (0.5μm spacing) is established, and a cold forging stress of 800MPa is applied. Simulation shows that when n=1-3, the stress within the cluster is uniform (≤900MPa < yield strength 950MPa); when n≥4, the stress at the center reaches 1100MPa, exceeding the yield strength. Simultaneously, it is verified that stress superposition disappears when the spacing is ≥1μm. Therefore, "spacing <1μm" is defined as aggregation, and only clusters with n≤3 are considered valid.

[0160] The design basis for a grayscale value of 0-10 accounting for ≥80% and a grayscale gradient of ≤2 is as follows: After etching with 4% nitric acid alcohol, the grayscale value of fully formed pearlite is 0-10, hemispherical is 11-20, and lamellar cementite is <0. Experiments show that when the grayscale percentage is ≥80%, the cracking rate is ≤0.5%. The grayscale gradient requirement is added because areas with a gradient >2 correspond to incompletely formed cementite residue, at which point the cracking rate increases by more than 3 times; hence, this condition is added.

[0161] To verify the accuracy and stability of the rating system of this invention, three typical critical dispute spheroidization quality samples were selected, and the ratings of the system of this invention were compared using manual rating and the rating of the system of this invention, respectively. The results of electron microscopy were used as the arbitration basis. The comparison results are shown in Table 4.

[0162] Table 4. Comparison of rating results and manual rating for samples of different sphericity quality.

[0163]

[0164] As shown in Table 4, the rating system of this invention is highly consistent with the results of electron microscopy arbitration in determining critical dispute samples. It is more stable and accurate than manual rating, solving the industry pain points of strong subjectivity and inconsistent results of manual rating. It can provide an objective and reliable basis for quality control of non-annealed cold heading steel wire rod.

[0165] In summary, by utilizing the technical solution of this invention, a four-dimensional quantitative judgment standard for effective spherical particles is constructed. This standard accurately screens particles beneficial to cold heading from multiple dimensions, including size, shape, aggregation state, and internal quality. It abandons the traditional, crude method of judging solely by the proportion of pearlite regions, accurately distinguishing between effective and ineffective pearlite particles. This ensures that the rating results directly match the cold heading performance, providing core technical support for ensuring the quality of cold heading products and reducing the risk of cracking during the cold heading process from the source. Through a customized multi-scale fusion network, precise and automated segmentation of pearlite regions is achieved. Combined with automated processes such as dynamic window adaptive preprocessing and multi-dimensional particle screening, this eliminates the reliance on operator experience in traditional manual or semi-automatic rating, reducing errors caused by human intervention. Simultaneously, it significantly shortens the testing time per batch, enabling rapid completion of batch testing of non-annealed cold heading steel wire rods, meeting the high-efficiency requirements of online quality control on the production line. A dynamic rating standard is established based on the characteristics of different grades of cold heading steel. The rating results are directly linked to the application scenarios of cold heading. At the same time, customized process adjustment plans are automatically generated for non-conforming products. This achieves full-chain control from organizational rating to performance prediction and process optimization. It solves the limitation of traditional rating methods that can only determine the organizational status and cannot guide production practice. It helps enterprises to accurately adjust production processes and improve product qualification rate and production efficiency.

[0166] This application also provides an electronic device, such as... Figure 5As shown, it includes: a processor, and a memory coupled to the processor, the memory being used to store a computer program; the processor being used to execute the computer program stored in the memory, so that the electronic device performs the cold heading steel wire rod microstructure rating method and system as described in any of the above embodiments.

[0167] Electronic devices can be computing devices such as desktop computers, laptops, handheld computers, and cloud servers. These electronic devices may include, but are not limited to, processors and memory.

[0168] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device, connecting various parts of the device via various interfaces and lines.

[0169] The memory can be used to store the computer program, and the processor implements various functions of the electronic device by running or executing the computer program stored in the memory and calling the data stored in the memory.

[0170] The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0171] This application also provides a computer-readable storage medium. The computer program is stored in the computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a flexible component distribution medium, etc.

[0172] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

Claims

1. A method for rating the microstructure of cold-heading steel wire rod, characterized in that, The method includes: S1. Using microscopic imaging, take several non-overlapping fields of view for the metallographic sample to obtain the original image; the metallographic sample is cut from the surface, middle and core of cold heading steel wire rod and has undergone sample preparation operation. S2. The original image is preprocessed to generate a metallographic image to enhance the grayscale difference between pearlite and ferrite; the preprocessing includes dynamic window local adaptive contrast enhancement, median filtering for noise reduction, and morphological opening operation. S3. Use a multi-scale fusion U-shaped network to perform semantic segmentation on the metallographic image to capture particle features and output a binary mask of the pearlite region to calculate the total pearlite coverage area. S4. Based on the connected components in the binary mask, perform morphological screening and grayscale verification to screen effective spheroidized particles in the metallographic image and calculate the weighted total area of ​​all effective spheroidized particles. S5. Calculate the weighted total area of ​​all effective spheroidized particles in each metallographic image, divide it by the total pearlite coverage area and convert it to a percentage to obtain the effective spheroidization rate of each metallographic image. S6. Integrate the effective spheroidization rate calculation results of metallographic images at different locations contained in all metallographic samples, match them according to the preset rating rules, and output the microstructure rating results of cold heading steel wire rod. The step of using a multi-scale fusion U-shaped network to perform semantic segmentation on the metallographic image to capture particle features and output a binary mask of the pearlite region, and calculating the total pearlite coverage area includes: S31. Construct a multi-scale fusion U-shaped network with five layers: input layer, encoding path, bottleneck layer, decoding path and output layer, and introduce particle enhancement branch and attention mechanism to capture particle features and feature weights of pearlite regions in metallographic images. S32. Construct a dedicated dataset for non-annealed cold heading steel, pre-train and fine-tune the multi-scale fusion U-shaped network to obtain the trained multi-scale fusion U-shaped network; S33. Input the metallographic image into the trained multi-scale fusion U-shaped network, perform feature extraction, feature fusion and semantic segmentation through multiple hierarchical structures, and output a binary mask of the pearlite region. S34. Perform pixel statistics on the binary mask, count the number of pixels with a pixel value of 1, multiply the number of pixels by the actual area of ​​a single pixel, and calculate the total pearlite coverage area. The construction of a dedicated training dataset for non-annealed cold heading steel, followed by pre-training and dedicated fine-tuning of the multi-scale fusion U-shaped network, yields the following trained multi-scale fusion U-shaped network: S321. Construct a dedicated dataset containing several sets of metallographic images of non-annealed cold heading steel for training a multi-scale fusion U-shaped network; the dedicated dataset includes the same number of metallographic images of cold heading steel from different brands and several sets of mixed interference images. S322. Pre-label the pearlite regions in the metallographic images of the dedicated dataset; S323. The multi-scale fusion U-shaped network is pre-trained on a general metallographic image dataset, and then fine-tuned using a dedicated dataset. The fine-tuning process uses granular weighted loss, and the loss weight of the granular region of the preset size is increased by a preset multiple. S324. Set training parameters, loss function and optimizer to solve the sample imbalance problem between pearlitic and non-pearlitic regions in metallographic images. S325. Validate the multi-scale fusion U-shaped network using the test set, and retain the multi-scale fusion U-shaped network that meets the performance standards based on the evaluation results of precision, recall and crossover ratio.

2. The method for rating the microstructure of cold heading steel wire rod according to claim 1, characterized in that, Preprocessing the original image to generate a metallographic image includes: S21. Convert the original image to an eight-bit grayscale image, calculate the average size of the particles in the current original image, and dynamically adjust the size of the sliding window according to the average size; traverse each pixel in the original image with the sliding window, calculate the local mean and local variance within the sliding window, and use the adaptive enhancement formula to perform contrast enhancement processing to obtain a contrast-enhanced image. S22. The contrast enhancement image is traversed using a preset value window, and the median value of all pixels within the value window is selected as the new pixel value for each pixel to obtain the median image. S23. Erosion is performed on square structural elements with pixel values ​​of one to remove bright spots smaller than the square structural elements in the median image. The original morphology of the pearlite particles in the median image is restored by dilation operation to obtain the metallographic image after preprocessing.

3. The method for rating the microstructure of cold heading steel wire rod according to claim 1, characterized in that, The morphological screening and grayscale verification based on connected components in the binary mask are used to screen effective spheroidized particles in the metallographic image, and the weighted total area of ​​all effective spheroidized particles is calculated, including: S41. Calculate the ratio of the total pearlite coverage area to the total area of ​​the metallographic image field of view as the pearlite coverage rate of a single field of view; if the pearlite coverage rate is less than the preset coverage rate threshold, the metallographic sample is determined to be insufficiently spheroidized; if the pearlite coverage rate is greater than the preset coverage rate threshold, then execute S42. S42. Perform connected component analysis on the pearlite binary mask and perform multi-dimensional morphological screening on the connected components to identify effective particle clusters within the connected components; the morphological screening includes dynamic particle size calibration, size screening, sphericity screening and multi-threshold aggregation state determination. S43. Extract the gray value distribution and gray gradient of the connected components selected by morphology in the original eight-bit grayscale image, perform two-dimensional verification on the effective spherical particles, and retain the final effective spherical particles. S44. Based on the sampling location of the metallographic sample where the effective spheroidized particles are located, assign different position weights, multiply the actual area of ​​a single effective spheroidized particle by the corresponding position weight, calculate the weighted area of ​​the effective spheroidized particles, and then calculate the total weighted area of ​​all effective spheroidized particles.

4. The method for rating the microstructure of cold heading steel wire rod according to claim 3, characterized in that, The connected component analysis of the pearlite binary mask, followed by multi-dimensional morphological screening of the connected components, identifies effective particle clusters within the connected components, including: S421. The eight-neighborhood connectivity criterion is used to perform connected component analysis on the pearlite binary mask, and each independent connected component in the metallographic image is marked. S422. Calculate the actual area of ​​each marked connected region, calculate the equivalent diameter of the connected region using the area equivalent diameter formula, and fit the particle edge curve using the least squares method to calculate the edge curvature. Select connected regions whose equivalent diameter is within the preset diameter range and whose edge curvature is greater than the preset curvature threshold to exclude pseudo-effective spherical particles with excessive size or uneven edges. S423. Calculate the connected components that pass the size screening, calculate the perimeter of the connected components, and substitute it into the sphericity formula to calculate the sphericity. Screen out the connected components whose sphericity is greater than the preset sphericity threshold to exclude irregularly shaped spherical particles. S424. For connected components that pass shape filtering, set three distance thresholds to generate multiple sets of distance maps. Automatically select the optimal marker point based on the grayscale uniformity of the particle cluster, segment the particle cluster, and count the number of particles within the particle cluster. If the shortest distance between the edges of particles within the particle cluster is greater than the maximum distance threshold, it is determined to be an independent particle and marked as a valid spherical particle. If the distance between the edges of particles within the particle cluster is less than the maximum distance threshold and the number of particles is less than the preset maximum number threshold, it is marked as a valid spherical particle. If the number of particles within the particle cluster is greater than or equal to the preset maximum number threshold, it is determined to be an invalid particle cluster.

5. The method for rating the microstructure of cold heading steel wire rod according to claim 3, characterized in that, The extraction of grayscale value distribution and grayscale gradient of morphologically screened connected components in the original 8-bit grayscale image, and the performance of two-dimensional verification on effective spherical particles, includes: S431. Calculate the ratio of the number of pixels whose gray values ​​in the connected component belong to the preset gray range to the total number of pixels in the connected component. If the ratio is greater than or equal to the preset gray-level qualified percentage threshold, then mark it as a candidate particle. S432. The Sobel operator is used to calculate the gray-level gradient in the connected domain. If the gray-level gradient is less than or equal to the preset gray-level gradient threshold, it is marked as a candidate particle. S433. If both dimensions of verification pass simultaneously, the candidate particle will be retained as the final output valid spheroidized particle; if any dimension of verification fails, it will be determined as an incomplete spheroidized particle.

6. A microstructure rating system for cold heading steel wire rod, used to implement the microstructure rating method for cold heading steel wire rod according to any one of claims 1-5, characterized in that, The system includes: The image acquisition module is used to capture several non-overlapping fields of view for the metallographic sample using microscopic imaging to obtain the original image; the metallographic sample is cut from the surface, middle and core of cold heading steel wire rod and has undergone sample preparation operation. The preprocessing module is used to preprocess the original image to generate a metallographic image to enhance the grayscale difference between pearlite and ferrite; the preprocessing includes dynamic window local adaptive contrast enhancement, median filtering for noise reduction, and morphological opening operation. The feature extraction module is used to perform semantic segmentation on the metallographic image using a multi-scale fusion U-shaped network to capture particle features and output a binary mask of the pearlite region to calculate the total pearlite coverage area. The particle recognition module is used to perform morphological screening and grayscale verification based on connected components in a binary mask, to screen effective spheroidized particles in metallographic images, and to calculate the weighted total area of ​​all effective spheroidized particles. The spheroidization rate calculation module is used to calculate the weighted total area of ​​all effective spheroidized particles in each metallographic image, divide it by the total pearlite coverage area and perform a percentage conversion to obtain the effective spheroidization rate of each metallographic image. The integrated rating module integrates the effective spheroidization rate calculation results of metallographic images from different locations in all metallographic specimens, matches them according to preset rating rules, and outputs the microstructure rating results of cold heading steel wire rod.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing a computer program to implement the steps of the cold heading steel wire rod microstructure rating method and system as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores a computer program, wherein when executed by a processor, the computer program implements the steps of the cold heading steel wire rod microstructure rating method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Pearlite spheroidization grading method based on contour tracing

    CN103018248A

  • System for intelligent analysis of granitic plaster proportion

    WO2025086584A1