How AI and machine vision detects threats