A photosensor employing data-driven binning for ultrafast image recognition

Pixel binning is a technique, widely used in optical image acquisition and spectroscopy, in which adjacent detector elements of an image sensor are combined into larger pixels. This reduces the amount of data to be processed as well as the impact of noise, but comes at the cost of a loss of information. Here, we push the concept of binning to its limit by combining a large fraction of the sensor elements into a single “superpixel” that extends over the whole face of the chip. For a given pattern recognition task, its optimal shape is determined from training data using a machine learning algorithm. We demonstrate the classification of optically projected images from the MNIST dataset on a nanosecond timescale, with enhanced dynamic range and without loss of classification accuracy. Our concept is not limited to imaging alone but can also be applied in optical spectroscopy or other sensing applications.


Results and discussion
Pixel binning. In Fig. 1 we schematically depict different types of binning and its impact on the classification accuracy of an artificial neural network (ANN). Besides the aforementioned conventional approach (orange lines), we also illustrate our concept of data-driven binning (green line). There, a substantial fraction of pixels are combined into a "superpixel" that extends over the whole face of the chip, thus forming a large-area photodetector with a complex geometrical structure that is determined from training data. For multi-class classification with one-hot encoding, one such superpixel is required for each class. As for conventional binning, the system becomes more resilient towards noise and its dynamic range increases. However, for large light intensities there is no loss of classification accuracy and hence no compromise in performance, in contrast to the conventional www.nature.com/scientificreports/ case. These benefits come at the cost of less flexibility, as a custom configuration/design is required for each specific application.
Photosensor implementation. Figure 2a shows a schematic of our photosensor, employing data-driven binning. A microscope photograph of the actual device implementation is shown in Fig. 2b. For details regarding the fabrication, we refer to the "Methods" section. The device consists of N pixels, arranged in a two-dimensional array. Each pixel is divided into at most M subpixels that are connected-binned-together to form the M superpixels, whose output currents are measured. Each detector element is composed of a GaAs Schottky photodiode (Fig. 2c) that is operated under short-circuit conditions (Fig. 2d) and exhibits a photoresponsivity of R = I SC /P ≈ 0.1 A/W, where I SC is the photocurrent and P the incident optical power. GaAs was chosen because of its short absorption and diffusion lengths, which both reduce undesired cross-talk between adjacent pixels; with some minor modifications the sensor can also be realized using Si instead of GaAs. The design parameters, that depend on the specific classification task and are determined from training data, are the geometrical fill factors f mn = A mn /A for each of the subpixels, where A mn denotes the subpixel area and A is the total area of each pixel.
From Fig. 2a  www.nature.com/scientificreports/ with p = (P 1 , P 2 , . . . , P N ) T being a vector that represents the optical image projected onto the chip, i = (I 1 , I 2 , . . . , I M ) T the output current vector, and F = f mn M×N a fill factor matrix that depends on the specific application. The m-th row of F is a vector f m = f m1 , f m2 , . . . , f mN T that represents the geometrical shape of the m-th superpixel.
Naïve Bayes photosensor. Let us now discuss how to design the fill factor matrix for a specific image recognition problem. As an instructive example, we present the classification of handwritten digits ('0' , '1' , …, '9') from the MNIST dataset 20 by evaluating the posterior P y m |p (the probability P of an image p being a particular digit y m ) for all classes and selecting the most probable outcome. By applying Bayes' theorem and further assuming that the features (pixels) are conditionally independent, one can derive a predictor of the form P P n |y m , known as Naïve Bayes (NB) classifier 21,22 . We use a multinomial event model P P n |y m = π P n mn , where π mn is the probability that the n-th pixel for a given class y m exhibits a certain brightness and express the result in log-space to obtain a linear discriminant function with weights w mn = log π mn . The bias terms b m = log P y m can be omitted ( b = 0 ), as all classes are equiprobable. The similarity to Eq. (1) allows us to map the algorithm onto our device architecture: F ∝ W . To match the calculated w mn -value range to the physical constraints of the hardware implementation, we normalize the weights according to In Fig. 3a we exemplify the working principle of the photosensor. A sample p from the MNIST dataset is optically projected onto the chip using the measurement setup shown in Fig. 3b (see "Methods" section for experimental details). Each of the M superpixels generates a photocurrent I m proportional to the inner product f T m p . If we visualize f m for each class (Fig. 3c), we obtain an intuitive result: The shape of each superpixel resembles that of the average-looking digit for the respective class. It is apparent that the superpixel with the largest spatial overlap with the image delivers the highest photocurrent. Figure 3e shows experimental photocurrent maps for the device in Fig. 2b. Here, each pixel of the sensor is illuminated individually and the output currents are recorded. The currents are proportional to the designed fill factors in Fig. 3c (apart from device imperfections such as broken lithographic connections), confirming negligible cross-talk between neighbouring subpixels. To evaluate the performance, we projected all 10 4 digits from the MNIST test dataset and recorded the sensor's predictions. The classification results are presented as a confusion matrix in Fig. 3f. The chip is able to classify digits with an accuracy that closely matches the theoretical result in Fig. 3d.
Artificial neural network photosensor. Beyond the instructive example of NB, the same device structure also allows the implementation of other, more accurate, classifiers. Specifically, we present the design and simulation results for a single-layer ANN 21 for the same MNIST classification task as discussed before. In Fig. 4a the architecture of the network is shown. It makes its predictions according to Note the similarity to Eq. (2), apart from a nonlinearity σ which can be readily implemented, either in the analogue or the digital domain, using external electronics. We choose a softmax activation function for σ . Again, due to the physical constraints of the sensor hardware, we train the network with bias b = 0 using categorical cross-entropy loss. In order to obey Eq. (3), we further introduce a constraint that enforces a non-negative weight matrix W by performing the following regularization after each training step: with ⊙ denoting the Hadamard product and θ the Heaviside step function. This leads to a < 1% penalty in accuracy.
The fill factor matrix F , plotted in Fig. 4d, is directly related to W by a geometrical scaling factor. Although the superpixel shapes do not clearly resemble the handwritten digits, the ANN shows better performance than the NB classifier, as demonstrated by the confusion matrix in Fig. 4b. In addition, the ANN shows a larger spread between the highest and all other output currents (Fig. 4c), which makes it more robust against noise (Supplementary Figure S2). A number of other machine learning algorithms can be described by an equation of (1) i = RFp, . www.nature.com/scientificreports/ the form (5) and can be implemented in a similar fashion. Also the realization of an all-analogue deep-learning network is feasible by feeding the sensor output into a memristor crossbar array 24,25 . Benefits of data-driven binning. In Fig. 5 we demonstrate the benefits of data-driven binning. It is evident that the readout of M photodetector signals requires less time, resources, and energy than the readout of the whole image in a conventional image sensor. In fact, the photodiode array itself does not consume any energy at all; energy is only consumed by the electronic circuit that selects the highest photocurrent. Pattern recognition and classification occur in real-time and are only limited by the physics of the photocurrent generation and/ or the electrical bandwidth of the data acquisition system. This is demonstrated in Fig. 5a, where we show the correct classification of an image on a nanosecond timescale, limited by the bandwidth of the used amplifier. Furthermore, it is known that binning can offer an K 1/2 -fold improvement in SNR 19 . In our case, a substantial fraction ξ ( ∼ 0.6 for NB) of all sensor pixels are binned together ( K = ξ N ), with each pixel being split into M elements. Together, this results in a (ξ N) 1/2 /M-fold SNR gain over the unbinned case. To characterize the noise performance, we performed binary image classification (NB, MNIST, '0' versus '1') at different light intensities. For the reference measurements, we projected the images sequentially, pixel by pixel, onto a single GaAs Schottky photodetector (fabricated on the same wafer and with an area identical to that of two subpixels), recorded the photocurrents, and performed the classification task in a computer. In the simulations, Gaussian noise was added by drawing random samples from a normal distribution N 0, σ 2 with zero mean value. The noise was added once per superpixel in the data-driven case, and per each pixel in the reference case. σ was used as a single fitting parameter to reproduce all experimental results. The results are presented in Fig. 5b. The classification accuracy is affected by the amplifier noise. For large intensities, the system operates with its designed accuracy. As the www.nature.com/scientificreports/ intensity is decreased, the classification accuracy drops and eventually, when the noise dominates over the signal, reaches the baseline of random guessing. Our device, employing data-driven binning, can perform this task at lower light intensities than the reference device without binning.

Conclusions
We conclude with proposed routes for future research. The main limitation of our current device implementation is its lack of reconfigurability. While this may be appropriate in some cases (e.g. a dedicated spectroscopic application), reconfigurability of the sensor would in general be preferred. This may, for example, be achieved by employing photodetectors with tunable responsivities, or a programmable network based on a nonvolatile memory material [26][27][28] to bin individual pixels together. Other schemes than standard one-hot encoding may allow to save hardware resources and extend the dynamic range further. Possible applications of our technology include industrial image recognition systems that require high-speed identification of simple objects or patterns,  www.nature.com/scientificreports/ as well as optical spectroscopy, where the incoming light is dispersed into its different colors and the sensor is trained to recognize certain spectral features. In both cases classical machine learning algorithms will provide sufficient complexity and sophistication for the approximation of the dataset.

Methods
Device fabrication. Device fabrication started with the growth of a 400 nm thick n − -doped ( 10 16 cm −3 ) GaAs epilayer by molecular beam epitaxy on a highly n + -doped GaAs substrate. An ohmic contact on the n + -side was defined by evaporation of Ge/Au/Ni/Au (15 nm/30 nm/14 nm/300 nm) and sample heating at 440 °C for 30 s. On the n − -GaAs epilayer we deposited a 20 nm thick Al 2 O 3 insulating layer by atomic layer deposition (ALD). We then defined a first metal layer (M1) by electron-beam lithography (EBL) and Ti/Au (3 nm/25 nm) evaporation. In the next step we deposited a 30 nm thick Al 2 O 3 layer by ALD. We then defined an etch mask for the via holes, which connect metal layers M1 and M2, by EBL and etched the Al 2 O 3 with 30% potassium hydroxide (KOH) aqueous solution. We then wrote an etch mask for the pixel windows via EBL and etched the aggregated 50 nm thick Al 2 O 3 with a 30% KOH aqueous solution in two steps. Inside the pixel windows, we defined the subpixels with EBL by removing the naturally formed oxide on the GaAs substrate with a 37% hydrochloric acid (HCl) aqueous solution and evaporating 7 nm thick semitransparent Au. Finally, we defined the M2 metal layer with EBL and Ti/Au (5 nm/80 nm) evaporation. The continuity and solidity of the device was confirmed by scanning electron microscopy and electrical measurements.

Experimental setup.
A schematic of the experimental setup is shown in Fig. 3b. A light-emitting diode (LED) source (625 nm wavelength) illuminates, through a linear polarizer, a spatial light modulator (SLM). The SLM is operated in intensity-modulation mode and changes the polarization of the reflected light according to the displayed image. The reflected light is then filtered using a second linear polarizer, and the image is projected onto the chip. The photocurrents generated by the sensor are probed with a needle array, selected by a Keithley switch matrix and measured with a Keithley source measurement unit. For time-resolved measurements a pulsed laser source (522 nm wavelength, 40 ns) is used. Here, the output signals are amplified with a high-bandwidth (20 MHz) transimpedance amplifier. The pulsed laser source is triggered with a signal generator and an oscilloscope is used to record the time trace.

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