Retinal degenerative diseases, such as retinitis pigmentosa or age-related macular degeneration, affect between 20 and 25 million people worldwide. These diseases lead to the gradual loss of photoreceptors, the light-sensitive cells of the retina, and therefore to blindness. Retinal prostheses are a promising strategy to restore sight to these patients. These devices are made of grids of electrodes or microphotodiodes positioned on or under the retina, or on the choroid -the vascular layer of the eye, to stimulate the remaining neurons of the retina by electrical impulses. The visual scene is filmed by a camera carried by the patient, and converted into an electrical stimulation pattern, to compensate for the loss of photoreceptors.Despite promising beginnings and considerable technical progress, with the latest generations of implants made up of several thousand independent stimulation units, the visual performance of equipped patients remains well below expectations. Patients who no longer perceived light are now able to locate objects, perform visual recognition tasks or simple spatial navigation. However, the functional benefits remain very limited. Several reasons can explain this performance. First of all, the perception of shapes is greatly affected due to the diffusion of current in the tissue and the activation of the distal parts of the axons: a given electrode does not produce a 'pixel' in the visual field, but an elongated and ill-defined shape. In addition, the electrical stimulation of different types of retinal cells, which normally encode different information about the visual stimulus, is nonspecific, so downstream visual centers receive corrupted information. Extensive efforts have been made to obtain a more focused and specific stimulation, to process the incoming image to transmit only the information necessary for visual performance, and to attempt to mimic the neural code using an appropriate encoder.In this thesis, we propose a new strategy for optimizing visual signal conversion in retinal prostheses based on the measurement of visual performance and patients' preferences. Users participate in a series of visual tasks, and their responses are used to continuously adjust the encoder according to a Bayesian optimization algorithm. Bayesian optimization is a powerful method to optimize functions whose analytical form is unknown without access to derivative information. It is especially used when the cost of a single function evaluation is high. It relies on a surrogate Bayesian model of the objective function which is used to query the system at locations informative about the optimum. The choice of querying a particular point is driven by a heuristic aiming at balancing exploration and exploitation. In this thesis, we validate this strategy in participants with normal or corrected vision, using a prosthetic vision simulator. We show that preference-based optimization improves the quality of participants' perception and that this subjective improvement is transferred to stimuli other than those used during optimization, and is accompanied by a better visual acuity. The use of an adaptive sampling scheme allows faster optimization compared to random sampling. We used a parameterization of the encoder based on a model predicting the perception of patients equipped with an implant. We show that the optimization procedure is robust to errors in this model. This robustness, together with the fact that this method does not make any particular assumption regarding the type of implant, suggests that it could be implemented to improve sight restoration in patients. In addition, we show that an optimization strategy based on personal preference is more effective than optimization based on performance.The challenges of applying preferential Bayesian optimization to retinal prostheses led us to develop new Bayesian optimization algorithms which outperform state-of-the-art methods in scenarios where the objective evaluation returns binary data, such as preference comparisons. In particular, many of the previously proposed method where either to computationally expensive to be used in a psychophysics context, or showed limited performance in practice. The new methods we proposed are based on the analytical decomposition of uncertainty about an evaluation outcome into its two components: aleatoric and epistemic, which allowed us to refine the definition of exploration in the context of Bayesian optimization. The optimization of retinal prostheses encoders is an example of a situation where the optimized system can operate in many different environments, which induces several challenges for efficient and robust performance improvement. We explore this type of problem, in the case where the evaluation of the system involves binary measurements, by generalizing binary Bayesian optimization. We propose new heuristics combining methods from Bayesian optimization and active learning to efficiently optimize the objective across contexts.