Automatic detection system