Step 1: Calculate skin tone ratio of person
Step 2: If light skinned then assign person to bin "foreigner".
This will work in 99% of cases, so by one standard its a good algorithm that requires little effort to give valid results.
However, it's just encoded the bias that light skinned people can't be citizens, and thus fails for mixed children, refugees and the thousands multigenerational dependents of expats.
No one can really say computers are unbiased. They simply do what you tell them to do. In my opinion, we computer scientists and practicing engineers understand that, but the general population has the mystique that the machine is somehow more right than a person, simply because you can't see the person(s) who programmed the machine.