A method for detecting a needle in magnetic-resonance images, wherein a needle artifact and/or a needle location is identified by means of algorithms based on artificial intelligence within the context of machine learning. Also, corresponding apparatus, control facility, and magnetic resonance tomography system.