Sure, but that’s not deterrence anymore. The question there is less “will it work” and more “is this morally justifiable?” especially given the concerning proximity to eugenics (which started off as eliminating crime by eliminating people with “crime genes”).