Abstract Introduction and aims Narrowband ultraviolet B therapy (NB-UVB) is an effective treatment for psoriasis. Currently, NB-UVB is delivered in whole-body cabinets to all of the patient’s skin, thus increasing the risk of normal skin sunburning and the potential risk of skin cancer development. This limits the NB-UVB doses that can be used and requires patients attend sessions three times weekly for up to 10 weeks in order to complete treatment. An artificial intelligence (AI)-mediated, targeted NB-UVB approach would avoid these risks and allow use of higher NB-UVB doses for the areas of the skin affected by psoriasis. We sought to train an artificial neural network on digital images of psoriasis, and subsequently test this trained model in order to assess its accuracy at distinguishing psoriasis from unaffected skin. Methods Overall, 104 digital images of psoriasis from 14 patients with this skin condition, who attended the dermatology department at University Hospital Southampton NHS Foundation Trust, were used to train a conditional generative adversarial network– ‘pix2pix’. Areas of psoriasis were delineated within the images prior to the images being augmented by randomly cropping, rotating and altering colour intensity, thereby increasing the total number to 23 111 images to train and test the neural network. Results The trained neural network was able to identify psoriasis in unseen digital images with 96.73% accuracy at the pixel level across the dataset. The output of the neural network (i.e. a computer-generated image of psoriasis) acted as a signal source for a digital micromirror device (DMD) that was able to shape visible light and project this light over the original image of psoriasis, while avoiding the uninvolved skin. Conclusions It is possible to differentiate psoriasis from unaffected skin within digital images using an artificial neural network. We demonstrated that AI-mediated targeted phototherapy using a DMD is feasible.