A Hybrid Neural Autoencoder for Sensory Neuroprostheses and Its Applications in Bionic Vision
s
AffiliationAddress
Abstract
Sensory neuroprostheses are emerging as a promising technology to restore lostsensory function or augment human capabilities.
However, sensations elicitedby current devices often appear artificial and distorted.
Although current modelscan predict the neural or perceptual response to an electrical stimulus, an optimalstimulation strategy solves the inverse problem: what is the required stimulus toproduce a desired response?
Here we frame this as an end-to-end optimizationproblem, where a deep neural network encoder is trained to invert a known, fixedforward model that approximates the underlying biological system.
As a proofof concept, we demonstrate the effectiveness of our hybrid neural autoencoder(HNA) on the use case of visual neuroprostheses.
We found that HNA is able toproduce high-fidelity stimuli from the MNIST and COCO datasets that outperformconventional encoding strategies and surrogate techniques across all tested conditions.
Overall this is an important step towards the long-standing challenge ofrestoring high-quality vision to people living with incurable blindness and mayprove a promising solution for a variety of neuroprosthetic technologies.
Introduction
Sensory neuroprostheses are emerging as a promising technology to restore lost sensory function oraugment human capacities [1, 2].
In such devices, diminished sensory modalities (e g., hearing [3],vision [4, 5], cutaneous touch [6]) are re-enacted through streams of artificial input to the nervoussystem.
For example, visual neuroprostheses electrically stimulate neurons in the early visual systemto elicit neuronal responses that the brain interprets as visual percepts.
Such devices have the potentialto restore a rudimentary form of vision to millions of people living with incurable blindness.
However, all of these technologies face the challenge of interfacing with a highly nonlinear system ofbiological neurons whose role in perception is not fully understood.
Due to the limited resolution ofelectrical stimulation, prostheses often create neural response patterns foreign to the brain.
Consequently, sensations elicited by current sensory neuroprostheses often appear artificial and distorted[7, 8].
A major outstanding challenge is thus to identify a stimulus encoding that leads to perceptuallyintelligible sensations.
Often there exists a numeric or symbolic forward model, f (Fig.
1A), constrained by empirical data, that can predict a neuronal or (ideally) perceptual response to the appliedstimulus (see [9] for a recent review).
To find the stimulus that will elicit a desired response, oneessentially needs to find the inverse of the forward model, f − 1 .
However, realistic forward modelsare rarely analytically invertible, making this a challenging open problem for neuroprostheses.
Here we propose to approach this as an end-to-end optimization problem, where a deep neuralnetwork (DNN) ( encoder ) is trained to invert a known, fixed forward model ( decoder , Fig. 1B).
The encoder is trained to predict the patterns of electrical stimulation patterns that elicit perception ( e.g., vision, audition) or neural responses ( e.g., firing rates) closest to the target.
This hybrid neural autoencoder (HNA) could in theory be used to optimize stimuli for any open-loop neuroprosthesiswith a known forward model that approximates the underlying biological system.
In order to optimize end-to-end, the forward model must be differentiable and computationallyefficient.
When this is not the case, an alternative approach is to train a surrogate neural network,ˆ f , to approximate the forward model [10–13].
However, even well-trained surrogates may result inerrors when included in our end-to-end framework, due to the encoders’ ability to learn to exploit thesurrogate model.
We therefore also evaluate whether a surrogate approach to HNA is suitable.
To this end, we make the following contributions:
• We propose a hybrid neural autoencoder (HNA) consisting of a deep neural encoder trained toinvert a fixed, numerical or symbolic forward model (decoder) to optimize stimulus selection.
Our framework is general and addresses an important challenge with sensory neuroprostheses.•
As a proof of concept, we demonstrate the utility of HNA for visual neuroprostheses, where wepredict electrode activation patterns required to produce a desired visual percept.
We show thatthe HNA is able to produce high-fidelity, patient-specific stimuli representing handwritten digitsand segmented images of everyday objects, drastically outperforming conventional approaches. • We evaluate
replacing a computationally expensive or nondifferentiable forward model with asurrogate, highlighting benefits and potential dangers of popular surrogate techniques.
Background
Sensory Neuroprostheses Recent advances in neural understanding, wearable electronics, andbiocompatible materials have accelerated the development of sensory neuroprostheses to restoreperceptual function to people with impaired sensation.
Use of neuroprostheses typically requiresinvasive implants that elicit neural responses via electrical, magnetic, or optogenetic stimulation.
Two of the most promising applications are cochlear implants, which stimulate the auditory nerve toelicit sounds [3], and visual implants (see next subsection) to restore vision to the blind.
However, avariety of other devices are in development; for instance, to restore touch [6, 14] or motor function[15].
The latter differ from other sensory neuroprostheses in that they generate stimuli using motorfeedback ( closed loop ) [16, 17].
In the absence of feedback ( open loop ), a proper stimulus encodingis paramount to the success of these devices.
Restoring Vision to the Blind For millions of people who are living with incurable blindness, avisual prostheses ( bionic eye , Fig. 2, left ) may be the only treatment option [4].
Analogous to cochlearimplants, these devices electrically stimulate surviving cells in the visual pathway to evoke visualpercepts ( phosphenes ), which can support simple behavioral tasks [5, 18, 19].
A common misconception is that each electrode in the array can be thought of as a pixel in an image;to generate a complex visual experience, one then simply needs to turn on the right combination ofpixels [20].
However, recent evidence suggests that phosphenes often appear distorted ( e.g. , as lines,wedges, and blobs) and vary drastically across subjects and electrodes [4, 7].
Phosphene appearance has been best characterized in epiretinal implants, where inadvertent activationof nerve fiber bundles (NFBs) in the optic fiber layer of the retina leads to elongated phosphenes[21, 22] (Fig. 2, center ).
To this end, Granley et.
al [23] developed a forward model to predictphosphene shape as a function of both neuroanatomical parameters ( i.e. , location of the stimulatingelectrode) and stimulus parameters ( i.e. , pulse frequency, amplitude, and duration).
With this model,phosphenes are primarily characterized by two main parameters, ρ and λ , which dictate the sizeand elongation of the elicited phosphene, respectively (Fig. 2, right ).
These parameters can bedetermined using psychophysical tasks ( e.g. , drawings, brightness ratings) [21, 23], and althoughthey vary drastically across patients [21], they do not change much over time [24, 25]. Stimulationfrom multiple electrodes is nonlinearly integrated into a combined perception, and if two electrodeshappen to activate the same NFB, they might not generate two distinct phosphenes.
Related Work
The conventional ‘naive’ encoding strategy sets the amplitude of each electrode to the brightness ofthe corresponding pixel in the target image [5, 26], making the stimulus a down-sampled version ofthe target.
Although simple, this strategy only works with near-linear forward models, cannot accountfor real phosphene data, and often leads to unrecognizable percepts (Fig. 2, right )
To provide an alternative, Shah et al.
[27] used a greedy approach to iteratively select the stimulithat best recreate a desired neural activity pattern over a given temporal window, assuming that thebrain would integrate them into a coherent visual percept.
Ghaffari et al.
[28] used a neural networksurrogate model combined with an interior point algorithm to optimize for localized, circular neuralactivation patterns for individual electrodes.
Fauvel et al.
[29] used human in-the-loop Bayesianoptimization to achieve encodings perceptually favored by the subject.
Spencer et al.
[30] proposedframing the problem of stimulus encoding as inversion of a forward model of neural activationpatterns, but to approximate the inverse, their approach either requires simplification or is NP-hard[30].
Furthermore, it cannot predict the perceptual consequences of the predicted neural activity. Van Steveninck et al.
[31] proposed an end-to-end optimization strategy with a fixed phosphenemodel, similar to HNA.
However, their approach crucially differs from ours in that they includeda secondary DNN to post-process the predicted phosphenes.
This is a critical limitation, because alow reconstruction loss does not reveal whether a high-fidelity encoder was learned or whether thesecondary decoder network simply learned to correct for the encoder’s mistakes.
In addition, theyused an unrealistic phosphene model that simply upscales and smooths a binary stimulus pattern.
It istherefore not clear whether their results would generalize to real visual prosthesis patients.
Relic et al.
[10] also utilized the end-to-end approach, but without the secondary decoder network usedin [31].
They used a more realistic phosphene model, which accounts for some spatial distortions( e.g. , axonal streaks), but not the effects of stimulus parameters.
Since including a nontrivialphosphene model in the loop is not straightforward, they instead trained a surrogate neural networkto approximate the forward model.
We re-implemented Relic’s surrogate approach in this paper as abaseline method to compare against, as described in Section 4.
Taken together, we identified three main limitations of previous work that this study aims to address:
1) Unrealistic forward models.
Most previous approaches ( e.g. , [27, 30, 31]) use an overly simpli-
fied forward model that cannot account for empirical data
We overcome this limitation
by developing (and inverting) a differentiable version of a neurophysiologically informed and
psychophysically validated phosphene model [23] that can account for the effects of stimulus
amplitude, frequency, and pulse duration on phosphene appearance.
2) Optimization of neural responses.
Most previous approaches ( e.g. , [27, 30]) focus on optimiz- ing neural activation patterns in the retina in response to electrical stimulation (“bottom-up”).
However, the visual system undergoes extensive remodeling during blinding diseases such asretinitis
pigmentosa [32].
Thus the link between neural activity and visual perception is unclear
We overcome this limitation by inverting a phenomenological (“top-down”) model constrained bybehavioral data that predicts visual perception directly from electrical stimuli [21, 23].3)
Objective function Most previous approaches rely on minimizing mean squared error (MSE)between the target and reconstructed image.
Although simple and efficient, MSE is known to bea poor measure of perceptual dissimilarity for images [33] and does not align well with humanassessments of image quality [34].
We overcome this limitation by proposing a joint perceptualmetric that combines mean absolute error (MAE), VGG, and Laplacian smoothing losses.
Methods
Problem Formulation We consider a system where there is some known forward process fmapping stimuli to responses f : S
(cid:55)→ R , f ( S ) ⊂ R .
In the case of visual prostheses, f may mapstimuli to visual percepts.
f may optionally be parameterized by patient-specific parameters ϕ .
Finding the best stimulus for an arbitrary target response t ∈ R is equivalent to finding the inverse off .
However, since not every response can be perfectly reproduced by a stimulus, the true inverse of fis not well defined.
We therefore seek the pseudoinverse (still denoted as f − 1 for simplicity) instead,which outputs the stimuli that produce the closest response to t under some distance metric d :
[Equation]
This problem is straightforward to solve using an autoencoder approach, where a learned encoderf − 1 is trained to invert the fixed decoder f (i.e., forward model).
Encoder We approximate the pseudoinverse f − 1 with a DNN encoder ˆ f − 1 ( t , ϕ ; θ ) with weights θ ,trained to minimize the distance d between the target image t and predicted image ˆ t :
[Equation]
[Equation]
where ϕ is sampled from a uniform random distribution spanning the empirically observed range ofpatient-specific parameters [21, 23].
We use a simple architecture consisting solely of fully connected (FC) and batch normalization (BN)[35] layers (1.4M trainable parameters).
First, the target t is flattened and input to a FC layer.
Inparallel, the patient parameters ϕ are input to a BN layer and two hidden FC layers.
Then, the outputsof these two paths are concatenated, and the combined vector fed through two FC layers, producing anintermediate representation x .
Amplitudes are predicted from x with a FC layer.
The amplitudes arethen concatenated with x , put through a BN layer, and used to predict frequency and pulse duration,each with a FC layer.
The outputs are merged into a stimulus matrix ˆs .
All layers use leaky ReLUactivation, except for stimulus outputs, which use ReLU to enforce nonnegativity.
Decoder The HNA decoder is a differentiable approximation of the underlying biological system,and describes the transform from stimulus to response.
For our decoder f , we use a reformulatedbut equivalent version of the model described in [23]. This model is specific to epiretinal prostheses;analogous models exist for other neuroprostheses ( e.g. , auditory [36–41], tactile and somatosensory[42–46]), and could potentially be adapted for use with HNA.
We use a square 15 × 15 array of150 µ m electrodes, spaced 400 µ m apart and centered on the fovea.
The size and scale of this deviceare motivated by similar designs in real epiretinal implants.f takes as input a stimulus matrix s ∈ R n e x3 ≥ 0 , where the stimulus on each electrode ( s e ) is a biphasicpulse train described by its frequency, amplitude, and pulse duration.
A simulated map of retinal
NFBs is used to predict phosphene shape.
Following [21], each retinal ganglion cells’ activation isassumed to be the maximum stimulation intensity along its axon.
Axon sensitivity is assumed todecay exponentially with i) distance to the stimulating electrode (radial decay rate, ρ ) and distance tothe soma along the curved axon (axonal decay rate, λ ).
To account for stimulus properties [23], ρ ,λ , and the per-electrode brightness are scaled by three simple equations F size ( s e , ϕ ) , F streak ( s e , ϕ ) ,and F bright ( s e , ϕ ) , respectively.
The brightness of a pixel located at the point x ∈ R 2 in the output image is given by
[Equation]
where A is the cells’ axon trajectory, E is the set of electrodes, ϕ
= { ρ, λ, ... } is a set of 12patient-specific parameters, and d s is the path length along the axon trajectory [47]from a to x :
[Equation]
This model ( f ) can be fit to individual patients; however, it is computationally slow and not differentiable.
For more details on these equations, see [23].
We therefore considered two approaches:
• Differentiable Model: We reformulated equations 4 and 5 into an equivalent set of parallelized
matrix operations, implemented in Tensorflow [48].
Significant efforts were put towards de-
veloping a model optimized for XLA engines on GPU, resulting in speedups of up to 5000x
compared to the model as presented in [23], enabling large-scale gradient descent.
To enforce
differentiability, we numerically approximated d s using | A | = 500 axon segments per axon.
• Surrogate Model: We also implemented the surrogate approach from [10] as a baseline method,
where f is approximated with another DNN ˆ f ϕ ( s ; θ f ) with weights θ f .
To achieve this we
generated 50,000 percepts using randomly selected stimuli passed through f and fit a DNN
to produce identical images.
As f is highly dependent on patient-specific parameters ϕ ,
we generated new data and fit a separate surrogate model for each ϕ in our experimental set.
Specific implementation details of the surrogate are presented in Appendix A.
Our implementation improves upon [10] by using the more advanced phosphene model described above, which
accounts for effects of stimulus properties and allows for optimization of stimulus frequency in
addition to amplitude.
Metrics To measure perceptual similarity, we use a joint perceptual objective consisting of a VGG[49] similarity term, a mean absolute error (MAE) term, and a smoothness regularization term.
The MAE term is given by L MAE = 1 |
[Equation]
The VGG term aims to capture higher-level differences between images [31, 50].
The target imageand reconstructed phosphene are input to VGG-19 pretrained on ImageNet [51], and the MSE betweenthe activations on a downstream convolutional layer is computed.
Let V l be a function that extractsthe activations of the l -th convolutional layer for a given image.
The VGG loss is then defined as
L VGG = 1 | t | || V l ( t ) − V l
(ˆ t ) || 2 2 .
We also include a smoothing regularization term.
This term imposes a loss on the second spatialderivative of the predicted image.
A low second derivative implies that where the target image doeschange, it changes slowly.
We found this encouraged smoother, more connected phosphenes.
Toapproximate the second derivative, we convolve the image with a Laplacian filter [52] of size k , denoted by Lap ( · , k ) , and compute the mean.
The smoothness loss is given by:
[Equation]
Our final objective is the weighted sum of the three individual losses, given by Eq.
7, where α and βare hyperparameters controlling the relative weighting of the three terms.
[Equation]
We also implement a secondary metric to quantify phosphene recognizability, applicable only forthe MNIST reconstruction task.
We first pre-train a classifier network on the MNIST targets untilit reaches 99% test accuracy, and then fix the weights.
The relative accuracy (RA) is then definedas the ratio of the classifiers accuracy on the reconstructed images to its accuracy on the targets
RA = ACC/ACC ( t ) .
A perfect encoder would result in RA = 100% .
A similar process was notpossible for the COCO task due to the possibility of having multiple objects in each target image.
Training/Optimization We trained using Tensorflow 2.7 [48] on a single NVIDIA RTX 3090 with24GB memory.
Stochastic gradient descent with Nesterov momentum was used to minimize thejoint perceptual loss.
We used a batch size of 16 due to memory limitations imposed by f .
Theamplitude, frequency predictions are scaled by 2, 20 respectively, while the pulse duration predictionswere shifted by 1e-3 prior to being fed through the decoder.
This encourages the initial predictionsof the network to be in a reasonable range.
The Laplacian filter size k is set to 5.
We choose l tobe first convolutional layer in the last block using cross validation (see Appendix B).
Similarly, weperform cross validation to find the best values for α and β .
Instead of using one value, we found thatincrementally increasing the weighting of the VGG loss ( β ) from 0 while simultaneously decreasingthe initially high weight on the smoothing constraint ( α ) was crucial for performance, especiallywhen the range of allowed ϕ values was large (see Appendix B).
Datasets We first evaluated on handwritten digits from MNIST [53], enabling comparison toprevious works [10].
Images preprocessing consisted of resizing the target images to the same shapeas the output of f (49x49).
We also evaluate on more realistic images of common objects from the
MS-COCO [54] dataset.
We selected a subset of 25 of the MS-COCO object categories deemedmore likely to be encountered by blind individuals ( e.g. people, household objects), and use onlyimages that contain at least one instance of these objects.
We further filter out images by various othercriteria, such as being too cluttered or too dim.
This process results in a total of approximately 47Ktraining images and 12K test images.
See Appendix C for a full description of the selection process.
Natural images often contain too much detail to be encoded with prosthetic vision.
While scenesimplification strategies exist [55], we focus on the encoding algorithm, so we simply used theground-truth segmentation masks to segment out the objects of interest.
The images were thenconverted to grayscale, and resized to 49 × 49 pixels.
Results
5.1 MNIST
The phosphenes produced from the HNA, surrogate, and naive encoders on the MNIST test set areshown in Fig.
3 and performance is summarized in Table 1.
For each MNIST sample, the targetimage is input to the encoder, which predicts a stimulus.
The stimulus is fed through the true forwardmodel f , and the predicted phosphene is shown. Since the surrogate method must be retrained foreach ϕ , results are only shown for 4 simulated patients. Our proposed approach outperformed thebaselines across all metrics (see Appendix D for a comparison of stimuli).
5.2 COCO
The phosphenes produced by HNA and the naive encoder for the segmented COCO dataset are shownin Fig.
We omit the surrogate results due to its poor perceptual performance on MNIST.
Averagedacross all ϕ , HNA had a joint loss of 0.713 on the test set and MAE of 0.1408, while the naive encoderhad a joint loss of 1.873 and MAE of 0.2830. [Table]
5.3 Modeling Patient-to-Patient Variations
MNIST encoder performance across simulated patients ( ϕ ) is shown in Fig.
Since the surrogateencoder has to be retrained for each patient, comparison is infeasible.
To visualize the effects ofchanging ρ and λ on the produced phosphenes, Fig.
5A shows the result of encoding two example
MNIST digits, both using the naive method and our encoder.
As λ increases, the naive phosphenesappear increasingly elongated, and as ρ increases, the phosphenes become increasingly large andblurry.
The phosphenes from HNA are slightly too dim and disconnected at low ρ , but are relativelystable across other values of ρ and λ .
To compare performance across the entire dataset, we computed the average test set loss acrossthe same range of ρ and λ (Fig.
5B).
The encoder performs well across a wide range of simulatedpatients, with larger loss only at low ρ .
The naive method performs well only on a limited set of ϕ ,with small λ and ρ ≈ 200 .
The naive loss was higher than the learned encoder at every simulatedpoint.
Random sampling of ρ and λ for each image results in a joint loss of 0.921, MAE of 0.120,and RA of 94.0% for HNA, while the naive encoder results in a joint loss of 3.17, MAE of 0.596, and
RA of 63.6%.
The same analysis yielded similar results on COCO (Appendix E).
An analysis acrossother parameters is presented in Appendix F.
In order for prosthetic vision to be useful, different instances of the same objects would ideallyproduce similar phosphenes, allowing for consistent perception.
To evaluate whether our modelachieves this, we cluster the target images and resulting phosphenes using t-SNE [56] shown in
Fig.
5C.
The ground truth images form clusters corresponding to the digits 0-9.
The phosphenes fromour encoder roughly form similar, slightly less separated groupings, whereas the naive phosphenes donot.
To ensure that this was not the result of bad t-SNE hyperparameters, we repeated the clusteringacross different perplexities and learning rates, obtaining similar or worse results.
5.4 Joint Perceptual Error Ablation Study
To show that the joint perceptual metric performs better than any of its individual components, wetrain models using just the VGG loss and just MAE loss.
Shown are values for ρ =150 and λ =600.
As mentioned previously, encoders trained using just VGG loss fail to converge, thus we pretrainthe VGG encoder using MAE and smoothing loss, then transition to using only VGG.
We do not consider ablating the smoothing term (Eq. 6) because it is simply a regularization term.
Fig.
6 showsthe phosphenes produced by HNA trained on the joint, VGG-only, and MAE-only loss.
The VGG encoder had a test VGG loss of 4% lower than the joint model, but its produced phosphenesare oversmoothed and blurry.
The MAE encoder had a final test MAE of 9% lower than the jointmodel, but its produced phosphenes are disconnected and low-quality.
The joint model had a RA of99.0%, the VGG encoder had a RA of 95.9%, and the joint model had a RA of 77.6%
Discussion
Visual Prostheses We found that HNA is able to produce high-fidelity stimuli from the MNISTand COCO datasets that outperform conventional encoding strategies across all tested conditions.
Importantly, HNA produces phosphenes that are consistent across representations of the same object(Fig.
5C), which is critical to allowing prosthesis users to learn to associate certain visual patterns withspecific objects.
On the MNIST task, HNA produced high quality reconstructions, nearly matchingthe targets (Figure 3).
On the harder COCO task, HNA significantly outperformed the naive encoder,but was still unable to capture all of the detail in the images.
In Appendix G, we demonstrate that thisis largely due to the implant’s limited spatial resolution and not a fundamental limitation of HNA.
Another advantage of the HNA is that it can be trained to predict stimuli across a wide range ofpatient-specific parameter values ϕ , whereas the conventional naive encoder works well only forsmall values of ρ and λ .
This may be one reason why the naive encoding strategy has been shown tolead to substantial individual differences in visual outcomes [18, 57].
Our results suggest that stimuliproduced with HNA may be able to reduce at least some amount of this patient-to-patient variability.
Furthermore, HNA also proved superior to a surrogate forward model.
The latter offer an alternativewhen the forward model is computationally expensive or not differentiable.
Understandably, anyinaccuracies in the surrogate model will propagate to the learned encoder during training.
However,we observed that even for well trained surrogates, the encoder may still learn to exploit the inexactsurrogate instead of learning to invert the true model (see Appendix A). It is possible that thisexploitation could be mitigated to some extent by adversarially-robust training techniques [58].
Wesuspect that the surrogate method’s inferior performance here compared to [10] can be explainedby our larger stimulus search space.
Thus, we cannot currently suggest HNA for surrogate forwardmodels, unless the forward model is sufficiently simple or has a small stimulus space. Deployment HNA encoders must be lightweight enough to be deployed in resource-limited neuroprosthetic environments.
Our encoder’s single image inference time was 1.2ms on GPU and4ms on CPU. Future work could reduce these numbers through network pruning, mixed precision,and architecture search. Low-power Edge AI accelerators ( e.g. , Intel’s Neural Compute Stick) anddedicated neuromorphic hardware ( e.g. , BrainChip’s Akida SoC) may provide another solution. Broader Impacts While our work is presented in the context of visual prostheses, the HNAframework may apply to any sensory neuroprosthesis where stimulus selection can be informed by anumeric or symbolic forward model.
For example, HNA could be used in cochlear implants [3] tochoose stimuli that result in a desired sound, and in spinal cord implants [15] to find the best way torelay neural signals through a damaged section of the spinal cord. Conveniently, the forward modelsrequired by HNA have already been developed for a range of applications [36–46].
However, HNAmight not apply to all neural interfaces, such as systems without a clear neural or perceptual target( e.g. , deep brain stimulation for the treatment of Parkinson’s [59]) or closed-loop systems [16, 60].
Limitations Despite HNA’s potential, the current implementation has a number of limitations.
First, as presented the HNA encoder only applies to static targets. Hence dynamic targets must besplit into individual frames and encoded separately. However, one approach might be to encode entirestimulus sequences (instead of frames) that are optimized to reconstruct the dynamic target sequence.
Second, HNA works best if there is an accurate forward model mapping from stimulus space toperception.
However, Appendix H shows that HNA may still give benefits over a naive encodingeven when patient-specific parameters are unknown or mis-specified. In general, if a prosthesis elicitssimilar results across patients, then a non-patient-specific model would suffice. Third, the current works deals only with simulated patients.
The use of a DNN for stimulus encodingin real patients may raise safety concerns.
Since we cannot examine the process by which stimuliare chosen, it is possible that HNA might produce harmful stimuli that could lead to serious adverseevents ( e.g. , seizures).
However, this concern is mitigated by the fact that most neuroprostheses areequipped with firmware responsible for ensuring stimuli stay within FDA-approved safety limits.
Conclusion
In summary, this paper proposes a hybrid autoencoder structure as a general framework for stimulusoptimization in sensory neuroprostheses and, as a proof of concept, demonstrates its utility on theprominent example of visual neuroprostheses, drastically outperforming conventional encodingstrategies.
This may prove a promising solution for a variety of neuroprosthetic technologies.
Checklist
For all authors...
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s
contributions and scope?
[Yes]
(b) Did you describe the limitations of your work?
[Yes] we highlight both the limitations of our general framework and our specific proof of concept, see Section 6(c)
Did you discuss any potential negative societal impacts of your work?
[Yes] SeeSection 6, last paragraph
(d) Have you read the ethics review guidelines and ensured that your paper conforms to
them? [Yes]
If you are including theoretical results...
(a) Did you state the full set of assumptions of all theoretical results?
[N/A] We do notpresent any theoretical results
(b) Did you include complete proofs of all theoretical results?
[N/A]
If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main experi-
mental results (either in the supplemental material or as a URL)?
[Yes] We include
the trained models, and code to reproduce the main result figures in the supplementarymaterials.
(b) Did you specify all the training details (e g., data splits, hyperparameters,
how they
were chosen)?
[Yes] detailed instructions are given in 4, training paragraph on hyperparameter selection, learning rates, and many other training details.
Data splits
were predetermined by the datasets (MNIST and COCO already have splits), with some
more details given in Appendix C
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[No] We do not train our models multiple times.
Once trained,
the networks produce consistent results.
(d) Did you include the total amount of compute and the type of resources used (e.g., typeof GPUs, internal cluster, or cloud provider)?
[Yes] This is specified in Section 4,
training paragraph
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators?
[Yes] We used models
from [10, 21, 23], which are all cited whenever used in the paper.
(b) Did you mention the license of the assets?
[N/A]
(c) Did you include any new assets either in the supplemental material or as a URL?
[Yes]
, we provide saved weights for our final trained models, along with code to display results shown on main results figures.
(d) Did you discuss whether and how consent was obtained from people whose data you’re
using/curating?
[N/A] We do not use any new personal data
(e) Did you discuss whether the data you are using/curating contains personally identifiable
information or offensive content?
[N/A]
The data used does not contain any identifying
information or offensive content.
If you used crowdsourcing or conducted research with human subjects...
(a) Did you include the full text of instructions given to participants and screenshots, ifapplicable?
[N/A]
(b) Did you describe any potential participant risks, with links to Institutional Review
Board (IRB) approvals, if applicable?
[N/A]
(c) Did you include the estimated hourly wage paid to participants and the total amount
spent on participant compensation?
[N/A]
Appendix
A Surrogate Model
This section covers specific implementation details about the surrogate model as well as observationson its performance.
Dataset To create training data for the surrogate model ˆ f ϕ , we used the phosphene model describedin [23] and implemented in pulse2percept v0.8 [61]. 50 , 000 stimuli were created by first selectinga number of electrodes to stimulate between 1 and 30 randomly chosen electrodes, then randomlyselecting an amplitude between 1 and 10 (specified as a multiple of the assumed threshold current)and frequency between 1 and 200 Hz for each electrode. In addition, between 10 and 100 electrodeswere chosen to act as “noise” electrodes, where either amplitude or frequency was given a nonzerovalue, but not both.
The purpose of these electrodes was for the surrogate model to learn thatboth a nonzero amplitude and a nonzero frequency are required to produce a visible percept.
Weused an 80-20 train-test split.
As the surrogate model is highly dependent on patient-specificparameters ϕ , we generated new data and fit a separate surrogate for each of the following ϕ :(
( ρ, λ ) ∈ { (150 , 100) , (150 , 1500) , (800 , 100) , (800 , 1500) } ).
Network Architecture
The surrogate model ˆ f ϕ used a fully-connected architecture.
The input tothe model was a stimulus matrix s ∈ R n e x3 ≥ 0 , which was identical to the input to f .
The stimulusmatrix was split into amplitude and frequency components (pulse duration was not used due topoor model performance), which were fed through a FC layer.
The outputs of both FC layers wereconcatenated and fed through another FC layer.
Concurrently, the model computed the element-wiseproduct of the amplitude and frequency components and passed it through a separate FC layer.
Theoutputs of the previous two layers were then concatenated and fed through a final FC layer withoutput size 49 × 49 .
The model was trained for 45 epochs using AdamW [62] optimizer and MAE loss.
A.2 Approximating the Forward Model
The surrogate model was able to accurately approximate the true phosphene model f .
Table 2 shows
MAE over the validation set ( 10 , 000 percepts) for all 4 trained ˆ f ϕ .
Visually, the predicted perceptswere nearly identical to the ground truth.
[Table]
A.3 Predicted Stimuli
Despite the low surrogate validation error, training with the surrogate model would often result in theencoder suggesting almost adversarial stimuli; that is, stimuli that if fed through the true forwardmodel f would lead to drastically different percepts than if fed through the surrogate model
ˆ f
(see Fig. A.1). With these adversarial-like stimuli, the encoder appears to be performing well under thesurrogate model, but performs poorly when the same stimuli are input to the true forward model.
Weidentify this as the primary disadvantage of using a surrogate model and resolving this issue remainsan open research problem for end-to-end training with surrogate methods.
We noticed several issues caused by the effects of varying stimulus parameters on phospheneappearance.
For example, increasing amplitude increases size and brightness, while increasingfrequency increases brightness only.
We noticed a larger mismatch between the surrogate and theforward model on the extreme ends of the spectrum ( e.g. very high frequency, low amplitude),
[Table]
resulting in the encoder settling into a minimum that does not exist in the true forward model.
Itis important to note this disparity appears despite a high training accuracy of the surrogate alone.
Although these examples are specific to the bionic vision application, we expect surrogate modelsderived to describe other neuromodulation technologies to suffer from similar limitations.
B Hyperparameter Selection
In this section, we detail how HNA hyperparameters ( l , k , α , and β ) were chosen.
VGG Loss To choose the layer of the VGG network to use for VGG loss ( l ) we performed crossvalidation across a set of candidate layers.
Previous studies [50] have shown that the first layer witheach of the 5 convolutional blocks perform well for neural style transfer.
Thus, we choose these asour candidate layers.
For cross validation, we trained HNA for 50 epochs using each candidate layer.
The resulting phosphenes are shown in Figure B.1.
Using earlier layers, the VGG term performssimilarly to MAE, and phosphenes are disconnected.
We chose layer 5_1 based on its perceivedability to capture high-level perceptual differences between images, although layer 4_1 also performssimilarly.
Laplacian Smoothing We chose to use a kernel size 5 for the Laplacian filter used to estimate thesecond derivative ( k , Eq. 6).
The size of the filter controls the scale on which smoothing is applied( i.e. , smaller filters sizes only encourage continuity within a small local region, whereas larger filtersencourage continuity within a larger region).
Size 5 was chosen because larger filters were observedto over-smooth the image, while smaller filters still led to highly disconnected phosphenes.
Joint Perceptual Metric We performed cross validation to find the best values for α and β .
Insteadof using one value, we found scheduled weighting to be crucial for performance.
The schedulerincrementally increased the weight of the VGG loss ( β ) from 0 while simultaneously decreasing theinitially high weight on the smoothing constraint ( α ).
This was motivated by the observation
that
the
VGG loss performed poorly during early iterations when the predicted phosphene was near-random.
Under this scheduled weighting strategy, the loss is dominated early on by the MAE and smoothingterms.
This encourages the the model to just output reasonable encodings.
As training progresses, thepredicted phosphenes become higher quality, causing the VGG loss to perform better, and thus thesmoothing term is no longer as important.
Additionally, we found it beneficial to temporarily decrease the learning rate by a factor of 10 for ashort ’warm-up’ duration following each increase in β , before resetting to 50% of the prior learningrate.
This results in the learning rate gradually decreasing throughout training by a factor of around100.
Throughout the paper, we use α = 0 and β = 0 .
00008 for comparisons of loss values.
C COCO Dataset
For the COCO task (Section 5.2), we used subset of images from the MS-COCO dataset [54].
MSCOCO was chosen due to its selection of common household objects relevant to the daily life ofprosthesis users, as well as availability of ground-truth segmentation masks.
To select the imagessuitable for prosthetic vision, we filtered out images according to the following criteria:
Too cluttered.
Any image with greater than 15 total objects was removed.
Removed:
Select chosen objects.
Any image that did not have at least 1 object from the selected categories
that was larger than 4% of the total image was removed.
Removed:
Too many.
Any image with greater than 5 objects meeting criteria 2 was removed.
Removed:
Too dim.
Any objects in the image with average pixel brightness less than 50 were discarded.
Ifthis resulted in an image having 0 remaining objects, the image was removed.
Removed:
This resulted in a total of 47,532 training images and 11,883 test images (80-20 train-test split).
Theobjects in the remaining images were segmented out using the ground-truth segmentation masks,resized to (49, 49), and converted to grayscale.
The distributions of classes used is shown in Figure
C
D Predicted Stimuli
Here, we directly examine the stimuli resulting from HNA and naive encoders.
Stimuli and theirresulting phosphenes for example images from the test set are shown in Figure D.1.
The naive encoderproduces stimuli with constant frequency (20 Hz) and pulse duration (0.45 ms), which are not shown.
We make the following observations about the predicted stimuli:
• Both encoders activate electrodes corresponding to the shape of the target image.
In naive stimuli,the amplitude directly corresponds to the pixel brightness.
In HNA stimuli, the distributions ofamplitude, frequency, and pulse duration across the electrodes is more complex and harder tocharacterize, but lead to higher-quality phosphenes.
• HNA uses amplitudes inversely proportional to ρ .•
For small ρ , HNA primarily uses amplitude to control brightness.
For large ρ , HNA primarily
uses frequency to modulate brightness, keeping amplitudes low to limit phosphene size.
• HNA uses small pulse durations to create lines parallel to the underlying axon NFB ( i
e. , itutilizes the streaked phosphenes to its advantage), and large pulse durations to create linesperpendicular to the underlying NFB.
In other words, HNA was able to exploit applicationspecific ( i
e. , neuroanatomical) information that is baked into the forward
model.•
On average, HNA uses more electrodes, larger frequencies and pulse durations, and smalleramplitudes than the naive encoder.
A large active electrode count and high pulse durations maynot be desirable for some prostheses, due to tissue activation and frame rate limits.
We found
that it was easy to constrain these parameters using regularization on the output stimuli, at thecost of slightly decreased performance.
E COCO Patient-to-Patient Variations
We repeated the analysis presented in Section 5.3 for the COCO dataset.
Figure E.1A shows twoexample COCO images, encoded by both HNA and the naive encoder, across varying ρ and λvalues.
The heatmaps in Figure E.1B show the log of the joint perceptual loss across simulatedpatients, for both the naive and HNA encoders.
To measure phosphene consistency, we performed
T-SNE clustering on a subset of the COCO images which have only 1 object.
Unfortunately, T-SNEclustering of the ground-truth COCO images did not form groups corresponding to the object types(Figure E.1C), suggesting that the representation of object instances vary drastically across COCOimages.
Therefore, it was not meaningful to repeat the analysis presented in Fig.
5C.
Similar to the MNIST results presented in Section 5.3, HNA produced higher-quality representationsthan the naive encoder, resulting in a lower joint loss for every simulated patient.
HNA performedconsistently well across all simulated patients (Figure E.1B), with a small increase in loss for small ρ( < 100 ).
Similar to MNIST, the naive encoder only performs well for patients with a mid-to-low ρ( ≈ 200 ) and low λ .
F Modeling Other Patient-to-Patient Variations
Previously, results were presented across patient-specific parameters ρ and λ , because these havethe greatest impact on phosphene appearance.
However, the forward model has a number of otherpatient-specific parameters, which HNA is also able to adapt to.
For full details on all parameters ofthe forward model, see [23].
Out of the remaining parameters, a 2 , a 3 , and a 5 are the most impactfulon phosphene appearance.
a 2 and a 3 modulate how much the brightness contribution from eachelectrode scales with increasing amplitude and frequency, respectively.
a 5 locally scales the globalradial current spread ρ based on each electrodes amplitude.
Figure F.1 ( left ) illustrates the effect ofthese parameters on phosphene appearance.
Figure F.1 compares HNA to naive encoder performance across a 2 , a 3 , and a 5 .
The ranges for theseparameters are based on values empirically observed in retinal prosthesis users [23].
HNA producesrelatively consistent phosphenes, and outperforms the naive encoder across all conditions.
G Simulating Higher-Resolution Implants
On the COCO task, HNA significantly outperformed the naive encoder, but was still unable to captureall of the detail in the images.
Two of the main reasons for this are the limited spatial resolution of theimplant and the patient-specific distortions from the forward model.
Here, we present results from
HNAs trained on implants of higher resolution, at small ρ and λ .
The chosen implants are illustratedin Figure G.1A.
For a fair comparison, each HNA was trained for only 50 epochs.
Phosphenes resulting from the HNA trained on the different implants are shown in Figure G.1C, andthe losses across implants is plotted in Figure G.1B.
As implant resolution increases, the phospheneslook increasingly similar to the ground truth, and small details (e.g. facial details, textures) start toemerge.
Thus, HNAs initial failure to capture high-frequency details in the image appears to be an applicationspecific limitation for visual prostheses more so than a limitation of the HNA framework.
For visualprostheses, learning to reconstruct the high-frequency features of complex images despite distortionsand limited implant resolution remains an open problem.
H Mis-Specified Patient-Specific Parameters
Due to noisy or limited patient data, there may be some uncertainty in the measured value of thepatient-specific parameters ϕ .
Therefore, we conducted an analysis of the consequences of incorrectpatient-specific parameters on the encodings produced by HNA.
Note that the true patient-specificparameters are not needed during training, so incorrect ϕ will only affect evaluation.
A ’mismatch’
HNA model was created, where the forward model decoder used the true patient-specific parametersϕ , and the encoder used another set of patient-specific parameters ϕ ′ .
In the first experiment, ϕ ′ was sampled from a uniform random distribution (we again focus on only ρand λ ).
The original HNA encoder, naive encoder, and mismatch HNA encoder with random ϕ ′ wereevaluated on the MNIST test set.
HNA achieved a joint loss of 0.92, the naive encoder had a jointloss of 3.13, and the mismatch HNA had a joint loss of 1.35 ± 0.003 (mean ± standard deviationacross 10 random ϕ ′ ).
Thus, even if the true patient-specific parameters are completely unknown, onaverage randomly selecting values will still produce higher-quality encodings than the naive method.
In a second experiment, we analyzed whether there were any configurations ( ϕ - ϕ ′
combinations)that resulted in a worse encoding than the naive model.
For the 90% of true ϕ , the mismatch modeloutperformed the naive model regardless of the chosen ϕ ′ .
However, the naive model performs best atρ = 250 and λ = 200 .
In Figure H.1A, we hold λ constant at 200 and, for each true ρ , plot the rangesof mis-specified ρ ′ for which the mismatch HNA still outperforms the naive.
Figure H.1B shows asimilar plot for varying λ , holding ρ constant at 250 .
Even for the naive model’s ideal patients, HNAstill outperforms the naive model for a large proportion of mis-specified ρ and λ .