Skip to content

CamelliaCode/M-OpenMax

Repository files navigation

Open-Set Automatic Modulation Classification Using Deep Metric Learning and Openmax

This repository contains the implementation of the paper "Open-Set Automatic Modulation Classification Using Deep Metric Learning and Openmax", published in VTC2025-Spring.

Overview

Automatic Modulation Classification (AMC) is a key technology in cognitive radio and dynamic spectrum access. Traditional AMC methods often assume a closed-set scenario where all test signals belong to known classes. However, in realistic environments, unknown signals may appear. This project addresses the Open-Set Recognition (OSR) problem in AMC by combining Deep Metric Learning (specifically Center Loss) with OpenMax.

The proposed method enhances the discriminative power of learned features using Center Loss and employs OpenMax to calibrate the prediction scores, enabling the model to effectively identify and reject unknown modulation types while maintaining high accuracy on known classes.

Features

  • Deep Metric Learning: Integrates Center Loss with Cross-Entropy Loss to minimize intra-class variance and maximize inter-class separability.
  • OpenMax: Adapts the OpenMax algorithm to estimate the probability of an input belonging to an unknown class based on Extreme Value Theory (EVT).
  • Modulation Classification: Optimized for classifying various modulation schemes under open-set conditions.

Requirements

  • Python 3.x
  • PyTorch
  • NumPy
  • SciPy
  • libmr (required for OpenMax Weibull fitting)
  • torchvision

Usage

Training

To train the model, use the train.py script. You can configure parameters such as batch size, learning rate, and the number of classes.

python train.py --train_class_num 20 --bs 128 --es 200

Testing

To evaluate the model and test its open-set recognition capabilities:

python train.py --evaluate --resume model/net_classes20_0.05-2.pth

(Note: The testing logic is integrated into train.py via the --evaluate flag or can be run using test.py if configured).

File Structure

  • train.py: Main script for training the model.
  • openmax.py: Implementation of the OpenMax algorithm and Weibull distribution fitting.
  • centerLoss.py: Implementation of the Center Loss function.
  • model.py / complexcnn.py: Neural network model definitions.
  • evaluation.py: Evaluation metrics and utilities.
  • get_data.py: Data loading and preprocessing utilities.

Citation

If you use this code in your research, please cite the following paper:

VTC2025-Spring 2025: 1-5

(Please update the citation with the full BibTeX entry when available).

License

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

About

M-OpenMax Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages