So, I have been reading about the Mercy Dogs of WWI and WWII. I was wondering, how did they actually train dogs to know which soldier belonged to their 'side', and which soldier belonged to the 'enemy side'? Is there sort of an algorithmic way to do it? Perhaps facial features, and/or uniform? I would like to know how they did it, and if there is sort of an algorithmic way to do it, for an AI project I have.
Not to My Knowledge
Speaking mostly for WWI, where my expertise is, there wasn't any discreet training to differentiate between friendly/enemy soldiers in any of the Major Powers that I know of. What, say, Romania was doing with dogs I have no idea. But as far as England/France/Germany etc were doing no, no differentiation. That being said, dogs can be VERY literal at times. So if all your training is "teach dog to recover man in British Uniform" they are more likely to recover a British solider than, say, a German or even a Frenchman.
For example, in the wiki you cited it says that German dogs were trained to grab a belt/helmet. If a German mercy dog comes across a wounded German and a wounded Frenchman, if all else is equal he'll likely grab the German first because he'll go "ah, I see that guy has the helmet I know how to grab! I will grab him and Be The Goodest Boy!" But to my knowledge there was no training given to dogs to intentionally AVOID recovering soldiers of opposing powers.
Also while it's hard to prove a negative, I would be shocked if any of the major powers tried to train dogs specifically NOT to recover anybody not wearing their uniform. Both the Brits and French had colonial troops and others with very nonstandard uniforms. The more Yes/No you have to teach a dog the harder it is. And every major power generally treated all wounded based on severity of injury and not nationality. (though admittedly that held less true for minorities because the world is garbage) You might bring the enemy's wounded in after you collected your own, but you're still getting them. Wasting time training a dog to disregard the enemy (and risking making him miss your OWN wounded) seems like a counterproductive waste of resources. Recovering enemy wounded is still depriving the enemy of a soldier after all! Even if he's a cripple afterwards and gets sent home he's a drain on the enemy economy/morale.
You might argue that dogs would be more likely to respond to people who speak their language (An English dog might go to a man saying "come here good boy" in English over someone saying the same thing in German). But again that'd be incidental and not part of training the Mercy Dog. For instance to my knowledge no country had a "command word" that a wounded man was supposed to say to get the dog to come/recover him.