I just finished reading War and Nature: Fighting Humans and Insects with Chemicals from World War I to Silent Spring by Edmund Russel.
In his book he suggests the it wasn't until World War I that humans started using derogatory terms for enemies, often comparing them to vermin, pests, etc.
Is this true? Are their instances of enemies being compared to insects, pests, etc before World War I?
The Northern soldiers in the civil war called Southerners "Greybacks" which was also the nickname for body lice. I think the metaphor is common, in all historical periods, but also I don't think it is a sign that soldiers managed to ever see the enemy as not-human.
I would point to the Ancient Greeks, Socrates described barbarians (anyone who didn't live in a Greek city state) as equal to slaves as they have no discernible class system and was very clear about his views on why they should be eliminated.
Unrelated to the Greeks there's a great book called "What its like to go to war" by Karl Marlantes about his time in Vietnam that has a great explanation of how soldiers use pseudospeciation (spelling?-basically giving you're enemy a made up name/species) to dehumanise the enemy and to an extent justify the killing to themselves