Rapid intelligent monitoring method and system for in-situ monitoring pitting morphology and its surrounding pH dynamic distribution in steel pitting corrosion electrochemical test process
By combining optical imaging with machine learning, rapid and intelligent monitoring of pitting morphology and surrounding pH dynamics in electrochemical testing of steel pitting corrosion was achieved. This solved the problem of difficult synchronous monitoring in existing technologies and achieved efficient real-time and high-resolution monitoring results.
Patent Information
- Application Number
- CN202610578279.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-29
- Publication Date
- 2026-07-10
AI Technical Summary
Existing technologies cannot simultaneously monitor the pitting morphology and the dynamic pH distribution around it in electrochemical testing of pitting corrosion on steel. Furthermore, commercial in-situ pH monitoring technologies have long sampling times and high costs, making it difficult to capture instantaneous pH changes during the dynamic development of pitting corrosion.
By employing a method based on optical imaging and machine learning, combined with the colorimetric properties of methyl orange, the dynamic color change of the corrosion area in the corrosion zone was captured in real time using an optical microscope and recorded by an electrochemical workstation, thus enabling multi-parameter correlation analysis.
It achieves millisecond-level dynamic monitoring of pitting corrosion initiation and propagation processes, provides high-resolution pixel-level monitoring data, significantly improves real-time performance and spatial data density, and can continuously capture real-time pH evolution information during pitting corrosion initiation and propagation processes.
Smart Images

Figure CN122361260A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of monitoring corrosion morphology and pH dynamic distribution in steel, and particularly to a rapid and intelligent monitoring method and system for in-situ monitoring of pitting morphology and surrounding pH dynamic distribution during electrochemical testing of pitting corrosion in steel. Background Technology
[0002] Pitting corrosion in steel (including stainless steel) is a form of localized corrosion whose rapid development poses a serious threat to material safety. The initiation of pitting corrosion forms pits on the steel surface, and simultaneously, the electrochemical signals (open-circuit potential, corrosion current density) of the steel surface undergo abrupt changes. Currently, the study of pitting corrosion on steel surfaces typically employs electrochemical methods, such as open-circuit potential testing and potentiodynamic polarization. These two methods can determine the initiation and development of pitting corrosion by monitoring the open-circuit potential and corrosion current density of the steel surface during the corrosion process. However, due to the significant randomness of pitting corrosion initiation and the small size of the pits during the initiation stage, they cannot be observed with the naked eye. Therefore, it is currently impossible to simultaneously obtain the morphological characteristics of pitting corrosion initiation and development during electrochemical testing. Determining the location of pitting corrosion initiation (inclusions, second phases, grain boundaries) and the morphological changes during pitting corrosion development allows for targeted optimization of the steel's pitting corrosion resistance from a material perspective, which is of great significance for improving the material's pitting corrosion resistance. Therefore, research on the initiation and development of pitting corrosion in steel urgently needs to develop a method that can simultaneously and dynamically obtain the pitting morphology during the electrochemical testing of steel, while obtaining the electrochemical signal of pitting corrosion.
[0003] Furthermore, during the pitting corrosion development process, Fe within the pitting pit... 2+ Ion hydrolysis produces a large amount of H +Ions can cause localized acidification within and around pitting corrosion pits, leading to rapid local development of pitting corrosion and drastic changes in the corrosion electrochemical signal. Therefore, rapid and accurate monitoring of the pH value around pitting corrosion, while simultaneously obtaining the dynamic morphology of pitting corrosion development, is a crucial prerequisite for analyzing the mechanism and kinetics of pitting corrosion propagation. Currently, commercial in-situ pH monitoring technologies (such as scanning ion-selective electrode technology, SIET) can measure the pH distribution in micro-areas, but their sampling time is long—the testing time for a single pH distribution map is typically several tens of minutes to one hour, making it difficult to capture instantaneous pH changes during the dynamic development of pitting corrosion. Furthermore, due to the point-by-point scanning testing method, the number of scan points in a single map is limited (usually no more than 100×100), and probe preparation costs are high. Moreover, commercial in-situ pH monitoring technologies currently lack the ability to simultaneously and dynamically observe the pitting corrosion morphology during testing. Therefore, for the study of pitting corrosion initiation and development, it is necessary to develop an in-situ testing method that can obtain the in-situ morphology of pitting corrosion and simultaneously provide low-cost, high spatiotemporal resolution, rapid response, and automated analysis of the pH spatial distribution around the pitting corrosion.
[0004] To address the aforementioned problems encountered in the study of pitting corrosion in steel, this invention provides an intelligent and rapid pH distribution monitoring method and system based on optical imaging and machine learning. This method enables the simultaneous acquisition of the corrosion morphology and dynamic pH distribution of the sample surface during the electrochemical testing of pitting corrosion in steel. Summary of the Invention
[0005] To address the current lack of methods for the initiation and development of pitting corrosion in steel, this invention provides a rapid and intelligent monitoring method and system for in-situ monitoring of pitting morphology and the dynamic pH distribution around it during electrochemical testing of steel pitting corrosion.
[0006] This invention is achieved through the following technical solution: a rapid and intelligent monitoring method based on in-situ monitoring of pitting corrosion morphology and its surrounding pH dynamic distribution, comprising the following steps: S1. Preparation of in-situ test samples Connect wires to the tail of the steel sample separately, and encapsulate the steel sample separately. The wires pass through the encapsulation structure, leaving the observation surface of the steel sample intact. S2. Installation of in-situ test samples Place the in-situ test sample from step S1 into the electrolytic cell with the observation surface facing upwards, and adjust the observation surface of the in-situ test sample to a horizontal state. S3. Preparation of methyl orange standardization solution and image calibration Prepare different methyl orange calibration solutions with pH ranges of 1-7, each containing the same concentration of methyl orange. Pour the different methyl orange calibration solutions into an electrolytic cell, ensuring the solution thickness above the in-situ test sample is uniform. Capture the morphology of the in-situ test sample under all pH solutions. Input the captured images into a recognition model. The recognition model identifies at least one pixel feature in the corresponding image, and maps the matched at least one pixel feature to the corresponding image. pH calibration is then performed based on this mapping. S4. Electrochemical in-situ testing After calibration, the methyl orange-containing calibration solution in the electrolytic cell is poured out, the in-situ test sample is taken out, and the electrolytic cell is cleaned. The in-situ test sample from step S3 is placed in the electrolytic cell as in step S2, and the methyl orange-containing test solution is injected. Then, a platinum sheet electrode and a reference electrode are installed. The in-situ test sample, the platinum sheet electrode, and the reference electrode are connected to the electrochemical workstation. The dynamic evolution of pitting initiation, location of pitting initiation, pH distribution, and pit size during the subsequent development of pitting is observed during the potentiodynamic polarization process. The methyl orange concentration in the methyl orange-containing test solution is the same as that in the methyl orange-containing calibration solution, and the test solution in the methyl orange-containing test solution is a colorless salt solution.
[0007] As a further improvement to the technical solution of the present invention, the specific method for pH calibration includes the following steps: The image to be processed is converted from RGB space to Lab color space. The brightness (L), red-green hue (a), and yellow-blue hue (b) of the image to be processed are extracted as pixel features. The mapping relationship between the pixel features and the image to be processed is calculated. A recognition model is constructed, and pH calibration of the image is completed based on the mapping relationship.
[0008] As a further improvement to the technical solution of the present invention, step S1, when encapsulating the steel sample, specifically includes the following steps: ① Place the steel sample in the silicone mold with the observation side facing down; ② Add the first layer of epoxy resin into the mold, covering half the height of the steel sample; ③ After the epoxy resin has cured, connect the exposed part of the steel sample to the core of the wire to form electrical conductivity, and then extend the wire out of the mold; ④ Inject a second layer of epoxy resin, covering the top of the steel sample; ⑤ After the epoxy resin has cured, remove the test sample from the original location.
[0009] As a further improvement to the technical solution of the present invention, after the epoxy resin in step ⑤ is cured, the observation surface and the opposite surface of the in-situ test sample are both ground to flatness, and then polished to meet the observation requirements of the optical metallographic microscope.
[0010] As a further improvement to the technical solution of the present invention, the electrolytic cell includes a cell body and a base. The bottom of the base is provided with multiple support legs, of which at least two support legs adopt a nut and leveling screw structure. The nut is fixedly set at the bottom of the cell body, and the leveling screw is threadedly connected to the nut.
[0011] As a further improvement to the technical solution of the present invention, when adjusting the observation surface of the in-situ test sample to a horizontal state, a level is placed on the in-situ test sample to ensure that the observation surface of the in-situ test sample is in a horizontal state.
[0012] As a further improvement to the technical solution of the present invention, the pH of the methyl orange standardization solution is adjusted using H2SO4 or hydrochloric acid solution.
[0013] As a further improvement to the technical solution of the present invention, the colorless salt solution is NaCl, KCl, Na2SO4, K2SO4, NaNO3 or KNO3.
[0014] As a further improvement to the technical solution of the present invention, the concentration of methyl orange in the methyl orange standardization solution or the test solution containing methyl orange is 0~5 g / L, and is not 0.
[0015] This invention further provides a rapid intelligent monitoring system based on in-situ monitoring of pitting corrosion morphology and its surrounding pH dynamic distribution, comprising: The raw image processing module is used for color space conversion, size adaptation, and pixel feature extraction of the raw image. The integrated recognition module takes pixel features as model input, uses a multivariate linear function to map pixel features to prediction results, and finally outputs the pH value of the corresponding pixel position. The heatmap visualization module uses the Jet color mapping algorithm to encode the heat distribution and uses OpenCV's addWeighted function to achieve the fusion display of the original image and the predicted heatmap. The pH matrix output module is used to generate a pixel-level pH matrix in CSV format.
[0016] As a further improvement to the system technical solution of the present invention, it also includes a graphical user interface architecture, which includes: a file operation panel, a visualization area, and a result display module.
[0017] The rapid and intelligent monitoring method and system provided by this invention for in-situ monitoring of pitting morphology and surrounding pH dynamics during electrochemical testing of pitting corrosion in steel has the following advantages compared with existing probe-based pH spatial distribution monitoring technologies: 1. Significantly Improved Real-Time Performance: This system enables millisecond-level dynamic in-situ monitoring of the spatial pH distribution around pitting corrosion during the corrosion growth process (video acquisition rate of 25 frames / s, temporal resolution up to 40 ms), continuously capturing real-time pH evolution information during pitting initiation and propagation. Traditional probe electrodes require point-by-point scanning measurements, typically taking tens of minutes to complete a single distribution test, making it difficult to dynamically track the transient evolution of pitting growth and only allowing analysis of pitting states that have stabilized.
[0018] 2. Significantly improved spatial data density: This method can provide high-resolution pixel-level monitoring data of more than 1000×1000 per frame, with extremely high spatial sampling density; while conventional probe electrodes are limited by scanning efficiency, and in order to shorten imaging time, the number of sampling points per distribution map is usually no more than 100×100, and the spatial resolution and data volume are far lower than this system. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 shows a schematic diagram (a) and a physical diagram (b) of the system hardware.
[0022] Figure 2 is a schematic diagram of the in-situ test sample preparation process.
[0023] Figure 3 shows the front and back photographs of the prepared in-situ test sample (taking a sample with an observation surface size of 1.3 mm × 1.3 mm as an example).
[0024] Figure 4 is a schematic diagram of an electrolytic cell.
[0025] Figure 5 is a schematic diagram of the in-situ test sample installation process.
[0026] Figure 6 shows a photo used for calibration.
[0027] Figure 7 is a screenshot of the software after the pH prediction system has completed calibration. (R in the figure...) 2=0.9996, which is close to 1, indicating that the calibration effect is good.
[0028] Figure 8 is a schematic diagram of the installation process of the in-situ test sample, including leveling, adding test solution, and installing the reference electrode and platinum sheet electrode.
[0029] Figure 9 shows the in-situ observation of pitting initiation and growth morphology of the in-situ test samples: (a) 0 s; (b) 3.5 s; (c) 4.8 s; (d) 6.0 s; (e) 6.9 s; (f) 8.3 s.
[0030] Figure 10 shows the pH distribution analysis of a local screenshot of a 6-s pitting morphology photograph by the pH prediction system (since it is a local screenshot, the pixel value is 103 × 103).
[0031] Figure 11 shows the box in (a) of the pH surface distribution measurement area in the in-situ test sample, the pH surface distribution measurement heatmap (b) and the pH surface distribution measurement color map (c).
[0032] Figure 12 Analysis of pH distribution in 1156 × 1107 pixel pitting morphology photographs (martensitic stainless steel in a "de-passivated" state) using a pH prediction system.
[0033] Figure 13 Analysis of pH distribution in a 1156 × 1107 pixel pitting morphology photograph (martensitic stainless steel in a normal "passivated" state) using a pH prediction system. Detailed Implementation
[0034] To better understand the above-mentioned objectives, features, and advantages of the present invention, the solutions of the present invention will be further described below. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other.
[0035] Many specific details are set forth in the following description in order to provide a full understanding of the invention, but the invention may also be practiced in other ways different from those described herein; obviously, the embodiments in the specification are only some embodiments of the invention, and not all embodiments.
[0036] The specific embodiments of the present invention will be described in detail below. Example 1
[0037] This invention provides a specific embodiment of a rapid and intelligent monitoring method based on in-situ monitoring of pitting corrosion morphology and its surrounding dynamic pH distribution. The method described in this invention utilizes a positive metallographic optical microscope (equipped with a telephoto lens) and an electrochemical workstation to analyze pH distribution using methyl orange (1... <C 甲基橙The acid-base colorimetric characteristics (reddening in acid, yellowdening in alkali) of the corrosion area (≤5 g / L) are observed, and the dynamic color changes of the corrosion area are captured in real time using an optical microscope. An electrochemical workstation simultaneously records current density data, and multi-parameter correlation analysis is achieved by combining optical images. Specific hardware schematic diagrams and physical images of key components are shown below. Figure 1 As shown.
[0038] Preparation of in-situ test samples: Due to the randomness of pitting corrosion initiation locations, the entire observation surface of the steel sample must be within the microscope's field of view to ensure timely capture of the pitting corrosion initiation process without moving the lens. Therefore, the size of the steel sample needs to be limited: at 50x magnification, the observation surface size should not exceed 1.3 mm × 1.3 mm; at 100x magnification, it should not exceed 0.65 mm × 0.65 mm; and at 200x magnification, it should not exceed 0.32 mm × 0.32 mm. The sample height should not exceed 1 cm. Sample cutting can be performed using wire cutting or laser cutting. After cutting, the sides of the steel sample need to be sanded down to 5000 grit to remove the influence of the wire cutting or laser cutting area, reducing the influence of the sides on the corrosion behavior during the corrosion process.
[0039] S1. Preparation of in-situ test samples Connect wires to the tail sections of the steel samples and encapsulate them separately. The wires pass through the encapsulation structure, preserving the observation surface of the steel samples.
[0040] like Figure 2 As shown, step S1, when sealing the steel sample, specifically includes the following steps: ① Place the steel sample in the silicone mold with the observation side facing down; ② Add the first layer of epoxy resin into the mold, covering half the height of the steel sample; ③ After the epoxy resin has cured, connect the exposed part of the steel sample to the core of the wire to form electrical conductivity, and extend the wire out of the mold; specifically, use soldering to connect the exposed part to the core of the wire with insulation to form electrical conductivity. ④ Inject a second layer of epoxy resin, covering the top of the steel sample; ⑤ After the epoxy resin has cured, remove the in-situ test sample. The prepared sample is shown in Figure 3. For ease of display, the first encapsulation resin is white epoxy resin, and the second encapsulation resin is transparent epoxy resin.
[0041] After the epoxy resin in step ⑤ has cured, the encapsulated in-situ test sample needs to be sanded smooth on both the front and back sides. It is important to note that the back of the sanded in-situ test sample must not expose the wires, and the thickness of all four sides must be measured using calipers. The maximum height difference should not exceed 500 μm to ensure the parallelism of the upper and lower surfaces of the sample. The observation surface needs to be sanded with sandpaper of 3000 grit or higher and polished with diamond polishing compound with a grit size of 1 μm to meet the observation requirements of an optical metallurgical microscope.
[0042] S2. Installation of in-situ test samples Place the in-situ test sample from step S1 into the electrolytic cell with the observation surface facing upwards, and adjust the observation surface of the in-situ test sample to a horizontal state.
[0043] Specifically, an adjustable electrolytic cell and a level are used to ensure the observation surface is horizontal. This embodiment provides the specific structure of the electrolytic cell, such as... Figure 4 As shown.
[0044] The electrolytic cell includes a cell body and a base. The bottom of the base is provided with multiple support legs, of which at least two support legs adopt a nut and leveling screw structure. The nut is fixedly set at the bottom of the cell body, and the leveling screw is threadedly connected to the nut.
[0045] In this embodiment, the electrolytic cell body and corresponding base are rectangular. Two legs along one side of the length are two standard φ6 mm screws of equal length, fixedly mounted at the bottom of the cell body. The other two legs use a nut and leveling screw structure; the height of the legs on that side can be adjusted by rotating the leveling screws for easy leveling later.
[0046] The installation of the in-situ test sample is shown in Figure 5. After placing the electrolytic cell on the stage of the metallographic microscope: ① Attach the in-situ test sample to the bottom of the electrolytic cell with double-sided tape, with the observation surface facing upwards; ② Place a bubble level above the in-situ test sample and adjust the leveling screw until the observation surface of the in-situ test sample is horizontal; ③ Pour 100 mL of the standardization solution containing methyl orange into the electrolytic cell, covering the surface of the in-situ test sample. To ensure a consistent solution thickness above the sample, the volume of solution added needs to be fixed here.
[0047] S3. Preparation of methyl orange standardization solution and image calibration Prepare different methyl orange calibration solutions with pH ranges from 1 to 7, each with the same methyl orange concentration. Pour the different methyl orange calibration solutions into an electrolytic cell, ensuring the solution thickness above the in-situ test sample is uniform. Take pictures of the morphology of the in-situ test sample under all pH solutions, and input the pictures into a recognition model. The recognition model identifies at least one pixel feature in the corresponding picture, and maps the matched at least one pixel feature to the corresponding picture. pH calibration is then performed based on this mapping.
[0048] Specifically, the identification model used in this implementation is a multiple linear regression model (referred to as the pH prediction system in this embodiment), which obtains a quantitative mapping relationship between pH and Lab values, such as... Figure 7 As shown in the figure, R 2 = 0.9996, indicating a good calibration effect. To ensure the calibration effect, R0 is required to... 2 >0.9.
[0049] The specific method for pH calibration includes the following steps: The image to be processed is converted from RGB space to Lab color space. The brightness (L), red-green hue (a), and yellow-blue hue (b) of the image to be processed are extracted as pixel features. The mapping relationship between the pixel features and the image to be processed is calculated. A recognition model is constructed, and pH calibration of the image is completed based on the mapping relationship.
[0050] In this invention, the pH of the methyl orange standardization solution is adjusted using H2SO4 or hydrochloric acid solution. In this embodiment, HCl is used as the pH adjustment solution, and the methyl orange concentration is specifically 5 g / L.
[0051] In this embodiment, seven methyl orange-containing standardization solutions with different pH values were selected based on the testing requirements and actual corrosion conditions. The prepared methyl orange-containing standardization solutions needed to be measured using a pH meter with an accuracy of 0.1 or higher to obtain accurate values, accurate to 0.1.
[0052] Subsequently, 100 mL of the methyl orange standard solution at each pH was poured into the electrolytic cell. After each pH of methyl orange standard solution was poured in, the morphology of the steel sample under the corresponding pH of methyl orange standard solution was photographed. After each photograph, the methyl orange standard solution for that pH was removed, the electrolytic cell was thoroughly rinsed, and then the next methyl orange standard solution was poured in to allow for photographing of the morphology of the steel sample under the next pH of methyl orange standard solution.
[0053] Here, we take the calibration process with pH=1.0, 2.0, 3.0, 4.0, 5.0, 6.0, and 7.0 as an example. As shown in Figure 6, due to the difference in pH value, the color of methyl orange changes from red in strongly acidic conditions (pH = 1) to orange-red in weakly acidic conditions (pH = 5), and gradually turns orange-yellow in neutral conditions (pH = 7).
[0054] S4. Electrochemical in-situ testing After calibration, the methyl orange-containing calibration solution in the electrolytic cell was poured out, the in-situ test sample was taken out, and the electrolytic cell was cleaned. The in-situ test sample was then cleaned, and then finely sanded and polished with sandpaper to remove the influence of the acidic solution on its surface and obtain a smooth surface that meets the requirements for metallographic microscopy observation.
[0055] The in-situ test sample from step S3 is placed in an electrolytic cell as described in step S2. A test solution containing methyl orange is injected, and then a platinum sheet electrode and a reference electrode are installed. The in-situ test sample, the platinum sheet electrode, and the reference electrode are connected to an electrochemical workstation. The dynamic evolution of pitting initiation, location of pitting initiation, pH distribution, and pit size during the subsequent development of pitting is observed during the potentiodynamic polarization process. The concentration of methyl orange in the test solution containing methyl orange is the same as that in the methyl orange standard solution containing methyl orange, and the test solution in the test solution containing methyl orange is a colorless salt solution.
[0056] The colorless salt solution is NaCl, KCl, Na₂SO₄, K₂SO₄, NaNO₃, or KNO₃. In this embodiment, 3.5% NaCl is used as the colorless salt solution, and the methyl orange concentration is the saturation concentration according to the test requirements. Specifically, the methyl orange concentration is 5 g / L.
[0057] Simultaneously open the electrochemical testing software, metallographic testing software, and screen recording software, and enable the screen recording function. The recording area of the screen recording software must include the display interfaces of the electrochemical and metallographic testing software. Then, perform electrochemical tests on the sample. For samples that can spontaneously pit in the test solution, measure their open-circuit potential and observe the change in open-circuit potential at the moment of pitting initiation, the location of pitting initiation, and the dynamic evolution of pH distribution and pit size during the subsequent development of pitting. For samples that require anodic polarization to pit in the test solution, observe the moment of pitting initiation during potentiodynamic polarization, the location of pitting initiation, and the dynamic evolution of pH distribution and pit size during the subsequent development of pitting. This embodiment demonstrates how potentiodynamic polarization induces pitting on the stainless steel surface.
[0058] Figures 9(a)-(f) show the in-situ observation results of pitting corrosion behavior of Cronidur30 high-N martensitic stainless steel under potentiodynamic polarization conditions. The figures show that the system can synchronously and dynamically monitor the potentiodynamic polarization curve of the sample, as well as the dynamic evolution of pit morphology with potential during potentiodynamic polarization.
[0059] Figure 10 shows the prediction process of the pH distribution around pitting corrosion by the pH prediction system. The image in the small gray box in the upper right of Figure 10 is a screenshot of the sample surface morphology photograph 6 seconds after pitting corrosion, imported from the system. The image in the large gray box in the lower right of Figure 10 is a heatmap generated by the software after predicting the pH distribution of the image. Because the imported image is a partial screenshot, the pixel count is only 103 × 103.
[0060] Figure 11 shows the pH distribution measurement of the test surface. Figure 11(a) is a photograph of the sample morphology in the upper right corner of Figure 10, and (b) and (c) are heat maps and color images of the pH distribution around the pitting corrosion. As can be seen from Figure 11(c), the area around the pitting corrosion pit is obviously acidic.
[0061] Figure 12 The image shows the pH prediction process of the pH prediction system for the pH distribution around pitting corrosion on the surface of another Cronidur30 high-N martensitic stainless steel sample with "de-passivation" characteristics. The sample size in the image is 1.3 mm × 1.3 mm, and the area around the pitting corrosion also shows acidity. The number of pixels is 1156 × 1007.
[0062] Figure 13 This image shows the pH prediction process of a pH prediction system for the pH distribution around pitting corrosion on the surface of another normal Cronidus 30 high-N martensitic stainless steel sample. The sample size in the image is 1.3 mm × 1.3 mm. The pitting is characterized by being small and deep, and the surrounding area also exhibits acidity. + The diffusion of ions to the surrounding area is obvious, with a pixel size of 1156 × 1007. Example 2
[0063] A rapid intelligent monitoring system based on in-situ monitoring of pitting corrosion morphology and surrounding pH dynamics includes: Graphical User Interface Architecture The main control window is built using the Tkinter framework, and functional areas are implemented through a layout manager. The core interactive components include: a file operation panel, a heatmap visualization module, and a results display module. The file operation panel primarily integrates image loading functionality and establishes a mapping relationship between pH values and image Lab color space values; the heatmap visualization module mainly presents the pH prediction results; and the results display module is equipped with multi-line text boxes for outputting the prediction results.
[0064] The original image processing module is used for color space conversion and pixel feature extraction of the original image; an image parsing module with Chinese path compatibility is developed, which uses OpenCV's imdecode function and Pillow to process the original image data.
[0065] Image preprocessing workflow includes: The color space conversion is to convert RGB to Lab values; the pixel feature extraction process is to establish a three-dimensional feature vector matrix of Lab values.
[0066] The multiple linear regression model prediction module constructs a multiple linear regression model to predict pH values. The model expression is as follows: pH = w 0 + w 1 L + w 2 a +w 3 b in, w 0 、w 1 、w 2 and w 3 The coefficients are linear fitting values. L, a, and b represent lightness, red-green hue, and yellow-blue hue, respectively.
[0067] The least squares method was used for parameter estimation, with the goal of minimizing the sum of squared residuals. The coefficient of determination (R²) was used during the model validation phase. 2 Quantitatively assess the goodness of fit and verify the explanatory power and robustness of the model under the current experimental conditions.
[0068] The heatmap visualization module uses the Jet color mapping scheme to encode the heat distribution, and uses OpenCV's addWeighted function to achieve the fusion display of the original image and the predicted heatmap. The weighting coefficients were experimentally determined to be 0.2:0.8.
[0069] The pH matrix output module is used to generate a pixel-level pH matrix in CSV format.
[0070] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the present invention. Although detailed descriptions have been provided with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments, and they should all be covered within the protection scope of the claims.
Claims
1. A rapid and intelligent monitoring method based on in-situ monitoring of pitting corrosion morphology and its surrounding dynamic pH distribution, characterized in that, Includes the following steps: S1. Preparation of in-situ test samples Connect wires to the tail of the steel sample separately, and encapsulate the steel sample separately. The wires pass through the encapsulation structure, leaving the observation surface of the steel sample intact. S2. Installation of in-situ test samples Place the in-situ test sample from step S1 into the electrolytic cell with the observation surface facing upwards, and adjust the observation surface of the in-situ test sample to a horizontal state. S3. Preparation of methyl orange standardization solution and image calibration Prepare different methyl orange calibration solutions with pH ranges of 1-7, each containing the same concentration of methyl orange. Pour the different methyl orange calibration solutions into an electrolytic cell, ensuring the solution thickness above the in-situ test sample is uniform. Capture the morphology of the in-situ test sample under all pH solutions. Input the captured images into a recognition model. The recognition model identifies at least one pixel feature in the corresponding image, and maps the matched at least one pixel feature to the corresponding image. pH calibration is then performed based on this mapping. S4. Electrochemical in-situ testing After calibration, the methyl orange-containing calibration solution in the electrolytic cell is poured out, the in-situ test sample is taken out, and the electrolytic cell is cleaned. The in-situ test sample from step S3 is placed in the electrolytic cell as in step S2, and the methyl orange-containing test solution is injected. Then, a platinum sheet electrode and a reference electrode are installed. The in-situ test sample, the platinum sheet electrode, and the reference electrode are connected to the electrochemical workstation. The dynamic evolution of pitting initiation, location of pitting initiation, pH distribution, and pit size during the subsequent development of pitting is observed during the potentiodynamic polarization process. The methyl orange concentration in the methyl orange-containing test solution is the same as that in the methyl orange-containing calibration solution, and the test solution in the methyl orange-containing test solution is a colorless salt solution.
2. The rapid intelligent monitoring method based on in-situ monitoring of pitting corrosion morphology and its surrounding pH dynamic distribution, as described in claim 1, is characterized in that... The specific method for pH calibration includes the following steps: The image to be processed is converted from RGB space to Lab color space. The brightness (L), red-green hue (a), and yellow-blue hue (b) of the image to be processed are extracted as pixel features. The mapping relationship between the pixel features and the image to be processed is calculated. A recognition model is constructed, and pH calibration of the image is completed based on the mapping relationship.
3. The rapid intelligent monitoring method based on in-situ monitoring of pitting corrosion morphology and its surrounding pH dynamic distribution, as described in claim 1, is characterized in that... In step S1, the process of sealing the steel sample specifically includes the following steps: ① Place the steel sample in the silicone mold with the observation side facing down; ② Add the first layer of epoxy resin into the mold, covering half the height of the steel sample; ③ After the epoxy resin has cured, connect the exposed part of the steel sample to the core of the wire to form electrical conductivity, and then extend the wire out of the mold; ④ Inject a second layer of epoxy resin, covering the top of the steel sample; ⑤ After the epoxy resin has cured, remove the test sample from the original location.
4. The rapid intelligent monitoring method based on in-situ monitoring of pitting corrosion morphology and surrounding pH dynamic distribution according to claim 1, characterized in that, After the epoxy resin in step ⑤ has cured, the observation surface and the opposite surface of the in-situ test sample are ground until flat, and then polished to meet the observation requirements of the optical metallographic microscope.
5. The rapid intelligent monitoring method based on in-situ monitoring of pitting corrosion morphology and surrounding pH dynamic distribution according to claim 1, characterized in that, When adjusting the observation surface of the in-situ test sample to a horizontal state, a level is placed on the in-situ test sample to ensure that the observation surface of the in-situ test sample is horizontal.
6. The rapid intelligent monitoring method based on in-situ monitoring of pitting corrosion morphology and surrounding pH dynamic distribution according to claim 1, characterized in that, The pH of the methyl orange standard solution is adjusted using H2SO4 or hydrochloric acid solution.
7. The rapid intelligent monitoring method based on in-situ monitoring of pitting corrosion morphology and surrounding pH dynamic distribution according to claim 1, characterized in that, The colorless salt solution is NaCl, KCl, Na2SO4, K2SO4, NaNO3, or KNO3.
8. The rapid intelligent monitoring method based on in-situ monitoring of pitting corrosion morphology and surrounding pH dynamic distribution according to claim 1, characterized in that, In the methyl orange standard solution or test solution containing methyl orange, the concentration of methyl orange is 0~5 g / L, and not 0.
9. A rapid intelligent monitoring system based on in-situ monitoring of pitting corrosion morphology and its surrounding dynamic pH distribution, characterized in that, include: The raw image processing module is used for color space conversion, size adaptation, and pixel feature extraction of the raw image. The integrated recognition module takes pixel features as model input, uses a multivariate linear function to map pixel features to prediction results, and finally outputs the pH value of the corresponding pixel position. The heatmap visualization module uses the Jet color mapping algorithm to encode the heat distribution and uses OpenCV's addWeighted function to achieve the fusion display of the original image and the predicted heatmap. The pH matrix output module is used to generate a pixel-level pH matrix in CSV format.
10. The rapid intelligent monitoring system based on in-situ monitoring of pitting corrosion morphology and surrounding pH dynamic distribution according to claim 9, characterized in that, It also includes a graphical user interface architecture, which includes: a file operation panel, a visualization area, and a result display module.
