Now when the robots destroy us, they can do it was a smile.

Facebook’s artificial intelligence lab has developed an AI robot that can express emotion.

The AI machine watched 250 Skype recordings to learn how human facial expressions can change in response to each other. To make it easier for itself, the AI split up the face into 68 “landmarks” to help it detect both large and small changes in expression.

“Even though the appearances of individuals in our dataset differ, their expressions share similarities which can be extracted from the configuration of their facial landmarks,” the researchers explained in a paper spotted by New Scientist.

Researchers then had the bot watch a video of a human speaking and had it chose what facial response would make the best response. So if the human laughed the bot might throw its head back or open its mouth.

Next, the AI was tested on a group of humans who watched its reactions to a human alongside an actual human reacting to a human — the panel agreed that the bot’s expressions appeared as natural as the human.

The researchers hope to eventually design a robot that isn’t in the “uncanny valley” – which describes the creepy or uncomfortable feeling you get when looking at something that seems human, but isn’t quite right.

They’ll present their findings at the International Conference on Intelligent Robots and Systems in Vancouver, Canada, at the end of September.