Application of a long short-term memory for deconvoluting conductance contributions at charged ferroelectric domain walls

Ferroelectric domain walls are promising quasi-2D structures that can be leveraged for miniaturization of electronics components and new mechanisms to control electronic signals at the nanoscale. Despite the significant progress in experiment and theory, however, most investigations on ferroelectric domain walls are still on a fundamental level, and reliable characterization of emergent transport phenomena remains a challenging task. Here, we apply a neural-network-based approach to regularize local I(V)-spectroscopy measurements and improve the information extraction, using data recorded at charged domain walls in hexagonal (Er0.99,Zr0.01)MnO3 as an instructive example. Using a sparse long short-term memory autoencoder, we disentangle competing conductivity signals both spatially and as a function of voltage, facilitating a less biased, unconstrained and more accurate analysis compared to a standard evaluation of conductance maps. The neural-network-based analysis allows us to isolate extrinsic signals that relate to the tip-sample contact and separating them from the intrinsic transport behavior associated with the ferroelectric domain walls in (Er0.99,Zr0.01)MnO3. Our work expands machine-learning-assisted scanning probe microscopy studies into the realm of local conductance measurements, improving the extraction of physical conduction mechanisms and separation of interfering current signals.


INTRODUCTION
The observation of electrically conducting ferroelectric domain walls in BiFeO 3 (ref. 1 ) has triggered tremendous interest in the field of domain-wall engineering and pushed the idea to develop nanoelectronics based on domain walls [2][3][4][5] . Since then, the enhanced electronic transport at domain walls has been identified and studied in a broad range of ferroic materials. First proof-ofconcept studies demonstrated that ferroelectric walls can readily be created, manipulated and erased 6,7 , and serve as active elements in multi-level resistors 8 and non-volatile memory 9,10 . Recently, it was shown that individual domain walls can be used to emulate the behavior of elementary electronic components, such as digital switches 11 and diodes 12 , opening the door towards atomic-scale devices and domain-wall-based nanocircuitry.
Despite the significant progress in experiment and theory, most investigations on ferroelectric domain walls are still fundamental in character, aiming to understand their complex nano-physics and tailor their local electronic properties 2,13-16 . One of the main challenges lies in the nanoscale characterization of transport phenomena. For example, in conductive atomic force microscopy (cAFM), an electrically biased probe is scanned line-by-line across the material's surface, measuring the local conductance with nanoscale spatial precision. Alternatively, conductance maps can be reconstructed from I(V)-spectroscopy measurements, where the tip moves from point to point in a pre-defined grid recording I(V) curves at each point. Although cAFM imaging and I(V) spectroscopy are powerful approaches for conductance mapping at domain walls, the interpretation of collected data can be challenging. This is mainly because they are two-probe measurements where multiple conduction contributions are simultaneously measured in ways that are difficult to deconvolute analytically. In addition, emergent transport mechanisms may deviate from existing models and, hence, elude conventional analysis approaches. The challenges associated with the evaluation of local conduction measurements, and possible deviations in mechanisms of response from established models, create a need for advanced tools that can assist with, and improve, the information extraction.
Recently, advances in large structured databases, efficient computation, and machine-learning algorithms have allowed the extraction of physically meaningful information based on statistical analysis 17 . This approach has become pervasive in scanning probe microscopy (SPM) measurements, where it has provided important insight into the switching processes of ferroelectric domain structures 18,19 , improved effective signal-to-noise ratios 20 , and was utilized to identify tip degradation artifacts 21 . These investigations showed the potential of combining multidimensional SPM with statistical methods of machine learning to better understand nanoscale functional responses and pathways.
The need for improved information extraction from local transport measurements and the recent progress in machine learning motivate the present work. Here, we explore advantages associated with a neural-network-based analysis of local conduction measurements, considering ferroelectric domains and domain walls in (Er 0.99 ,Zr 0.01 )MnO 3 as an instructive example. We demonstrate how to leverage a special class of deep-learning algorithms, so-called long short-term memory (LSTM) recurrent neural-network (RNN) autoencoders to glean additional insights from local I(V)-spectroscopy measurements. Using the donor doped hexagonal manganite (Er 0.99 ,Zr 0.01 )MnO 3 as a model system, we conduct a comprehensive cAFM study, revealing an unusual evolution of the local conduction contrast. We then use the developed neural network approach to extract complementary insight from I(V)-spectroscopy data, which allows us to disentangle different emergent conductivity contributions and to isolate extrinsic conduction contributions from the intrinsic domain-wall responses. While the measured physical effects are specific to the model system, the neural-network-based approach is not bounded by existing models and theories. It thus provides a less biased and complimentary approach to enhance information extraction from local conduction measurements, independent of the material under investigation.

RESULTS AND DISCUSSION
Electronic bulk properties We begin our discussion with the electronic bulk properties of our model system, (Er 0.99 ,Zr 0.01 )MnO 3 single crystals, which we determine by frequency-dependent dielectric spectroscopy measurements and density functional theory (DFT) calculations as summarized in Fig. 1 (see Supplementary Fig. 1 and Supplementary  Fig. 2 for further details). Figure 1a shows the frequency-dependent conductivity for ErMnO 3 (green) and (Er 0.99 ,Zr 0.01 )MnO 3 (red). The dielectric spectroscopy data allows for extracting the intrinsic dc conductivities and dielectric constants: The data is fitted to the equivalent circuit sketched in the inset to Fig. 1a as explained in refs. 22,23 . To model the bulk response, we use an RC-circuit with an additional frequency-dependent resistivity, which is connected in series with two RC-circuits, simulating the dielectric response of thin insulating layers (black lines in Fig. 1a indicate the corresponding fits). While our measurements reveal similar values for the intrinsic dielectric constant in ErMnO 3 and (Er 0.99 ,Zr 0.01 )MnO 3 (ε′ ≈ 10-30, see Supplementary Fig. 1), significant differences are observed in conductivity. The dc conductivity, σ DC , is extracted from the plateau in σ′(ν) in Fig. 1a, occurring above 100 kHz for ErMnO 3 and above 1 MHz for (Er 0.99 ,Zr 0.01 )MnO 3 (an additional increase in conductivity towards higher frequencies can be assigned to contributions from frequency-dependent ac conductivity 24,25 ). We determine via the equivalent circuit analysis σ DC (ErMnO 3 ) = 4.8 • 10 -6 Ω −1 cm −1 and σ DC ((Er 0.99 ,Zr 0.01 )MnO 3 ) = 2.0 • 10 −3 Ω −1 cm −1 , which indicates a significant increase in conductivity of about three orders of magnitude in the Zr-doped material.
To understand the microscopic origin of the enhanced conductivity, we use DFT to calculate the relevant defect formation energies and the electronic density of states (DOS) with respect to doping and oxygen content (see Supplementary Note 2 and Supplementary Fig. 2 for details). Based on the calculated defect formation energy for A-or B-site substitution with Zr 4+ (Supplementary Fig. 2), we observe a significant energy preference (0.67 eV) for A-site substitution. Respective atomresolved DOSes are presented in Fig. 1b. As the Zr-doping affects the defect formation energy for oxygen interstitials, O 00 i (Supplementary Fig. 2), during post-synthesis cooling 26,27 , we consider the effect of oxygen off-stoichiometry on the electronic structure and DOS. From Fig. 1b we conclude that Zr-doping reduces a fraction of the Mn 3+ to Mn 2+ , which corresponds to electron doping, rendering Zr-doped ErMnO 3 n-type. However, adding one O 00 i per Zr-dopant not only charge compensates the Zr 4+ donor dopant, but also leads to the formal oxidation of one Mn 3+ to Mn 4+ thereby rendering the material p-type. The DFT calculations highlight a strong correlation between the concentrations of Zr 4+ and oxygen interstitials. As the Zr-doping changes the oxygen content, (Er 1-x ,Zr x )MnO 3+δ compositions can either have n-type (x > 2δ) or p-type (x < 2δ) conductivity (as δ is unknown, we keep the simplified notation (Er 1-x ,Zr x )MnO 3 in the following).
The level of complexity arising from this competition renders (Er 0.99 ,Zr 0.01 )MnO 3 an ideal model system for demonstrating advantages associated with the neural-network-assisted evaluation of I(V)-spectroscopy data. As Fig. 1 reflects, the interpretation of the conductivity data is non-trivial at the bulk level, with additional challenges arising in local transport measurements due to the two-probe principle used in cAFM, combined with the inhomogeneous electric field distribution under the probe tip and uncertainties caused by variations in the tip-sample contact. In addition, the cAFM technique is sensitive to contributions from the surface and surface near regions, where pronounced deviations in stoichiometry can emerge due to the thermal and atmospheric history 28 , making it difficult to rationalize the exact electronic transport behavior. Similar difficulties occur for internal interfaces, such as grain boundaries and domain walls, where the local strain, polar discontinuities, crystallographic defects, and confinement effects can alter the electronic structure 12,29 and complicate the analysis.
Electronic conductance at charged ferroelectric domain walls The ferroelectric domain structure of (110)-oriented ErMnO 3 and (Er 0.99 ,Zr 0.01 )MnO 3 is resolved in the piezoresponse force microscopy (PFM) images in Fig. 2a, b, respectively. Domains of opposite polarization direction (indicated by the arrows) can be distinguished by their contrast. Both materials exhibit the typical domain structure of hexagonal manganites 30,31 with slightly smaller domains in (Er 0.99 ,Zr 0.01 )MnO 3 , which we attribute to faster cooling after synthesis 32 . cAFM scans obtained at the same position as the PFM data are presented in Fig. 2c, d. In ErMnO 3 , we measure enhanced conductance at the tail-to-tail domain walls (Fig. 2c), which is consistent with previous work 33 and can be explained based on its p-type semiconducting properties: mobile hole carriers accumulate at the tail-to-tail walls to screen the negative bound charges, giving rise to a higher carrier density and conductance than in the bulk. In contrast, (Er 0.99 ,Zr 0.01 )MnO 3 exhibits a different cAFM response at comparable voltages. Here, enhanced conductance is observed near positively charged head-to-head domain walls (Fig.  2d). This behavior is qualitatively different from ErMnO 3 and cannot be explained within the framework of p-type bulk conductivity; in fact, it is more akin to n-type systems 34,35 .
To characterize the conducting features seen in Fig. 2d, we perform comprehensive cAFM experiments as a function of voltage and with varying tip coating as presented in Fig. 3 and Supplementary Fig. 3. Figure 3a-f show selected voltagedependent cAFM scans gained with bias voltages between 8 and 14 V (applied to the back-electrode) using a diamond-coated probe. Analogous to Fig. 2d, the data in Fig. 3a shows locally enhanced conductance near the positively charged head-to-head domain walls. At higher voltage (Fig. 3b, c), conductance contrast arises between +P and -P domains, which inverts as the voltage is enhanced further (Fig. 3d-f). Interestingly, the cAFM images gained at 12 V and higher show the same domain-wall properties as ErMnO 3 (Fig. 2c), that is, insulating head-to-head and conducting tail-to-tail walls. Using Pt-coated probes (Supplementary Fig. 3), we find qualitatively the same conduction behavior as function of voltage, but conducting features are already resolved at lower voltages. Figure 3g shows a detailed analysis of the voltage-dependent scans, evaluated for the cross-section marked in Fig. 3d. A closer inspection of the data in the I(V) waterfall plot reveals that the enhanced (Fig. 3a) and suppressed (Fig. 3f) conductance signals associated with head-to-head walls are actually detected in different spots. While the suppressed conductance is observed symmetrically around the head-tohead wall positions, as determined by PFM, the enhanced conductance occurs asymmetrically next to the walls with only one side having enhanced conductance (see inset to Fig. 3g and Supplementary Fig. 3).
All observations in Fig. 3a-g and Supplementary Fig. 3 can be categorized into two characteristic regimes as presented in Fig. 3h: In regime ①, current signals are measured in domain regions, emerging first next to the head-to-head domain walls. The insulating nature of the head-to-head walls themselves, however, is not resolved in regime ①. Regime ② is defined as the voltage regime where we record suppressed conductance at the head-tohead walls.
In summary, the cAFM study reveals the existence of two distinct conduction regimes ① and ②. The transition from ① to ② is observed at ≳11 V with diamond-coated probes and ≳4 V when using Pt-coated probes, indicating the significance of the tipsample contact. Furthermore, the transition is reversible (Supplementary Fig. 3h), excluding pronounced effects due to tip wearing. From the voltage-dependent cAFM maps alone, however, it is difficult to separate the different conduction contributions, which is crucial in order to rationalize the transition between regime ① and ②. In particular, due to the noise level and pronounced point-to-point variations, a less biased extraction of general trends seems virtually impossible.
To learn more about regime ① and ② and the intermediary transition, we conduct hyperspectral I(V)-spectroscopy measurements (an I(V) curve at each pixel). Figure 4a shows a cAFM image, overlapping with the area presented in Fig. 3a-f. Coarse conductance maps recorded at the same position from I(V)spectroscopy measurements are displayed in Fig. 4b, c. Independent of the method, cAFM or I(V) spectroscopy, qualitatively equivalent results are observed as a comparison of Fig. 4a, c shows. The two conductance maps are recorded at 12 V, revealing conducting tail-to-tail walls and insulating head-to-head walls. From the I(V)-spectroscopy data, it is possible to identify different regions of interest and evaluate the respective local I(V) curves as shown in Fig. 4d. Consistent with the voltage-dependent cAFM maps (Fig. 3a-f), a crossover is observed at about 12 V, where the conductance at the head-to-head domain walls falls below that of the bulk. The data itself in Fig. 4d, however, is noisy and usually only a few representative I(V) curves are compared in this type of conductance studies, which causes ambiguity. This ambiguity can be eliminated by the application of a neural-network analysis, providing the opportunity for less biased generalization from the high-dimensional I(V)-spectroscopy data as presented in the next section.
Neural-network-based generalization of I(V)-spectroscopy data To produce less biased projections from the I(V)-spectroscopy data (Fig. 4), we train a LSTM autoencoder neural network. Briefly, the developed neural-network analyses the spectra in the voltage domain learning a sparse representation of the most statistically important characteristic responses. These statistical descriptors can be visualized in the spatial domain (i.e., by reconstructing images). The identified spectral characteristics can be visualized by generating the resulting spectra when traversing the learned latent space.
The neural-network architecture was inspired by the practical problem of identifying statistical trends in hyperspectral images. To include voltage-sequence awareness, the encoder and decoder use recurrent neurons that process the data recurrently (sequentially) through time. The LSTM recurrent neurons include learnable logic for memory, forgetfulness, and new state determination. This internal structure allows LSTMs to preserve long-and short-term temporal information, and thus they are used in natural language processing where consideration of the sequence and order of words is essential. To make the latent representation interpretable, we imposed three constraints on the embedding layer. First, because our encoder uses LSTM neurons, we can compress information in the time domain by extracting just the last time step from the encoder. Secondly, we impose a non-negativity constraint by using a rectified-linear activation function (ReLU) f x ð Þ ¼ maxð0; xÞ. Third, we apply strong L 1 activity regularization λ P p i¼j Z j on the embedding layer defining the latent space. In this equation, λ represents a hyperparameter that balances the trade-off between the global optimization based on the mean squared reconstruction error (MSE) and the regularization constraint. In L 1 regularization, because the iso-surface is nonconvex, the minimum defined by the intersection of the MSE and regularization results in sparsity. This sparsity serves to extract unique features from the data without human directive or bias. Specific details regarding the network architecture are provided openly on Zenodo 36,37 . We note that neural networks have many tuneable hyperparameters that are co-dependent on the data distribution. We conducted an exhaustive hyperparameter search; the practical conclusions derived in the subsequent analysis were robust when non-extremal hyperparameters were selected. It is worth noting that deep autoencoders, as a consequence of stochastic mini-batching, impose a natural mechanism to denoise the data via random averaging.
After training the neural network, we identify a sparse latent space defined by three characteristic components (representing trajectories in the latent manifold) that statistically explain the I(V)spectroscopy measurements (Fig. 5). We note that we conducted an exhaustive parameter search where we modified the number of neurons in the embedding layer and the λ parameter that determines the sparsity. Upon convergence, all models contained latent representations indistinguishable from the components we present. The first component (Fig. 5a) is capturing a response that is highest in the yellow areas (coinciding with the position of the tail-to-tail walls; green dashed line) and lowest in dark blue areas (including the domains and head-to-head domain walls; red . Increased conductance is first observed within +P domains next to the head-to-head domain walls (8 V), evolving into a pronounced conductance contrast between +P (bright) and −P (dark) domains (10 and 11 V). At higher voltages (12,13, and 14 V), we record conducting tail-to-tail and insulating head-to-head walls, and slightly enhanced conductance in −P domains compared to +P domains. Scale bar 200 nm. g Waterfall plot showing the evolution of the conductance contrast at a head-to-head wall, evaluated for the cross-section marked by the orange dashed arrow in d. The position of the insulating head-to-head wall is marked by the gray plane. The inset presents the current signal at 8 V. Scale bar 50 nm. h Evolution of the conductance at a head-to-head wall (I(wall)) relative to the domains (I( + P) and I(−P)), evaluated for the positions marked by the white circles in d. For voltages ≤ 11 V, no difference in conductance is resolved. In contrast, for voltages ≥12 V, we observe suppressed conductance at the head-to-head walls. The two voltage regimes with qualitatively different response are defined as regime ① and regime ②, respectively. Error bars represent the standard deviation of ΔI.
T.S. Holstad et al. dashed line). The color scales are determined by the activation of the neural network, encoding characteristic features of the dataset. Thus, one could say that the first component (Fig. 5a) represents a metric for how much the response in a certain region resembles the response at tail-to-tail walls. We emphasize that the neural network does not understand physical concepts or magnitudes besides what is hard-coded into its structure. Instead, it just holistically looks at the distributions in data.
The second component (Fig. 5b) identifies a characteristic response that is lowest at the position of the head-to-head walls (yellow in the inset), corresponding to supressed conductance relative to the domains and the tail-to-tail walls. In particular, no signature that could be associated with enhanced conductance at head-to-head domain walls is observed in regime ①.
In addition to the domain-wall-specific transport response curves, the network identifies a third contribution that correlates with the domain distribution. The spatial distribution of this contribution is shown in the inset to Fig. 5c, where yellow/green regions coincide with -P domains and blue areas with +P domains. This domain-related component has a more complex response curve: We find that below ≈13 V the +P domains exhibit a higher conductance than -P domains, which inverts for higher voltages, reproducing the contrast inversion observed for the domains in the cAFM maps in Fig. 3a-f. Furthermore, as the comparison in Fig. 5d verifies, the onset voltage of the signal from +P domains is lower than for the head-to-head walls.
The fact that the required voltage for cAFM imaging depends on the tip coating already indicated that the domain-related contributions are due to workfunction differences at the tip-sample contact (see Fig. 3 and Supplementary Fig. 3). Conceivable sources are Schottky-barriers in imperfectly (110)-oriented surfaces, giving rise to a small out-of-plane component of the ferroelectric polarization 38 and electrostrictive effects. Anomalous mechanical properties may enhance the latter near the head-to-head walls 39 , providing a possible explanation for the conducting features in Figs. 2d and 3a. We note that this interpretation is a hypothesis; to connect the results back to physical concepts, additional experiments are required.
Most important for the scope of this work, Fig. 5 demonstrates how the neural networks enables a clear separation of different conduction contributions, yielding generalized and noise-free data that improve the analysis significantly and, hence, assist with the interpretation of complex local conduction measurements. Furthermore, the neural network allows for an assessment of emergent mixing of different contributions, with the color scale in the activation maps indicating to what extent a certain response contributes to the measured conductance at each pixel. For example, the highly conducting tail-to-tail domain wall in the top left of the cAFM scan in Fig. 4a shows a high response (yellow) in Fig. 5a and a medium response (green) in Fig. 5c. This observation is consistent with the calculated spreading of the tip-injected current and previous experimental data 14,33 and demonstrates that the locally measured signal contains both domain-wall and domain contributions, which becomes crucial when extracting quantitative information from I(V) spectroscopy measurements.
In summary, we employed a deep long short-term memory neural network to analyze transport measurements and demonstrated how a less biased generalization can be achieved, leading to response curves free from the noise of individual I(V) curves and ambiguities from local data analysis. Using (Er 0.99 ,Zr 0.01 )MnO 3 as model system, we used an LSTM autoencoder to analyze I(V)-spectroscopy data, separating domain-wall intrinsic transport properties from extrinsic effects. The analysis clarified the impact of contributions related to the tip-sample contact, which cover the intrinsic domain-wall behavior in (Er 0.99 ,Zr 0.01 )MnO 3 at low voltages (regime ①).  Our study demonstrates how machine learning can accelerate and increase the veracity of the analysis of spatially resolved conduction measurements and complement conventional macroscopic and local transport measurements. Such machine-learningassisted measurements are particularly helpful for the characterization of functional domain walls, and nanoscale objects in general, where emergent conduction phenomena fall outside the pre-existing empirical models and mixing of multiple conduction contributions may occur. In addition to disentangling qualitatively different conduction mechanisms, the neural network can discover additional mechanisms of response not bounded by the existing theories and help avoiding to either miss information or provide incorrect results. The deconvolution of current contributions pixel by pixel can improve both physical property extraction and spatial resolution in SPM-based conductance measurements, facilitating the detailed input required to refine existing theories and develop our understanding of conduction phenomena at the nanoscale.

Sample preparation
Single crystals of hexagonal (Er 0.99 ,Zr 0.01 )MnO 3 are grown by the pressurized floating-zone method 40 . The parent material, ErMnO 3 , shows improper ferroelectricity below 1470 K with a polarization P ≈ 6 μC cm −2 (P ║[001]) and as-grown crystals exhibit p-type semiconducting behavior with a band gap of about 1.6 eV (refs. 11,[41][42][43][44]. All data presented in this work is measured on oriented, disk-shaped samples (diameter and thickness of about 1 mm) with the spontaneous polarization lying inplane. To achieve the high-quality surfaces required for our SPM studies, the samples are polished using a chemo-mechanical silica slurry, which gives smooth surfaces with a RMS roughness of ≈0.5-1.5 nm.
Electrical characterization SPM characterization is conducted at ambient conditions in a NT-MDT NTEGRA Prima SPM using Pt-coated (MikroMasch NSC35/Pt) and diamondcoated (TipsNano DCP20) conductive probes, with samples mounted on a metallic disk using conductive silver paste. For PFM, an ac voltage is applied to the metallic disk (ω = 40 kHz, U RMS = 5 V); two Stanford Research 830R lock-in amplifiers are used to monitor the amplitude and phase of the deflection and torsion of the cantilever. For cAFM and I(V)spectroscopy measurements, a dc voltage is applied to the metallic disk. I(V) spectroscopy is done in a 0.8 × 0.8 μm square with 20 nm distance between each point and a voltage ramp rate of 5 V s −1 .
In order to perform macroscopic dielectric measurements, silver-paint is used as metal electrode contact on the top and bottom of our plate-like samples. An Agilent 4294A and a Novocontrol AlphaAnalyser are used to measure the frequency-dependent dielectric response ranging from 40 Hz to 110 MHz and from 1 Hz to 10 MHz, respectively. The latter measurements are conducted in vacuum and in a closed-cycle refrigerator covering the temperature range from 50 to 300 K.

Density functional theory calculations
The site preference of Zr 4+ and changes in the electronic properties with oxygen content are determined by density functional theory (DFT) calculations with the projector augmented wave method 45 (PAW) as implemented in VASP 46,47 . 2x2x1 supercells with one Zr 4+ or one Zr 4+ +O 00 i defect pair per supercell, with the corresponding stoichiometries (Er 1-x ,Zr x )MnO 3 , Er(Mn 1-x ,Zr x )MnO 3 , and (Er 1-x ,Zr x )MnO 3+δ (x = d = 1/24 ≈ 0.04), are investigated. The Er_3, Mn_pv, O and Zr_sv pseudopotentials supplied with VASP are used together with a plane-wave energy cutoff of 550 eV. Brillouin zone integration is done on a Γ-centered 2 x 2 x 2 k-point mesh for geometry optimization and increased to 4 x 4 x 4 for density of states (DOS) calculations. PBEsol+U 48,49 with U = 5 eV applied to Mn 3d, combined with a collinear frustrated antiferromagnetic 50 ordering on the Mn sublattice, is used to reproduce the experimental lattice parameters 51 and band gap 43,44 . Lattice positions are relaxed until the residual forces are below 0.005 eV Å −1 , and the lattice parameters are fixed to relaxed bulk values. The defect formation energies are calculated by E f def ¼ E defect À E ref À P i n i μ i , where E defect and E ref are the energies of a defect cell and a reference cell, respectively, n i is the number of species i added to the reference cell, and μ i is the chemical potential of species i. The chemical potentials of the cations are defined by the chemical equilibria with the cations, oxygen, and the respective binary oxides Er 2 O 3 , Mn 2 O 3 and ZrO 2 , and μ o is assumed to range within the calculated chemical stability window of the prototypical YMnO 3 (ref. 52 ). Charge neutral cells are considered in this work due to the high doping concentration and the large capacity of hexagonal manganites for oxygen non-stoichiometry 53 .

Machine learning
A LSTM recurrent neural network (RNN) autoencoder 36,37,54 is employed to investigate voltage-dependence of the local currents measured by I(V) spectroscopy. An autoencoder is a model that learns an identify function (i.e., a function that reproduces the input), which consists of an encoder and a decoder. The encoder derives a feature vector from the input and the feature vector is then used by the decoder to generate the input spectra. Feature maps are generated from the activation (value) of a feature at each real-space position. The properties associated with each feature is visualized by using the decoder to generate I(V) curves as the latent space defined by the feature vector is transversed. We note that training of the network in meaningful ways requires the use of regularization (in the form of dropout and L 1 regularlization to the embedding layer) to prevent overfitting and increase interpretability through sparsity. Further information regarding the neural network can be found in refs. 19,36

DATA AVAILABILITY
The data that support the findings of this study are available from the corresponding author upon reasonable request.