A photodetector with a front surface (111, 211) and a back surface (112, 212), wherein the photodetector comprises a silicon substrate (12, 22) with a corresponding front surface (121, 221) and a corresponding back surface (122, 222), and the silicon substrate (12, 22) comprises one or more field-effect transistor pixels which comprise: - a source region (13S, 23S) on the front surface (121, 221) of the silicon substrate (12, 22) and a conductive source electrode (14S, 24S) connected to the source region (13S, 23S), - a gate region (13G, 23G) on the front surface (121, 221) of the silicon substrate (12, 22) and a conductive gate electrode (14G, 24G) connected to the gate region (13G, 23G), - a drain region (13D, 23D) on the front surface (121, 221) of the silicon substrate (12, 22) and a conductive drain electrode (14D, 24D) connected to the drain region (13D, 23D), - a transistor channel region (15, 25) encompassing the source, gate and drain regions on the front surface of the silicon substrate, wherein the silicon substrate (12, 22) has been doped to a first conductivity type in the transistor channel region (15, 25), - a transistor well (16, 26) encompassing the transistor channel region on the front surface (121, 221) of the silicon substrate, wherein the silicon substrate (12, 22) has been doped to a second conductivity type in the transistor well (16, 26), characterized in that - the one or more field-effect transistor pixels further comprise a cavity (171, 271) extending from the back surface of the silicon substrate to the transistor channel region (15, 25), wherein the top of the cavity comprises a photoactive layer (18, 28) which is in contact with the transistor channel region (15, 25) and configured to generate a photovoltage at the interface between the photoactive layer (18, 28) and the transistor channel region (15, 25), and wherein the cavity (171, 271) also comprises an at least partly transparent encapsulation layer (19, 29) overlying the photoactive layer (18, 28) in the cavity, and that - one or more openings (172, 272) in the back surface (112, 212) of the photodetector are aligned with one or more field-effect transistor pixels and allow electromagnetic radiation to reach the cavity (171, 271) in the one or more field-effect transistor pixels. - a source region (13S, 23S) on the front surface (121, 221) of the silicon substrate (12, 22) and a conductive source electrode (14S, 24S) connected to the source region (13S, 23S), - a gate region (13G, 23G) on the front surface (121, 221) of the silicon substrate (12, 22) and a conductive gate electrode (14G, 24G) connected to the gate region (13G, 23G), - a drain region (13D, 23D) on the front surface (121, 221) of the silicon substrate (12, 22) and a conductive drain electrode (14D, 24D) connected to the drain region (13D, 23D), - a transistor channel region (15, 25) encompassing the source, gate and drain regions on the front surface of the silicon substrate, wherein the silicon substrate (12, 22) has been doped to a first conductivity type in the transistor channel region (15, 25), - a transistor well (16, 26) encompassing the transistor channel region on the front surface (121, 221) of the silicon substrate, wherein the silicon substrate (12, 22) has been doped to a second conductivity type in the transistor well (16, 26), - the one or more field-effect transistor pixels further comprise a cavity (171, 271) extending from the back surface of the silicon substrate to the transistor channel region (15, 25), wherein the top of the cavity comprises a photoactive layer (18, 28) which is in contact with the transistor channel region (15, 25) and configured to generate a photovoltage at the interface between the photoactive layer (18, 28) and the transistor channel region (15, 25), and wherein the cavity (171, 271) also comprises an at least partly transparent encapsulation layer (19, 29) overlying the photoactive layer (18, 28) in the cavity, and that - one or more openings (172, 272) in the back surface (112, 212) of the photodetector are aligned with one or more field-effect transistor pixels and allow electromagnetic radiation to reach the cavity (171, 271) in the one or more field-effect transistor pixels.