An apparatus for restoring or improving vision in a subject in need thereof comprising: a device for receiving a stimulus, a processing device comprising: non-transient computer readable media storing a set of encoders to generate a set of codes from the stimulus; at least one processor configured to: process image data using the set of encoders to generate encoded data, where the image data comprises a plurality of values, each value being associated with a location and a time, and the set of encoders is characterized by an input/output transformation that mimics the input/output transformation of a mammalian retina, and wherein processing the image data comprises: applying a spatiotemporal transformation to the image data to generate firing rate values for retinal output cells; and generating the encoded data based on the firing rate values, wherein applying the spatiotemporal transformation comprises applying a single stage spatiotemporal transformation that comprises a set of weights that are determined directly from experimental data, and wherein the experimental data is generated using a stimulus that includes natural scenes, and non-transient computer readable media storing the encoded data, an interface for converting the encoded data into an output, and a high resolution transducer for activating a plurality of retinal cells based on the output, wherein activating the plurality of retinal cells results in retinal ganglion cell responses, to a broad range of stimuli, that are substantially similar to the responses of retinal ganglion cells from the mammalian retina to the same stimuli. a device for receiving a stimulus, a processing device comprising: non-transient computer readable media storing a set of encoders to generate a set of codes from the stimulus; at least one processor configured to: process image data using the set of encoders to generate encoded data, where the image data comprises a plurality of values, each value being associated with a location and a time, and the set of encoders is characterized by an input/output transformation that mimics the input/output transformation of a mammalian retina, and wherein processing the image data comprises: applying a spatiotemporal transformation to the image data to generate firing rate values for retinal output cells; and generating the encoded data based on the firing rate values, wherein applying the spatiotemporal transformation comprises applying a single stage spatiotemporal transformation that comprises a set of weights that are determined directly from experimental data, and wherein the experimental data is generated using a stimulus that includes natural scenes, and non-transient computer readable media storing the encoded data, an interface for converting the encoded data into an output, and non-transient computer readable media storing a set of encoders to generate a set of codes from the stimulus; at least one processor configured to: process image data using the set of encoders to generate encoded data, where the image data comprises a plurality of values, each value being associated with a location and a time, and the set of encoders is characterized by an input/output transformation that mimics the input/output transformation of a mammalian retina, and wherein processing the image data comprises: applying a spatiotemporal transformation to the image data to generate firing rate values for retinal output cells; and generating the encoded data based on the firing rate values, applying a spatiotemporal transformation to the image data to generate firing rate values for retinal output cells; and generating the encoded data based on the firing rate values, wherein applying the spatiotemporal transformation comprises applying a single stage spatiotemporal transformation that comprises a set of weights that are determined directly from experimental data, and wherein the experimental data is generated using a stimulus that includes natural scenes, and non-transient computer readable media storing the encoded data, an interface for converting the encoded data into an output, and a high resolution transducer for activating a plurality of retinal cells based on the output, wherein activating the plurality of retinal cells results in retinal ganglion cell responses, to a broad range of stimuli, that are substantially similar to the responses of retinal ganglion cells from the mammalian retina to the same stimuli.