Fig. 4: Construction of the Nonlinear Neural Network.

a The process of spectral reconstruction: an unknown spectrum is incident on the photonic memristor, generating a nonlinear photoresponse. This data undergoes nonlinear regression preprocessing before being input into a custom-built nonlinear neural network for final spectrum prediction. b Loss curves for the training and validation sets. c Coefficient of determination (R2) for the training and validation sets, indicating the model’s fit. d The discrepancy between the photocurrent reconstructed from the spectral response matrix for narrowband stimuli and the measured reference photocurrent. e Introduction of a nonlinear regression curve, derived from the discrepancies between reconstructed and reference photocurrents. These values serve as nonlinear weighting factors to specifically enhance predictions during subsequent neural network processing