# An Improved Automatic Modulation Classification Scheme Based on Adaptive
Fusion Network ††thanks: This work is supported by the National 111 Center.

1st Hao Shi  School of Microelectronics
Xidian University
Xi’an, China
<EMAIL_ADDRESS>2nd Qi Peng 1 1 Qi Peng is corresponding author. School of
Microelectronics
Xidian University
Xi’an, China
<EMAIL_ADDRESS>3rd Yiqi Zhuang  School of Microelectronics
Xidian University
Xi’an, China
<EMAIL_ADDRESS>
###### Abstract

Due to the over-fitting problem caused by imbalance samples, there is still
room to improve the performance of data-driven automatic modulation
classification (AMC) in noisy scenarios. By fully considering the signal
characteristics, an AMC scheme based on adaptive fusion network (AFNet) is
proposed in this work. The AFNet can extract and aggregate multi-scale spatial
features of in-phase and quadrature (I/Q) signals intelligently, thus
improving the feature representation capability. Moreover, a novel confidence
weighted loss function is proposed to address the imbalance issue and it is
implemented by a two-stage learning scheme. Through the two-stage learning,
AFNet can focus on high-confidence samples with more valid information and
extract effective representations, so as to improve the overall classification
performance. In the simulations, the proposed scheme reaches an average
accuracy of 62.66% on a wide range of SNRs, which outperforms other AMC
models. The effects of the loss function on classification accuracy are
further studied.

###### Index Terms:

Automatic modulation classification, deep learning, convolutional neural
networks, loss function.

##  I Introduction

The evolving fifth generation (5G) communication systems are turning our
society into a densly connected one, placing higher demands on communication
speed and quality. Automatic Modulation Identification (AMC), as one of the
key technologies for non-collaborative wireless communication systems, aims to
identify the modulation scheme of the received signal with unknown channel
interference [1]. Traditionally, AMC algorithms are divided into two
categories: likelihood-based (LB) and feature-based (FB) [2]. Whereas the LB
classifiers are theoretically optimal, they involve unacceptable computational
costs when estimating unknown parameters. The FB methods have lower
complexity, but the performance depends greatly on expertise and the quality
of hand-crafted features.

Compared to traditional feature engineering, deep learning (DL) algorithms
attempt to learn the deep feature hierarchies and directly induce the complex
function mapping input to output from original data. In recent years, many DL-
based neural networks have been designed in order to achieve high-performance
AMC [3, 4, 5, 6, 7, 8]. O’Shea et al. proposed a compact CNN structure to
identify eleven modulation schemes using baseband in-phase/quadrature (I/Q)
samples [3]. Rajendran et al. trained a dual-layer long-short term memory
(LSTM) using the amplitude/phase (A/P) representation of raw data to extract
the long-term dependencies and improve the classification accuracy [5]. Some
other studies combined spectrum analysis and neural networks to enrich the
features by providing different modal information [6].

Although the above schemes vary in terms of data format and network design,
they all follow the conventional DL training strategy that randomly sampling
in each batch and the importance difference of samples are ignored. However,
some samples contain strong noise and some contain invalid silent periods [3].
These abnormal samples are very difficult to classify and have a high
probability of being outliers in the sample space. The neural network is
easily to memorize the invalid knowledge if the training dataset includes a
certain proportion of these samples, thus falling into local optimum and
leading to degradation of classifier performance[9]. Furthermore, the network
architectures are mostly migrated from the generic models and lack special
design for extracting modulation information.

Figure 1: The architecture of proposed AFNet.

Based on the above considerations, this paper puts forward an improved scheme
from two parts: classifier and loss function. First, the modulation
information is usually contained in several adjacent symbols. Therefore,
multi-scale features and dynamic receptive fields which can cover the key
symbols are very important for the classifier. Thus, we propose a novel neural
network with specially designed multi-scale parallel convolution and adaptive
feature fusion to enrich the high-level features, namely adaptive fusion
network (AFNet). Second, in order to alleviate the interference of the hard
samples, per-instance weights are applied to the cross-entropy loss function
based on the confidence level of each instance to guide the attention
allocation for model training. The simulation results on RadioML dataset show
that the combined AMC scheme can achieve superior overall accuracy from -20 dB
to 18 dB than other DL-based models. The extended experiments evaluate that
the proposed weighted loss is also effective for other models.

The rest of this paper is organized as follows. Section II presents the signal
model. Section III introduces the proposed AMC scheme. Simulation results are
presented and discussed in Section IV. Finally, Section V concludes the paper.

##  II Signal Model

AMC can generally be regarded as the M-classification problem of complex base-
band time series, where M represents the number of candidate modulation
schemes. A general expression for the received signal is

$r(t)=s(t)+n(t),$ (1)

where $s(t)$ represents noise-free baseband complex envelope of the received
signal and $n(t)$ is the additive white Gaussian noise (AWGN) with a mean of
zero and variance $\sigma_{n}^{2}$. The received signal $r(t)$ is sampled $N$
times to generate a discrete sequence $r[n],n=1,2,...,N$, which can be
expressed as

$r[n]=I[n]+jQ[n]=Re(r[n])+jIm(r[n]).$ (2)

The real and imaginary parts of $r[n]$ can be extracted and packed into a two-
dimensional (2-D) matrix with shape $(2,N)$ and the k-th collected sequence
$r_{k}$ can then be written as follows:

${r}_{k}=\left(\begin{array}[]{c}Re(r_{k}[1],...,r_{k}[N])\\\
Im(r_{k}[1],...,r_{k}[N])\\\ \end{array}\right)\text{.}$ (3)

For a given M-class modulation scheme set
$\mathbf{\Theta}=\\{\theta_{i}\\}_{i=1}^{M}$, according to the maximum a
posteriori probability criterion, the decision can be made as
$\theta_{i}=\mathop{\mathrm{arg}\max}_{\theta_{i}\in\Theta}P(\theta_{i}|{r}),$,
where $P(\theta_{i}|\boldsymbol{r})$ is the a posteriori probability of
$\theta_{i}$ under the condition of received sequence $r$.

##  III The Proposed AMC Scheme

Figure 2: The structure of AF unit.

###  III-A Implementation of AFNet

Fig. 1 demonstrates the architecture of the proposed AFNet, which is composed
of feature extraction stage and classification stage. The first layer is a
conventional convolution layer to learn the general high-resolution features
and the correlation between I and Q, which utilized 48 filters with size of
$(2,5)$. Then, this is followed by nine AF units, in which two max pooling
layers are inserted to reduce the spatial dimensionality, as well as the
computational complexity. The function of AF units is to extract and aggregate
multi-scale features for next classification stage. In many DL related works,
the fusion of multi-scale and multi-level features is one method for improving
performance. There are two main fusion methods of feature maps: concatenation
and element-wise summation. However, such linear superposition methods lack
flexibility in the selection of features. Therefore, we designed an AF unit
based on the attention mechanism to adaptively learn the weight vectors for
feature maps and provide nonlinear fusion.

The structure of AF unit is shown in Fig. 2. In each unit, dual-branch
parallel convolution is firstly set to capture small-scale and large-scale
spatial features with kernel sizes of $(1,3)$ and $(1,5)$, respectively. The
number of filters is consistent with the channels of the input, in order to
maintain the dimensionality after convolution. In actual implementation, we
adopt the group convolution [10] and dilated convolution [11] to reduce the
parameters. The right part of Fig. 2 is the schematic diagram of the fusion
module based on attention mechanism. For given feature maps
$A,B\in\mathbb{R}^{H\times W\times C}$, they are processed by sequential
summation-global average pooling (GAP)-fully connections (FC) and converted
into two C-dimension vectors $a$ and $b$, and a modified channel-wise Softmax
function with a factor $\lambda$ (referred as $\lambda$-Softmax) is applied to
acquire the attention vectors $\alpha$ and $\beta$ as follows:

$\alpha_{c}=\frac{\lambda
e^{a_{c}}}{e^{a_{c}}+e^{b_{c}}},\beta_{c}=\frac{\lambda
e^{b_{c}}}{e^{a_{c}}+e^{b_{c}}},$ (4)

where $c=0,1,...,C$ represents the channel index. In the first fusion module,
the factor $\lambda$ is set to 1 and the function become the vanilla Softmax.
While it is set to 2 in the second module which can be regarded as an
optimized skip connection in ResNet. The main purpose of setting to 2 is to
prevent vanishing gradient problems during the back propagation [12] and
accelerate the training process. Finally, the output feature map
$V={[V_{1},V_{2},...,V_{C}]},V_{c}\in\mathbb{R}^{H\times W}$ is obtained by
the fusion of feature maps using the following formula:

$V_{c}=\alpha_{c}\cdot A_{c}+\beta_{c}\cdot
B_{c},\alpha_{c}+\beta_{c}=\lambda.$ (5)

For each fusion module, only the FC layers involves trainable parameters, and
the total number $N_{train}$ is

$N_{train}=C\times d\times 3=3C^{2}/r.$ (6)

where $r$ is the compression factor of the FC layer and its default value is
16. Therefore, the amount of parameters generated by the attention module is
only related to the number of channels, which is determined by the number of
filters.

Through the nonlinear fusion of features maps from different branches, the AF
unit can obtain dynamic receptive fields to adapt to different inputs. Similar
to traditional convolution layers, the AF units can be flexibly embedded into
any CNN structure. By stacking the units, the multi-scale features obtained
from different layers are scaled and propagated through the entire network by
the modified skip connections, thereby enriching the classification
information. Considering the balance between accuracy and efficiency, the
benchmark model utilizes nine AF units.

In regard to the classifier, the parameters could be greatly cut down by GAP
to transform the 2-Dimensional (2-D) feature map into a vector instead of a
flattened layer followed by several FC layers. The vector is fully connected
to the last layer with 11 neurons, which corresponds to the number of classes.
Finally, a Softmax layer is applied to calculate the a posteriori probability
vector.

Once the model is built, it can be trained on a dataset by using a loss
function and optimization algorithm based on stochastic gradient descent
(SGD). The training flow related to the proposed confidence weighted loss is
described in detail in the following subsection.

###  III-B Pipeline of The Proposed Two-stage Learning

Figure 3: The pipeline of proposed two-stage learning scheme.

In conventional DL-based AMC methods, the deep models are trained with general
single-stage strategy utilizing the categorical cross entropy loss function

$L_{CE}=-\sum_{i=1}^{M}y_{i}log(p_{i})\text{,}$ (7)

where $M$ is the number of categories, $y$ represents the one-hot label and
$p$ is the prediction of classifier, respectively. In the iterative training,
the model is executed and the trainable parameters are continuously updated
epoch by epoch until the loss converges to a constant. In one epoch, the
training samples are shuffled and fed into the model in batches to calculate
the batch loss and update the parameters.

However, if there are a large number of low-quality samples in the dataset,
the losses of them will account for the majority of the total loss. And most
of these samples are difficult to classify, so the optimization direction of
the model is not what we want. In order to solve such problems, the idea of
curriculum learning is proposed driven by the human learning pattern, that is,
the model should pay more attention to easy samples and gradually generalize
to hard samples [9]. Inspired by this, we propose an instance confidence
weighted loss (CW loss) function to suppress the hard samples and make the
descending direction of gradient dominated by high-confidence samples.
Moreover, the weights are given by the model itself rather than artificial
design to ensure the reliability. The full pipeline of the proposed learning
strategy consisting of two stages is shown in Fig. 3.

The first stage namely confidence evaluation stage aims at computing the
weights for training examples according to the predicted posterior probability
distribution of the model. Firstly the model is pre-trained with training set
$\Omega_{x}$ and label $y$ using conventional cross entropy loss. Then, the
training instances are fed into the model again to obtain the prediction
vector $y_{pred}$ for each instance. The elements $p_{i},i=0,1...,M$ in
$y_{pred}$ is the probability of the i-th class and $\sum_{i=1}^{M}p_{i}=1$.
The final prediction result is determined by the largest item in the vector.
However, the results given by the model may be ambiguous. For example, for a
binary classification problem, the probability distributions of $[0.9,0.1]$
and $[0.6,0.4]$ will lead to a same prediction class, but the former has a
higher confidence level. Therefore, a metric is needed to measure the
uncertainty of prediction results. A common metric to identify uncertain
examples is the entropy of their predicted class distribution [13]. For
$p=[p_{1},p_{2},...,p_{M}]$, the entropy is defined as

$H(p)=-\sum_{i=1}^{M}p_{i}log(p_{i})\text{.}$ (8)

The higher the value of $H(p)$, the more uniform the probability distribution,
which means higher uncertainty. However, sometimes the original entropy can
not describe the actual uncertainty well. For two distributions
$p(a)=[0.5,0.25,0.25]$ and $p(b)=[0.5,0.5,0]$, according to the formula we get
$H(p(a))>H(p(b))$, but $p(b)$ is more uncertain than $p(a)$ for the
classification scenario.

A simple but effect adjustment is to use only the first top-k probability
values to calculate the entropy. Suppose $p_{1},p_{2},...,p_{k}$ are the first
k values with the highest probability, then the top-k-entropy is defined as

$H_{top\mbox{-}k}(p)=-\sum_{i=1}^{k}\widetilde{p_{i}}log(\widetilde{p_{i}})\text{,}$
(9)

where $\widetilde{p_{i}}=p_{i}/\sum_{i=1}^{k}$. Then, the final confidence,
i.e. sample weight $w$ is calculated by

$w=1-H_{top\mbox{-}k}(p)/log(k)\text{,}$ (10)

where the purpose of $H_{top\mbox{-}k}(p)/log(k)$ is to normalize the value to
$0\sim 1$. The larger the value of $w$, the higher the confidence is, which
indicates that the prediction result of this sample is more reliable. Through
the above process, the weights $w_{\Omega_{x}}$ for all training examples can
be calculated for next stage.

The second stage executes the re-training by the weighted cross entropy loss
which is expressed as

$L_{CW}=-w\sum_{i=1}^{M}y_{i}log(p_{i}).$ (11)

The training process is the same as the normal way and when the model
converges, the optimal parameters are learned. The two-stage training
readjusts the model attention to different samples, and the feature
representations of high-confidence signals which provide more valid
information are learned, so as to improve the robustness of the classifier.

##  IV Simulation Results and Discussion

###  IV-A Dataset and Simulation Settings

We adopt the RadioML2016.10a dataset as our main research object, which is
generated by Tim et al. via GNU radio in [14]. The data is uniformly
distributed across all 11 modulation types and the SNRs ranging from -20 dB to
+18 dB with a step of 2 dB. The samples are divided into training set and
testing set by the ratio 8:2. Training and performance evaluation are
performed on the Google Colaboratory equipped with one Tesla K80 GPU and 16 GB
RAM. All of the networks utilize the Adam optimizer [15] with a learning rate
of 0.001. The batch size of each iteration is 512 to make full use of
computing resources. An early stop strategy with a patience value of 15 is
also adopted to prevent potential overfitting.

###  IV-B Experimental Results

TABLE I: Accuracy Comparison of Different k Values  | k=2 | k=3 | k=4 | w/o CW Loss
---|---|---|---|---
| Average
---
Acc
62.12% | 62.66% | 62.11% | 62.09%
| Max
---
Acc
92.75% | 92.79% | 92.37% | 91.63%

First, a comparison experiment is conducted to determine the optimal value of
hyper-parameter k in the top-k cross entropy. The average and maximum accuracy
under all SNRs are listed in Table I. Based on the results, we adopt $k=3$ in
the follow-up experiments.

Figure 4: Classification accuracy versus SNR of the proposed CW loss trained
AFNet against other methods.

For exploring the overall performance of the proposed AMC scheme, comparative
experiments are performed against other DL-based models, which are ResNet[4],
LSTM2[5], CLDNN[7] and IC-AMCNet[8]. The classification accuracy on the same
testing set of the proposed method and the other models at varying SNRs are
detailed in Fig. 4. It is observed that the proposed AFNet has outperformed
other examined models. Moreover, the CW loss further improves its overall
accuracy especially at high SNRs and the combined scheme achieves the superior
performance. The results not only prove that the special design of AFNet is
effective, but also indicate that the CW loss is conducive to improve the
model’s attention to high-quality samples and there is little accuracy
degradation for low-quality samples.

Figure 5: Classification accuracy of different modulation schemes versus SNR.
The left is the result of AFNet trained by vanilla CE loss and the right is
obtained by the CW loss.

Figure 6: Average instance confidence distribution for SNRs (upper) and
modulation schemes (lower).

The classification accuracy curves of 11 modulation schemes are fully
illustrated in Fig. 5. Comparing the results before and after using CW loss,
it can be seen that in general all high SNR signals are identified more
accurately. From the perspective of modulation type, the recognition rates of
QAM16, QAM64, QPSK and WBFM have been improved, along with certain decline of
some other modulation types. Therefore, it can be inferred that the overall
improvement of classification performance stems from the fact that the model
has adjusted its prediction strategy to more rationally allocate its efforts
to various signals.

In order to understand what kinds of samples are high-confidence and what are
low-confidence in the cognition of deep models, we visualize the relationship
between confidence and SNR and modulation type respectively, as presented in
Fig. 6. The results indicate that the average confidences of high SNR signals
and digital modulation signals are relatively higher, which is consistent with
the intuitive assumption.

Finally, in order to verify the generality of the proposed two-stage training
and CW loss, the instance weights obtained by AFNet are utilized to re-train
other models. The performance improvements are described in Table II. The
results show that CW loss brings different degrees of improvement to the
classification performance of all models, among which ResNet achieves the
largest gain. This fully illustrates the validity and potential of our
proposed CW loss.

TABLE II: Performance of CW Loss on Other Models | Average Acc | Max Acc
---|---|---
ResNet | 59.20% | 88.90%
ResNet+CW loss | (+1.95) 61.15% | (+3.71) 92.61%
CLDNN | 58.17% | 87.84%
CLDNN+CW loss | (+1.02) 59.19% | (+2.06) 89.90%
LSTM2 | 59.94% | 91.17%
LSTM2+CW loss | (+0.25) 60.19% | (+0.93) 92.10%
IC-AMCNet | 60.06% | 90.77%
IC-AMCNet+CW loss | (+0.37) 60.43% | (+0.88) 91.65%

##  V Conclusion

In this work, in order to improve the performance of AMC under noisy
conditions, a novel DL-based scheme is proposed, which includes the AFNet and
CW loss function. The AFNet has a dynamic receptive field mechanism, which can
adapt to different modulation schemes and capture the modulation information
contained in adjacent symbols. The CW loss is exploited to improve the
classification performance of high-confidence samples by re-weighting the
samples according to the predicted class distribution. Simulation results show
that the proposed scheme outperforms other DL-based models in terms of average
and maximum accuracy. Moreover, the effectiveness of CW loss function with the
two-stage learning strategy is investigated by implementing on different
models and the significant improvements show its application potential.

## References

  * [1] O. A. Dobre, A. Abdi, Y. Bar-Ness, and W. Su, “Survey of automatic modulation classification techniques: classical approaches and new trends,” IET communications, vol. 1, no. 2, pp. 137–156, 2007.
  * [2] O. A. Dobre, “Signal identification for emerging intelligent radios: classical problems and new challenges,” IEEE Instrumentation Measurement Magazine, vol. 18, no. 2, pp. 11–18, 2015.
  * [3] T. J. O’Shea, J. Corgan, and T. C. Clancy, “Convolutional radio modulation recognition networks,” in International conference on engineering applications of neural networks, pp. 213–226, Springer, 2016.
  * [4] T. J. O’Shea, T. Roy, and T. C. Clancy, “Over-the-air deep learning based radio signal classification,” IEEE Journal of Selected Topics in Signal Processing, vol. 12, no. 1, pp. 168–179, 2018.
  * [5] S. Rajendran, W. Meert, D. Giustiniano, V. Lenders, and S. Pollin, “Deep learning models for wireless signal classification with distributed low-cost spectrum sensors,” IEEE Transactions on Cognitive Communications and Networking, vol. 4, no. 3, pp. 433–445, 2018.
  * [6] Y. Zeng, M. Zhang, F. Han, Y. Gong, and J. Zhang, “Spectrum analysis and convolutional neural network for automatic modulation recognition,” IEEE Wireless Communications Letters, vol. 8, no. 3, pp. 929–932, 2019.
  * [7] S. Ramjee, S. Ju, D. Yang, X. Liu, A. E. Gamal, and Y. C. Eldar, “Fast deep learning for automatic modulation classification,” arXiv preprint arXiv:1901.05850, 2019.
  * [8] A. P. Hermawan, R. R. Ginanjar, D.-S. Kim, and J.-M. Lee, “Cnn-based automatic modulation classification for beyond 5g communications,” IEEE Communications Letters, vol. 24, no. 5, pp. 1038–1041, 2020.
  * [9] G. Hacohen and D. Weinshall, “On the power of curriculum learning in training deep networks,” in International Conference on Machine Learning, pp. 2535–2544, PMLR, 2019.
  * [10] G. B. Tunze, T. Huynh-The, J.-M. Lee, and D.-S. Kim, “Sparsely connected cnn for efficient automatic modulation recognition,” IEEE Transactions on Vehicular Technology, vol. 69, no. 12, pp. 15557–15568, 2020.
  * [11] F. Yu and V. Koltun, “Multi-scale context aggregation by dilated convolutions,” arXiv preprint arXiv:1511.07122, 2015.
  * [12] K. He, X. Zhang, S. Ren, and J. Sun, “Identity mappings in deep residual networks,” in European conference on computer vision, pp. 630–645, Springer, 2016.
  * [13] M. Jia, A. Reiter, S.-N. Lim, Y. Artzi, and C. Cardie, “When in doubt: Improving classification performance with alternating normalization,” arXiv preprint arXiv:2109.13449, 2021.
  * [14] T. J. O’shea and N. West, “Radio machine learning dataset generation with gnu radio,” in Proceedings of the GNU Radio Conference, vol. 1, 2016.
  * [15] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014.