Spark

"Skyknit" AI creates its own hilarious knitting patterns

Janelle Shane writes comedy...using artificial intelligence. With her latest project, she trained an AI on a dataset of knitting patterns and asked actual knitters to knit 'em up.
Researcher and AI enthusiast, Janelle Shane, created Skyknit, an AI that makes knitting patterns.
Research scientist and neural network humourist, Janelle Shane. (Janelle Shane)

Janelle Shane likes to write humour...using artificial intelligence. She's trained AI to come up with unintentionally funny new names for paint colours, for instance. "Burf pink", anyone?

Neural networks are 'trained' by being exposed to large datasets, which they then try to create similar models of. The humour comes from the disconnect between what we humans would do and the imperfect approximation of the AI.

A recent project used machine learning to produce knitting patterns, though Shane herself didn't knit. The project was suggested by a knitter who was reading her blog. "I'd never even seen a knitting pattern," she explained. Looking them up, she found they were text-based, a help because her neural nets train on text, but "I could also see it was going to be a struggle."

I had to rely on all these knitters to tell me if these were even knitting patterns at all- Janelle Shane

She sought out the LSG forum on Ravelry, an online community for knitters, asked for help tracking down datasets of patterns, and then she set about training the AI.

Then it was time to see what came out of the neural network's designs.

Because she wasn't a knitter, Shane went back to the forum. "I had to again rely on...all these knitters who thought the project sounded like a lot of fun. I had to rely on them to tell me if these were even knitting patterns at all."

Seaweed stitch sock. (Emma Lehman)

The knitters submitted comments, and some tried their hand at knitting the designs.

Textile artist Emma Lehman wearing a piece she knit, based on the neural network's pattern. (Emma Lehman)

Emma Lehman is a freelance textile artist who participated in the knitting experiment. Like many of the knitters, she thought the AI's patterns were "hilarious".

"It's hard to explain to someone who doesn't knit...what makes it funny," Lehman said. "It reminds me a bit of when they ask pre-schoolers to write recipes. They kind of know that there are ingredients, but they don't know proportion, they don't know enough to write a recipe."

In order to turn the patterns into something viable, Lehman and the other knitters had to adapt the designs, a process Shane likened to debugging a computer program.

"Knitters are used to taking patterns that don't quite make sense and adjusting them to work," Lehman explained. And the end result of her knitting? "Some of them worked out pretty well, some of them, I had to fight with quite a bit to get anywhere at all, some of them I still haven't quite figured out how to make into a functional object."  

Emma Lehman's notebook, where she worked on 'debugging' Skyknit's patterns. (Emma Lehman)

The AI — which by now had been dubbed "Skyknit" — did improve over time, partly as a result of Shane deciding to train it on a dataset of simple, consistent swatches.

Some of them I still haven't quite figured out how to make into a functional object- Emma Lehman

"I eventually did come up with a version of Skyknit that could sometimes produce a valid pattern," she said. "There were a couple of patterns that didn't actually have any mistakes in them, or other patterns where the mistakes were not major, and for Skyknit, that is a resounding success."



You can read more about the project on Shane's blog, here, where you can also see some of the other knitters' creations.