Training a YOLOv11 Nano Model for 3D Printing Error Detection
As shown in the previous posts, one of the approaches being explored for the error detection subsystem of AutoPrint is Obico, a commercial/open-source monitoring solution that uses AI to detect failures during 3D prints.
However, in order to compare different options for this part of the system, we are also exploring a more custom machine learning approach based on YOLOv11 nano and a custom-filtered dataset. This allows us to test whether a model trained specifically for selected 3D printing error classes could be a viable alternative for automatic error detection.
During this phase of the project, we focused on exploring this custom computer vision solution for detecting errors during 3D prints.
This was an important step because one of the goals of AutoPrint is not only to start and remove prints automatically, but also to understand when something has gone wrong during the printing process.
To do this, we tested a solution based on YOLOv11 nano, using an existing 3D printing error dataset that was filtered to focus only on the most relevant error classes.
The goal is to later compare this approach with the Obico-based solution and decide which option is more suitable for the final version of the error detection subsystem.
1. Objective of the YOLOv11 Nano Approach
The main objective was to evaluate whether a trained object detection model could identify visible printing failures from camera images.
For our project, this is especially relevant because the system should eventually be able to make decisions based on the state of the print. For example, if a serious error is detected, the system could pause the print, notify the user or prevent the next automatic step from starting.
The error classes selected for this first experiment were:
- Spaghetti
- Stringing
- Warping
- Bed Adhesion
These classes were chosen because they represent common and relevant problems in 3D printing. Some of them, such as spaghetti or bed adhesion failures, can completely compromise the print and should be detected as early as possible.
2. Dataset Selection and Filtering
To train the model, we used a public dataset from Roboflow that already contained annotated images for 3D printing error detection.
Since the original dataset contained more classes than needed for this first stage, we filtered it to keep only the selected classes:
- Spaghetti
- Stringing
- Warping
- Bed Adhesion
This filtering step was useful for two main reasons.
First, it made the initial training process simpler, because the model did not need to learn too many classes at once. Second, it allowed the experiment to focus on the types of errors that are more relevant for the autonomous printing workflow.
After filtering, the dataset was exported in a format compatible with YOLOv11 nano, including the images, labels and configuration files needed for training.
3. Model Training
The model was trained using Google Colab, since it provides access to better computational resources, including GPU acceleration.
This was important because the Raspberry Pi is intended to be used mainly for inference in the final system, not for training the model.
The general training procedure included:
- Importing the filtered dataset into the training environment
- Checking the dataset structure
- Confirming that the selected classes were correctly included
- Configuring the YOLO data file
- Training the YOLOv11 nano model
- Validating the model after training
- Testing the trained model on example images
A lightweight YOLOv11 nano model was selected because the final goal is to run the trained model on hardware with limited resources, such as a Raspberry Pi.
This choice helps balance detection performance with computational efficiency.
4. Testing the Trained Model
After training, the model was tested using validation images and example images from the dataset.
The goal was to verify whether the model could correctly detect the selected printing errors and place the bounding boxes around the relevant areas of the image.
At this stage, the analysis was both quantitative and visual.
The training process produced performance metrics, but it was also important to visually inspect the predictions. This helped us understand whether the detections made sense in practice and whether the model was actually identifying the problematic regions of the print.
The tests focused on checking:
- Whether the predicted class was correct
- Whether the bounding box matched the visible error
- Whether the model produced false positives
- Whether some visible errors were missed
- Whether some classes were easier to detect than others
This step is important because, in an autonomous system, wrong detections can lead to wrong decisions. A false positive could pause a print unnecessarily, while a false negative could allow a failed print to continue wasting material.
5. Relevance for the AutoPrint System
The YOLOv11 nano approach is relevant for AutoPrint because it gives us more control over the error detection process.
Unlike a commercial or pre-built solution, a custom model can be adapted to our own needs. We can choose the classes, modify the dataset, test different model versions and improve the system over time using images collected from our own printers.
In the future, this model could be integrated with the Raspberry Pi and the rest of the AutoPrint system.
A possible workflow would be:
- The camera captures images during the print
- The Raspberry Pi runs the YOLOv11 nano model on those images
- The model detects possible printing errors
- The prediction, confidence level and image are saved
- The system decides whether to continue, notify the user or pause the print
This would make the computer vision module part of the decision-making process of the automatic printing system.
6. Limitations and Next Steps
Although this approach is promising, there are still some limitations.
The main limitation is that the model was trained using a public dataset. This means that the images may not fully represent the real conditions of our own setup, such as the camera angle, lighting, printer model, filament type or print geometry.
Because of this, the next important step is to test the model with images captured directly from our own printer.
Another limitation is the computational performance on the Raspberry Pi. Even though a lightweight YOLOv11 nano model was selected, we still need to test whether inference is fast enough for the project requirements.
However, since print error detection does not necessarily require real-time video analysis, it may be enough to analyse one image every few seconds or at specific moments during the print.
Future improvements may include:
- Collecting our own images during real prints
- Adding those images to the dataset
- Retraining the model with more representative data
- Testing the model directly on the Raspberry Pi
- Integrating the prediction results with the backend or control application
- Defining automatic actions based on the detected error and confidence level
Conclusion
This phase allowed us to explore a custom AI-based solution for detecting 3D printing errors.
By using YOLOv11 nano and a custom-filtered dataset focused on relevant classes, we were able to train and test a first model capable of identifying errors such as spaghetti, stringing, warping and bed adhesion problems.
This approach is important for AutoPrint because it can become a flexible and adaptable error detection layer. In the future, it may allow the system to analyse images during a print and make decisions based on the detected problem.
Although further testing with real images from our own printer is still necessary, this work created a solid foundation for integrating machine learning-based error detection into the AutoPrint prototype.
Together with the Obico-based tests, this work will help us compare a ready-to-use monitoring solution with a more custom machine learning approach, allowing us to decide which option is more suitable for the final error detection subsystem.