Introduction

Machine vision enables machines to analyze and understand the visual world, playing a crucial role in the development of artificial intelligence applications. Compared with human vision systems, the existing conventional machine vision systems inevitably generate a large amount of redundant data due to the physical separation of functional units, resulting in considerable time delays and high power consumption1,2,3. Fortunately, emerging in-sensor computing architecture-inspired retinomorphic devices provide potential solutions to overcome these limitations4,5,6,7,8. So far, various retinomorphic devices have been developed to implement in-sensor computing because they can perform multiply and accumulate (MAC) operations using tunable responsivities as the weights of built-in artificial neural networks. However, these retinomorphic devices predominantly utilize traditional p-n junction regulation or dual-gate modulation, with their photoelectric conversion efficiency and open-circuit voltage (Voc) constrained by the Shockley-Queisser (S-Q) limit. Furthermore, the volatility of their photoresponse and the ongoing need for gate bias regulation or additional functional layer (e.g. ferroelectric layer) lead to additional power consumption and complicate the integration process9,10,11,12. In this context, the bulk photovoltaic effect (BPVE), driven by the spontaneous electric polarization of ferroelectric materials, provides significant advantages for the hardware implementation of in-sensor computing. This effect allows for precise tuning of photoresponsivity using the ferroelectric field and leverages the inherent stability of ferroelectric materials to ensure nonvolatile photoresponsivities. Additionally, the straightforward fabrication and integration processes associated with ferroelectric materials significantly enhance their practical applicability13,14,15,16,17.

Current research on BPVE primarily focuses on three-dimensional perovskite oxide ferroelectric films, such as BiFeO3, PbTiO3, etc18. The photoresponsivity and photocurrent conversion efficiency of perovskite oxide ferroelectric films are limited by the large bandgap (2.7–5.0 eV) and when the thickness is reduced to the nanoscale, the ferroelectricity will disappear, which is detrimental to the development and integration of miniaturized devices19,20. Recently, two-dimensional (2D) ferroelectric materials with narrow-bandgap have been considered promising candidates for improving the performance of BPVE and are promising to be used in integrated devices21,22,23. Specifically, rhombohedral (3R) stacked/interlayer sliding 2D transition metal dichalcogenides (TMDs) are typical narrow-bandgap 2D ferroelectric semiconductors with excellent properties such as ultra-thin thickness, uniform surface without dangling bonds, and high carrier mobility24. It should be noted that the stable BPVE of 3R TMDs enables nonvolatile and reconfigurable photoresponsiveness, further enhancing its applicability in BPVE for advanced in-sensor computing systems. Thus, synthesizing 3 R stacked/interlayer sliding TMDs and producing retinomorphic devices to achieve in-sensor computing with a simple structure, low power consumption, and reconfigurable, nonvolatile photoresponsivities is a forward-looking strategy for realizing an efficient machine vision system.

Here, we propose a BPVE modulation strategy using 3R-WS2 to realize reconfigurable and nonvolatile modulation of photoresponsivity and develop a convolutional neural network (CNN) for image processing based on two-terminal all 2D van der Waals layers vertical retinomorphic device (graphene/3R-WS2/graphene). The 3R-WS2 bulk ferroelectric single crystals are successfully synthesized via chemical vapor transport (CVT) and demonstrate the inversion symmetry broken in interlayer-sliding WS2 layers and out-of-plane (OOP) polarization ferroelectric characteristics. The retinomorphic device offers polarization-tunable linear positive and negative stable photoresponsivities, covering red, green, and blue (RGB) spectra, making it an ideal candidate for in-sensor MAC operation applications and CNN processing of images. Configurable CNN and various convolution kernels (3 × 3) for both low-level (e.g., edge detection, sharpening) and high-level (100% classification accuracy of colored letters) image processing tasks have been successfully implemented based on the reconfigurable and nonvolatile photoresponsivities of the retinomorphic device. This marks the achievement of 2D ferroelectric BPVE for in-sensor computing, offering new avenues for simplifying bionic vision hardware and inspiring the development of low-power, high-responsivity machine vision systems.

Results

Retinomorphic in-sensor computing system based on BPVE

Traditional visual processing architectures typically begin with the acquisition of visual data by the sensors, followed by digitization via an analog-to-digital converter (ADC), then culminates in image processing by the computational unit (Fig. 1a, top). Undoubtedly, this sequential transmission of data introduces significant latency and energy consumption due to the handling of redundant information, posting considerable challenges for the efficient deployment of machine vision in artificial intelligence. In contrast, the human retina shows remarkable operation efficiency in processing visual stimuli and effectively minimizing redundant input. Furthermore, the ability of the retina to discern color through specialized cone cells underscores the potential for advanced color detection in artificial systems25,26,27. Cones are primarily tasked with color recognition and can be further classified into several types that include L (long-wavelength) cones for red (R) perception, M (medium-wavelength) cones for green (G), and S (short-wavelength) cones for sensing blue (B), as shown in Fig. 1b28,29.

Fig. 1: Design and mechanisms of in-sensor computing systems inspired by the human visual system.
figure 1

a Conventional sensory computing, and in-sensor computing systems. For conventional sensory systems, analog sensory data are initially converted to digital signals through an analog-to-digital converter (ADC), subsequently stored in memory temporarily, and finally sent from memory to the processing unit. While for in-sensor computing system, multiple connected sensors can directly process sensor information directly, thereby obviating the sensor/processor interface and integrating sensing and computing functions. b Schematic diagram of artificial retinal vision system containing L/M/S cones and retina-inspired 2D ferroelectric bulk photovoltaic effect.

Inspired by biological efficiencies, in-sensor computing systems (Fig. 1a, bottom) integrate sensing, memory, and computational functionalities, greatly simplifying the system structure and reducing data transmission. To achieve high-level sensory processing through the in-sensor computing paradigm, reconfigurable photovoltaic retinomorphic devices can be connected to directly implement MAC operations for artificial neural networks (ANN) or CNN. The basic MAC operation using a photovoltaic sensing array is shown in Fig. 1a. This operation is implemented using the photocurrent generation process (In = Rmn×Pm) and Kirchhoff’s current summation law, where Rmn is the photoresponsivity, In and Pm denote the output photocurrent and incident illumination power, respectively4,9,30,31. In-sensor computing can be achieved by setting the Rmn of each pixel to a positive or negative value, which is instrumental in enabling the sensor to process images in real time9,10,32. Therefore, determining the method for achieving positive and negative linearly tunable photoresponsivity (Rmn) becomes the key to realizing the in-sensor computing system. Recently, the BPVE of 2D ferroelectric materials has received widespread attention because its energy conversion efficiency can exceed the S-Q limit of traditional p-n junctions. The robust ferroelectric polarization states of these materials can be shifted, leading to a displacement of the internal electric fields. This modification impacts the separation and collection efficiency of charge carriers, thus enhancing the tunability of photoresponsivity and performance of these materials beyond conventional limits. 2D ferroelectrics with controllable thickness are ideal candidates for enhanced photocurrent generation via BPVE to realize the reconfigurable and nonvolatile photoresponsivity, highlighting the potential of developing in-sensor computing system for machine vision (Fig. 1b).

Crystalline structure characterization of 3R-WS2

The 3R-WS2 (space group: R3m) is composed of covalently bonded W − S triangular prism layered sheets and is one of the polytypes of WS2 (Fig. 2a). Due to its ABC-type stacking order, 3R-WS2 has a non-centrosymmetric triangular symmetry from bilayer to bulk, resulting in spontaneous polarization (sliding ferroelectricity) along OOP directions33. For 2H phase WS2 (space group: P63/mmc), there is no OOP spontaneous polarization since the even-layer system maintains inversion symmetry and the odd-layer system maintains mirror symmetry. In this study, we successfully synthesized 3R-WS2 crystals using the CVT method. The elemental distribution was revealed by energy dispersive spectrometer (EDS) in Fig. 2b. To further confirm the crystalline structure of the synthesized samples, we carefully examined the scanning transmission electron microscopy (STEM) annular dark-field (ADF) image of the 3R-WS2 crystal. The contrast in the STEM-ADF image is directly related to the atomic number of the element being imaged, and the brighter dots represent W atoms, whereas the dimmer ones denote S atoms. Compared with 2H, the 3R-WS2 can be distinguished by the weak spots appearing at the center of each hexagon. The intensity line distribution of the five-layer 3R-WS2 shows that the atoms are in alternating light and dark contrast along the 60° tilted lattice direction, indicating the existence of a rhombic crystal structure consistent with the crystal structure of 3R-WS2 as illustrated in Fig. 2c. And according to the atomic structure of 3R-WS2, the atoms in the yellow dotted line box are 2 W + 4S, 2 W + 2S, W + 4S, 2 W + 4S, 2 W + 2S, W + 4S respectively, which shows good agreement with the simulated STEM images (Fig. 2d and Supplementary Fig. 2).

Fig. 2: Atomic-scale characterization of 3R-WS2 nanoflakes.
figure 2

a Top and side view schematic of 2H and 3R WS2 crystals along different axes. The blue and red spheres represent the sulfur and tungsten atoms, respectively. The blue boxes mark the unit cells, and the blue arrows indicate the direction of spontaneous polarization. b STEM image and corresponding EDS mapping of 3R-WS2. c Atomic resolution ADF-STEM images of five-layers 3R-WS2 and corresponding simulated. d Experimental and simulation results for the intensity line profile marked by the yellow dashed rectangle in (c).

Inversion symmetry broken in interlayer-sliding WS2 layers

Second harmonic generation (SHG) microscopy is an effective technique for studying the structural symmetry of WS2 crystals. It is predicted that due to the inversion symmetry of 3R-WS2 is broken, a strong built-in piezoelectric field will generate and enhance the SHG signal. Since the polarization-resolved SHG is related to crystal orientation, the relationship between SHG intensity and sample rotation angle can reveal the orientation of 3R-WS2 flakes. To verify this, we measured the signal relationship between different angles and SHG intensity, as shown in Fig. 3a. The sample was excited with linearly polarized light in the normal direction to obtain the SHG intensity I|| cos2(3φ + θ), where φ is the angle between the mirror surface of the crystal structure and the polarization direction of the pump light, and θ represents the armchair direction of the crystal relative to γ rotation34. The blue fitting curve in Fig. 3a is consistent with the experimental data, indicating that the armchair is initially consistent with the polarization direction of the input laser. In addition, we explored the SHG intensity as a function of excitation power as shown in Fig. 3b. Under the excitation light wavelength of 1040 nm, the power-dependent SHG spectrum of 3R-WS2, with a peak at 520 nm, which is exactly the doubled frequency of the excitation light was obtained. The dependence of the SHG peak intensity on the excitation power on the logarithmic coordinate can be well fitted by a power law function with a coefficient of 1.9 (blue curve), confirming the contribution of the SHG signal (Fig. 3c). All these characterizations confirm that the sample we used here belongs exclusively to the 3R phase.

Fig. 3: Inversion symmetry broken and ferroelectricity of 3R-WS2 nanoflakes.
figure 3

a The angle dependence of SHG intensity of the 3R-WS2 nanoflake. b SHG spectra of 3R-WS2 nanoflake with different excitation powers. c The distribution diagram of SHG intensity exhibits a power-law relationship with excitation power, and the coefficient is fitted to 1.9. d Height image and OOP intrinsic amplitude images of 3R-WS2 nanoflake under different drive voltages. e Corresponding OOP amplitude evolution curve with different drive AC voltages. f OOP amplitude and phase images of 3R-WS2 after sequential lithography by using a box-in-box pattern. The inside of the white dotted line indicates −6 V, and the outside represents 6 V. g Local OOP ferroelectric switching spectra under DC off state of 3R-WS2 nanoflake.

To further confirm the non-centrosymmetric structure of 3R-WS2, the effective OOP piezoelectric coefficients (d33) of an exfoliated nanoflake with a thickness of 19 nm on an Au-coated SiO2/Si substrate was measured with piezoresponse force microscopy (PFM). An electrical field was applied to the 3R-WS2 nanoflake through a Pt/Ir-coated conductive tip in dual alternating current (AC) resonance tracking (DART) PFM mode. When the signal with a driving amplitude Vac increases, the deflection of the conductive tip manifests different types and amplitudes of strains in the vertical direction of the samples. This variation highlights the piezoelectric behavior of the nanoflake under varying electrical stimuli35. As shown in Fig. 3d, when the Vac signal sweeps from 1 V to 5 V, the OOP amplitude signal of the sample increases significantly, while the amplitude of the substrate remains almost unchanged. This amplitude change ensures that the piezoelectricity originates solely from the inverse piezoelectric effect caused by breaking centrosymmetry of the 3R-WS2 nanoflake rather than fake imaging of electrostatic accumulation. By fitting multiple local oscillator amplitude points of the sample to the driving AC voltage, we determined the effective d33 of 3R-WS2 nanoflakes to be 2.8 ± 0.27 pm V1 (as depicted in Fig. 3e and Supplementary Note 2), which is much higher than that of 3R-MoS2 (0.44 ± 0.02 pm V1) reported previously (as listed in Supplementary Table 1). Given that the piezoelectric coefficient of 2D materials is often correlated with thickness, PFM scans were strategically performed on 3R-WS2 nanosheets with varying thicknesses to evaluate the trend of effective d33 (see Supplementary Fig. 3).

Spontaneous electrical polarization of 3R-WS2

To confirm the switchable electric polarization directly in the 3R WS2, we have investigated the polarization states by employing both the PFM and the polarization–electrical field (PE) measurement. First, to substantiate the ferroelectric behavior, the OOP polarization lithography was performed by applying a DC voltage of ±6 V on 3R-WS2 nanoflakes (highlighted by a dashed line in Fig. 3f). The ensuing PFM scan revealed two contrasting areas in the phase image, signifying the large-area switchable spontaneous polarization of the 3R-WS2 nanoflakes. Remarkably, after being preserved in air environment for three months, the 3R-WS2 nanoflakes still display a significant ferroelectric response, indicating the superior stability of the ferroelectric phase (Supplementary Fig. 7). The local switching spectroscopy in the OOP model was further conducted on 3R-WS2 nanoflakes to verify the ferroelectric polarization. Local PFM amplitude and phase hysteresis loops detected in 3R-WS2 nanoflakes are depicted in Fig. 3g, exhibiting a typical OOP ferroelectric polarization butterfly amplitude-voltage loop and a hysteresis loop with an evident 180° phase switch at room temperature. The butterfly and hysteresis loop maintained consistency after 6 cycles, indicating the robust ferroelectricity of 3R-WS2 nanoflakes (Supplementary Fig. 8). The hysteresis loops of ferroelectric 3R-WS2 under AC electric field were then measured via fabricating vertically stacked Au/3R-WS2/Au device, where \({E_{{3{{\rm{R}}}{\mbox{-}}{{\rm{WS}}}}_{2}}}\) is the effective electric field across the 3R WS2 layer (Supplementary Fig. 9a). For clarity, we compared the hysteresis loops for different electric field values and tested the stability characteristics of the hysteresis loops (Supplementary Fig. 9b–d). Through a comparative analysis of the ferroelectric polarization characteristics between our 3R-WS2 and 3R-MoS2, as detailed in Supplementary Fig. 10, it is revealed that 3R-WS2 demonstrates superior ferroelectric performance with enhanced polarization, a reduced coercive field, and notably lower leakage currents. All the above evidence unambiguously established that the spontaneous polarization primarily stems from the inherent ferroelectricity of the 3R-WS2 nanoflakes rather than external spurious noise, showing the promising applications for 2D ferroelectric retinomorphic photovoltaic devices.

Bulk photovoltaic effect of 2D ferroelectric 3R-WS2

To demonstrate the BPVE concept for in-sensor computing outlined in Fig.1b, a retinomorphic device structure based on 2D all van der Waals layer graphene/3R-WS2/graphene structure was fabricated (Fig. 4a). In this configuration, due to the high transmittance of graphene electrodes in the visible range, the setup permits direct measurement of photogenerated carriers with simultaneous electrically-controlled polarization. Such devices were prepared with mechanical exfoliation and controlled dry transfer method to vertically stack 2D 3R-WS2 with graphene electrode and the corresponding optical microscopy image shown in the inset of Fig. 4a. Additional details on device fabrication are delineated in the Methods section. Raman spectra of the materials are shown in Supplementary Fig. 12. The cross-sectional transmission electron microscopy (TEM) and EDS elemental mapping analysis distinguish W, S, and C components, thereby verifying the purity of the interface and the absence of interdiffusion at the van der Waals junction between 3R-WS2 and graphene (Fig. 4b).

Fig. 4: Switchable bulk photovoltaic effect in 2D 3R-WS2 based retinomorphic device.
figure 4

a Schematic diagram and optical microscope image illustrating the crossbar structure of the graphene/3R-WS2/graphene retinomorphic device. The blue and red spheres represent the sulfur and tungsten atoms for the crystal structure, respectively. The purple arrows indicate the direction of spontaneous polarization. b Cross-sectional TEM image and corresponding EDS element mapping of the graphene/3R-WS2/graphene interfaces. c, The characteristics I-V curve of positive and negative photovoltaic behavior under different poled voltage. d, e Illuminated I-V characteristics measured after applying positive and negative poling voltage to the graphene/3R-WS2/graphene retinomorphic device initialized by 2 V and −2 V pulses (pulse width: 0.5 ms), respectively and the black dotted arrow illustrates the different polarization direction. The excitation light wavelength is 623 nm and the light intensity is 20 mW cm2. f The energy band diagrams of graphene/3R-WS2/graphene in different polarization states under illumination, highlight the influence of ferroelectric polarization on the generation and movement of photogenerated carriers. The top and bottom graphene electrodes are represented by gray atoms, and the built-in electric fields are represented by orange arrows.

Next, we explored the generation of the photovoltaic effect under uniform light illumination of the 3R-WS2-based retinomorphic device. As demonstrated in Fig. 4c, under uniform illumination (wavelength: 623 nm, light intensity: 20 mW cm2), the I-V characteristics of the device exhibit an obvious photovoltaic effect, with negative Voc = −78 mV and positive short-circuit photocurrent (Isc)= 0.95 nA. The Isc and Voc can also be effectively switched by applying poling voltages in different directions. To assess the robustness of the device, we conducted cycling tests, and the results showed that after 2000 cycles of polarization switching, the distributions of Voc and Isc remained nearly unchanged (Supplementary Fig. 13). This indicates that the polarization switching of the 3R-WS2 photovoltaic device is highly durable, showcasing excellent stability and reliability under repeated operational conditions. In contrast, while similar devices based on 2H-WS2 nanoflakes show no photovoltaic phenomenon in the I-V measurement under different light intensities (Supplementary Fig. 14). It should be noted that the variation between various devices was characterized by measuring the photocurrent of devices composed of 3R-WS2 with different thicknesses (Supplementary Fig. 15), which all exhibited obvious photovoltaic behaviors. The ferroelectric polarization regulation of the graphene/3R-WS2/graphene photovoltaic effect was further measured by applying continuous poled pulses. Before applying continuous polling pulse, the preset pulse of 2 V or −2 V can be applied to set the polarization up or down, respectively. As illustrated in Fig. 4d, when a 2 V pulse is initially applied to the device, Voc of −0.2 V is obtained. As the negative voltage increases, Voc gradually changes from negative to positive value and Isc shifts downward, indicating that the polarization direction is gradually changing, thus influencing the direction of the built-in electric field. Conversely, when negative voltages are applied to the device in the -2 V polarization state, Voc gradually decreases from 0.2 V as illustrated in Fig. 4e. The gradual transition of photocurrent from negative to positive direction verifies the shift in ferroelectric polarization direction, which is responsible for the linear and continuously tunable photoresponse. In addition, the curves of Isc and Voc versus poled voltage form a well-defined hysteresis loop as depicted in Supplementary Fig. 16. The stability of Isc and Voc is further investigated across varying different polarization voltages, indicating that our photovoltaic device is fatigue-free and non-volatile (Supplementary Fig. 17). This observation further confirms the reversible control of polarization in modulating the photovoltaic response.

The physical mechanism of polarization control photovoltaic behavior can be understood through the switchable energy band alignments of the graphene/3R-WS2/graphene as illustrated in Fig. 4f. The polarization of ferroelectric materials can alter the Fermi level of graphene, thereby manipulating this asymmetric band structure and resulting in asymmetric barrier modulation. When the polarization is oriented upward, the Fermi level of the bottom graphene electrode shifts downward, increasing the contact barrier height, while the Fermi level of the top graphene ascends, reducing the contact barrier height. This scenario generates a downward built-in electric field (as indicated by the direction of the blue arrow), which enhances the separation and transport of photogenerated carriers under illumination. Thus this process leads to a higher accumulation of electrons on the top graphene electrode and diminishes the photocurrent. Conversely, when the polarization is oriented downward, the direction of the built-in electric field reverses. Due to the built-in electric field, more holes accumulate in the top graphene, culminating in an increase in photocurrent. In this way, the magnitude of the photocurrent is contingent on the intensity of the built-in electric field, which is governed by the state of ferroelectric polarization. To further directly quantify the Fermi level shift in graphene induced by the switching of the polarization field in 3R-WS₂, we performed Kelvin probe force microscopy (KPFM) to measure the surface potential variations. This approach enabled us to capture the change in the Fermi level of the graphene electrode on 3R-WS₂ as the polarization direction of the ferroelectric layer was reversed (Supplementary Fig. 18). Our results reveal a Fermi level shift of approximately 0.35 eV in the graphene electrode, corresponding to the switching of ferroelectric polarization in 3R-WS₂, providing direct evidence of the polarization-modulated electronic properties at the graphene/WS₂ interface.

Reconfigurable photoresponsivity for in-sensor computing

To achieve in-sensor computing with ferroelectric photovoltaic retinomorphic devices, the linear tunability of the photoresponsivity is necessary. The bandgap of 3R-WS2 facilitates effective absorption of RGB light, combined with its intrinsic ferroelectric polarization, enabling the reconfigurable ferroelectric bulk photovoltaic behavior observed in our retinomorphic devices. Initially, the photocurrent response of the 3R-WS2 based retinomorphic device under distinct wavelengths of light (RGB) was evaluated as depicted in Fig. 5a and Supplementary Fig. 21. As the light intensity increased from 1 mW cm2 to 200 mW cm2, it was observed that the photocurrent exhibited a linear increase, particularly showing a more pronounced photocurrent response under blue light (445 nm)(Fig. 5b). For retinomorphic hardware systems, the reliability of devices within neural networks is pivotal for attaining high computational accuracy. As illustrated in Fig. 5c and Supplementary Fig. 20, the photocurrent state of 3R-WS2 based retinomorphic device under non-polarization voltage is stable with more than 1000 s. This observation substantiates the nonvolatile nature of the photoresponsivity, which benefits from the stable ferroelectric characteristics of 3R-WS2.

Fig. 5: Photoresponse characteristics of 2D 3R-WS2 based retinomorphic device under RGB wavelengths for in-sensor computing.
figure 5

a The I-V characteristics of the device under R (623 nm) wavelength with increasing light intensities (from 1 to 200 mW cm−2). b Light intensities dependence of the Isc of the 3R-WS2 retinomorphic device under different wavelengths. c Long-term stability of the photocurrent with different intensities (from 10 mW cm2 to 90 mW cm2) under different red light. d Positive and negative photoresponse under red light illumination tuned by different poled voltages (Light intensity increasing from 10 to 90 mW cm2). Light-intensity dependence of the photocurrents for the device with 28 different responsivities under positive (e) and negative (f) poled voltages (Pulse width: 1 s). g Photoresponsivity is a function of the number of poling voltages when a series of pulse numbers are applied consecutively under red light illumination. Comparison of Jsc (h) and Voc (i) of our 3R-WS2 with the bulk photovoltaic effect of various ferroelectric materials.

The linear dependence of photocurrent on light intensity is essential for in-sensor image processing, which needs further exploration. Figure 5d demonstrates the positive and negative photoresponses of the 3R-WS2 based retinomorphic device under polarization voltages in different directions (Light wavelength: 623 nm). It is desirable to have more tunable responsivity to represent pixels for convolutional processing. Benefiting from the gradually switching ferroelectric polarization state of 3R-WS2, both the enhancement and suppression processes of photoresponsiveness can be linearly regulated (Figs. 5e, f and Supplementary Fig. 23). The power-dependent Isc curves were plotted under different polarization voltages and fitted these curves with the formula IscPα. The fitting results show that under different polarization states, the extracted values of α are close to the ideal value of 1.0, exhibiting a linear correlation. Meanwhile, consistent photoresponsivity with minimal variation is crucial for improving machine vision calculation accuracy and efficiency, as it directly influences the weights used for in-sensor computing. To evaluate this, the photoresponsivity across 50 different 3R-WS2 ferroelectric photovoltaic devices under both positive and negative ferroelectric polarization was measured, which demonstrated high reproducibility and tunability of the photoresponsivity (Supplementary Fig 24, 25). By applying gradually increasing and decreasing polarization voltages, the asymmetric, reversible, and non-fluctuating modulation of the responsivity is achieved, which is also almost linear in the range of ±0.92 A W−1 (Fig. 5g). Notably, the responsivity value of 0.92 A W−1 is the highest reported so far (Supplementary Table 2). In addition, the 3R-WS2 based retinomorphic device exhibited a fast photoresponse under 623 nm illumination, with rise and fall times of 12.8 μs and 19.2 μs, respectively (Supplementary Fig. 26), showing the potential for fast photoresponse and indicating that the device has no obvious parasitic photomemory effect, which is crucial for the development of high-speed machine vision system. Finally, to demonstrate the advantages of our 3R-WS2 ferroelectric photovoltaics, we compared the photocurrent density (Jsc) and the relationship between Voc and optical power of different 2D ferroelectric and noncentrosymmetric materials devices BPVE in Fig. 5h, i. The photocurrent density can be expressed by the following: Jsc=Isc/A, A denoted effective sample area of our device, here is 50 μm2. By comparison, we found that the photocurrent density of our 3R-WS2 is better than that of 3R-MoS2, WS2 nanotube, the widely reported CuInP2S6 (CIPS), and MoTe2 under the same light power conditions13,36,37,38,39,40,41,42,43. Similarly, Voc values exceed those of currently reported ferroelectric 2D material. These results highlight the potential of our reconfigurable and nonvolatile retinomorphic device for enhancing in-sensor computing functions (Supplementary Table 2).

In-sensor convolution kernel processing

Ferroelectric photovoltaics-based linear photoresponsivity modulation and linear light intensity dependence of photocurrent, as demonstrated above, make it possible to realize hardware implementation of reconfigurable visual neural perception and image convolution processing. The image convolution processing workflow is outlined in Fig. 6a. Different convolution kernel configurations are attainable via varying polarization voltages, enabling diverse manipulations of the image. To validate the efficacy of the convolution process, an image (1918 × 1280 pixels) of the ‘Hive’ at Nanyang Technology University is transformed from a three-channel colorful image into a single-channel gray image. In this context, a reconfigurable 3 × 3 light responsivity array serves as a convolution kernel for sensing and processing the ‘Hive’ architectural images. By employing convolution kernels with distinct responsivity distributions, the detection and amalgamation of the X-axis and Y-axis edges of the image are performed, respectively (as demonstrated in Fig. 6b). This approach successfully accomplishes edge detection, with experimental outcomes aligning with simulation predictions. Moreover, the utility of our visual neural device extends beyond edge detection, showcasing promising applications in image sharpening (Supplementary Fig. 28). The compilation of computational results underscores the potential of reconfigurable ferroelectric retinomorphic devices for expedited computing in image recognition tasks.

Fig. 6: Implementation of convolutional processing and in-sensor CNN for RGB color-image classification.
figure 6

a Schematic diagram of the convolutional processing ‘Hive’ image. The photoresponsivity of the device can be used as an operator for kernel calculations, and the merging, normalization, and binarization of the output currents are completed in the software. b Demonstration of edge detection convolutional processing, and these operations are achieved by changing the polarization voltage to control the photoresponsivity of each pixel. The experimental results for different convolution operations are compared with simulation results. Image source: Nanyang Technological University. c Schematic diagram of the convolutional neural network mode of a color image classifier based on 3 × 3 kernels with three different color (RGB) channels. d Illustration of a randomly generated colored three-letter N, T, and U dataset without (σ = 0) and with Gaussian noise (σ = 0.1, 0.2 and 0.3) e Photoresponsivity distribution of different noise levels letters before training (initial) and after training (final) based on RGB-color CNN classification. f Classification accuracy and loss distribution of the classifier during training on data sets with different Gaussian noise levels.

In addition to the feature extraction processing of gray images, the photoresponse of ferroelectric photovoltaic retinomorphic device based on 3R-WS2 to RGB lights makes it possible to realize the CNN classification of color images. By constructing a convolutional neural network composed of 3 × 3 × 3 different RGB conventional kernels, 3 × 3 × 3 maximum pooling operators, and 9 × 3 fully connected neural networks, a complete neuromorphic visual system including retina and visual cortex is formed (Fig. 6c and Supplementary Fig. 29, 30). To demonstrate the recognition accuracy of the CNN network, as shown in Fig. 6d and Supplementary Fig. 3133, we constructed training and test data sets based on different Gaussian noise levels (σ = 0.1, 0.2 and 0.3), which contain letters of three RGB colors with 9 × 9 pixels of “N”, “T”, “U”. In each training epoch, a randomly selected set of 20 letters is optically projected onto the three cores, and the corresponding output photocurrent of each core is further nonlinearly activated through the Softmax function. The activated output updates the responsivity (weight) of each kernel by backpropagating the gradient of the loss function (Supplementary Note 3). Figure 6e shows the photoresponsivity distribution of images containing different noise levels before and after training. The accuracy of color convolutional neural network recognition was evaluated by classifying 100 letters selected from the test data set, as shown in Fig. 6f. Although adding noise will cause a slight decrease in the efficiency of color image recognition, the recognition accuracy can still reach 100% within 6 epochs, proving the successful classification of letters in RGB color images. Since the photoresponsivity of the device is regulated by the polarization state of the 3R-WS2 ferroelectric characteristics, the weights can be stored in the CNN without external fields and have nonvolatile response properties. Thus, the 3R-WS2-based retinomorphic system can perform self-powered image perception and classification tasks without energy consumption. In addition to the validation of in-sensor computing via the BPVE demonstrated in this work, further optimization of device structures and integration of device arrays are crucial for advancing the proposed concept toward practical applications. The integration of memory elements into 2D ferroelectric materials could facilitate the development of intelligent devices capable of performing in-sensor computing. Future advancements in the large-scale fabrication of 2D ferroelectric materials, such as large-area slip ferroelectric materials produced through seeded epitaxy, will also be instrumental in enabling large-scale integration of these devices44. When combined with progress in the controllable transfer of 2D materials, such as electrode array transfer techniques, these innovations could significantly contribute to the practical realization of in-sensor computing systems based on 2D materials45,46.

Discussion

In summary, we have implemented a reconfigurable and nonvolatile retinomorphic device that utilizes the BPVE properties of 3R-WS2 nanoflakes to achieve in-sensor computing MAC operation and conventional process color images. It is noteworthy that 3R-WS2 exhibits excellent piezoelectric coefficients and robust OOP ferroelectric properties. Such all van der Waals vertical retinomorphic device composed of graphene/3R-WS2/graphene structure exhibits multi-level nonvolatile photoresponses, and the photoresponsivities can be modulated by their polarization states, which can be used to realize convolution recognition processing of color images. We believe that the reconfigurable 3R-WS2 ferroelectric photovoltaic retinomorphic devices with in-senor computing functions can effectively achieve target recognition and low-power machine vision in autonomous robotics chips.

Methods

CVT synthesis of 3R-WS2

Bulk 3R-WS2 semiconductor is grown by the chemical vapor transport (CVT) method. A mixture of W and S powders in a 1:2 ratio, along with a little of WCl5, is put in a silica tube, which is then sealed under a high-vacuum ( < 10−2 Pa). Subsequently, the tube is loaded into a horizontal furnace with two zones, heated to 1050 °C and 1000 °C and held for 20 days. After 15 days, bulk shinny 3R-WS2 plates are obtained in the sealed tube.

SHG and STEM characterisations

The SHG signal was measured in the temperature range of 298 ~ 650 K using a spectrometer (Princeton Instrument HRS-750-MS) with a HAMAMATSU H12386-110 photomultiplier tube or an X50 objective (NA = 0.5). A horizontally polarized Ti: sapphire laser (wavelength 1040 nm) was used. Mechanical exfoliation of 3R- WS2 crystals on SiO2 substrate. Atomic resolution ADF-STEM imaging was performed on an aberration-corrected ARM200F equipped with an 80 kV cold field emission gun. The samples were prepared using the drop-casting method.

AFM, PFM, and KPFM measurement

The thickness, surface potential, and vertical piezoelectricity were performed using AFM (Cypher S, Asylum Research) with different modes. The AFM was conducted in AC mode, while the PFM was conducted in contact mode. The silicon tip, endowed with a force constant of 2.8 N m-1 and coated with a Pt/Ir conductive layer, was utilized for the PFM analysis. To facilitate photolithography and the measurement of ferroelectric hysteresis loops, 3R-WS2 nanoflakes were transferred onto a Cr/Au (5/25 nm) coated Si substrate, which was subsequently grounded through the application of carbon glue to attach a conductive cable. The measurement of piezoelectric response and imaging of ferroelectric domains employed an AC driving voltage, alternated between positive and negative to detect the piezoelectric vibrations and phase changes of the specimen. Conversely, for the hysteresis loop measurements and photolithography, a DC driving voltage was applied, enabling the reversal of polarization direction. For KPFM measurements, a graphene/3R-WS2/graphene structure was used to measure the surface potentials of the top electrode graphene and 3R-WS2. Before KPFM measurements, a bias voltage (2 and −2 V, respectively) was applied to the device to switch the ferroelectric polarization within 3R-WS2.

Device fabrication

Two-dimensional 3R-WS2 and graphene nanoflakes were isolated via a mechanical exfoliation technique, and a vertical device structure of graphene/3R-WS2/graphene was fabricated employing a controlled dry transfer method using Polyvinyl alcohol (PVA)/Polydimethylsiloxane (PDMS). Initially, multiple layers of graphene and 3R-WS2 were exfoliated from their respective bulk crystals using blue tape and subsequently transferred onto 300 nm SiO2/Si substrate. Subsequently, under microscopy, the target graphene material was identified, and its corresponding 3R-WS2 nanoflake was transferred onto the graphene using PVA/PDMS through an alignment transfer system. The graphene was then transferred as the top electrode utilizing the same technique. Standard electron beam lithography facilitated the patterning of electrodes, while electron beam evaporation coupled with a lift-off process was utilized to fabricate Cr/Au (5/25 nm) contact electrodes.

Electrical measurements

For the electrical characterization, fundamental electrical properties were assessed using a semiconductor analyzer (Keithley, 4200A-SCS). Pulse assessments were conducted utilizing an arbitrary waveform generator (Keysight B2912A). To facilitate light input, LED light sources with adjustable intensity and wavelength were employed, corresponding to red (623 nm), green (525 nm), and blue (445 nm) spectra.

Preparation of datasets

For classification tasks, we generated four distinct sets of training and testing datasets, each subjected to varying levels of Gaussian noise (σ = 0, 0.1, 0.2, and 0.3). In the preparation of the training dataset, 1,000 images representing the letters N, T, and U were randomly produced. Subsequently, these images were further processed by the addition of colors (blue, green, red) and noise (corresponding to the specified σ values). Both the training and testing datasets were constructed utilizing Python.