Git Product home page Git Product logo

tl-bearing-fault-diagnosis's Introduction

Transfer learning for Fault Diagnosis

Introduction

This repository is an open-source library for cross-domain fault diagnosis, including Single-source Unsupervised Domain Adaptation (SUDA) and Multi-source Unsupervised Domain Adaptation (MUDA) methods.

Supported Methods

  • ACDANN - Integrating expert knowledge with domain adaptation for unsupervised fault diagnosis. [TIM 2021] [Code]
  • ADACL - Adversarial domain adaptation with classifier alignment for cross-domain intelligent fault diagnosis of multiple source domains. [MST 2020] [Code]
  • BSP - Transferability vs. discriminability: Batch spectral penalization for adversarial domain adaptation. [ICML 2019] [Code]
  • CDAN - Conditional adversarial domain adaptation. [NIPS 2018] [Code]
  • CORAL - Deep coral: Correlation alignment for deep domain adaptation. [ECCV 2016] [Code]
  • DAN - Learning transferable features with deep adaptation networks. [ICML 2015] [Code]
  • DANN - Unsupervised domain adaptation by backpropagation. [ICML 2015] [Code]
  • IRM - Invariant risk minimization. [ArXiv] [Code]
  • MCD - Maximum classifier discrepancy for unsupervised domain adaptation. [CVPR 2018] [Code]
  • MDD - Bridging theory and algorithm for domain adaptation. [ICML 2019] [Code]
  • MFSAN - Aligning domain-specific distribution and classifier for cross-domain classification from multiple sources. [AAAI 2019] [Code]
  • MSSA - A multi-source information transfer learning method with subdomain adaptation for cross-domain fault diagnosis. [Knowledge-Based Systems 2022] [Code]
  • MixStyle - Domain generalization with mixstyle. [ICLR 2021] [Code]

Installation

Prerequisites

  • python3 (>=3.8)
  • Pytorch (>=1.10)
  • numpy (>=1.21.2)
  • pandas (>=1.5.3)
  • tqdm (>=4.46.1)
  • scipy (>=1.10)

Data Preparation

Download datasets

Download the data from a public bearing or gearbox fault dataset. Loading code for the following datasets is provided referring to this.

  • CWRU - Case Western Reserve University dataset.
  • MFPT - Machinery Failure Prevention Technology dataset.
  • PU - Paderborn University dataset.
  • XJTU - Xi’an Jiaotong University dataset.
  • IMS - Intelligent Maintenance Systems dataset.

Within-dataset transfer

According to different operation conditions, divide a specific dataset into folders like "op_0", "op_1" and so on. In each "op_?" folder, use subfolders for different categories, which contain the fault data.

For example, CWRU dataset can be divided into 4 folders according to 4 motor speed. In each folder, data of this operation condition can be classified into 9 fault classes, such as 7 mil Inner Race fault, 14 mil Inner Race fault, 7 mil Outer Race fault and so on (referring to this article). Then, the dataset folder is organized as

.
└── dataset
    └── CWRU
        ├── op_0
        │   ├── ball_07
        │   │   └── 122.mat
        │   ├── inner_07
        │   │   └── 109.mat
        │   ...
        ├── op_1
        │   ├── ball_07
        │   │   └── 123.mat
        │   ...
        ├── op_2
        ...

Cross-dataset transfer

You can also try to implement transfer among different datasets. In this case, the categories of faults contained in each dataset must be the same.

For example, organize CWRU and MFPT datasets as follows for one-to-one transfer.

.
└── dataset
    ├── CWRU
    │   ├── inner
    |   |    ├── ***.mat
    |   |    |   ***.mat
    |   |    ...
    │   ├── normal
    │   └── outer
    └── MFPT
        ├── inner
        ├── normal
        └── outer

Note: It is highly recommended to modify the dataset loading code based on custom training. Make sure that datasetname in the loading code is consistent with names of your subfolders. The sampling length can also be changed by adjusting the signal_size inside.

Usage

Load trained weights.

python train.py --model_name CNN --load_path ./CNN/single_source/model.pth --target_name CWRU_3 --num_classes 9 --cuda_device 0

Within-dataset transfer

One-to-one transfer (such as CWRU operation condition 0 to condition 1).

python train.py --model_name CNN --source_name CWRU_0 --target_name CWRU_1 --train_mode single_source --num_classes 9 --cuda_device 0

Many-to-one transfer.

python train.py --model_name MFSAN --source_name CWRU_0,CWRU_1 --target_name CWRU_2 --train_mode multi_source --num_classes 9 --cuda_device 0

Cross-dataset transfer

One-to-one transfer.

python train.py --model_name CNN --source_name CWRU --target_name MFPT --train_mode single_source --num_classes 3 --cuda_device 0

Many-to-one transfer.

python train.py --model_name MFSAN --source_name CWRU,PU --target_name MFPT --train_mode multi_source --num_classes 3 --cuda_device 0

Contact

If you have any problem with our code or have some suggestions, feel free to contact Jinyuan Zhang ([email protected]) or describe it in Issues.

Citation

If you use this toolbox or benchmark in your research, please cite this project.

@misc{dafd,
    author = {Jinyuan Zhang},
    title = {TL-Bearing-Fault-Diagnosis},
    year = {2022},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/Feaxure-fresh/Domain-Adaptation-Fault-Diagnosis}},
}

tl-bearing-fault-diagnosis's People

Contributors

feaxure-fresh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.