1 Introduction

The most popular connection choice for Internet of Things (IoT) applications needing extended range, great energy efficiency, and low cost has emerged as Low Power Wide Area Networks (LPWAN). The goal of LPWAN protocols is to connect a large number of battery-operated devices, such as sensors used in applications that can tolerate delays and have modest throughput requirements per device [1]. A significant number of LPWAN technologies uses unlicensed frequencies, which presents an extra obstacle on account of the increased interference levels. Effective data transmission is essential for long-range communications and improved quality of service, which increases reliability. Consequently, reducing the need for signal retransmission, which entails spectrum congestion. Spectrum efficacy is especially critical in the unlicensed Industrial, Scientific, and Medical (ISM) band, because this spectrum is open to the public.

The goal of every communication system is to accurately recreate the message sent by the transmitter at the other end of the channel. The transmitted signal may get distorted as a result of the channel’s noise characteristics, and the receiver may not be able to reconstruct the message exactly. A reliable communication system ought to be capable to overcome these channel-induced corruptions and faithfully reconstruct the message at the recipient. Wireless communication systems have traditionally been built using accurate system models and complicated mathematical theories. The complex relationship between spectrum data and communication architecture of new generation wireless communication technologies is difficult to represent using traditional modeling approaches. Machine Learning (ML) and Deep Learning (DL) technologies are grown rapidly in recent years, with applications extending into practically every sector and academic domain. The nonlinearity resistance of DL algorithms has made them a topic of intense study for implementation in wireless communication systems [2]. DL has emerged as a practical approach to address the challenges associated with the wireless communication system’s need for increased data rate, speed, reliability, and security. Utilizing multiple DL classification approaches [3,4,5] enables its usage for modulation recognition. Equalization and sampling synchronization with DL has been investigated in [6, 7].

Multiple functional blocks are utilized to construct links in traditional mathematically derived models of communication systems. Every functional block is optimized separately to get maximum efficiency. As an alternative, the DL-based autoencoder architecture offers a comprehensive answer, one that is wholly data-driven and focused on learning from end-to-end in order to achieve optimal performance. This research focused on the end-to-end design of autoencoder-based communication systems. The idea of training a wireless communications network to act as an autoencoder was first proposed in [8]. An autoencoder is one kind of a Deep Neural Network (DNN) that features both an encoder and a decoder. It is the responsibility of the encoder to discover an underlying representation of the input data, and the decoder’s task is to recover the original data from the encoding. Instead of optimizing the transmitter and receiver independently, this is accomplished by designing the two major components as an autoencoder. The authors in [9] presented a training method for end-to-end systems without knowing about the channel by considering perturbation stochastic approximations. In [10], another method based on transmitter output perturbations is suggested. [11, 12] provide techniques for utilizing neural networks to approximate the channel distribution and then use that as a substitute channel for backpropagation.

Long Range (LoRa) is a widely used LPWAN modulation technology that supports numerous IoT applications, including smart metering, smart agriculture, smart buildings, and logistics monitoring [13]. LoRa is a low-power, long-range communication standard implemented at the physical layer. LoRa’s ability to provide compromises between power consumption, communication range, and data rate enables sustainable IoT. The physical layer of LoRaWAN allows for the orthogonalization of transmissions in terms of channel frequency, bandwidth, coding rate, transmission power, and spreading factor, enabling the deployment of LoRa nodes in high density. However, it also faces several challenges in terms of scalability, capacity, interference and so on. Most LoRa-based IoT applications nowadays are used to create massive network maps consisting of millions of nodes. This creates a problem for LoRa network densification. Evaluating an application on such a massive scale necessitates the use of advanced simulation and modeling techniques.

The following is a list of the contributions made in this work:

  • Designing a DL-based autoencoder for end-to end communication of LoRaWAN.

  • Implementing effective channel model and training mechanism.

  • Performance evaluation of the model with simulation data.

The remainder of the article is organized as follows: The second section discusses the fundamentals of LoRa technology and how DL can be implemented in LPWANs. The autoencoder architecture and system model are presented in Sect. 3. Section 4 goes into detail about implementation, including two-phase training. The results of the simulation are presented in Sect. 5, and the article is concluded in Sect. 6.

2 LoRa and deep learning

LoRa is a physical layer acquired and developed by Semtech corporation, with higher-level properties for implementing LPWANs. LoRa’s base adjustment is Chirp Spread Spectrum (CSS). It has similar low-power characteristics as Frequency Shift Keying, but apparently improves contact range. Multiple IoT nodes in LoRa network can be connected with a network server via gateways using a virtual channel. There are six virtual channels called Spreading Factors (SFs), ranging from 7 to 12 are used for communication between LoRa nodes and gateway. LoRa data rate varies between 300 bits and 50,000 bits per second relative to the selection of SF and bandwidth. A LoRa receiver can decode signals that are 19.5 decibels below the noise floor, allowing for extremely extended communication ranges. The possible communication range of LoRa is 15 km in rural and 5 km in urban areas [14]. Depending on the network environment and the number of LoRa nodes served by a LoRa gateway, the parameters of the network can be optimized to achieve better efficiency. The primary parameters of LoRa that can be optimized for better results are SF, bandwidth, coding rate, carrier frequency, and transmission power.

In addition to the LoRa radio protocol, the LoRa Alliance has developed the LoRaWAN protocol stack and network architecture [15]. LoRaWAN is a MAC layer protocol with open access which operates on regional ISM band frequencies of 433 MHz–868 MHz (EU), 915 MHz (AUS and US), and 923 MHz (ASIA). The LoRaWAN MAC layer determines the network architecture that in this respect is a star of stars. The LoRaWAN network architecture depicted in Fig. 1 consists of three functional devices, including LoRa nodes, gateways, and a network server. There are three classes of LoRa nodes (A, B, and C), with output varying according to the data rates and latencies made accessible by the network and, therefore, resulting in longer battery life. Gateways function as transparent bridging between LoRa nodes and the network server. Typically, communications to the network server are implemented through secured TCP/IP lines, application data are encoded from LoRa nodes, and gateways do not impose higher-level protocols because they are only pass-through tools. Before arriving at the application point, packets are inspected at gateways and any duplicates are discarded. The network server is the place where application real getting intent is performed.

Fig. 1
figure 1

LoRaWAN network architecture

LoRa communication technology has several advantages over other communication technologies, including its long-range capabilities, low power consumption, and low cost. However, as the demand for IoT applications and devices increases, LoRa communication faces several challenges that can affect its performance and scalability. Scalability is a significant challenge for LoRa communication, as the number of IoT devices and applications continues to grow. With an increasing number of devices transmitting data, the network can become congested, resulting in reduced data rates and increased latency. Additionally, LoRa communication is susceptible to interference from other devices operating in the same frequency band, which can further impact network performance. To address these challenges, the usage of DL has become increasingly important to maintain network performance.

The performance of LoRa systems can be highly dependent on the channel conditions, such as distance, location, and signal strength. The proposed autoencoder can be used to model the LoRaWAN channel accurately and learn the optimal mapping between the transmitted signal and the received signal under different channel conditions. This can help improve the accuracy of signal detection and interference mitigation algorithms. Additionally, DL-based LoRa autoencoder can also reduce the energy consumption and transmission time of the LoRaWAN by compressing the sensory data need to be transmitted [16].

2.1 Deep learning in LPWANs

IoT and Smart City implementations are producing massive volumes of sensory data that must be analyzed. Research in this area focuses on finding ways to apply DL to these different fields. DNNs are high-rated efficient DL algorithms. They are distinguished from traditional neural networks by their reliance on nonlinear processing neurons for feature extraction. They conceal a multitude of layers, each of which contributes to the accurate modeling of more intricate functions. DNNs often handle nonlinear data properties, which are helpful in big data use cases. DNNs are used to recognize the radio’s one-of-a-kind hardware impairments and patterns. This is accomplished by studying a substantial quantity of the raw data that is released by the radios. Typically, IoT networks have a high density of devices, making it ideal for utilizing DL approaches in these networks to improve network performance, authentication, security, and service accessibility.

DL is used in multiple ways to address the challenges of LoRaWAN. One of the primary challenges with LoRaWAN communication is the need for efficient and reliable data transmission. A DL-based approach [17] is used to predict the optimal transmission parameters, such as the SF and data rate, based on the characteristics of the environment and the data traffic. This can help to minimize collisions and reduce energy consumption, resulting in improved performance and longer battery life for LoRaWAN devices. DL is also used for interference detection and mitigation in LoRaWAN communication by designing a model to analyze the received signal and detect patterns that indicate interference [18]. In addition to these applications, DL also used for data compression, feature extraction, and anomaly detection in LoRaWAN communication [19]. These techniques can help to reduce the amount of data that needs to be transmitted, improve data transmission rates, and detect abnormal events or behaviors in the network.

Various DL algorithms are employed in LoRaWAN; however, the autoencoder principle from DL is rarely used. Autoencoder is a DL technique that can be used for unsupervised feature learning and data compression. A compressed version of the input data is created by the encoder network, and the decoder network then restores the original data. Recent works have utilized the autoencoder concept for LoRaWAN localization [20] and demodulation [21] applications. According to our knowledge, this is the first attempt to design an end-to-end communication system for LoRaWAN using a DL-based autoencoder.

3 System model

The proposed model aims to provide end-to-end communication in a LoRa network through the use of an autoencoder. Figure 2 depicts a block diagram of the system. Sensor Nodes (SNs) connected to LoRa nodes (LNs), LoRa Gateway (LG), and Network Server (NS) make up the system. The SNs gather sensory data from IoT devices. The LN is responsible for compressing and transmitting sensory data to the LG. The LG receives and transmits the same to the NS. The transmitted data is decompressed at the NS and forwarded to the AS. Autoencoders are utilized in the design of communication system to simultaneously optimize sender and receiver modules, which is a wholly novel approach for constructing communication systems. The system employs the DNN model to compress sensory data. Encoder and decoder of DNN perform compression and decompression operations at LN and NS, respectively. The system employs sender net as an encoder for compression of sensory data and channel net to simulate LoRa channel characteristics. At the NS, the receiver net decompresses and retrieves the original data.

Fig. 2
figure 2

Illustration of the system model

3.1 Design of autoencoder

Autoencoders are a type of neural network that is programmed to learn a compressed version of raw data and then use that information to reconstruct the input at the output. Developing strong representations for the message at each layer is necessary for the network to ensure reliable transmission. The proposed autoencoder model architecture is presented in Fig. 3. Consider the data to be transmitted from the sender to be \(s \in S\). To send data over a noisy channel, modern communication systems transform the data s into a representation \(x \in X\). At the destination, a corrupted form of \(x\), denoted by \(y\), is received. The receiver makes an effort to recreate s from y as accurately as feasible. A transmitter is modeled as a function that takes input data s and generates an intermediate representation x using the formula \(x = f\left( s \right)\). The channel that corrupts x is denoted by \(y = h\left( x \right)\). Here, the input \(x\) is transformed into the desired output \(y\) using the stochastic gradient function \(h\left( x \right)\). Lastly, the receiver can be thought of as another function that uses \(\hat{s} = g\left( y \right)\) to figure out the best way to reconstruct \(\hat{s}\) from \(y\).

Fig. 3
figure 3

Illustration of proposed model architecture

3.1.1 Sender net

The sender net is composed of a feed-forward neural network that has dense layers, which is then followed by a layer that is used for normalization. Every dense layer in a neural network is a deep-connected layer, indicating that each neuron in it receives input from all neurons in the preceding layer. Matrix–vector multiplication is carried out in the background by the dense layer. Back propagation can be used to learn and update the values of the real parameters that are represented as variables in the matrix.

LoRa employs CSS modulation, in which a frequency-modulated pulse is used to spread data across the channel’s bandwidth. LoRa supports \(M = 2^{{{\text{SF}}}}\) distinct symbols, each of which contains SF bits. The duration of a symbol is denoted by Ts = MT, where T = 1/B and B represents the bandwidth of the signal. The SF range in LoRa is \(\left\{ {7,8,9,10,11,12} \right\}\) and available bandwidths are 125,250, and 500 kHz. A chirp is used to represent each LoRa symbol, and this chirp has a linear frequency shift that occurs over a period of time denoted by Ts. As input, the sender network receives the symbols from LoRa nodes.

An L-layered feed-forward neural network performs an iterative mapping \(f(s_{0}\); θ): \(R^{{N_{0} }}\) → \(R^{{N_{L} }}\) to transform a vector of inputs \(s_{0} \in R^{{N_{0} }}\) to an output vector \({\text{x}}_{L} \in R^{{N_{L} }}\) by multiple steps:

$$ s_{l} = f_{l} \left( {s_{l - 1} ;\,\theta_{l} } \right),\quad l = 1, \ldots ,L $$
(1)

where \(f_{l} \left( {s_{l - 1} ;\,\theta_{l} } \right) : R^{{N_{l - 1} }} \to R^{{N_{l} }}\) is the mapping performed at \(l{\text{th}}\) layer. This mapping relies on set of parameters \(\theta_{l}\) along with an output vector \(s_{l - 1}\) from the previous layer. The mapping \(f_{l}\) is a function of random variables as it is stochastic. The collection of network parameters is represented with \(\theta = \left\{ {\theta_{1} , \ldots ,\theta_{l} } \right\}\). The \(l{\text{th}}\) layer is fully connected layer with

$$ f_{l} \left( {s_{l - 1} ;\theta_{l} } \right) = \sigma \left( {W_{l} s_{l - 1} + b_{l} } \right) $$
(2)

where activation function is given by \(W_{l} \in R^{{N_{l} \times N_{l - 1} }} ,\,b_{l} \in R^{{N_{l} }} ,\), and σ (·). The parameters set of this layer is \(\theta_{l}\) = {\(W_{l}\), \(b_{l}\)}. A fresh random mapping is created by all layers with stochastic mappings on every invocation. Normalization is used at the output of the last dense layer to alter the data such that it satisfies the average power restriction or the amplitude constraint imposed by hardware. Finally, the compressed version of input data denoted by x is transmitted via Channel net to the gateway.

3.1.2 Channel net

Once the transmitted samples are given to the LoRa channel, the next operation to be performed is the propagation of the signal through the channel. This involves the signal being affected by path loss, shadowing, multi-path, and noise, which can lead to attenuation, distortion, and interference. The channel also introduces timing errors due to the delay and dispersion of the signal.

The Channel net is designed to simulate the effects of the LoRa channel on the transmitted data. The Channel net designed of a single layer with a Gaussian noise function, where the standard deviation of the noise is determined by the path loss and shadowing effects, and the amplitude and phase of the noise are determined by the fading effect. Each in-phase and quadrature-phase (IQ) sample component is amplified by a genuine Gaussian random variable N in the standard channel known as Additive White Gaussian Noise (AWGN). To simulate the channel effects, a stochastic channel model can be used, which incorporates the LoRa channel features. The most common propagation models used for LoRaWAN systems are the log-normal shadowing model and the Rayleigh fading model. The parameters used to simulate the channel includes the distance between the transmitter and receiver, the frequency of the signal, the gain of the antennas, and the standard deviation of the shadowing and fading models.

The stochastic channel model for LoRa is designed as shown in Fig. 4 with the following components:

  1. 1.

    Upsampling and pulse shaping: In order to accurately reflect the proportion of complex samples to symbols, we set sampling factor β ≥ 1. To begin, we upsample the input symbol vector x ∈ \(C^{n}\) by appending β − 1 zeros at the end of each symbol. Then, passed through a discrete normalized root-raised cosine filter \(g_{{{\text{rrc}}}} \left( t \right)\). Upsampled and filtered output \(g_{{{\text{rrc}}}} \in C^{{\left( {N_{{{\text{msg}}}} + L - 1} \right)}}\) contains complex-valued samples of length \(N_{{{\text{msg}}}} + L - 1\).

  2. 2.

    Sample offset time: Due to asynchronization of sender and receiver, the sample time has a random offset, indicated by \(\tau_{{{\text{off}}}}\). Since it is anticipated that the receiver would operate directly on IQ-samples received without resorting to any conventional synchronization methods, this timing offset may be modeled during the pulse-shaping stage. The time-shifted filter \(g_{{{\text{rrc}}}} \left( {t - \tau_{{{\text{off}}}} } \right)\) is used to calculate the convolution of the upsampled input.

  3. 3.

    Phase offset and carrier frequency offset: The carrier frequency offset occurs when the oscillator frequencies of the sender \(f_{{{\text{tx}}}} \) and receiver \(f_{{{\text{rx}}}} \) in radio hardware are slightly out of sync. We describe this as a time-varying rotation impact on the complicated IQ samples.

    $$ x_{{{\text{cfo}},}} k = x_{{{\text{rrc}}}} ,ke^{{j\left( {2\pi t\Delta \varphi + \varphi_{{{\text{off}}}} } \right)}} $$
    (3)

where \(f_{s}\) is a sampling frequency, \(\Delta \varphi = \frac{{f_{{{\text{cfo}}}} }}{{f_{s} }}\) is the common-phase offset, and \(\varphi_{{{\text{off}}}}\) is an optional unknown phase offset.

Fig. 4
figure 4

Representation of channel modeling process

  1. 4.

    Path loss model: The path loss model is used to simulate the attenuation of the signal as it travels through the channel. The Friis transmission equation [22] is used to model the path loss, which is given by:

    $$ P_{r} = P_{t} *G_{t} *G_{r} *\left(\frac{\lambda }{4\pi d}\right)^{2} $$
    (4)

    where \(P_{r}\) is the received power, \(P_{t}\) is the transmitted power, \(G_{t}\) and \(G_{r}\) are the gains of the transmitting and receiving antennas, λ is the wavelength of the signal, and d is the distance between the transmitter and receiver.

  1. 5.

    Shadowing model: The shadowing model is used to simulate the attenuation of the signal due to obstacles in the environment. The log-normal distribution is considered to model the shadowing, which is given by:

    $$ {\text{PL}} = {\text{PL}}\left( {d_{0} } \right) + 10\gamma \log 10\left( {\frac{d}{{d_{0} }}} \right) + X $$
    (5)

    where PL is the path loss, \(d_{0}\) is the reference distance, \(\gamma\) is the path loss exponent, and X is a random variable representing the log-normal shadowing with a standard deviation σ.

  1. 6.

    Fading model: The fading model is used to simulate the variation in the signal amplitude and phase due to multi-path propagation. The Rayleigh distribution is used to model the fading, which is given by:

    $$ h = \left( {\frac{1}{\sqrt 2 }} \right)*\left( {a + ib} \right) $$
    (6)

    where \(a\) and \(b\) are independent, identically distributed Gaussian random variables with zero mean and unit variance.

  1. 7.

    Additive White Gaussian: To simulate the effects of noise and interference in the channel model, we have considered AWGN. Therefore, the output of the channel is described as having the form y ∈ \(C^{{N_{{{\text{msg}}}} + L - 1}}\).

    $$ y = x + n_{k} $$
    (7)

    where \(n_{k} \sim {\text{CN}}\left( {0,\, \sigma^{2} } \right)\).

The stochastic channel model takes the transmitted signal samples as input and applies the above-mentioned channel effects to produce the received signal samples. These received signal samples are then fed into the receiver net of the autoencoder model for decoding and demodulation.

3.1.3 Receiver net

Demodulation of LoRa signals relies on the orthogonality of the underlying basis signals, as well as the cross-correlation qualities that exist between the \(2^{{{\text{SF}}}}\) different potential LoRa basis signals. The LoRa receiver’s correlator would provide \(2^{{{\text{SF}}}}\) outputs according to the received signal’s correlation with all basis signals. The default approach for recognizing LoRa symbols is to choose the index of the LoRa base signal that has the maximum correlation value with the signal that has been received.

As shown in Fig. 3, the receiver net is designed as DNN architecture consisting multiple fully connected layers with its final layer activated using a “softmax” function. The modulus of the de-chirped received samples will serve as the input to the receiver net, and there will be \(C^{n}\) input nodes. The output is comprised of the bits that make up the symbol that is being conveyed, which results in output nodes equal to M. The ReLU activation is employed in the hidden layers of the network. In the output layer, the sigmoid function is used to transform the output values into a range from [0, 1]. To avoid overfitting, batch normalization is included in the hidden layers. The complex value is transformed into its real value in the receiver network by adding the real and imaginary parts of the channel’s output. The output of receiver \(b \epsilon (0,\,1)^{M}\) is a vector of probabilities that allocates probabilities to each of the potential messages.

4 Implementation

The proposed autoencoder is implemented for LoRaWAN communication by training the autoencoder with IQ data collected from LoRa nodes. Table 1 shows the LoRaWAN attributes that were considered for system design and data gathering. Table 2 lists the architectural parameters of an autoencoder network. The Stochastic Gradient Descent (SGD) method is implemented for training the autoencoder. As the communication issue has been formulated as a classification challenge, it is appropriate to employ the cross-entropy loss function

$$ L_{{{\text{loss}}}} = - \log \left( {b_{s} } \right) $$
(8)

where \(b_{s}\) stands for the \(s{\text{th}}\) component of b. In light of the fact that we are working with an autoencoder, which requires that the output and the input be the same throughout training, we have a set number of M distinct training labels. Usage of randomized channel functions as a regularization prevents the NN from overfitting, as the receiver never sees the same training sample again. Training using the same set of M labels over and over again yields an unlimited amount of labeled training data. The autoencoder was separated into a transmitter (TX) and a receiver (RX) after training, with each half responsible for establishing a different mapping TX: M \(\to C^{n}\) and RX: \(C^{n} \to M\).

Table 1 Summary of LoRa network Parameters
Table 2 Autoencoder network architectural parameters

4.1 Training of autoencoder

The main benefit of representing the whole communication network from end to end as an autoencoder is that it makes the training process easier. The backpropagation technique [23] is used by all cutting-edge DL programs to efficiently calculate gradients across all layers. This technique can only be used with models of stochastic channels, which provide a mathematically differentiable transfer function for the channel throughout all training data. To address the mentioned issue, a two-stage training technique related to transfer learning [24] is employed. The overall training process [25] is depicted in Fig. 5. To begin, an autoencoder is trained with the use of a stochastic channel model that was built to precisely describe the LoRa channel behavior (Phase I). The pseudocode for stochastic channel modeling is given in algorithm 1. The initial performance will be dependent on the accuracy of the model with trained transmitter and receiver deployment for over-the-air communication. Inconsistencies between the simulated and actual communication channels are a common source of system failure.

Fig. 5
figure 5

Representation of two-phase training technique

We address this mismatch by performing (Phase II) by fine-tuning the receiver component of the autoencoder. The sender will send several messages across the real LoRa channel, and the receiver will record the corresponding IQ samples. After gathering enough data from these samples and message indices, a guided receiver tuning is performed. Transmitters in effective models of stochastic channels acquire representations ‘x’ of the message ‘s’, which are resilient to distortions introduced by the channel. In spite of any differences in channel behavior, the acquired representations are sufficient for training a receiver that reliably recovers the transmitted messages.

figure a

5 Results and discussion

To train the autoencoder, we created a labeled dataset by simulation. This dataset contains LoRa IQ symbols with SF ranges from 7 to 12, a bandwidth of 125 kHz, a carrier frequency of 868.1 MHz, a coding rate of 4/5, and a number of various channel impairments, as described in Sect. 3. In the first step of the process, an open-source LoRa simulator is used to generate a set of LoRa symbols [26]. After that the data is processed via a radio channel emulator, which causes various impairments to be introduced into them. These impairments include AWGN noise, carrier offset, time offset, pathloss, and shadowing. The output of the channel emulator is recorded as in-phase and quadrature information, which consists of two sinusoids that are π/2 radians out of phase with one another. LoRa demodulation methods are then used on the channel’s output to acquire the demodulated samples, which are then used to train the receiver net in the autoencoder. As mentioned in the training process, the receiver is trained with stochastic channel output samples and finetuned with the real channel samples.

In the first step of our process, we generated 10,000 LoRa IQ samples of data transmissions with SF values in the range of 7 to 12. The produced dataset is partitioned into three distinct subsets: training, validation, and test sets. The autoencoder is first trained with the help of the training data set, after which it is validated and tested for its performance in terms of BER and PSR. Later, the dataset is divided into segments based on each SF, and the autoencoder is tested using a set of data for each particular SF. We have also used a dataset with varying numbers of transmissions to test the autoencoder’s robustness against interference, which grows in proportion to the number of transmissions. Therefore, the autoencoder is subjected to testing for a variety of SFs and interference levels as well.

The stochastic channel model is used to train the autoencoder employing SGD and Adam optimizer [27], with a learning rate of 0.001. We trained through 60 iterations of 10,000 arbitrary messages with a batch size of 50, 100, 500, and 1000 rising every 20 epochs. The validation accuracy rapidly surpasses 91.5%, while the validation loss decreases gradually as shown in Fig. 6a. To fine-tune the training data, we have used sequences for which the first receiver achieved a BER performance in range of \(10^{ - 1}\) and \(10^{ - 4}\). To increase performance in the low SNR region, we used fine-tuning of sequences with which the original receiver’s performance was less than around \(10^{ - 1}\). Additionally, it brought for a considerable error floor in the region with a high SNR. Due to the fact that fine-tuning with extremely noisy sequences obscures crucial data structure, the receiver loses its capacity to adapt to high SNR. Finally, we found that fine-tuning using sequences for which the BER was less than \(10^{ - 4}\) led to a small but significant improvement. Fine-tuning was performed over the course of one epoch per batch size, with batch sizes of 1000, 5000, and 10,000, respectively. The training is performed with a limited number of iterations to avoid the neural network being overtrained. A comparison of the autoencoder’s performance with and without fine-tuning is depicted in Fig. 6b.

Fig. 6
figure 6

a Performance of autoencoder b Autoencoder training loss with and without fine-tuning of receiver net (RX)

5.1 Performance metrics

The quality of service of a LoRa network depends on several parameters and metrics, including coverage, data rate, latency, packet success rate, bit error rate, scalability, and Interference. We evaluated the efficacy of a LoRaWAN network with the proposed autoencoder using the following three metrics.

5.1.1 Bit error rate

The bit error rate (BER) is defined as the percentage of lost data relative to the overall data. We have evaluated the performance of LoRa DL autoencoder with conventional LoRa in terms of BER. This evaluation consists of multiple tests corresponding to each SF. The BER is evaluated with respect to SNR for each individual SF. The BER curves of proposed model along with traditional LoRa are presented in Fig. 7. In conventional LoRa, the BER increases as the SNR decreases. The proposed autoencoder model provides substantially lower BER than traditional LoRa at the same SNR. The improvement in BER is more prominent at lower SNR values. In terms of SF, the BER will typically decrease as the SF value increases, with the autoencoder providing almost the same level of performance across the board for all SF values.

Fig. 7
figure 7

BER analysis of proposed model in comparison with conventional LoRaWAN

5.1.2 Collision rate

The collision rate is the percentage of packets that collide with other packets and are not successfully received by the receiver device out of the total number of packets transmitted. The network throughput will be massively impacted by collision rate. As the number of transmissions increases, the collision rate will increase due to the increased likelihood of packets colliding with each other. The relationship between the number of transmissions and collision rate for proposed autoencoder and conventional LoRa are given in Fig. 8a. The conventional LoRa network shown collision rate of 82.5% for around 600 number of transmissions and the proposed autoencoder lowered it by almost 20% by achieving 62%.

Fig. 8
figure 8

Comparison of collision rate a and Packet success rate b of proposed model with conventional LoRaWAN

5.1.3 Packet Success Rate

PSR is the ratio of reliably received data packets to the total number of data packets sent. In order to characterize the reliability and coverage of LoRa network, PSR values can be utilized. We have calculated the PSR of autoencoder by varying the number of transmissions. The comparative results are presented in Fig. 8b. The autoencoder shown 5% of improvement in PSR compared to traditional LoRa.

5.2 Testing scenarios

In order to evaluate the autoencoder in various test scenarios, the model’s performance is examined for data with different spreading factors ranging from 7 to 12. Initially, the autoencoder is trained and tested with the dataset of samples taken from LoRa nodes which used all types of SFs. In this test scenario, the autoencoder was subjected to further testing using multiple set of input samples containing only data pertaining to each SF individually. The performance of the autoencoder in relation to the various input sets was calculated in terms of categorical cross-entropy loss of the model and the findings are presented in Fig. 9a. Based on the results, it can be concluded that the proposed autoencoder exhibits superior performance with higher SFs as compared to the lower ones, albeit the difference is relatively minor. Nonetheless, it can be ascertained that the autoencoder delivers remarkable performance for all SFs overall.

Fig. 9
figure 9

Performance of proposed model for a different spreading factors b different levels of interference

In a second scenario, the autoencoder is evaluated for different levels of interference. The autoencoder is tested with different datasets by increasing the number of transmissions. The loss value of autoencoder for various levels of interference is presented in Fig. 9b. In a traditional LoRaWAN network, the number of collisions will rise as the number of transmissions in the network increases, which will result in a degradation of the network’s performance. In the same manner, the performance of autoencoder degraded slightly with an increase in the number of transmissions, but not by an unacceptable amount.

6 Conclusion and future scope

In this article, we have proposed a novel approach to improve the performance of LPWANs by integrating the intelligence of DL. Specifically, we have demonstrated the feasibility of building an end-to-end communication system for LoRa using DNNs. We have developed a framework for designing, training and evaluating an autoencoder with different channel impairments to emulate practical LoRa communication channel conditions. Our results indicate that the proposed model performs efficiently in comparison with classic LoRa system. The proposed model achieved 5% of improvement in PSR and reduced 20% of collision rate. In terms of BER also the proposed model shown moderate improvement. We anticipate that performance will be enhanced further by adjusting hyperparameters and altering the NN topologies. Future work will involve rigorous training and testing to optimize different network parameters and improve overall performance. Implementing the proposed concept in real-time with hardware is also an interesting direction for future research.