Code release for Unsupervised Deep Transfer Learning for Intelligent Fault Diagnosis: An Open Source and Comparative Study by Zhibin Zhao, Qiyang Zhang, and Xiaolei Yu. The methods about multi-domains can be found in (https://github.com/zhanghuanwang1/UDTL_multi_domain)
- 2020.06.02, we modified the errors in util/train_utils_combines. (class_num --> num_classes).
This project just provides the baseline (lower bound) accuracies and a unified intelligent fault diagnosis library based on unsupervised deep transfer learning (UDTL) which retains an extended interface for everyone to load their own datasets and models by themselves to carry out new studies. Meanwhile, all the experiments are executed under Window 10 and Pytorch 1.3 through running on a computer with an Intel Core i7-9700K, GeForce RTX 2080Ti, and 16G RAM.
- Python 3.7
- Numpy 1.16.2
- Pandas 0.24.2
- Pickle
- tqdm 4.31.1
- sklearn 0.21.3
- Scipy 1.2.1
- opencv-python 4.1.0.25
- PyWavelets 1.0.2
- pytorch >= 1.1
- torchvision >= 0.40
Part of the code refers to the following open source code:
- CORAL.py from the paper "Deep CORAL: Correlation Alignment for Deep Domain Adaptation" proposed by Sun et al.
- DAN.py and JAN.py from the paper "Deep Transfer Learning with Joint Adaptation Networks" proposed by Long et al.
- AdversarialNet.py and entropy_CDA.py from the paper "Conditional adversarial domain adaptation" proposed by Long et al.
This repository is organized as:
- loss contains different loss functions for Mapping-based DTL.
- datasets contains the data augmentation methods and the Pytorch datasets for time and frequency domains.
- models contains the models used in this project.
- utils contains the functions for realization of the training procedure.
-
download datasets
-
use the train_base.py to test Basis and AdaBN (network-based DTL and instanced-based DTL)
-
for example, use the following commands to test Basis for CWRU with the transfer_task 0-->1
-
python train_base.py --data_name CWRU --data_dir D:/Data/CWRU --transfer_task [0],[1] --adabn ""
-
for example, use the following commands to test AdaBN for CWRU with the transfer_task 0-->1
-
python train_base.py --data_name CWRU --data_dir D:/Data/CWRU --transfer_task [0],[1]
-
use the train_advanced.py to test (mapping-based DTL and adversarial-based DTL)
-
for example, use the following commands to test DANN for CWRU with the transfer_task 0-->1
-
python train_advanced.py --data_name CWRU --data_dir D:/Data/CWRU --transfer_task [0],[1] --last_batch "" --distance_metric "" --domain_adversarial True --adversarial_loss DA
-
for example, use the following commands to test MK-MMD for CWRU with the transfer_task 0-->1
-
python train_advanced.py --data_name CWRU --data_dir D:/Data/CWRU --transfer_task [0],[1] --last_batch True --distance_metric True --distance_loss MK-MMD --domain_adversarial ""
Codes:
@misc{Zhao2019,
author = {Zhibin Zhao and Qiyang Zhang and Xiaolei Yu and Chuang Sun and Shibin Wang and Ruqiang Yan and Xuefeng Chen},
title = {Unsupervised Deep Transfer Learning for Intelligent Fault Diagnosis},
year = {2019},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/ZhaoZhibin/UDTL}},
}
Paper:
@article{zhao2019unsupervised,
title={Unsupervised Deep Transfer Learning for Intelligent Fault Diagnosis: An Open Source and Comparative Study},
author={Zhibin Zhao and Qiyang Zhang and Xiaolei Yu and Chuang Sun and Shibin Wang and Ruqiang Yan and Xuefeng Chen},
journal={arXiv preprint arXiv:1912.12528},
year={2019}
}