Skip to content
Xiaohan-ChenPublic

About

The officieal implementation of the paper: CoWS: Self-Supervised Representation Pre-Training for Cross-Machine Fault Diagnosis

Topics

Resources

Stars

11 stars

Watchers

2 watching

Forks

Repository files navigation

CoWS: Consistent Wave and Spectrogram

CoWS Logo

Python PyTorch License DOI

📖 Overview

The officieal implementation of the paper: CoWS: Self-Supervised Representation Pre-Training for Cross-Machine Fault Diagnosis, which has been published by IEEE Transactions on Emerging Topics in Computational Intelligence.

CoWS (Consistent Wave and Spectrogram) is a novel self-supervised learning method for mechanical fault diagnosis that leverages the consistency between time domain waveforms and time-frequency domain spectrograms. By learning consistent representations across these two complementary views, CoWS achieves superior performance in bearing fault diagnosis tasks.

Key Features

  • 🔄 Cross-domain Consistency: Aligns representations between time-domain and frequency-domain views
  • 🎯 Self-supervised Learning: No labeled data required for pre-training
  • 📊 Multi-view Learning: Exploits complementary information from wave and spectrogram representations
  • ⚡ Efficient Training: Limited data required for fine-tuning
  • 🚝 Cross-machine Tasks: Good performance on cross-machine fault diagnosis tasks

🏗️ Architecture

CoWS employs a dual-encoder architecture:

  • Wave Encoder: 1D ResNet50 for processing time-domain signals
  • Spectrogram Encoder: 2D ResNet50 for processing frequency-domain representations
  • Contrastive Learning: Maximizes agreement between wave-spectrogram pairs

CoWS is a general contrastive learning model. The wave and sepctrogram encoders can be replaced with your self-defined architectures.

CoWS

🚀 Quick Start

Prerequisites

  • Python 3.7+
  • PyTorch 1.8+

Installation

  1. Clone the repository:
git clone https://github.com/Xiaohan-Chen/CoWS
cd cows
  1. Install dependencies:
pip install -r requirements.txt

Data Preparation

Place your bearing data in the Data/ directory following this structure:

Data/
├── Bearing/
│   ├── load0.pkl
│   └── ...
└── HITBearing/
│   ├── load0.pkl
│   └── ...
└── HUSTBearing/
│   ├── load0.pkl
│   └── ...
└── XJTUBearing/
│   ├── load0.pkl
│   └── ...

Training

  1. Pre-training with CoWS:
python CoWS.py
  1. Linear Evaluation:
python Evaluation.py --label_ratio 0.01
  1. Transfer Learning:
python Transfer.py --tgt_data 'HUSTBearing'--tgt_load 0 --num_train 10

📊 Experiments

📄 Citation

If you find CoWS useful in your research, please consider citing:

@ARTICLE{11364255,
  author={Chen, Xiaohan and Yang, Rui and Xue, Yihao and Wang, Zidong},
  journal={IEEE Transactions on Emerging Topics in Computational Intelligence}, 
  title={CoWS: Self-Supervised Representation Pre-Training for Cross-Machine Fault Diagnosis}, 
  year={2026},
  volume={},
  number={},
  pages={1-13},
  keywords={Fault diagnosis;Data models;Cows;Feature extraction;Spectrogram;Machinery;Deep learning;Training;Knowledge transfer;Brain modeling;Self-supervised learning;pre-training model;knowledge transfer;fault diagnosis},
  doi={10.1109/TETCI.2026.3654383}}

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🥐 See Also

  • TFPred: Learning Discriminative Representations from Unlabeled Data for Few-Label Rotating Machinery Fault Diagnosis. [Paper][GitHub]
  • Transfer Learning Fault Diagnosis: A Survey. [Paper][GitHub]
  • Few-Shot Fault Diagnosis. [GitHub]

🙏 Acknowledgments

  • Thanks to the self-supervised learning open source community
  • Special thanks to the mechanical fault diagnosis public datasets

⭐ Star this repository if you find it helpful!

About

The officieal implementation of the paper: CoWS: Self-Supervised Representation Pre-Training for Cross-Machine Fault Diagnosis

Topics

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages