Deep Neural Network Predicts Ti‐6Al‐4V Dissolution State Using Near‐Field Impedance Spectra

Retrieval studies document Ti‐6Al‐4V selective dissolution within crevices of total hip replacement devices. A gap persists in the fundamental understanding of Ti‐6Al‐4V crevice corrosion in vivo and its impact on local impedance. Previous studies use nearfield electrochemical impedance spectroscopy (nEIS) for characterization of retrieved CoCrMo surfaces and phase angle symmetry‐based EIS (sbEIS) for rapid data acquisition. In this study, these methods are combined with a deep neural network to characterize the local impedance changes after selective dissolution. It is hypothesized that structural changes occurring during dissolution will manifest as property changes to the oxide film capacitance. First, after sustained cathodic activation, the Ti‐6Al‐4V β phase selectively dissolves from the surface. Next, nEIS acquires n = 100 control and n = 105 dissolved spectra. Over dissolved regions, oxide capacitance significantly increases (Log10Q = ‐4.17 versus ‐4.78 (Scm−2(s)α), p = 0.000). Using single frequency EIS (5000 Hz), a capacitance‐based scanning impedance microscopy method identifies dissolved regions within seconds. Finally, Bode phase plots of the 205 control and dissolved nEIS spectra are input into a deep neural network. After training with n = 180 spectra, the model predicts the surface state for n = 25 previously unseen nEIS spectra with 96% accuracy.


Introduction
Titanium alloys are widely used in orthopedic applications.[3] In vivo, the metaloxide-solution interface is complex.6][7][8][9][10][11][12][13][14] Wear during cyclic loading of orthopedic devices abrades the Ti-6Al-4V oxide film. [15,16][19][20] Potential decreases during MACC cathodically activate the surface and may generate reactive oxygen species (ROS).Previous studies document potentials as negative as -1 V during fretting corrosion of Ti-6Al-4V surfaces.A second source of ROS may arise from the biology. [11]Activated immune cells, including M1 macrophages and foreign body giant cells can adhere directly to the implant surface and secrete ROS.[23][24][25][26] A further gap exists in our fundamental understanding of the interaction between potentials and the passive oxide film's electrochemical behavior under varying solution conditions, and the effects of prior electrochemical damage on the impedance response of Ti-6Al-4V.
Previous studies use electrochemical impedance spectroscopy (EIS) to map fundamental structural and property relationships between the Ti-6Al-4V oxide film's impedance and its ability to prevent corrosion. [27]Defects generated in the Ti-6Al-4V oxide structure as it remodels under cathodic activation, tribology, or corrosive solutions decrease the oxide's polarization resistance (R p ), promoting corrosion at the interface.From our group, we used EIS to document a synergistic effect between negative potential excursions (i.e., cathodic activation) and inflammatory species, decreasing oxide R p by a factor of 10 5 . [28]Further elucidation of these structure-property relationships between the oxide film and the degraded implant surface is critical to replicating chemically and biologically induced corrosion in the lab and preventing these damage modes in vivo.
Recent developments in EIS techniques provide powerful insights into the metal-oxide interface.First, phase angle symmetry-based (sbEIS) rapidly captures multiple impedance spectra. [29]Next, nearfield EIS (nEIS) quantifies the impedance of both small areas (mm 2 to um 2 resolution) and different corrosion damage modes.[32] The application of nEIS in a retrieval study documented significant differences in the capacitive behavior of intergranular corrosion, phase boundary corrosion, and oxide debris regions from control surfaces. [33]They also report differences in the constant phase element exponent, .Thus, sbEIS, for the first time, allows for the design of high throughput impedance testing and nEIS may be utilized to identify unique impedance characteristics, or "signatures", of various corrosion damage modes.
[41] Previous research shows the promise of AI in classifying the Goldberg score of retrieved femoral stems.Support vector machine and neural networks models achieved high accuracy with multiclassification (85%) and binary classification (98%) problems, respectively.The ability to classify damage on femoral stems may have clinical implications at the point of care.During revision surgeries of total hip arthroplasty devices, the clinician must make a real time decision whether to replace the femoral head and acetabular components, or to remove the stem as well.Extraction of a well-fixed stem is a time-consuming process and can impact revision outcomes.Additionally, replacing the stem in patients exhibiting bone loss may require a custom device.The ability to quickly predict the corrosion state of a femoral stem trunnion may have value as a decision support tool for surgeons, and act as an aid in surgical planning.
In this study, we combine sbEIS, nEIS and an AI approach to elucidate the differences between selectively dissolved and control areas of Ti-6Al-4V surfaces.We hypothesize that structural changes to the oxide film under cathodic activation and inflammatory species will manifest as functional changes to the oxide's impedance.First, we utilize nEIS and sbEIS to repeatedly capture impedance spectra on dissolved and control areas.Next, we capture nEIS across a dissolved surface at intervals of 1-3 mm.Additionally, we introduce an impedance microscopy method where we continuously capture the loss impedance (-Z″) at a fixed high frequency (e.g., 5000 Hz) within seconds, moving our electrochemical cell across a Ti-6Al-4V surface with both selectively dissolved and uncorroded control areas.Finally, we use nEIS spectra from selectively dissolved and control areas to train and test a deep neural network (DNN) model.We sought to answer the following research questions: 1) are selectively dissolved and uncorroded control Ti-6Al-4V regions identifiable using nEIS and 2) can a DNN predict the surface dissolution state from the respective impedance spectra?

Experimental Section
To address our research questions, we used various electrochemical experiments and techniques including: 1) the application of sustained cathodic activation to induce selective dissolution; 2) the repeated nEIS measurement over dissolved and control Ti-6Al-4V surfaces; 3) the acquisition of nEIS as we manually moved an electrochemical cell fixture (1-3 mm increments) over a control and dissolved surface and 4) the continuous capture of -Z″ at a single high frequency as we moved the fixture across a control and dissolved surface.To assess the predictive capability of impedance, we used the spectra captured over dissolved and control areas as inputs to a DNN.This systematic approach is reported in the following methods.

Sample Preparation
Ti-6Al-4V samples (ASTM F-136) were mechanically polished using increasingly fine grits of emery paper, starting with 240 grit, and ending with 600 grit.Next, samples were manually held on polishing wheels for ≈15 min each.Alumina/deionized H 2 O suspensions of 1 and 0.3 μm, respectively, were applied until a mirror finish was achieved.Prior to imaging the control Ti-6Al-4V microstructure, a further chemical-mechanical polish was applied using a 40% H 2 O 2 , 60% colloidal silica suspension.Scanning electron microscopy (SEM, Hitachi S-3700N, Hitachi Inc., Tokyo) images were captured in both backscattered electron (BSE) and secondary modes.Chemically polished Ti-6Al-4V surfaces were mechanically polished afterwards to return both the surface finish and oxide structure to the same starting state as Ti-6Al-4V samples that were selectively dissolved.Prior to inducing selective dissolution, electrical connection was maintained between the back of the sample and an external wire using copper or carbon tape.This wire-Ti-6Al-4V junction was protected from the electrolyte solution using hot glue.Finally, individual surfaces on a Ti-6Al-4V discs were isolated using tape, and the nominal surface area was measured using digital optical microscopy (DOM, Keyence VHX-6000, Keyence Corp., Mahwah, NJ).

Inducing Selective Dissolution
Selective dissolution was induced on Ti-6Al-4V samples by cathodically activating the surface at −0.4 V for 24 h.The electrochemical cell consisted of a Ti-6Al-4V working electrode and a carbon rod counter electrode.Reference electrodes included sintered Ag/AgCl references, as well as silver wire references chlorinated in household bleach for at least 24 h.Reference electrode potential difference was evaluated versus a mother electrode prior to use to assure a common reference potential.A VersaSTAT4 (AMETEK, Berwyn, PA) was used.The electrolyte consisted of a 0.1 M H 2 O 2 / Phosphate buffered saline (PBS) solution.Experiments were conducted at both 24 °C (room temperature) and 37 °C ± 3 °C (physiological temperature).Physiological solution temperature was maintained using an IKA C-Mag HS7 digital hot plate with an external temperature sensor.To prevent active corrosion of the metallic temperature sensor, and unintended Fenton reactions at the Ti-6Al-4V oxide-solution interface, a second beaker was placed on the hot plate, filled with DI H 2 O to the same volume as the beaker containing the electrochemical cell.Both beakers were simultaneously covered with parafilm to ensure equal heating, and the final temperature of the electrolyte in the electrochemical cell was measured to ensure accuracy.After 24 h, samples were removed, sonicated in 70% ethanol/30% H 2 O solution, and dried with a kim wipe.SEM BSE micrographs of dissolved surfaces were captured at 5000x magnification.Resulting images were analyzed for  dissolution using ImageJ contrast thresholding. [28]

Additively Manufacturing nEIS Fixture
An nEIS fixture consisting of a 25 mm wide base and a 40 mm high solution chamber was manufactured using fused filament fabrication (Original

Repeated nEIS Measurement over Dissolved and Control Ti-6Al-4V Surfaces
nEIS spectra were repeatedly captured from dissolved (n = 105 spectra) and control (n = 100 spectra) regions.The PETG fixture was first clamped to the Ti-6Al-4V working electrode (Figure 1A).The 0.07 cm 2 (3 mm diameter) opening (Figure 1C) was then visually inspected for the presence of corrosion, to ensure accurate spectra labeling.Next, 0.1 M H 2 O 2 solution was added to the fixture using a 10 ml Corning auto-pipette.Then, a 1 ml plastic pipette tip was inserted into the electrolyte solution within the PETG fixture, until the tip contacted the working electrode surface.This was done to assure solution contact with the working electrode by breaking any surface tension generated between the hydrophobic Oring, PETG fixture, and the Ti-6Al-4V working electrode surface.A sintered Ag/AgCl reference electrode and Pt wire counter electrode were inserted into the open top of the PETG fixture, an alligator clip was connected to the Ti-6Al-4V working electrode, and potential was monitored to ensure a complete electrochemical cell (Figure 1B).The open circuit potential was recorded for 10 s.Next, EIS was captured from 10 5 to 10 1 Hz, or until the crossover frequency,  x , corresponding with the maximum phase angle was recorded. [29]In cases where EIS capture did occur at frequencies lower than 10 1 Hz, due to not reaching  x , only a few additional points were needed.Following capture, EIS data were fit using the sbEIS method, with a Randles CPE circuit equivalent.Fifteen EIS spectra were captured from each of the seven dissolved regions (n = 105, Figure 1D).The nEIS PETG fixture was moved after an EIS spectrum was recorded to ensure that a unique spectrum was acquired.One hundred EIS spectra were captured on a separate polished Ti-6Al-4V disc.The nEIS fixture was moved several mm after each capture to ensure that a unique spectrum would be recorded.The full details of the nEIS PETG fixture, capture resolution, and electrochemical cell can be seen in Figure 1.

Spatial nEIS Acquisition
During spatial nEIS acquisition, full nEIS spectra were systematically acquired on dissolved and control areas.The log adjusted capacitance from these experiments was plotted versus the position on the surface in mm.
The PETG fixture was manually moved across a selectively dissolved area in increments of 1-3 mm.Generally, acquisition began in a control area, moved across a dissolved area of the sample surface and ended in a second control area.EIS spectra (n = 3) were captured from two areas in the first control region (6 total spectra), one area at the control-dissolved border, and two areas within the selectively dissolved region.This process was mirrored as the fixture continued to move left to right.Captured spectra were fit using sbEIS with a Randles CPE circuit model.The distance of the first control nEIS spectra was labeled as 0 mm, and the locations of the following nEIS spectra were marked with sharpie and measured on the sample (±1 mm) using a ruler.Following nEIS measurement, DOM images of the control-dissolved region were captured.

Spatial Scanning with Single Frequency Capture of Loss Impedance
Single frequency (5000 Hz) data of the loss impedance (-Z″) were continuously captured while spatially moving the system from left to right.During capture, the nEIS fixture was first held over a control area for 30 s. Next, the fixture, including the electrochemical cell, was slowly moved 5 mm from control to selectively dissolved region and held there for 10 s.The fixture was then moved 5 mm again to a second control area for 10 s, before moving in the reverse direction, −5 mm back onto the dissolved region.Finally, the nEIS fixture was moved back to the original control region and held for 10 s.The PETG nEIS fixture was swept back and forth across the dissolved region for four complete cycles.The resulting -Z″ values were converted to the CPE capacitance Q using the following formula: where  is determined from the average peak height for dissolved ( dissolved = 0.86) or control ( control = 0.90) regions calculated from experimental nEIS data (Figure 5F),  was the nEIS dϴ/dlog 10 () frequency peak (5000 Hz), and Z'' is the impedance loss.Data at the two linear plateaus corresponding with dissolved and control regions were identified, labeled, and clustered.

Deep Neural Network Model
A DNN was used to predict the dissolution state of the Ti-6Al-4V surface.
The DNN comprised of input, output, and hidden layers.Inputs consisted of the phase angle versus frequency datasets obtained through repeated nEIS capture (detailed in Section 2.4).Model output was a binary classification of control or dissolved (1 or 0).The DNN model was trained with n = 180 phase angle versus frequency data and the respective ground truth labels.Model accuracy was evaluated using n = 25 phase angle versus frequency test data.The test dataset was previously unseen to the model and not used in model training.
To measure model error, the output of the DNN model was compared against the ground truth using a loss function.During backpropagation, the error was fed back to the network and the model parameters, including the weights within the hidden layers, were updated.Forward propagation, loss evaluation, back propagation, and parameters were iteratively and continuously updated until an acceptable loss was obtained.
The DNN model comprised of multiple hidden layers.Each hidden layer was an assembly of several neurons.A neuron may be defined as a function that takes input, processes it and produces an output.A rectified linear unit (ReLU) activation function was used within the hidden layer and a sigmoid function was used in the output layer.
ReLU is widely used as an activation function and has been successfully implemented in several applications. [42]Advantages of the ReLU function include its abilities to overcome vanishing gradient problems, increase sparsity, and quickly converge. [43]Compared to other activation functions, ReLU offers better performance and generalization. [44,45]The ReLU function is expressed as follows: where x is the input of the layer.The max function returns x, if x is greater than zero, and zero, if x is less than or equal to zero.A sigmoid activation function was used for the output layer of the DNN model.The sigmoid function was calculated as follows: where x is the input of the layer.The sigmoid functions output ranges from 0 to 1.For example, when x = 0, the sigmoid output is 0.5, indicating that both classes have equal probabilities.Our binary classification problem had only two output values 0 (control) and 1 (dissolved).Hence, the threshold 0.5 was used to convert the output of our sigmoid function to either 0 or 1.The binary cross entropy function was applied to evaluate the loss of the DNN model.The loss function calculates the error by comparing the predicted output p(y i ) with the ground truth y i .The equation of binary cross entropy is: where N is number of samples.Backpropagation fine-tuned the learning parameters (weights and biases) of the DNN model based on the loss obtained from the binary cross entropy loss function.The gradients of the loss with respect to the weights and biases were evaluated layer by layer starting from the output layer and consecutively working back to the input layer.Based on these gradients, the neural network adjusted the weights and bias of each layer using gradient descent algorithms.The gradient descent algorithm further uses a learning rate that determines the iteration step size.This training process continued until the network output error decreased to an acceptable value.
A model of the neural network architecture can be seen in Figure 2.
To evaluate DNN model performance, accuracy, confusion matrix, and F1 score were used.These metrics are widely used and defined through predicted values and actual values. [46]The combination of predicted values and actual values results in four outcomes: 1) true positive (TP), 2) true negative (TN), 3) false positive (FP), and 4) false negative (FN).Within this study, we define positive as control and negative as dissolved.We further define TP as the predicted class is control and true; TN as the predicted class is dissolved and true; FP as the predicted class is control and false, and FN as the predicted class is dissolved and false.Accuracy is defined as the ratio of total true predictions (TP + TN) to the total predictions (TP + TN + FP + FN).The confusion matrix, the matrix of predicted and actual values, is shown in Table 1.
Model performance can be fine-tuned using F1 score.F1 score is defined using precision and recall where precision is the ratio of true positives (TP) and total predicted positives (TP + FP), and recall is the ratio of true positives (TP) and total actual positives (TP + FN).F1-score is evaluated using: Hyperparameter tuning is the process of selecting a set of optimal hyperparameters for the DNN model.Hyperparameters include the number of hidden layers, layer size (no. of neurons in each layer), batch size (number of samples), and learning rate.Additionally, these hyperparameters influence the rate of training and were critical in model selection.The five DNN models and their classification accuracies with different hyperparameter combinations are listed in Table 2.Among these five models, the first DNN model configuration achieved the best performance on the test cases with 0.96 classification accuracy and F1 Score.The confusion matrix of this DNN model is shown in Table 3.

Statistical Analysis
First, acquired EIS spectra were fit with a CPE-Randles circuit and normalized with the working electrode area, 0.07065 cm 2 .Second, error bars above and below averaged data throughout this work represent the standard deviation.Statistical analysis was performed in MATLAB versions 2019b-2022b.Machine learning analysis was performed in Python version 3.6.
Two-sample t-tests were used to assess the differences in log 10 (Q) (Figure 5C) and the CPE exponent  (Figure 5F) between n = 105 dissolved and n = 100 control nEIS spectra.A one-way analysis of variance (ANOVA) was used to determine significant differences in the spatially acquired nEIS (Figure 6A) capacitance.Pairwise comparisons between control (n = 12), border (n = 6), and dissolved regions (n = 6) were conducted using a post hoc Tukey's multiple comparison test.Differences in capacitance following the continuous capture of loss impedance (Figure 7D) were assessed using a two-sample t-test.Transient Z'' points captured while moving the PETG fixture between control and dissolved regions were removed and the remaining points were labeled as either 0 (control) or 1 (dissolved) and converted to CPE capacitance.The mean capacitance of a dissolved cluster (n = 338) was compared with the mean capacitance of a control cluster (n = 417).An alpha rejection level of 0.05 was used for all statistical tests.A minimum of n = 6 data points were sampled from each population statistically analyzed in this work.

Inducing Selective Dissolution
Cathodically activating Ti-6Al-4V samples at −0.4 V for 24 h in 37 °C or 24 °C 0.1 M H 2 O 2 induced preferential dissolution of the Ti-6Al-4V  phase (Figure 3).Reference secondary electron SEM micrographs (Figure 3A) of the untreated surface show a uniform surface with the faint outline of the Ti-6Al-4V  phase.
In BSE mode (Figure 3B), the two phases are easily distinguishable.Equiaxed globular  takes up more relative surface area and is darker in contrast to the vein-like interspersed  phase.The  phase appears light grey.On surfaces exposed to cathodic activation and inflammatory species, the  phase is preferentially  leached (Figure 3C,D).Note the dark crevices in Figure 3D where the  phase used to be and the beveled appearance of the remaining  at the phase boundaries.Digital images of the Ti-6Al-4V sample show seven separately selectively dissolved regions (Figure 4A).Digital optical microscopy (DOM, Figure 4B) reveals a heterogenous surface.Though the entire surface appears selectively dissolved, indicated by the dark crevices surrounding the remaining globular , various regions are shades of brown, blue, and purple.Note the nEIS capture resolution, the circular area of the surface exposed to the electrochemical cell, overlayed on top of the DOM image.For the image in Figure 4B, the nEIS capture resolution is ≈22% of the dissolved region.ImageJ contrast thresholding of BSE micrographs of the seven dissolved regions (Figure 4C) confirms the visual analysis from the DOM.All seven surfaces exhibited at least 89%  dissolution.The maximum  dissolution measured was 100%.

Repeated nEIS Measurement over Dissolved and Control Ti-6Al-4V Surfaces
Representative (n = 1) impedance spectra captured on dissolved and control areas are shown in Bode magnitude and phase plots (Figure 5A,B).Note the similarity in |Z| at low frequencies for control and dissolved areas in Figure 5A.These values correspond with the predicted solution resistance (R s )+ R p using sbEIS.Bode phase plots (Figure 5B) show a leftward shift in the peak of the dissolved spectra.Circuit elements extracted from control (n = 100) and dissolved (n = 105) spectra reveal several important characteristics (Figure 5C-F).First, there is a significant increase in the log adjusted Q for dissolved regions (Figure 5C, −4.17 Scm −2 s  compared to control regions (−4.78 Scm −2 s  , p = 0.000).This increase quantifies the leftward shift of the dissolved spectrum presented in the Bode phase plot in Figure 5B.Next, the magnitudes of R p and R s (Figure 5D,E) are similar, indicating that changes in the capacitance are due to modifications in the oxide structure rather than changes to the electrochemical cell setup or solution chemistry.Finally, there is a significant decrease in the CPE exponent  for dissolved regions (0.86) compared to control regions (0.90, p = 0.000).

Spatial Measurement using nEIS of Dissolved and Control Regions
Following spatial acquisition at 1-3 mm intervals across a dissolved Ti-6Al-4V surface, nEIS spectra (Figure 6A, region 1 in Figure 4A) show an increase in the log adjusted Q for selectively dissolved regions (Figure 6B, p = 0.000).At distances of 0 and 4 mm over control areas, log 10 (Q) was recorded as −4.86 and −4.80 Scm −2 s  respectively.At the first border between control and dissolved regions (6 mm), log 10 (Q) increased to −4.41 Scm −2 s  .EIS spectra captured in the center of the dissolved region (9 mm, 11 mm) reveal a second increase in log 10 (Q) to −4.24 and −4.16 Scm −2 s  respectively.This behavior was mirrored as EIS data were captured on the border and second control area.Log 10 (Q) was lower on the second dissolved-control border at 13 mm and returned to −4.88 and −4.81 Scm −2 s  at 17 and 20 mm respectively.The differences in log adjusted Q between control, dissolved, and border areas were all statistically significant (p = 0.000).

Continuous Impedance Loss Capture at a Single High Frequency
Continuously acquiring impedance loss at a constant 5000 Hz frequency and rastering the nEIS electrochemical cell 10 mm across the Ti-6Al-4V sample shows an increase in the imaginary component of the impedance magnitude, Z'', over dissolved regions (Figure 7A).This plot is of Z″ versus time as the electrochemical cell is manually moved over the surface from control regions to selectively dissolved regions, and back.Note the increase in Z'' from −105 Ω at 31 s to −35 Ω at 32 s in 0.1 M H 2 O 2 electrolyte solution, corresponding with moving the nEIS electrochemical cell 5 mm from a control area to the center of a dissolved area.After capturing Z'' over the dissolved area for 10 s, moving the nEIS fixture another 5 mm to a second control area decreased Z'' at 42 s to −96 Ω. Rastering 5 mm back across the dissolved region, holding for 10 s, and returning to the original control area at 62 s replicated the increase in Z'' over dissolved regions and subsequent decrease over control areas.Note, similar results (although shifted in value) were obtained when the solution was replaced with PBS.This rastering back and forth was repeated four times over 180 s, yielding similar characteristic increases in Z'' over dissolved regions (Figure 7B).Converting Z'' to Q, and removing transient points captured during movement of the electrochemical cell shows two distinct linear regions, one corresponding with control areas and a second corresponding with dissolved areas (Figure 7C).Plots of the Log 10 (Q) values versus their ground truth labels (Figure 7D) reveals two clusters of data, the capacitance captured over control areas (labeled 0) at −4.3 Scm −2 s  and the capacitance over dissolved areas (labeled 1) at −3.8 Scm −2 s  .The means capacitance of the dissolved cluster (n = 338) was significantly higher than the control cluster (n = 417, p = 0.000).

Deep Neural Network Dataset and Predictions
Plots of the Randles CPE exponent  versus Log 10 Q show two clusters of data, corresponding with the ground truth labels (Figure 8A).Spectra captured over control regions are clustered at ≈−4.8 Log 10 (Q) and 0.9 .In contrast, dissolved spectra CPE values have increased variance, though the resulting CPE variables are still visually distinguishable from the control cluster.A DNN trained with the phase angle and frequency dataset (n = 180 training data), and a binary label (0 for control, 1 for dissolved) predicted the true class of unseen test data (n = 25) with 96% accuracy (n = 24/25, Figure 8B).It is important here to note that while we visually represent the EIS spectra in Figure 8B using the calculated CPE parameters and exponents, these data were Log 10 Q over control (n = 12), dissolved (n = 6), and border regions (n = 6) are significantly different (p = 0.000).Data are presented as mean ± standard deviation for the three spectra captured at each location.A p-value was calculated using a one-way analysis of variance (ANOVA) followed by a post-hoc Tukey's multiple comparison test.not used to train the model.Instead, only the unfit EIS phase versus log  spectra were needed for classification.

Assessing the Deep Neural Network's Generalizability
In this section, we present the results of two tests cases to assess the generalizability of the trained DNN.First, A DOM image (Figure 9A) of a Ti-6Al-4V sample shows a dissolved area after 7 h of cathodic activation at −0.4 V in 0.1 M 37 °C H 2 O 2 solution.Though the time exposed to inflammatory species and cathodic activation was lower than those in the training data set (24 h), the state of the surface is dissolved.EIS captured in control areas, border areas, and dissolved areas shows similar behavior to the linear acquisition in Figure 6B.Log adjusted Q starts off low, rises at the border regions between control and dissolved areas, and peaks in the dissolved area.As EIS were captured across the second border area (7 mm), and second control area (9-10 mm), this behavior is maintained.The trained DNN was able to successfully predict the true class of n = 7/8 of the points (or 21/24 individual impedance spectra) in Figure 9B from the associated phase angles and frequencies.It is important to note that this surface was 1) dissolved on a separate Ti-6Al-4V disc than the training data was captured from, and 2) none of these impedance spectra were used to train the neural network.
A second generalizability test was performed on region five in Figure 4A.While dissolved impedance spectra were captured from this area using 0.1 M H 2 O 2 to train the neural network in Figure 8, here, we linearly acquired nEIS of the region using a PBS electrolyte solution.A DOM image shows the 10 mm raster  path of the line scan (Figure 10A).Resulting Q values are low over control areas, increase over the border between dissolved and control areas and increase again over dissolved areas.These characteristics are similar to the EIS line scans captured using 0.1 M H 2 O 2 in Figure 6 and Figure 9.The DNN predicted 8/8 points (100%) and 24/24 EIS spectra (100%) correctly.

Discussion
In this study, we used a combination of four approaches, including 1) nEIS, 2) sbEIS, 3) high frequency Z″ spatial scanning and 4) a DNN (based on phase versus log ) to quantify and classify the impedance differences between selectively dissolved and control Ti-6Al-4V areas.This combination of impedance analysis and artificial intelligence methods demonstrates the potential for high speed measurement and classification of corrosion damage on alloy surfaces.While only two classes were identified and studied in this work (selectively dissolved and control surfaces), the possibility of adopting this approach for rapid analysis of damaged implant surfaces exists, or in other circumstances where variations in surface alloy impedance may reflect variations in surface quality.In particular, high frequency loss impedance measurements, which were chosen to be at 5000 Hz in this work, but could be at higher frequencies as well, may provide high speed and high throughput impedance-based analysis for imaging and surface assessment.When used in combination with DNN methods, monitoring and determination of degradation classes, as well as high speed imaging based in impedance become possible.
The results presented in this study build off the existing body of literature.Prestat et al. document capacitive changes to the oxide film over time during active selective dissolution of the Ti-6Al-4V  phase. [47]They present a linear increase in oxide capacitance with respect to time, as the Ti-6Al-4V surface is exposed to oxidizing solutions, including PBS/ 0.1 M H 2 O 2 and PBS/ 0.1 M H 2 O 2 with the addition of 0.16 mM FeCl 3 .When the Ti-6Al-4V surface is cathodically activated at −0.4 V in addition to the oxidizing solutions, the capacitance increases with a logarithmic relationship to the elapsed time.It is important to note here that while Prestat et al. are actively measuring the EIS of a corroding surface, we are capturing the nEIS of the surface after dissolution has been completed, and the oxide has re-aerated.Despite these experimental differences, we still identify a significant increase in the capacitance of dissolved surfaces compared to the control Ti-6Al-4V (p = 0.000).This suggests that changes in the capacitance are driven by modifications to the TiO 2 oxide structure during  dissolution, and that once modified, the oxide does not recover to the pre-dissolution state.
These insights support the hypothesis of electrochemical history, where the oxide accumulates defects in vivo when exposed to adverse electrochemical events.It is unrealistic, for example, to expect the supraphysiological conditions (0.1 M H 2 O 2 , sustained cathodic activation at −0.4 V) used in this work to occur at the biology-oxide-device interface in vivo.Retrieval studies document dissolved surface states, including the formation of thick oxide films, and pitting within the crevices of modular taper junctions where  dissolution appears as an initiating mechanism.[50][51][52][53] We hypothesize that as Ti-6Al-4V modular taper junctions are cyclically loaded in vivo, the cathodic activation of the surface induces defects in the oxide film.In combination with ROS generated from fretting or activated immune cells during inflammation, the number of defects may reach a threshold such that the R p of the TiO 2 oxide film may no longer be sufficient to prevent active dissolution initiating at the  +  phase boundaries.Indeed, it is not only the  phase that corrodes in vivo.Retrieval studies show evidence of chemically induced corrosion of the Ti-6Al-4V  phase and recently published in vitro studies show that  may be targeted for preferential dissolution. [7,9,54]re in vitro work is needed to confirm this hypothesized in vivo mechanism.Future studies will evaluate the cyclic effect of cathodic activation and inflammatory species on the oxide capacitance and R p .
Functional changes in the oxide capacitance documented in this study are likely directly related to structural changes in the oxide film and/or topographic changes to the surface.Atomic force microscopy of the oxide overtop titanium and its alloys reveals homogenous, closely packed domes. [55]When subjected to inflammatory species, these domes become fuzzy (when imaged in AFM), indicating defects in the oxide film. [55,56]Additionally, FIB-SEM of dissolved and cross sectioned Ti-6Al-4V surfaces reveals structural differences in the oxide overtop  and the oxide overtop . [47]While the oxide over top  remains closely packed, voids appear in the  oxide.A habit relationship likely exists between the oxide over  and the oxide over , corresponding with the different elemental composition of the two phases ( is aluminum rich in contrast with the vanadium rich  phase).Additionally, the increase in defects due to the differing crystal structures (HCP, BCC) at the  +  phase boundaries may aid in initiating  dissolution in the presence of cathodic activation and inflammatory species.
In this work, we make several modifications to the nEIS method presented by Wiegand and Shenoy. [30]While their electrochemical-cell-in-a-pipette setup had a spatial resolution of 0.00196 cm 2 , our electrolyte contact area with the working electrode was 0.07065 cm 2 .Both the PETG filament diameter (1.5 mm), PRUSA printing resolution, and O-ring size limited are ability to recapitulate their nEIS capture resolution.Despite a larger spatial scale, our nEIS results support key findings from their study.Wiegand and Shenoy identify nEIS as a method to classify various corrosion damage modes based on their impedance "signature".They show significant increases in both  and Q corresponding with different classes of corrosion damage modes in vitro and in vivo.While this experiment was designed for binary classification between dissolved and nondissolved surface states, we document significant changes to the CPE capacitance and exponent between dissolved and control surfaces (p = 0.000).Additionally, the Bode Phase plots of dissolved surfaces clearly show defining, "signature", characteristics allowing for visual classification, including a shifting to lower frequencies and decrease in peak height.
We used a DNN model to predict the surface dissolution state of Ti-6Al-4V.While DNNs are a widely used approach within the broader corrosion literature, few studies to date have explored implementation in the field of orthopedic biomaterial corrosion. [57]hough the binary classification DNN architecture presented in this work may seem rudimentary, given that  dissolution may be visually assessed within seconds on a micrograph or a Bode plot, the results in this study demonstrate that nEIS may indeed be used to identify corrosion damage modes in the absence of traditional imaging methods.Additionally, we show how a DNN may predict the dissolution state from the captured EIS spectra, negating the need for circuit fitting.
Future studies will expand this AI approach for the classification of multiple corrosion damage modes, and the degrees of corrosion damage present.The DNN model presented here may struggle with multiclassification.Codirenzi et al. document a decrease in neural network model accuracy when switching from binary classification of modular taper Goldberg scores to multiclass classification. [58]While the original intentions of the Goldberg score may play a role in the poor neural network multiclass accuracy (the Goldberg score was intended for quick, visual classification within seconds, rather than complex computational analysis of features extraction from digital imaging), other investigators were able to circumvent this pitfall with a support vector machine (SVM) approach. [41]Thus, when this AI architecture is expanded for the classification of more than one corrosion damage mode, it may be important to consider other AI models.
Finally, we present a methodology for the identification of dissolved surface states using linear EIS.By capturing the Z″ at a frequency close to the peak of the derivative of the phase angle with respect to the log of the frequency (in this case, 5000 Hz), we can calculate the CPE capacitance Q from a single point, negating the need to capture an entire, or partial EIS spectrum.This methodology allows for the rapid acquisition of capacitance data from a surface, and may be used for scanning impedance microscopy, where the PETG filament is rastered across the surface of a metallic biomaterial to identify dissolved regions.In combination with an AI approach, scanning impedance microscopy may be able to correctly classify corrosion damage modes in the time scale of seconds on metallic biomaterials.Further investigation is needed.

Conclusion
In this study, we used nEIS, sbEIS, and a DNN approach to identify property changes in the Ti-6Al-4V oxide film after selective dissolution of the Ti-6Al-4V  phase.We document significant increases in capacitance of dissolved areas (p = 0.000), and significant decreases in the CPE exponent  compared to control areas (p = 0.000).We present scanning impedance microscopy as a new method to rapidly identify corrosion damage modes on metallic surfaces.Constant acquisition of the impedance loss and subsequent conversion to CPE capacitance revealed a significant increase (p = 0.000) in dissolved Q, consistent with the nEIS results.We built a neural network architecture that can predict the dissolution state of the surface from the measured impedance response.After training the model with 180 EIS spectra, the DNN accurately classified 24/25 test spectra (96% accuracy).Future work will expand the binary classification model developed in this study to classify multiple corrosion damage modes.

Figure 1 .
Figure 1.Digital image showing the nEIS PETG fixture clamped to the Ti-6Al-4V working electrode A).The blue wire extending out the top of the fixture is the reference electrode, and the alligator clip attached to the base of the Ti-6Al-4V disc connects directly to the potentiostat.The electrochemical cell consisted of Pt wire counter, sintered Ag/AgCl reference, and Ti-6Al-4V working electrodes B).The PETG fixture was designed for a 4 mm outer diameter O-ring insert to create a sealed and constant contact region with the working electrode C).A cut-away view of the PETG fixture in contact with a corroded region on the Ti-6Al-4V disc is shown in D).Graphics in B-D) are not to scale.

Figure 2 .
Figure 2.Deep neural network approach.First, n = 105 dissolved and n = 100 control nEIS spectra were captured from Ti-6Al-4V samples.Next, these spectra were fit using sbEIS, and capacitance was identified as a differentiating variable.The phase angle and frequency data from the nEIS spectra were used to train (n = 180) and test (n = 25) a DNN.Model prediction of the surface state (0 for control, 1 for dissolved) was compared with the ground truth.

Figure 3 .
Figure 3. Matched Secondary and BSE micrographs of control A,B) and selectively dissolved C,D) Ti-6Al-4V.Dark crevices appear on the Ti-6Al-4V surface in C) and D) where the  phase used to be.

Figure 4 .
Figure 4. Digital image A) of the Ti-6Al-4V sample showing seven separately dissolved regions.DOM imaging B) reveals a non-uniform surface and shows the 0.07 cm 2 spatial scale of the nEIS.ImageJ contrast thresholding C) quantifies the level of  dissolution of the dissolved regions in image A).

Figure 5 .
Figure 5. Bode magnitude A) and phase B) plots of representative EIS spectra for dissolved and control areas.Note the leftward shift in the dissolved phase angle peak in B).Extracted Randles circuit element values Q C); R p D); R s E); and  F) for dissolved (n = 105) and control (n = 100 spectra) areas.Log adjusted Q for dissolved areas significantly increased (p = 0.000) and the constant phase element exponent, , significantly decreased (p = 0.000).Data are presented as mean ± standard deviation, p-values are calculated using two-sample t-tests.

Figure 6 .
Figure 6.DOM images A) of dissolved and control areas.Log adjusted capacitance B) acquired at 1-3 mm intervals over the 20 mm scale bar in A).Log 10 Q over control (n = 12), dissolved (n = 6), and border regions (n = 6) are significantly different (p = 0.000).Data are presented as mean ± standard deviation for the three spectra captured at each location.A p-value was calculated using a one-way analysis of variance (ANOVA) followed by a post-hoc Tukey's multiple comparison test.

Figure 7 .
Figure 7. Continuous capture of loss impedance at 5000 Hz shows an increase in Z'' when rastering across dissolved areas A).This process was repeated four times with similar results B).Converting the Z'' 0.1 M H 2 O 2 values in B) to CPE capacitance and area normalizing reveals two distinct linear regions C).Plotting the log adjusted Q versus the ground truth label shows two clusters corresponding with data captured over and control (n = 417) and dissolved areas (n = 338) D).The means of these clusters are significantly different (p = 0.000).The presented data are unaveraged, a p-value was calculated using a two-sample t-test.

Figure 8 .
Figure 8. Ground truth labels for the EIS spectra used to train and test the DNN A).Note the visually distinct clusters of control (n = 100) and dissolved data (n = 105).The EIS spectra associated with the data in A) were randomly divided into training (n = 180) and testing (n = 25) data B).A DNN was able to predict the class of previously unseen testing data with 96% accuracy.Data inputs for the neural network were the phase angles and frequencies captured during EIS and the output was a binary classification of the dissolution state of the Ti-6Al-4V surface, 0 for control or 1 for dissolved.

Figure 9 .
Figure 9. DOM images A) show a selectively dissolved Ti-6Al-4V area after 7 h at −0.4 V in 37 °C 0.1 M H 2 O 2 solution.Line scan impedance B) measured across the 10 mm axis in A) show an increase in log adjusted Q on both border and dissolved areas from the control areas, similar to the behavior of Q in Figure 6B.EIS spectra were captured in triplicate (n = 3) for each point in B).Error bars are plotted with the standard deviation though they are too small to appear here.The DNN trained in Figure 8 was able to successfully predict the labels of 7/8 points (87%).

Figure 10 .
Figure 10. 10 mm raster path A) of the EIS linescan across control and dissolved areas using PBS as an electrolyte.Resulting Q values B) show an increase over dissolved regions.The neural network trained in Figure 8 was able to predict the dissolution state of the EIS spectra with 100% accuracy (n = 8/8).EIS spectra were captured in triplicate (n = 3) at each distance.Data are presented as mean ± standard deviation.