Researchers from Laurentian University in Canada have created an artificial intelligence (AI) model that allows knitting robots to recreate fabric patterns simply by analyzing an image.
“Our paper addresses the challenge of automating knitting by converting fabric images into machine-readable instructions,” the researchers explained.

In order to enable a knitting machine to recreate a knitted fabric, a human currently has to examine the image and manually label each stitch and pattern so that it can understand what to do — a process that is not only time-consuming but that also demands expertise and precision.
To translate the images of knitted fabrics into precise instructions for knitting machines, the team created a two-step deep learning framework that mimics how a human might analyze and interpret fabric patterns.
The first step is called the generational phase, and it is when an image of the knitted fabric is converted into a simpler, clearer version that shows only the necessary parts of the pattern. This image focuses on the stitches than can be seen on the surface, and from it, the system then creates “front labels,” which serve as a blueprint for how the fabric was made.
With the second step, the AI model relies on the front labels to reveal the knitting instructions, including both the visible and hidden layers of stitches. These instructions are then formatted so that the knitting machines can directly understand and execute them.
The team trialed the AI model to recreate patterns for roughly 5,000 textile samples. “Our model attained an accuracy of over 97% in converting images into knitting instructions, significantly outperforming existing methods. The system effectively handled the complexity of multi-colored yarns and rare stitch types, which were major limitations in earlier approaches. In terms of applications, our method enables fully automated textile production, reducing time and labor costs,” the team noted.
Its developers suggest that automating the conversion of fabric images into knitting instructions can potentially streamline production, cut costs and enable on-demand manufacturing. Likewise, the technology could potentially enable the preservation and reproduction of culturally and historically important ancient textile designs and patterns.
The study, "Knitting Robots: A Deep Learning Approach for Reverse-Engineering Fabric Patterns," is published in the journal Electronics.
