Metallographic detection method and system based on image recognition
Through the metallographic detection method based on image recognition, images are collected using high-resolution microscopes and industrial cameras, combined with intelligent algorithms and automated measurements, the problems of low efficiency and insufficient accuracy of traditional metallographic detection are solved, and efficient and accurate metallographic structure analysis is achieved.
Patent Information
- Application Number
- CN202510767126.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-08-15
AI Technical Summary
Traditional metallographic detection methods are inefficient, limited accuracy, insufficient standardization, weak complex organizational analysis capabilities and strong environmental dependence, making it difficult to meet the needs of modern industry for high-precision and automated testing.
Metallographic detection method based on image recognition is adopted, images are collected through high-resolution optical microscope and industrial cameras, grain boundaries are extracted in combination with median filtering and adaptive binarization algorithms, and grain boundary recognition is used to assist grain boundary recognition to realize multi-parameter automated measurements and generate intelligent reports.
It significantly improves the efficiency and accuracy of metallographic tissue analysis, reduces dependence on professionals, and builds a high-precision and high-efficiency metallographic tissue detection system, suitable for aerospace and medical devices and other fields.
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of metallographic detection, and more particularly to a metallographic detection method and system based on image recognition. Background Art
[0002] As the microscopic "gene" of metal material properties, metallographic structure testing is a core link in material research and development, production quality control, and failure analysis. The mechanical properties (such as hardness, strength, fatigue life) and process performance (such as machinability and weldability) of metal materials are closely related to the metallographic structure (grain size, phase composition, precipitate distribution, etc.). For example, martensitic structure gives the material high hardness, while coarse grains lead to decreased toughness. Traditional metallographic testing relies on manual observation under an optical microscope, and empirical judgment of the structure type and measurement of grain parameters. This method is time-consuming, labor-intensive, and highly subjective. It is also difficult to capture micron-level phase boundary details and the distribution characteristics of complex multiphase structures. It can no longer meet the needs of modern industry for high-precision, automated testing.
[0003] In the research, development, and production of metal materials, especially high-performance alloys like titanium, metallographic analysis is a key tool for evaluating material properties and optimizing process parameters. However, traditional metallographic testing relies on manual observation using an optical microscope, resulting in significant issues such as low efficiency, limited accuracy, insufficient standardization, weak ability to analyze complex structures, and strong environmental dependence. To address these issues, we propose a metallographic testing method and system based on image recognition. Summary of the Invention
[0004] The purpose of the present invention is to provide a metallographic detection method and system based on image recognition to solve the problems raised in the above background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions: A metallographic detection method based on image recognition comprises the following steps: Image acquisition and preprocessing: Metallographic images of metal specimens were collected using an optical microscope with an image resolution of 2752 × 2208 pixels. Median filtering was performed on the metallographic images to remove noise, and an adaptive threshold binarization algorithm was used to extract grain boundaries. The threshold range was dynamically adjusted to grayscale values between 50 and 200, and color range inversion was supported to accurately separate the target phases. Field of view and scale calibration: Select the corresponding scale according to the shooting magnification, with a scale length of 10,000 / magnification (μm), or customize the manual scale; define the elliptical / rectangular field of view in the metallographic image, and support the merging, separation, and position movement of ≥3 fields of view; Multi-parameter automated measurement: Grain size analysis: Use the length tool to mark grain boundaries and calculate the average grain intercept, perimeter, and area; Grain size rating: Based on the intercept method, using a horizontal straight line / cross line grid, setting the intercept error, automatically counting the intercept points and calculating the average grain size grade according to GB / T 6394-2017, allowing manual addition / deletion of intercept points; Second phase analysis: Use binary extraction to distinguish target phases, set area screening intervals, calculate phase area ratios and particle counts, and support hole filling and edge smoothing to optimize analysis results. Intelligent report generation: Automatically generate reports based on preset templates, including original images, binary images, measurement data and histograms. Report fonts and layout can be adjusted in real time through visual controls.
[0006] Preferably, the binarization process supports color interval inversion, and can accurately extract grain boundaries or target phases by adjusting the minimum grayscale value [X] to the maximum grayscale value [Y]. Abnormal particles with an area of less than 1.0 μm² can be deleted through the particle screening function, and the watershed algorithm is supported for automatic segmentation of adhered particles.
[0007] Preferably, when measuring grain size, the intercept format supports hollow / solid style switching, the intercept line width is adjustable from 1 to 20 μm, and the error value is negatively correlated with the number of intercepts. When the error value increases, the number of intercepts decreases.
[0008] A metallographic structure detection system based on image recognition, comprising: a hardware interaction module: including an optical microscope, an industrial camera and a stable workbench, a supporting temperature and humidity control system and a purification and isolation device; Image processing module: Integrates grayscale, median filtering, and adaptive binarization algorithms, provides hole filling, object segmentation, and edge smoothing tools, and supports real-time preview of processing effects; Data analysis module: used to extract data from microscopic images and complete metallographic structure parameter measurement and analysis; Parameter management module: supports batch import / export of commonly used configurations such as scale parameters, grid style, and cutoff format, and pre-stores ≥10 groups of historical parameters.
[0009] Preferably, the data analysis module includes: Scale field unit: scale library with automatic magnification matching and multi-shape field tool; Measuring unit: Grain size measurement: length marking tool, accuracy ±0.5μm; Grain size rating: intercept method calculation engine, compatible with GB / T 6394 and ASTM E112 standards; Phase analysis unit: two-phase ratio statistics module, supporting area / number dual-dimensional screening; Report generation unit: Visual template designer, built-in data grouping and sorting engine, capable of outputting reports in PDF / Word format.
[0010] Preferably, the data analysis module is provided with a slide bar for dynamically adjusting the interception error and displays the curve of the number of interceptions in real time. When the interception is manually modified, the system automatically saves the operation record.
[0011] Preferably, the image processing module supports AI-assisted grain boundary recognition and automatically optimizes the binarization threshold through a convolutional neural network pre-training model.
[0012] Compared with the prior art, the present invention has the following beneficial effects: (1) The detection method of the present invention significantly improves the efficiency, accuracy and reliability of metallographic structure analysis of metal materials through the full-process design of image acquisition standardization, intelligent preprocessing, automated data analysis and templated report generation; metallographic images are collected by high-resolution optical microscopes and industrial cameras, and image quality is improved through intelligent preprocessing such as median filtering and AI-assisted grain boundary recognition. Multi-field batch operation and automatic calculation by interception method are used to realize automatic measurement of grain size, grain size and second phase content. Standardized reports are generated by combining parameter pre-storage and reuse, dynamic error adjustment and visual templates, which significantly improves detection efficiency and accuracy. At the same time, it reduces manual dependence, supports multi-standard compatibility and data traceability, and provides efficient and reliable microstructure analysis solutions for aerospace, medical equipment and other fields, promoting the development of metallographic detection towards intelligence and standardization.
[0013] (2) The detection system of the present invention has built a high-precision and high-efficiency metallographic structure detection system through the collaborative design of hardware integration, intelligent algorithms, and process automation, significantly improving the microstructure analysis capabilities of metal materials. High-resolution industrial cameras and stable workbenches ensure that the metallographic image details are clear and the grain boundary width can be accurately distinguished; temperature and humidity control and purification devices reduce environmental interference; AI-assisted grain boundary recognition (CNN model) has a high recognition accuracy rate for complex structures; adaptive binarization + watershed segmentation solves the problems of incomplete phase separation and particle adhesion, comprehensively improving detection accuracy and reliability, and improving detection efficiency; functions such as intercept error slider + real-time curve, multi-field visualization operation, etc., reduce dependence on professional experience, and junior personnel can quickly get started. DETAILED DESCRIPTION
[0014] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0015] Example: A metallographic detection method based on image recognition comprises the following steps: Step 1: Image Acquisition and Preprocessing: Metallographic images of metal specimens were acquired using an optical microscope at a resolution of 2752 × 2208 pixels to ensure clear microstructures such as grain boundaries. Median filtering was applied to the metallographic images to remove image noise and improve the accuracy of subsequent analysis. Grain boundaries were extracted using an adaptive threshold binarization algorithm. The threshold range was dynamically adjusted to grayscale values between 50 and 200, with support for color range inversion to accurately separate the target phase. Separation of the target phase from the background: The continuous grayscale values of the metallographic image were converted into a black-and-white binary image (with the target phase white and the matrix black, or vice versa) to facilitate subsequent quantitative analysis. An adaptive threshold (grayscale range of 50-200) was used to dynamically segment the grain boundaries from the matrix, with support for color inversion to flexibly extract the target phase. For example, in the α+β dual-phase structure of titanium alloy, binarization was used to separate the bright α phase (grayscale value > 120) from the dark β phase (grayscale value < 120), and the area percentages of each phase were calculated. Black and white separation: Convert continuous grayscale images into binary images (with clear target phase / background separation), providing standardized input for quantitative analysis (such as grain size rating and phase content statistics).
[0016] Through automated pre-processing processes, human intervention is reduced, analysis efficiency (single image processing < 2 minutes) and accuracy (error ≤ ± 2%) are improved, and it is suitable for the metallographic structure detection needs of complex metals such as titanium alloys.
[0017] Specifically, binarization processing supports color range inversion, allowing precise extraction of grain boundaries or target phases by adjusting the minimum grayscale value [X] to the maximum grayscale value [Y]. Particle screening can also be used to remove anomalous particles with an area less than 1.0μm², and a watershed algorithm is used to automatically segment contiguous particles. Color range inversion and grayscale threshold (XY) adjustment are supported to precisely extract grain boundaries or target phases, adapting to different contrast imaging scenarios. The particle screening function removes anomalous particles (such as contaminants and noise) less than 1.0μm², purifying analytical data with a statistical error of ≤±2%. Contiguous particle analysis: The watershed algorithm automatically segments contiguous particles (such as precipitated phase agglomerates), improving the accuracy of particle count and size statistics. Intelligent processing addresses issues such as incomplete phase separation, noise interference, and particle adhesion in metallographic images, providing high-quality data for quantitative analysis of grain size, grain content, and other parameters.
[0018] Step 2: Field of View and Scale Calibration: Select a scale based on the shooting magnification (50×-1000×), with a scale length of 10,000 / magnification (μm), or customize a manual scale (minimum unit is 5μm). Define an elliptical or rectangular field of view within the metallographic image, supporting the merging, splitting, and repositioning of ≥3 fields of view. Automatic or manual scales are available for shooting magnifications from 50×-1000×. The automatic scale calculates the dimension (μm) as "10,000 / magnification," while the manual scale minimizes the unit to 5μm, ensuring accurate mapping between image pixels and actual physical dimensions. Define an elliptical or rectangular field of view, supporting the merging, splitting, and repositioning of ≥3 fields of view, covering areas of microstructural inhomogeneity (such as welds or parent metal), improving statistical representativeness, reducing repetitive operations, and increasing analysis efficiency. This "magnification-scale-field of view" linkage balances standardized measurement with the customized analysis needs of complex structures, providing a reliable spatial reference for quantitative statistics of parameters such as grain size and grain fraction.
[0019] Step 3: Multi-parameter automated measurement: Grain size analysis: Use the length tool to mark grain boundaries and calculate the average intercept, perimeter, and area of grains. Scale pre-storage and one-click recall are supported. The length tool automatically marks grain boundaries and calculates parameters such as the average intercept, perimeter, and area. Scale pre-storage and one-click recall improve efficiency and reduce measurement errors.
[0020] Grain size rating: Based on the intercept method, using a horizontal straight line / cross line grid, the intercept error can be set. For example, if the intercept error is set to 50μm, the intercept number is automatically counted and the average grain size grade is calculated according to GB / T 6394-2017. Manual addition / deletion of intercept points is allowed. The intercept size is 9μm and circular / square shapes are optional. Second phase analysis: Use binary extraction to distinguish target phases, set an area screening range of 3.463-10476.326μm², calculate phase area ratio and particle number, support hole filling, and edge smoothing with a smoothing coefficient of 0.1-0.5 to optimize analysis results. Through multi-parameter synchronous automated measurement, covering the core indicators of metallographic analysis, combined with scale pre-storage, manual editing, and post-processing tools, it takes into account both efficiency and accuracy to meet the high-standard inspection requirements of aerospace and other industries.
[0021] Step 4: Intelligent Report Generation: Automatically generate reports based on preset templates (supporting script editing), including original images, binary images, measurement data (such as grain size grade 13.1±0.3), and histograms. Report fonts and layout can be adjusted in real time using visual controls. Standardized reports are automatically generated based on preset templates, supporting scripting for custom logic and real-time adjustment of visual controls such as fonts and layout. Content includes original images, binary images, measurement data, and statistical charts, intuitively presenting analysis results such as grain size and phase content. Compatible with PDF / Word formats, this meets the compliance and data traceability requirements of aerospace, scientific research, and other scenarios, significantly improving efficiency compared to traditional manual tabulation. In this application, when measuring grain size, the intercept format supports switching between hollow and solid styles, with an adjustable intercept line width of 1-20μm. The error value is negatively correlated with the number of intercepts; as the error value increases, the number of intercepts decreases. By dynamically adjusting the error value (default 50μm), the efficiency of automated statistics can be balanced with the workload of manual corrections. This not only improves grain size grading speed, but also improves accuracy by reducing the error value (for example, to 10μm), meeting the data granularity requirements of different testing standards.
[0022] A metallographic structure detection system based on image recognition, comprising: The hardware interaction module includes an optical microscope, an industrial camera (resolution 2752×2208), and a stable workbench (vibration amplitude ≤ 5μm) to ensure clear metallographic image details. It also features a temperature and humidity control system (temperature 15-38°C, humidity ≤ 60%) and a purification and isolation device. The stable workbench and temperature and humidity control system reduce environmental interference, preventing image jitter and lens condensation. The purification and isolation device prevents dust from contaminating the specimen and optical system, ensuring stable imaging quality. This complete hardware suite provides a reliable physical foundation for high-precision metallographic analysis, meeting the rigorous testing environment requirements of aerospace and other applications, minimizing image acquisition errors and reducing equipment failure rates.
[0023] The image processing module integrates grayscale, median filtering (kernel size 3×3 / 5×5), and adaptive binarization algorithms. Grayscale eliminates color interference, while median filtering effectively removes noise. Adaptive binarization dynamically separates grain boundaries from the matrix, supporting real-time preview and parameter adjustment. It also provides tools for hole filling, object segmentation (manual polygon segmentation), and edge smoothing (1-5 iterations), all with real-time preview of processing results. Hole filling repairs internal grain defects, object segmentation accurately outlines complex contours, and edge smoothing optimizes measurement boundaries. The full-process tool supports real-time preview, reducing manual trial and error and reducing image preprocessing time from 20 minutes per image to under 5 minutes. The processed image features high accuracy, laying a high reliability foundation for subsequent quantitative analysis.
[0024] Data analysis module: used to extract data from microscopic images and complete metallographic structure parameter measurement and analysis; Specifically, the data analysis module includes: Scale field unit: Automatically matches the magnification scale library, with pre-stored 50×, 100×, and 500× scales, automatically matches the imaging magnification to avoid manual conversion errors, and a multi-shape field tool (supports batch operation of ≥5 fields of view) covers uneven areas of microstructure, improves statistical representativeness, and improves operating efficiency compared to the traditional single field of view mode.
[0025] Measuring unit: Grain size measurement: Length marking tool with an accuracy of ±0.5μm; automatically calculates parameters such as intercept, perimeter, and area to meet the needs of titanium alloy grain uniformity analysis.
[0026] Grain size rating: Intercept point calculation engine, compatible with GB / T 6394 and ASTM E112 standards; automatically outputs grain size grade number, with a rating error of ±0.3 grade.
[0027] Phase Analysis Unit: A two-phase ratio statistics module supports dual-dimensional screening of area and number (screening parameter error ±2%), accurately quantifying the target phase content and distribution, and assisting in determining the rationality of metal heat treatment processes. Through automated scale matching, multi-field batch analysis, and multi-standard compatible calculations, an efficient and accurate metallographic data quantification system is established to meet the standardized testing requirements for titanium alloy microstructures in fields such as aerospace and precision manufacturing.
[0028] Report Generation Unit: A visual template designer (with scripting support) features a built-in data grouping and sorting engine, and can output PDF / Word reports (including electronic signatures). The visual template designer supports scripting to customize report logic, and a built-in data grouping and sorting engine (such as sorting by field of view or phase content) allows for flexible adaptation to different industry reporting standards. One-click PDF / Word report generation automatically embeds original images, binary images, measurement data tables, and statistical charts. Electronic signatures ensure data compliance and traceability.
[0029] Parameter Management Module: Supports batch import / export of commonly used configurations such as scale parameters, grid styles (horizontal / vertical / cross-hatch), and cutoff formats, and pre-stores 10 or more sets of historical parameters. When switching between testing tasks, pre-stored parameters can be recalled with a single click, eliminating repeated settings and reducing cross-project testing preparation time from 30 minutes to under 5 minutes. The historical parameter traceability function facilitates reproducible testing processes, meeting ISO 17025 requirements for test repeatability. It also supports batch migration of parameters to multiple devices, improving laboratory standardization efficiency and data consistency.
[0030] Specifically, the data analysis module features a dynamic adjustment slider for intercept error within a 10-100μm range, displaying a real-time curve of the number of intercepts. Manually modifying the intercept automatically saves the operation record. This slider allows for a real-time visualization of the intercept number curve (for example, when the error value increases from 10μm to 50μm, the number of intercepts decreases by approximately 40%), allowing operators to intuitively balance detection efficiency and accuracy. Large error values (such as 100μm) are suitable for rapid initial screening, while small error values (such as 10μm) are used for high-precision retesting. Manually modifying the intercept automatically saves the operation record, ensuring data traceability and compliance with GLP (Good Laboratory Practice) requirements. This prevents analytical deviations caused by human error and improves the reliability and review efficiency of grain size rating results.
[0031] Specifically, the image processing module supports AI-assisted grain boundary recognition, automatically optimizing the binarization threshold using a pre-trained convolutional neural network (CNN) model. This automatically optimizes the binarization threshold using a pre-trained CNN model, replacing traditional manual adjustment. The module achieves an accuracy rate of ≥95% for complex metallographic structures (such as α / β mixed grain boundaries and twins), an improvement of over 30% compared to manual operation. Grain boundaries can be accurately extracted without relying on operator experience, reducing trial and error (single-image processing time reduced from 8 minutes to 2 minutes), making it particularly suitable for batch inspection scenarios. The model continuously optimizes recognition results by learning from historical data, enhancing the system's adaptability to varying erosion conditions and imaging quality, and providing intelligent support for automated metallographic analysis.
[0032] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely preferred examples of the present invention and are not intended to limit the present invention. Various changes and improvements may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and improvements fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.
Claims
1. A metallographic detection method based on image recognition, characterized in that: The steps include: Image acquisition and preprocessing: Metallographic images of metal specimens were collected using an optical microscope with an image resolution of 2752 × 2208 pixels. Median filtering was performed on the metallographic images to remove noise, and an adaptive threshold binarization algorithm was used to extract grain boundaries. The threshold range was dynamically adjusted to grayscale values between 50 and 200, and color range inversion was supported to accurately separate the target phases. Field of view and scale calibration: Select the corresponding scale according to the shooting magnification, with a scale length of 10,000 / magnification (μm), or customize the manual scale; define the elliptical / rectangular field of view in the metallographic image, and support the merging, separation, and position movement of ≥3 fields of view; Multi-parameter automated measurement: Grain size analysis: Use the length tool to mark grain boundaries and calculate the average grain intercept, perimeter, and area; Grain size rating: Based on the intercept method, using a horizontal straight line / cross line grid, setting the intercept error, automatically counting the intercept points and calculating the average grain size grade according to GB / T 6394-2017, allowing manual addition / deletion of intercept points; Second phase analysis: Use binary extraction to distinguish target phases, set area screening intervals, calculate phase area ratios and particle counts, and support hole filling and edge smoothing to optimize analysis results. Intelligent report generation: Automatically generate reports based on preset templates, including original images, binary images, measurement data and histograms. Report fonts and layout can be adjusted in real time through visual controls.
2. The metallographic detection method based on image recognition according to claim 1, characterized in that: The binarization process supports color interval inversion, accurately extracting grain boundaries or target phases by adjusting the minimum grayscale value [X] to the maximum grayscale value [Y]. It also uses the particle screening function to delete abnormal particles with an area of less than 1.0 μm² and supports the watershed algorithm to automatically segment adhering particles.
3. The metallographic detection method based on image recognition according to claim 1, characterized in that: When measuring the grain size, the intercept format supports hollow / solid style switching, the intercept line width is adjustable from 1 to 20 μm, and the error value is negatively correlated with the number of intercepts. When the error value increases, the number of intercepts decreases.
4. A detection system for a metallographic detection method based on image recognition according to any one of claims 1 to 3, characterized in that: include: Hardware interaction module: includes an optical microscope, an industrial camera, and a stable workbench, along with a temperature and humidity control system and a purification and isolation device; Image processing module: Integrates grayscale, median filtering, and adaptive binarization algorithms, provides hole filling, object segmentation, and edge smoothing tools, and supports real-time preview of processing effects; Data analysis module: used to extract data from microscopic images and complete metallographic structure parameter measurement and analysis; Parameter management module: supports batch import / export of commonly used configurations such as scale parameters, grid style, and cutoff format, and pre-stores ≥10 groups of historical parameters.
5. The metallographic structure detection system based on image recognition according to claim 4, characterized in that: The data analysis module includes: Scale field unit: scale library with automatic magnification matching and multi-shape field tool; Measuring unit: Grain size measurement: length marking tool, accuracy ±0.5μm; Grain size rating: intercept method calculation engine, compatible with GB / T 6394 and ASTM E112 standards; Phase analysis unit: two-phase ratio statistics module, supporting area / number dual-dimensional screening; Report generation unit: Visual template designer, built-in data grouping and sorting engine, capable of outputting reports in PDF / Word format.
6. The metallographic structure detection system based on image recognition according to claim 4, characterized in that: The data analysis module is provided with a dynamic adjustment slide bar for interception error and displays the interception number change curve in real time. When the interception point is manually modified, the system automatically saves the operation record.
7. The metallographic structure detection system based on image recognition according to claim 4, characterized in that: The image processing module supports AI-assisted grain boundary recognition and automatically optimizes the binarization threshold through a convolutional neural network pre-training model.
Citation Information
Patent Citations
Mixed crystal degree automatic measurement and fine classification method for steel crystal grains, and system thereof
CN104880389A
Marked watershed segmentation-based steel grain boundary automatic extraction method
CN106599793A
Method and device for identifying grain size through AI, computer equipment and storage medium
CN113112512A
Intelligent grading method and system for grain size of medium-low carbon steel
CN115345846A
Method and system for extracting grain boundary in nickel-based superalloy based on incremental learning
CN115713521A
Cited By
Metallographic image grain size determination method based on artificial intelligence
CN121169842A
Steel grain size grade automatic evaluation system based on deep neural network
CN121414711A
Automatic steel grain size rating system based on deep neural network
CN121414711B