MCPcopy Index your code
hub / github.com/GuoweiaaZhang/BDC

github.com/GuoweiaaZhang/BDC @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
31 symbols 68 edges 4 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

⚙️ Balancing Discrepancy and Consistency (BDC)

🛠️ This repository provides the official implementation of the paper.
"[IEEE TII] Balancing Discrepancy and Consistency: Adversarial Single Domain Generalization in Fault Diagnosis".Paper Link

🔗 Data link

The datasets used in this project can be accessed from the links below.

No. Dataset Source Link
1 PU (Paderborn University) University Website Data Link
2 HUST (Huazhong University of Science and Technology) GitHub GitHub Link
3 BJUT (Beijing University of Technology) GitHub GitHub Link
4 SDUST (Shandong University of Science and Technology) GitHub GitHub Link
5 RFB (Real Factory Bearing) Google Drive Drive Link
# 🛠️ Data preprocessing
The raw input data consists of vibration acceleration signals. We do not apply any additional preprocessing steps such as denoising or normalization.
  • Each sample is extracted by segmenting the original signal into fixed-length (2048) windows.
  • A Fast Fourier Transform (FFT) is applied to each segment during data loading, implemented in load_data.py.

This ensures that the entire pipeline is simple, reproducible, and focused on frequency-domain representations only.

👉 Download the segmented data and corresponding labels here: 📥 Click to download time-domain dataset

🧪 Environment Setup

This project is developed and tested under Python 3.9 with PyTorch 1.12.

We recommend using conda to manage the environment for consistent dependencies.

📁 Project Structure

BDC

├── PU_0900_1000_07.mat # Quick-run example data provided

├── PU_1500_0400_07.mat # Quick-run example data provided

├── PU_1500_1000_01.mat # Quick-run example data provided

├── load_data.py # Data loading and FFT

├── construct_loader.py # Dataloader builder

├── module.py # Loss functions and modules

├── main.py # Training and evaluation

└── README.md

🚀 Quick Start

A sample dataset and a ready-to-run script are provided to facilitate quick and easy implementation for users.

  1. Preparing data.
  2. Option 1: To help users get started quickly, we provide three pre-segmented sample sets of vibration signals from the PU dataset, corresponding to three different operating conditions:

  3. PU_0900_1000_07.mat

  4. PU_1500_0400_07.mat
  5. PU_1500_1000_01.mat

These .mat files are already uploaded to this repository root and can be used directly without any preprocessing. They are representative of different operating conditions and fault types. - Option 2: Download the data manually from: 📥 External download link

  1. Clone this repository.
  2. Please modify the dataset loading path in the code (main.py) to match the actual location where you store the .mat files on your machine.
  3. Run the main.py file to start training and evaluation.

📊 Comparative Methods

We compare our method with the following state-of-the-art single-domain generalization and fault diagnosis methods:

Method Paper Link
MEADA Maximum-Entropy Adversarial Data Augmentation for Improved Generalization and Robustness
L2D Learning To Diversify for Single Domain Generalization
AMINet Adversarial Mutual Information-Guided Single Domain Generalization Network for Intelligent Fault Diagnosis
MSGACN Multi-scale style generative and adversarial contrastive networks for single domain generalization fault diagnosis
ACL Single domain generalization method based on anti-causal learning for rotating machinery fault diagnosis
DEFSDG Domain expansion fusion single-domain generalization framework for mechanical fault diagnosis under unknown working conditions

📬 Contact

If you have any questions, feel free to open an issue or contact the author.

Core symbols most depended-on inside this repo

load_data
called by 3
load_data.py
get_covariance_matrix
called by 2
module.py
construct_loader
called by 1
construct_loader.py
get_cross_covariance_matrix
called by 1
module.py
cross_whitening_loss
called by 1
module.py
CORAL
called by 1
module.py
forward
called by 0
module.py
forward
called by 0
module.py

Shape

Method 16
Class 8
Function 7

Languages

Python100%

Modules by API surface

module.py29 symbols
load_data.py1 symbols
construct_loader.py1 symbols

For agents

$ claude mcp add BDC \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact