A system (1) for controlling an automatic milking system (2), configured for automatically receiving, identifying and selectively milking a lactating animal in accordance with a set of milking parameters associated with the animal. The system comprises a thermal imaging device (3), configured for generating at least one current thermal image of at least a portion of an udder of the animal, a storage device (4), configured for storing at least one reference thermal image of the udder, and a processing device (7), configured for comparing at least one current value derived from the at least one current thermal image and/or at least one current thermal image with at least one reference value derived from the at least one reference thermal image and/or at least one reference thermal image. The processing device is arranged to selectively provide a status indication of the animal in response to a result of the comparison.