Skip to content

Justin900429/3d-printer-anomaly-detect

Repository files navigation

3D-Printer Anomaly Detection

cover image

Introduction

This project is to design a system for detecting the anomalies during the printing process. We collect our own dataset with a RPI and a Ender 3 pro. This project mainly consists three components - RPI, User application, and Linebot. Users can setup these three components to start using our projects.

Installation

# Download the weights
$ wget -O weights/resnet.onnx https://github.com/Justin900429/3d-printer-anomaly-detect/releases/download/v0.0.1/resnet.onnx
$ wget -O weights/resnet.pt https://github.com/Justin900429/3d-printer-anomaly-detect/releases/download/v0.0.1/resnet.pt
$ wget -O weights/resnet.pt https://github.com/Justin900429/3d-printer-anomaly-detect/releases/download/v0.0.1/quantized.pt


# Install the python package
$ pip install -r requirements.txt

Run file

RPI

Before using our project, users should install OctoPrint first

$ pip install opencv-python
$ python send_image.py

Backend

$ python backend/main.py

Linebot

We use ngrok to host our linebot server, users can use Heroku as well

$ export FLASK_APP=app.py
$ flask run

Dataset

We upload our data to kaggle.

Model

Performance

Training method Acc UF1 Model size
Meta Learning 100% 1.0 85.3 MB
Quantization aware training 100% 1.0 21.5 MB

Inference Speed

We test the inference speed with CPU on MacBook Pro 2020 by averaging the 10 samples' runtime

Model Avg. inference time
PyTorch 0.2544 s
ONNX 0.0382 s
Quantization (PyTorch) 0.0356 s

Notebook

Usage Link
Meta Learning Open In Colab
Quantization Open In Colab