This repository contains the implementation and results for the [Classification / Anomaly Detection] task for Automobile Assembly Process.
The project focuses on classifying robot arm data into normal and defective categories. Unlike common datasets such as images or speech signals, this project aims to handle time-series data that includes specific metrics like force and torque, providing valuable experience in managing specialized tasks. The primary goal is to explore various methods and techniques, regardless of achieving optimal results.
The project utilized two types of data:
OK | NG |
---|---|
-
Action Data:
- Time-series data obtained from end-effector sensors on the robot arm, measuring forces (
Fx, Fy, Fz
) and torques (Tx, Ty, Tz
) in each direction at every timestep. - Data labels:
OK
: 0NG
: 1NG_+Z_inner_path
: 2NG_-X_Y_offset
: 3NG_-Z_outer_path
: 4NG_X_-Y_offset
: 5
- Time-series data obtained from end-effector sensors on the robot arm, measuring forces (
-
Sticker Image Data:
- Image data labeled as:
OK
: 0NG
: 1
- To be developed...
- Image data labeled as:
-
Action Data:
- Noise reduction using low-pass filters.
- Feature engineering, including rate of change of variables, angles between vectors, and vector directions.
-
Sticker Image Data:
- Resizing to match model input size.
- Standardization using pre-trained dataset statistics.
- To be developed...
-
Action Data:
- Classification
- LSTMClassifier
- GRUClassifier
- CNN1DClassifier
- TCNClassifier
- TransformerClassifier
- Anomaly Detection
- AutoEncoder (Linear)
- RNNAE (AutoEncoder based on LSTM)
- CNN1DAE (AutoEncoder based on Conv1D)
- Classification
-
Sticker Data: To be developed...
- Baseline Models:
- Initial experiments with basic LSTM without preprocessing: Accuracy = 0.5.
- With Preprocessing:
- LSTM: Improved but not significant.
- CNN1D: Loss = 0.4472, Accuracy = 0.8077.
- Transformer-based model: Loss = 0.0591, Accuracy = 0.9231.
- Additional Features:
- Expanded features to 21 dimensions: Loss = 0.0679, Accuracy = 0.9423.
- Method:
- Used CNN1D-based Autoencoder trained only on normal data.
- Detected anomalies by evaluating reconstruction errors.
- Results:
- Optimal Threshold: 0.026091
- Precision: 0.8571
- Recall: 0.7000
- F1-Score: 0.7706
- Classification Task:
- Achieved high accuracy (0.9231) using Transformer models with preprocessing.
- Anomaly Detection:
- Demonstrated the potential of Autoencoder-based approaches for detecting anomalies.
- Clone the repository:
git clone https://github.com/Dexoculus/Anomaly-Detection-for-Car-Assemble-Process.git
cd Anomaly-Detection-for-Car-Assemble-Process
- Install required dependencies:
pip install -r requirements.txt
Make sure PyTorch and other dependencies (such as torchvision, yaml, matplotlib) are installed. Adjust the requirements as needed.
Also, My code uses a experiment_manager from: https://github.com/Dexoculus/PyTorch-Experiment-Manager
- Run the main code:
- main.py (for Classification task)
python main.py --config ./configs/classification_config.yaml
- anomal_main.py (for Anomaly Detection task)
python anomal_main.py --config ./configs/anomal_config.yaml
- Check the Result.
- Checkpoints: Stored in
./checkpoints/
by default. - Loss plots: Stored in the path you write in config if visualization is enabled.
- results files: Stored in the path you write in config if exporting is enabled.
- Logs: Training and validation logs displayed in the terminal.