Automatic detection, consistent mapping, and training