The historic sale of an artwork generated by artificial intelligence has been marred by controversy, after the creator of the algorithm hit back at the company who profited.

‘Edmond de Belamy, from La Famille de Belamy’ sold for $US432,500 ($609,000) to an anonymous bidder at famous New York auction house Christie’s last week.

The AI-created work came from French art collective Obvious and used a machine-learning algorithm that scanned historical portraits to create a depiction of the fictional Belamy family.

It is an example of a ‘generative adversarial network’ (GAN) algorithm, which looks for patterns in a specified dataset and generates copies.

“It is an exciting moment,” Obvious said in a statement following the sale.

“Our hope is that the spotlight on this sale will bring forward the amazing work that our predecessors and colleagues have been producing.”

The $US432,500 price tag was much higher than the anticipated $US7,000 to $US10,000. In the same sale, an Andy Warhol piece sold for $75,000.

But right as the portrait was going under the hammer, a 19-year-old high school graduate was stirring up controversy on social media.

On Twitter Robbie Barrat posted a photo of ‘Edmond de Belamy’ alongside his own AI-created works.

“left: the "AI generated" portrait Christie's is auctioning off right now. right: outputs from a neural network I trained and put online *over a year ago*. Does anyone else care about this? Am I crazy for thinking that they really just used my network and are selling the results?”

Barrat on Twitter. Source: Twitter

Barrat, who titles himself as an artist working with artificial intelligence, had created the code used to generate Obvious’ work and posted it online via an open-source license.

“I've been trying to play it off and spin it positively - when news people have asked me about this event I usually just try and mention actual AI artists and say to check out their work instead, but this is *really* becoming incredibly upsetting,” he continued on his Twitter rant.

“Here's the code to the network they copied. If any of you guys want to make a quick $10,000 from my work, now is the perfect time,” he said, before sharing a link to his github profile.

Obvious did not deny it had used Barrat’s work in creating ‘Edmond de Belamy’ – rather it provided a screenshot of its message to Barrat earlier this year in which it made clear “we made use of some code of yours on github.”

Part of the conversation between Obvious and Barrat. Source: Twitter

Tech lead at Obvious, Hugo Caselles-Dupré, told The Verge that although the code used was mostly borrowed, his team still deserved credit.

“If you’re just talking about the code, then there is not a big percentage that has been modified,” he said. “But if you talk about working on the computer, making it work, there is a lot of effort there.”

In response, Barrat posted another screenshot of his conversation with Obvious, this time showing he had asked for credit in the piece.

The portrait itself is signed by “min G max D x [log (D(x))] + z [log(1 – D (G(z)))]” – part of the algorithm used.