In the quest for emerging in-sensor computing, materials that respond to optical stimuli in conjunction with non-volatile phase transition are highly desired for realizing bioinspired neuromorphic vision components. Here, we report a non-volatile multi-level control of VO2 films by oxygen stoichiometry engineering under ultraviolet irradiation. Based on the reversible regulation of VO2 films using ultraviolet irradiation and electrolyte gating, we demonstrate a proof-of-principle neuromorphic ultraviolet sensor with integrated sensing, memory, and processing functions at room temperature, and also prove its silicon compatible potential through the wafer-scale integration of a neuromorphic sensor array. The device displays linear weight update with optical writing because its metallic phase proportion increases almost linearly with the light dosage. Moreover, the artificial neural network consisting of this neuromorphic sensor can extract ultraviolet information from the surrounding environment, and significantly improve the recognition accuracy from 24% to 93%. This work provides a path to design neuromorphic sensors and will facilitate the potential applications in artificial vision systems.