The invention provides for a medical instrument (100, 400) comprising a medical imaging system (102, 402) configured for acquiring medical imaging data (432) from a subject (108); a subject support (110) configured for supporting the subject during acquisition of the medical imaging data; and an optical imaging system (114, 114') configured for acquiring optical imaging data (134) of the subject on the subject support. The execution of the machine executable instructions causes a processor (122) controlling the medical instrument to: control (200) the optical imaging system to acquire the optical imaging data; generate (202) the initial vector (136) using the optical imaging data; generate (204) the synthetic image by inputting the initial vector into a generator neural network; calculate (206) a difference (140) between the synthetic image and the optical imaging data; and provide (208) a warning signal (142) if the difference differs by a predetermined threshold. The generator neural network is trained to generate a synthetic image (138) of the subject on the subject support in response to inputting an initial vector.