# Secure MRI Brain Image Transmission Using IOT Devices Based on Hybrid Autoencoder and Restricted Boltzmann Approach

Authors: S. Aruna Deepthi; E. Sreenivasa Rao; M. N. Giriprasad
Journal: Journal of Sensors
 (2022)

---

## Abstract

In recent times, the medical image processing solves several clinical issues by inspecting the visual images, which are generated in the clinical health care units. The main objective of the research is to gain valuable information from the images for better clinical diagnosis. In the biomedical engineering domain, the medical image analysis is an emerging research topic. In the recent decades, the use of medical images is highly growing, which are acquired from different image modalities; so, there is a necessity for data compression for transmission, storage, and management of digital medical image datasets. Hence, the machine learning methods are effective for medical image analysis, where the deep learning models are used in the machine learning tools for automatically learning the feature vectors from the huge medical datasets. The automated deep learning models are effective compared to the conventional handcrafted features. In addition to this, a wireless sensor network (WSN) is used to create a primary health care scheme, which brings patient data together and expands the medical conveniences, whereas the WSN design must comprise of sensor nodes, because it consumes less power and resources at a relatively low cost; so, it is essential for implementing the Raspberry Pi-based WSN nodes. The sensor nodes are important for limited battery capacity and to transmit the vast amount of medical data. The proposed work is broadly classified into two categories such as (i) the medical image compression algorithm is developed using the deep learning model based on autoencoders and restricted Boltzmann machines (RBM) and (ii) implementation of the WSN sensors nodes with Raspberry Pi and Messaging Queue Telemetry Transport (MQTT) Internet of Things (IoT) protocol for secure transmission of the medical images. The experimental results are evaluated using the standard performance metrics like peak signal to noise ratio (PSNR) and presented a Real-Time Linux (RTL) implementation of the design. The proposed model showed 10 dB to 15 dB improvement in the PSNR value, while transmitting the medical images, which is better compared to the existing model.


---

## Body

## 1. Introduction

Magnetic resonance imaging (MRI) or computerized tomography (CT) scan medical imaging creates digital images of the human body. While these imaging techniques generate enormous quantities of data, compression is needed for storage and transmission [1]. Most current compression schemes achieve a high compression rate at the expense of significant quality loss. Maintaining image quality only in the area of interest, i.e., in medically relevant regions, may be required in some areas of medicine. A standard 12-bit medical X-ray has a dimension of 2048 pixels by 2560 pixels. This equates to 10,485,760 bytes in file size. A standard 16-bit mammogram image could be 4500 pixels by 4500 pixels, with a file size of 40,500,000 bytes (40 MB) [2]. This has implications for disc storage as well as image transmission time. Despite the fact that disc capacity has steadily increased, the amount of digital imagery provided by hospitals and their new filmless radiology departments has increased even more rapidly. Even if there was limitless storage, the issue of transmitting the images would still exist.Most hospitals have remote clinics or satellite centers in small towns and remote areas to make it easier for patients who have difficulty travelling long distances to the clinic, particularly for diagnostic procedures. These facilities use applications, which enable clinic staff to work without the presence of a radiologist. A clinic technician or basic radiologist will take the X-ray and send it to the hospital via a network connection, where a diagnostic radiologist will read it and send back a diagnosis. Although this may seem to be reasonable, keep in mind that the patient is often asked to remain in the imaging machine until the radiologist certifies that the data is sufficient. Not only does compression affect storage costs but it also affects transmission times, MRI apparatus use, and patient safety and security [3].Compression techniques can help improve overall treatment by reducing file size and transmission time. The redundancy that occurs in images is exploited by image compression techniques. Different forms of redundancy exist. Each compression technique can take advantage of one of these redundancies. Spatial, temporal, and spectral redundancies are the three forms of redundancies [4]. Deep learning is a branch of machine learning that is based on a neural network that processes data and mimics the thought process by layering algorithms. Deep learning uses a deep architecture consisting of several layers of transformations to simulate the functioning of the human brain [5]. This is close to how the human brain processes knowledge. Traditional machine learning techniques performed poorly when faced with high-dimensional data, necessitating a preliminary feature extraction process to transform the most informative representation of the raw data into a normalization matrix. Deep learning got rid of the difficult task of sophisticated automated feature extraction without sacrificing the data’s sense. Autoencoder is a form of unsupervised artificial neural network that learns the most efficient data. The goal of an autoencoder is to learn a representation called encoding, which is then used to reduce dimensionality by training the network. We have considered both the autoencoder [6] and RBM [7] as the compression techniques for medical images on the belief that they can be used to select the most discriminative features in an image in a most efficient manner leading to smaller footprint of the image without losing quality.WSN [8] is a communication network that does not rely on wires or other electronic links between them. WSNs are used in industries like manufacturing, forest fire detection, transportation, construction, and office space surveillance and monitoring. WSNs are usually deployed closer together in inaccessible locations where battery replacement is nearly impossible. The WSN’s key challenges include limited power, limited processing ability, and an open climate. We choose to implement the system design for wireless sensor networks with Raspberry pi (RPi) [9], a small footprint hardware device with wireless, and Bluetooth capabilities for communication with other similar Raspberry Pi units that can act as sensor nodes to which the compressed medical images can be transmitted. The platform comprises of four WMSN nodes built with the Raspberry Pi (RPi) [9]; we introduce a technique where every source node retains its data transmission rate uniformly and periodically apprises its information sending rate based on the other node’s congestion level. Each node is identified by a unique IP address so that it can create a routing path to the sink using multihop communication; we also propose the MQTT [10] protocol for the transmission mechanisms, where the packets lost can be stored and retransmitted when the network bottleneck has cleared. The suggested platform can be adaptable, accessible, and appropriate for wireless monitoring of constructions, open spaces, remote locations, etc., which is depicted in Figure 1.Figure 1
Raspberry Pi WSN with four nodes for compressed image transmission using MQTT.Largely, the information handling utilizes far less power than transmitting it in a wireless channel. Hence, by compressing the images before transmitting them will considerably reduce the net energy consumed across the sensor nodes. It is also feasible for image compression to be sustained at a high compression ratio without evident degradation of quality in the reconstructed images [11] The image compression schemes proposed and developed in this work could have some parameters such as minimalism in coding, minimal memory demand, low computational need, and maximum compression rate. The image compression process in WSN is stated in Figure 2.Figure 2
Image compression in a WSN.The major contributions of this research are given below:(1)
Developed a medical image compression algorithm based on the autoencoders and restricted Boltzmann machines. An effective image algorithm consumes less space on the hard-drive and effectively retains the same physical size(2)
WSN sensor’s nodes with Raspberry Pi and MQTT IoT protocol is implemented for secure transmission of the medical images, and then the proposed model effectiveness is validated by using the performance measures like PSNRThis research manuscript is structured as follows: the Section2 surveys the related research literature articles and previous published papers on the topic “medical image compression and WSN.”. The Section 3 covers the general performance metrics used to analyze the compression standard and then the relevant research. In addition, the compression methodologies used in this work are discussed effectively in Section 3. The Section 4 provides information about the WSN design with Raspberry Pi, and the Section 5 provides the results achieved with the compression algorithms with the original and the reconstructed images. The RTL schematic diagram is provided in Section 5. The Section 6 discusses the scope of the work and its implications for future research in the field.


## 2. Related Research Works

In today’s healthcare systems, medical imaging is a necessary tool. With applications in tumor segmentation, cancer identification, classification, image driven therapy, medical image description, and restoration, machine learning plays a critical role in CADx. Since any redundant information is lost during compression, lossy techniques will not be able to restore the original image from the reconstructed image. The lossless procedure will precisely recreate the actual image from the restored image.Information can be compressed using transform-based coding strategies like DCT [12], DWT [13], SVD [14], PCA [15], and wavelet-based compression techniques like EZW [16], SPIHT [17], WDR [18], and JPEG2000 [19]. On satellite images, Walker et al. [20] used PCA and neural network algorithms to compress the data. Finding the covariance matrix, eigenvalue, and eigenvectors of an input image using the PCA method is extremely difficult. PCA is used to compress images, but the compressed result is not considered to be appropriate. The ANN algorithm, which produces better results, will boost the outcome.Gaidhane et al. [21] found that image compression using the wavelet transform produces the best results as compared to DCT for ultrasound and angio images. Blocking objects plagued the DCT process. Puniene et al. [22] used DCT and SPIHT-based compression techniques to compress medical images. DCT is used to decompose the medical image, and then SPIHT is used to compress the coefficients. Singular value decomposition (SVD) and wavelet difference reduction techniques are used by Antonini et al. [14] to propose a lossy image compression method (WDR). The image quality is better with SVD compression, but the compression ratio is poor. As a result, the SVD output was compressed once more using WDR. At high compression ratios, WDR achieves excellent image quality.Angadi and Somkuwar [23] use a combination of SVD and the embedded zero tree wavelet approach to compress ECG signals. The SVD method, followed by the EZW method, has been tested and proven to improve the efficiency of the reconstructed signal. Kumar et al. [24] used DCT and DWT techniques to compress images in wireless sensor networks. As compared to the discrete cosine transform, the discrete wavelet transform has a higher PSNR value and a faster compression process. Each node in a sensor network has extremely limited resources, such as memory, electricity, and processing power. To address these limitations, image compression algorithms rely on DCT and DWT that are used to reduce memory space and storage usage. They evaluate the results of DCT and DWT procedures using several performance metrics, and the results showed that the discrete wavelet transform outperforms the discrete cosine transform in terms of PSNR.Artificial intelligence approaches, specifically in the context of computer vision, imaging, voice recognition, and natural language comprehension [25, 26], are just one of those directions that can help resolve the limitations of traditional image compression standards. Deep learning got ahold of the difficult task of sophisticated automated feature extraction without sacrificing the data’s context. As a result, deep learning for feature extraction and classification of medical images from a variety of diseases has gained a reputation for exceeding expectations and producing more than satisfactory results.After training two stacked denoising autoencoders to obtain a reduced version of the data dimension, Xing et al. [27] used a theory components neural network to classify data. They identified the areas of the brain that distinguish ASD from conventional controls (TC) with approximately 70% accuracy across the entire dataset. Heinsfeld et al. [28] reduced multivariate data using a variational autoencoder (VAE) model and discovered the most discriminative features. Choi [29] added spatiotemporal information in the fMRI to the 3D conventional neural network to detect spatially useful features (CNN). The researchers then devised a voting system based on these characteristics to decide whether or not each subject has ASD.In [30], the authors proposed a DNN-based novel feature election method from fMRI images and then used it to obtain whole-brain function communication patterns using multiple trained sparse autoencoders. They developed a DNN-FS classification model that had an accuracy of 86.36 percent on a sample of 55 ASD and 55 TC.WSN technology can be used to develop realistic Health Care WSNs that meet the main system design requirements of secure connectivity, node mobility, multicast technology, energy efficiency, and timely data delivery. Long data transmission routes, vast volumes of data, and limited battery power all reduce WSN lifetime. The optimization of energy consumption effectively extends the lifespan of the network, which is important. To get more energy optimization, Guo et al. [31] proposed an energy efficient clustering hierarchy protocol for WSN. Mann and Singh [32] presented a routing protocol for WSNs that was established to preserve a reasonable level of scalability, energy efficiency, and reliability. A fuzzy logic and genetic dependent clustering approach to optimize network energy was defined in the paper presented by Sim and Lee [33]. Saeedian et al. [34] employs a Digital Signal Processing-based Wireless Sensor Network Platform to achieve high compression efficiency of physiological data for telemedicine applications.With the advancement in rapid hardware prototyping technology and the advent of microcontroller-based board such as Arduino, ESP32, and Raspberry Pi, WSNs with smaller size footprint, better energy efficiency, and low cost are a reality enabling researchers experiment with them. Hsu et al. [35] created a new model for saving, exchanging, and archiving patient health records using a Raspberry Pi board and a hard drive. The disc that is accessible in the local cloud and can be shared with other public clouds that are farther out, such as Google Drive, Azure Cloud, and other similar services, are available. They also safeguarded the medical details by introducing a new security protocol.Elhoseny et al. [36] used fast bilateral filter for noise removal in the medical images, because it has better edge preservation ability. Further, the image segmentation is carried out by using the canny edge detector. In addition, the developed fast bilateral filter algorithm is implemented in Raspberry Pi by utilizing open CV software. Kumar and Gupta [37] have implemented a fast and secure encryption technique for the medical images on the basis of one dimensional logistic map, which is associated with pseudo random numbers. In the resulting phase, the proposed technique is validated on the standard medical datasets under the conditions of noise and differential attacks. Ahmed and Salah [38] applied a fast sub pixel registration technique to achieve high-resolution image registration on the basis discrete wavelet transform and the convolutional neural network. In this literature, the classification result of convolutional neural network and genetic algorithm is used for MRI image registration.


## 3. Image Compression and Performance Metrics

### 3.1. Image Compression

Image comprises of pixels that are extremely related to each other. Consequently, it holds a sizable quantity of redundancy that utilizes substantial memory for image storage space, which in turn can reduce the transmission bandwidth. These redundancies can be grouped into two classes: (1) spatial and (2) temporal redundancy. In the spatial class, nearby pixels are correlated, whereas in temporal redundancy, there exists similarities between the two subsequent frames. Hence, to eliminate the redundancies, image compression has to be done for a reduced amount of storage area and smaller bandwidth [14, 39, 40].Image compression can further be categorized into two types: lossy and lossless. Lossy image compression is commonly applied in WMSN owing to its gains over lossless compression standards, namely, higher compression rates, that reduces the bytes needed to be transmitted over the WMSN and less power consumption for transmitting the images.Additionally, lossy image compression has the advantage of taking less time for encoding/decoding the image transmitted in relation to lossless compression. This paper focuses its approach on the lossy compression algorithm because of our need to increase the bandwidth availability in the sensor nodes for transmission without any congestion, which can subsequently reduce the transmission delay across the network and provide a more streamlined transfer suitable for live image or video feeds [41].


### 3.2. Performance Metrics

We have studied the compression ratio and peak signal to noise ratio (PSNR) readings to analyze the performance of the compression algorithms considered here. We have decided not to consider the processing time as it would not be fair to compare it between the simulation-based experimental setup versus the Raspberry Pi-based hardware implementation. The mathematics behind the performance metrics used to evaluate the compression schemes is presented below for better understanding of the concepts.


#### 3.2.1. Mean Square Error (MSE)

MSE is defined in Equation (1).
(1)MSEσ2=1N∑n=1Nxn−yn2,where N is the data sequence length, and xn represents the input data sequence, while yn corresponds to the reconstructed data sequence.


#### 3.2.2. Peak Signal to Noise Ratio (PSNR)

The quality of signal representation is influenced by the relationship between the maximum feasible signal value and the distortion capacity, which can be used as a comparison of compressed and original image quality. The better the quality of the compressed or reconstructed image, the higher the PSNR. The decomposed image quality is better when the PSNR value is higher [42]. PSNR is defined as the size of the error in relation to the signal’s peak value xpeak (for 8-bit pixel xpeak2 equals 255) and is calculated using following equation (2).
(2)PSNR=10log10xpeak2σd2,where σd2 is the MSE of (σ2).


#### 3.2.3. Compression Ratio (CR)

Compression ratio (CR) is a phrase used to refer to the ratio of binary sequence length of the compressed output image (B1) to binary sequence length of the original uncompressed input image (B0) and measured as bits per pixel (bpp) as given in Equation (3).
(3)CR=B0B1.It is generally used to find how good the compression efficiency is as a higher value means better compression [42].


#### 3.2.4. Power Consumption

For all practical implementation cases of the WSN, power consumption must be considered as the most important metric, which is highly influenced by the above discussed metrics. The transmission power and the energy dissipation across the nodes can be greatly reduced by adapting to less complex processing units and by minimizing the data size.To summarize, less transmission error is a direct product of low MSE values and has an inverse relation with PSNR, which proportionately increases, which in turn points out the noise in the compressed image is lower and this can help with the better reconstruction of the image.


## 3.1. Image Compression

Image comprises of pixels that are extremely related to each other. Consequently, it holds a sizable quantity of redundancy that utilizes substantial memory for image storage space, which in turn can reduce the transmission bandwidth. These redundancies can be grouped into two classes: (1) spatial and (2) temporal redundancy. In the spatial class, nearby pixels are correlated, whereas in temporal redundancy, there exists similarities between the two subsequent frames. Hence, to eliminate the redundancies, image compression has to be done for a reduced amount of storage area and smaller bandwidth [14, 39, 40].Image compression can further be categorized into two types: lossy and lossless. Lossy image compression is commonly applied in WMSN owing to its gains over lossless compression standards, namely, higher compression rates, that reduces the bytes needed to be transmitted over the WMSN and less power consumption for transmitting the images.Additionally, lossy image compression has the advantage of taking less time for encoding/decoding the image transmitted in relation to lossless compression. This paper focuses its approach on the lossy compression algorithm because of our need to increase the bandwidth availability in the sensor nodes for transmission without any congestion, which can subsequently reduce the transmission delay across the network and provide a more streamlined transfer suitable for live image or video feeds [41].


## 3.2. Performance Metrics

We have studied the compression ratio and peak signal to noise ratio (PSNR) readings to analyze the performance of the compression algorithms considered here. We have decided not to consider the processing time as it would not be fair to compare it between the simulation-based experimental setup versus the Raspberry Pi-based hardware implementation. The mathematics behind the performance metrics used to evaluate the compression schemes is presented below for better understanding of the concepts.


### 3.2.1. Mean Square Error (MSE)

MSE is defined in Equation (1).
(1)MSEσ2=1N∑n=1Nxn−yn2,where N is the data sequence length, and xn represents the input data sequence, while yn corresponds to the reconstructed data sequence.


### 3.2.2. Peak Signal to Noise Ratio (PSNR)

The quality of signal representation is influenced by the relationship between the maximum feasible signal value and the distortion capacity, which can be used as a comparison of compressed and original image quality. The better the quality of the compressed or reconstructed image, the higher the PSNR. The decomposed image quality is better when the PSNR value is higher [42]. PSNR is defined as the size of the error in relation to the signal’s peak value xpeak (for 8-bit pixel xpeak2 equals 255) and is calculated using following equation (2).
(2)PSNR=10log10xpeak2σd2,where σd2 is the MSE of (σ2).


### 3.2.3. Compression Ratio (CR)

Compression ratio (CR) is a phrase used to refer to the ratio of binary sequence length of the compressed output image (B1) to binary sequence length of the original uncompressed input image (B0) and measured as bits per pixel (bpp) as given in Equation (3).
(3)CR=B0B1.It is generally used to find how good the compression efficiency is as a higher value means better compression [42].


### 3.2.4. Power Consumption

For all practical implementation cases of the WSN, power consumption must be considered as the most important metric, which is highly influenced by the above discussed metrics. The transmission power and the energy dissipation across the nodes can be greatly reduced by adapting to less complex processing units and by minimizing the data size.To summarize, less transmission error is a direct product of low MSE values and has an inverse relation with PSNR, which proportionately increases, which in turn points out the noise in the compressed image is lower and this can help with the better reconstruction of the image.


## 3.2.1. Mean Square Error (MSE)

MSE is defined in Equation (1).
(1)MSEσ2=1N∑n=1Nxn−yn2,where N is the data sequence length, and xn represents the input data sequence, while yn corresponds to the reconstructed data sequence.


## 3.2.2. Peak Signal to Noise Ratio (PSNR)

The quality of signal representation is influenced by the relationship between the maximum feasible signal value and the distortion capacity, which can be used as a comparison of compressed and original image quality. The better the quality of the compressed or reconstructed image, the higher the PSNR. The decomposed image quality is better when the PSNR value is higher [42]. PSNR is defined as the size of the error in relation to the signal’s peak value xpeak (for 8-bit pixel xpeak2 equals 255) and is calculated using following equation (2).
(2)PSNR=10log10xpeak2σd2,where σd2 is the MSE of (σ2).


## 3.2.3. Compression Ratio (CR)

Compression ratio (CR) is a phrase used to refer to the ratio of binary sequence length of the compressed output image (B1) to binary sequence length of the original uncompressed input image (B0) and measured as bits per pixel (bpp) as given in Equation (3).
(3)CR=B0B1.It is generally used to find how good the compression efficiency is as a higher value means better compression [42].


## 3.2.4. Power Consumption

For all practical implementation cases of the WSN, power consumption must be considered as the most important metric, which is highly influenced by the above discussed metrics. The transmission power and the energy dissipation across the nodes can be greatly reduced by adapting to less complex processing units and by minimizing the data size.To summarize, less transmission error is a direct product of low MSE values and has an inverse relation with PSNR, which proportionately increases, which in turn points out the noise in the compressed image is lower and this can help with the better reconstruction of the image.


## 4. Image Compression Methodologies

### 4.1. Autoencoders

An auto encoder is a fine example of the unsupervised neural network learning algorithm, and it is graphically depicted in Figure3. Commonly, it is used during the back propagation of the neural network model where the target values are selected to be equal to the inputs such that yi=xi. It makes use of the convergent and divergent layers where convolution and deconvolution take place, and the features are compressed in the middle layers to generate the desired output.Figure 3
The structure of proposed convolutional autoencoders (CAE) for MNIST.An autoencoder can be mathematically characterized as follows to describe the encoder and the decoder sections of the model [6], as mentioned in the equations (4)–(6).
(4)ϕ:Χ⟶F,(5)ψ:F⟶X,(6)ϕ,ψ=argminϕ,ψX−ψoϕX2.As can be seen from the equations (4)–6, presented above, the encoder and decoder parameters are enhanced in a manner that minimizes the reconstruction error, which is the error between the original input image and the reconstructed compressed image.The parameter settings of the convolutional autoencoder are given below [12]:Number of batches: the original image is divided into training set and further, it is divided into many batches to perform the stochastic gradient descent optimization of the model. In this experimentation, the batch size is considered as 100Learning rate: at any time, the model weight is changed at every iteration, a hyperactive parameter that restricts how to adjust the model in response to the predicted error. It should be minimal, but not too small, as this could lead to a lengthy training phase, where the learning rate is considered as 0.01, and the number of iteration is assumed as 2000Max epochs: this cannot be a definite value based on logic but just a backstop against endless iterations. It can be easily changed to a suitable value later if the model seems to overfit or underfit the learning experience. The maximum epoch of 2000 is considered for training the model


### 4.2. Restricted Boltzmann Machines (RBM)

Boltzmann machines, as with any other neural network, consist of an input layer and several hidden layers. The neurons make stochastic decisions [43] like when to turn on depending on the data fed during the training process and based on the minimization of the cost function. The Boltzmann machine upon training attains the learning to deduce some interesting features from the dataset on which it is trained that can help the model to learn the complex fundamental relationships and patterns inherent in the data [22].From Figure4, it can be seen that the weight, wij∋W, is connected to the visible unit, V, to the hidden unit, h, where W∋Rmxn is the super set of all the weights, considering both the hidden and visible units. The visible unit, V, biases can be signified as bi∋b, while the hidden unit, h, biases are represented as cj∋c.Figure 4
Basic structure of a restricted Boltzmann machine.We can assume that the joint distribution of a visible layer vector,V, and a hidden layer vector, h, is proportional to the exponential of the negative energy of the configuration as shown in Equation (7) based on [24]: the Boltzmann distribution from statistical physics:
(7)Pv,h∝e−Ev,h.Before designing the RBM model using deep learning approach, we can reset the parameters to the original ones or leave them as defaults reasonable for most image processing applications. The parameters setting of restricted Boltzmann machine [43] is discussed below:Random initialization iterations: initially, a set of random number of trail weights is considered for each layer of the network in order to use it as a good starting point for testing the model. Here, a stochastic gradient descent training is applied, and the number of iterations is selected as 2000Number of batches: the training set is divided into batches to reduce the processing time and memory of hardware, where the batch size is considered as 100Learning rate: in the case of autoencoder, the learning rate should be small for reducing the training process length that helps in the faster generation of the learning model, and the learning rate is considered as 0.1Max epochs: the maximum number of epochs is selected by trial and error, and the number is adjusted based on the learning rate, whether it is overfitting or underfitting. The maximum epochs is considered as 100, but it is dynamically changed based on the above scenarios


## 4.1. Autoencoders

An auto encoder is a fine example of the unsupervised neural network learning algorithm, and it is graphically depicted in Figure3. Commonly, it is used during the back propagation of the neural network model where the target values are selected to be equal to the inputs such that yi=xi. It makes use of the convergent and divergent layers where convolution and deconvolution take place, and the features are compressed in the middle layers to generate the desired output.Figure 3
The structure of proposed convolutional autoencoders (CAE) for MNIST.An autoencoder can be mathematically characterized as follows to describe the encoder and the decoder sections of the model [6], as mentioned in the equations (4)–(6).
(4)ϕ:Χ⟶F,(5)ψ:F⟶X,(6)ϕ,ψ=argminϕ,ψX−ψoϕX2.As can be seen from the equations (4)–6, presented above, the encoder and decoder parameters are enhanced in a manner that minimizes the reconstruction error, which is the error between the original input image and the reconstructed compressed image.The parameter settings of the convolutional autoencoder are given below [12]:Number of batches: the original image is divided into training set and further, it is divided into many batches to perform the stochastic gradient descent optimization of the model. In this experimentation, the batch size is considered as 100Learning rate: at any time, the model weight is changed at every iteration, a hyperactive parameter that restricts how to adjust the model in response to the predicted error. It should be minimal, but not too small, as this could lead to a lengthy training phase, where the learning rate is considered as 0.01, and the number of iteration is assumed as 2000Max epochs: this cannot be a definite value based on logic but just a backstop against endless iterations. It can be easily changed to a suitable value later if the model seems to overfit or underfit the learning experience. The maximum epoch of 2000 is considered for training the model


## 4.2. Restricted Boltzmann Machines (RBM)

Boltzmann machines, as with any other neural network, consist of an input layer and several hidden layers. The neurons make stochastic decisions [43] like when to turn on depending on the data fed during the training process and based on the minimization of the cost function. The Boltzmann machine upon training attains the learning to deduce some interesting features from the dataset on which it is trained that can help the model to learn the complex fundamental relationships and patterns inherent in the data [22].From Figure4, it can be seen that the weight, wij∋W, is connected to the visible unit, V, to the hidden unit, h, where W∋Rmxn is the super set of all the weights, considering both the hidden and visible units. The visible unit, V, biases can be signified as bi∋b, while the hidden unit, h, biases are represented as cj∋c.Figure 4
Basic structure of a restricted Boltzmann machine.We can assume that the joint distribution of a visible layer vector,V, and a hidden layer vector, h, is proportional to the exponential of the negative energy of the configuration as shown in Equation (7) based on [24]: the Boltzmann distribution from statistical physics:
(7)Pv,h∝e−Ev,h.Before designing the RBM model using deep learning approach, we can reset the parameters to the original ones or leave them as defaults reasonable for most image processing applications. The parameters setting of restricted Boltzmann machine [43] is discussed below:Random initialization iterations: initially, a set of random number of trail weights is considered for each layer of the network in order to use it as a good starting point for testing the model. Here, a stochastic gradient descent training is applied, and the number of iterations is selected as 2000Number of batches: the training set is divided into batches to reduce the processing time and memory of hardware, where the batch size is considered as 100Learning rate: in the case of autoencoder, the learning rate should be small for reducing the training process length that helps in the faster generation of the learning model, and the learning rate is considered as 0.1Max epochs: the maximum number of epochs is selected by trial and error, and the number is adjusted based on the learning rate, whether it is overfitting or underfitting. The maximum epochs is considered as 100, but it is dynamically changed based on the above scenarios


## 5. Raspberry Pi WSN Implementation

The hardware implementation was done using Raspberry Pi, and MQTT (Message Queuing Telemetry Transport) protocol was selected as the de facto method to transfer the compressed images across the Raspberry Pi WMSN [9]. MQTT was an opt choice for wireless networks where high latency is an issue due to its bandwidth constraints and unpredictable network downtimes. In case of the connection gets broken when a subscribing client tries to access the transmitted image from the broker, the broker has the ability to buffer the lost messages back to the subscriber again when the network becomes online. Similarly, when the publisher node loses the connection with the broker, the broker can initiate the process to close the connection; before it can send all the subscribed nodes in the network, the cached message received earlier from the subscriber.This process is explained clearly in Figure5 with a block diagram. Here, we have used four Raspberry Pi nodes which can behave as publisher, broker, and subscriber. A publisher, by design, can behave as both a publisher and a subscriber; so, every other Raspberry Pi node can transmit and receive images except the broker which can only facilitate the communication between the subscriber and the publisher. Any Raspberry Pi node can initiate the transmission across the WMSN by acting as a publisher by transmitting images to the broker, while the other nodes can subscribe to receive the images from the broker, which can then serve the images to the subscriber.Figure 5
MQTT architectural block diagram.


## 6. Results and Discussion

We have used different approaches in the evaluation of results by analyzing the performance metrics of the image compression and WSN using both simulation and hardware implementations. The simulation analysis is done on the system configuration with 128 GB random access memory, 4 TB hard disk, windows 10 operating system, and Intel core i9 processor.The hardware implementation was done using Raspberry Pi, and MQTT (Message Queuing Telemetry Transport) protocol was selected as the de facto method to transfer the compressed images across the Raspberry Pi WMSN [9]. MQTT was the apt choice for wireless networks where high latency is an issue due to its bandwidth constraints and unpredictable network downtimes. In case of the connection gets broken when a subscribing client tries to access the transmitted image from the broker, the broker has the ability to buffer the lost messages back to the subscriber again when the network becomes online. Similarly, when the publisher node loses the connection with the broker, the broker can initiate the process to close the connection; before it can send all the subscribed nodes in the network, the cached message received earlier from the subscriber.Our experimental process is concerned with analyzing the performance of the neural network-based image compression schemes by comparing their PSNR values when the images are transmitted through the WMSN. We have used the MRI images from the brain tumor dataset gathered from [44] for our experiment for its simplicity and availability of large number of images.Test images included T1-weighted MR images with a TR of 1740 and an echo time (TE) of 20, T2-weighted MR images with a TR of 5850 and an echo time (TE) of 130, and FLAIR-weighted MR images with a TR of 8500 and an echo time (TE) of 130.A 3 Tesla Siemens Magnetron Spectra MR computer was used to create these test images. The total number of slices for all channels was 15, resulting in 135 images at 9 slices or images per patient with a field of view of 200 mm, a 1 mm interslice distance, and voxel sizes of0.78mm×0.78mm×0.5mm. The proposed technique is tested on a real dataset that includes 512×512 pixel brain MR images, which was converted to grayscale before processing using autoencoder/RBM. The autoencoder/RBM compression for sample test MR images with and without tumor is given in Figures 6–9. The images consisted of both the images with tumors detected and tissues without tumor (healthy tissues). We adopted this approach to analyze the performance of the image compression algorithms on both the MR images with and without tumor and identify if the tumor issues are visible after compression.Figure 6
Autoencoder compression for sample test MR images with tumor. (a) Actual images. (b) Compressed images.
(a)(b)Figure 7
Autoencoder compression for sample test MR images without tumor. (a) Actual images. (b) Compressed images.
(a)(b)Figure 8
RBM Compression for sample test MR images with tumor. (a) Actual images. (b) Compressed images.
(a)(b)Figure 9
RBM Compression for sample test MR images without tumor. (a) Actual images. (b) Compressed images.
(a)(b)The RTL schematic for autoencoder and RBM was implemented with Xilinx ISE development platform version 14.1 of family Virtex 6-XC6VLX757, and the device utilization summary is given in Tables1–4. RTL schematic is shown below in Figures 10 and 11. Comparing the RTL design of RBM with autoencoder, we can easily infer that RBM utilizes far lesser flip flops in its design for the same image compression, which attests for its superior performance when compared with autoencoder. It also performs better other factorization-based image compression methods by a significant factor.Table 1
Autoencoder–PSNR values for test sample of two images with and without tumor.
Images with tumor (dB)Images without tumor (dB)11.563911.819913.57506.8321Table 2
RBM–PSNR values for test sample of two images with and without Tumor.
Images with tumor (dB)Images without tumor (dB)11.87410.7859.5729.264Table 3
Autoencoder Xilinx ISE device utilization factor.
Logic utilizationUsedAvailableDevice utilizationNo. of slices28446566%No. of slices in flip flops6093120%No. of 4 input LUTs43093124%No. of bonded IOBs659270%No. of GCLKs1244%Table 4
RBM Xilinx ISE device utilization factor.
Logic utilizationUsedAvailableDevice utilizationNo. of slices44746569%No. of slices in flip flops5693120%No. of 4 input LUTs86193129%No. of bonded IOBs659270%No. of GCLKs1244%Figure 10
RTL schematics of autoencoder design.Figure 11
RTL schematic of restricted Boltzmann machines (RBM).


## 7. Discussion

The proposed model’s performance is validated by comparing it with the existing model developed by Elhoseny et al. [36]. In the existing work, the author developed fast bilateral filter for noise removal in the medical images. The fast bilateral filter has better edge preservation ability. Then, the canny edge detector is developed for segmenting the brain tissues. Lastly, the fast bilateral filter algorithm is implemented in Raspberry Pi by utilizing open CV software. Compared to the existing model, the proposed model achieved showed 10 dB to 15 dB improvement in the PSNR value, while transmitting the medical images. In addition, the effectiveness of the security protocol is as follows: MQTT is validated in terms of accuracy, precision, and recall. In our test case, the MQTT protocol achieved 95.60% of accuracy, 96.90% of recall, and 95.92% of precision, which is better compared to the existing technique [38], where the existing technique achieved only 90.90% of precision and recall and 94% of accuracy.


## 8. Conclusion

This work was chiefly carried out to analyze the performance of the deep learning algorithms in compressing medical MRI images and the efficiency of the Raspberry Pi WSN in transmitting the compressed images across the WSN nodes. Since there are many requirements in the medical field where the need to stream the medical images across the WSN with greater efficiency for immediate presentation and diagnosis of doctors, it calls for optimized compression of images for preserving the data transmission bandwidth and lesser transmission time at the same time not losing any considerable loss of image quality as it is impair the prognosis. The deep learning neural network implementations of autoencoder and RBM coded on Raspberry Pi with MQTT as the transmission protocol for additional security in the WSN performed as per the expectations with minimal power loss and latency. The RTL schematic implementation was done for all the image compression schemes used in the paper as a means to find out the device utilization in the WSN. This can be used as the foundation for the further development of the work on custom FPGA boards that can offer more control over the power performance of the WSN.



---

*Source: 5841630-2022-05-29.xml*