DETECTING 3D PRINTING FAILURES WITH AI AND COMPUTER VISION

Additive Manufacturing (AM), commonly known as 3D printing, has rapidly grown in popularity, both for prototyping and manufacturing final products. Among AM techniques, Fused Deposition Modeling (FDM) is the most widespread, thanks to its ease of use and cost-effectiveness, as well as support for a wide range of materials. However, FDM remains imperfect, commonly facing defects that affect print quality or make the final product completely unusable.

Motivated by these recurring issues in FDM, I conducted this research as part of my graduation project for the MSc in Computer Science at the University of Twente. The project took place from September 2024 to April 2025 at the Fraunhofer Innovation Platform for Advanced Manufacturing at the University of Twente. I carried out the work under the supervision of Dr. Ir. Alex Chiumento, Prof. Dr. Mariëlle I.A. Stoelinga, and Ir. Reinier Stribos. Their guidance and expertise helped me in shaping a focused investigation into real-time defect detection using AI and computer vision.

 

One very common error is the spaghetti defect (see Figure 1). This failure occurs when printed parts detach mid-process, causing semi-liquid filament to be extruded into the air instead of attaching to the previous layer. This results in a mess of curled-up filament resembling spaghetti, hence the name. If the printer is not stopped, this mess can turn into a “blob of death”, where built-up filament forms around the print head, sometimes damaging hardware and potentially requiring costly repairs (see Figure 2).
 

Smart Detection with AI (YOLO11)
Catching a defect early is the best way to prevent wasted filament, time, and possible damage to hardware. Traditional methods rely on sensor data or fixed thresholds, but modern solutions make use of AI and computer vision.

By using a camera with a computer vision algorithm, 3D printers can identify defects as they occur and respond in real time, without the need for human intervention. In my research project, I explored spaghetti defect detection by using one of the most advanced real-time detection algorithms currently available: YOLO11.

 

Additionally, an experiment was conducted using a Low-Light Image Enhancement (LLIE) algorithm to see if it impacted detection performance in low-contrast scenarios, such as when using black filament.

You Only Look Once (YOLO) is a state-of-the-art object detection algorithm, known for its high speed and precision. It can not only determine whether an image contains a spaghetti defect, but also where that defect is present. Figure 3 shows YOLO11 detecting multiple spaghetti defects.

 

The Print Failure Stopping Metric
Traditional evaluation metrics, such as accuracy and F1-score (a measure of predictive performance), show how well the model performs on individual image frames. This is good for evaluating overall performance, but it does not consider the entire printing process. For this reason, this work introduced the Print Failure Stopping Metric (PFSM), providing a way to show how a detection system would behave during an actual print.

The PFSM simulates what would happen if a printer were to stop after a number of consecutive frames with detected defects. For example, the printer might be set to stop after three consecutive frames containing detected spaghetti defects. By comparing whether the printer would have stopped and should have stopped, the PFSM provides an easy way to analyze how the system would behave in practice.

Besides simulating real-world performance, the PFSM helps fine-tune the trade-off between stopping unnecessarily – false positives (FPs) – and failing to stop when a defect occurs – false negatives (FNs). Higher stopping thresholds reduce FPs, but might miss real defects. In contrast, lower thresholds catch more defects, but may stop the print when no real issue occurs. By analyzing the system’s behaviour across different stopping thresholds, the optimal balance can be achieved.

 

Results
To evaluate the detection performance, the YOLO11-based approach was compared against the open-source Obico implementation, which is built using an older YOLOv2 model (https:// github.com/TheSpaghettiDetective/ obico-server). The results showed that YOLO11 outperformed Obico across all tests:

These improvements demonstrate that YOLO11 has strong generalizability and robustness, not only performing better in low-contrast scenarios, but also effectively detecting defects in unseen environments.

Using the PFSM metric, a major improvement in real-world stopping behaviour was observed. The YOLO11 model obtained significantly fewer false positives, while correctly detecting more defects. This means less material waste and hardware damage while having fewer unnecessary stops.

Lastly, the effect of LLIE was tested on the low-contrast dataset. However, no improvement was observed. This highlights that YOLO11 already handles such scenarios well, without the need of LLIE.

 

 

Looking ahead
This research shows that upgrading to the latest YOLO version can bring a significant performance increase to spaghetti defect detection in 3D printers, reducing wasted material and time. This performance increase can be seen not only in the dataset collected for this work, but also in unseen environments, demonstrating the model’s generalizability and robustness.
In low-contrast environments, LLIE showed no significant improvements. However, alternative solutions to improve in this area should be explored. Depth-based imaging techniques, such as using LiDAR or stereo vision, could provide more reliable data for detection by capturing the three-dimensional structure, reducing dependence on two-dimensional image contrast.

Leenheer IT
After finishing this research, I founded Leenheer IT, where I work as a consultant focused on applying machine learning to real-world problems. Whether it’s using computer vision to detect 3D printing defects or exploring entirely different use cases, I enjoy finding practical ways to use modern AI.

If you are interested in integrating AI into your product or workflow, feel free to reach out. I am always open to discussing ideas and collaborations in applied AI and machine learning. You can contact me at bart@leenheer-it.nl.

Bart Leenheer’s full thesis is available here: https:// purl.utwente.nl/essays/106149

Back to FIFTEENTH ISSUE
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.