According to the developers, the algorithm was able to make the guess based on looking at a picture of a face.
It was correct in determining a man’s sexuality 81 per cent of the time, and a woman’s 74 per cent of the time.
When given five pictures of the same person, the guess was correct 91 per cent of the time in men and 83 per cent for women.
In comparison, human guesses were less accurate, correctly guessing a man’s 61 per cent of the time and a woman’s 54 per cent of the time.
According to the researchers, the AI was trained by using pictures of 36 630 men and 38 593 women sourced from the online dating profiles of gay and straight people.
Researchers told The Economist they believe that the algorithm was able to detect differences in facial structures that could possibly relate to hormone levels that foetuses are exposed to in the womb, such as testosterone, which is thought to determine sexuality.
With the rapid advances occurring in facial recognition technology making it speedier, more reliable and accurate, it is being used more and more as security features in smartphone technology and by governments to tackle crime.
However, in countries where homosexuality is still illegal and with an increase in hate crimes in recent times, this new found technology could put gay people at risk.
While researchers said that AI was less reliable outside of the confines of the experiment, they admitted that when asked to pick people it was most confident were gay, it was right nine times out of ten.