Skip to content

Latest commit

 

History

History
82 lines (64 loc) · 6.02 KB

README.md

File metadata and controls

82 lines (64 loc) · 6.02 KB

Relational based Transfer Learning for Automatic Optical Inspection based on domain discrepancy

license Open In Colab SPIE

Abstract

Transfer learning is a promising method for AOI applications since it can significantly shorten sample collection time and improve efficiency in today’s smart manufacturing. However, related research enhanced the network models by applying TL without considering the domain similarity among datasets, the data long-tailedness of a source dataset, and mainly used linear transformations to mitigate the lack of samples. This research applies relational-based TL via domain similarity to improve the overall performance and data augmentation in both target and source domains to enrich the data quality and reduce the imbalance. Given a group of source datasets from similar industrial processes, we define which group is the most related to the target through the domain discrepancy score and the number of samples each has. Then, we transfer the chosen pre-trained backbone weights to train and fine-tune the target network. Our research suggests increases in the F1 score and the PR curve up to 20% compared with TL using benchmark datasets.

Keywords: machine vision, automatic optical inspection (AOI), transfer learning, domain similarity, data augmentation, supervised learning, domain adaption.

Requirements

  • If you plan to run inferences in your local machine using YOLOv5, please follow the instructions provided by Ultralytics

  • Else, please write the commands below:

conda create -y --name RTLAOI-DD --file requirements.txt 
conda activate RTLAOI-DD
pip install thop>=0.1.1 opencv-python>=4.1.1

You can also find all notebooks available in Google Colab. Please click on them, and you will find a link to see them.

Description

This repository complements the research paper presented in SPIE COS Phonotics Asia 2022

We included a short version of the full-sized dataset for your reference. Unfortunately, we cannot share the full-size dataset, so the results obtained using it may not fit the same as the ones presented in the paper.

Domain_similarity.ipynb

This Jupyter notebook contains a demonstration of how we calculated the Earth Mover’s Distance for domain discrepancy estimation from stratch. It is available in Google Colab too.

Open In Colab

Weights & Biases report

We prepared reports for the Domain Adaption section:

Target Source F1-score PR-score W&B
DC-1 NJ-101 [email protected] 0.741 [email protected] link
DC-1 JY-381-2 [email protected] 0.285 [email protected] link
DC-1 LC-101 [email protected] 0.754 [email protected] link
DC-1 XH-1 [email protected] 0.76 [email protected] link
JY-381-4 JY-381-2 [email protected] 0.777 [email protected] link
JY-381-4 LC-201 [email protected] 0.891 [email protected] link
JY-381-4 NJ-201 [email protected] 0.726 [email protected] link
NJ-101 XH-1 [email protected] 0.698 [email protected] link
NJ-101 LC-101 [email protected] 0.644 [email protected] link
XH-4 LC-201 [email protected] 0.408 [email protected] link
XH-4 NJ-201 [email protected] 0.423 [email protected] link
XH-4 XH-3 [email protected] 0.396 [email protected] link

Implementation details

Our experiments were performed on a PC with an Intel(R) Core(TM) i5-10400F 2.90GHz CPU and an NVIDIA RTX 3060 GPU. Regarding neural network models, we utilized YOLOv5 because it offers model scaling, is easy to implement and modify. Its architecture loads pre-trained weights in COCO from their respective official repositories. This model was trained with a batch size of 11 on a single GPU for 50 epochs.

Additional information about labels

Our datasets contain labels in Chinese, so we decided to translate them into English for research purposes. The chart below shows the changes we made.

Defects Original name
white crack _bailiewen
standard chipping _biaozhunbengque
standard crack _biaozhunliewen
chamfer _daojiao
multifaceted _duocengmian
crystallization _jiejing
contour chipping _lunkuobengque
superficial chipping _mohubengque
ambiguity _molengliangke
plane chipping _pingmianbengque
light inking _qianmo
triangular row _sanjiaolie
bump _tudian
fine cracks _xixiaoliewen
impurities _zazhi
chipping bengque
abnormal chamfer daojiaoyichang
crack liewen
gas hole qikong
stains wuzi