# The Proposed Model

The block diagram of the proposed system is depicted in Fig. 4.1. It is comprised of eight major elements:

- • Medical IoT Devices
- • UCI Repository Data Set
- • Medical Records
- • Cloud Database
- • Data Collection Module

FIGURE 4.1 Block diagram of the proposed model.

- • Secured Storage Mechanism
- • Health Prediction
- • Diagnosing System and Knowledge Base

The wearable as well as the embedded IoT devices are assumed as IoT devices. Such tolls are applied in collecting medical data even at remote sites. The UCI Repository is composed of the diabetes data set. The medical data set contains patient record histories that have been gathered from hospitals. Hence, data sets are saved in the cloud database. The data collection process is suitable for gathering essential data from a cloud database.

The essential data will be saved inside a cloud database for easy access. The health detection as well as the diagnosis is applicable to forecast the disease under the application of the presented classifier method. It is further divided as a subcomponent termed as a severity module that is applied to analyze the disease severity.

## Data Collection

The newly developed CC and IoT-relied on health observing system assumes three kinds of data. It is mainly used in collecting unique patient data that is acquired by applying IoT devices and sensors. Basically, these tools are used for verifying single medical data along with normal data. When an individual medical data exceeds the values of normal data in the case of significant parameters, it forwards an alert message to physicians and to the data collection strategy. Hence, the medical analysis applies 5G mobile networks for sending medical data into a cloud database. In this approach, UCI Repository data set measures can be employed in mapping with original data that is generated by applying IoT devices. Furthermore, clinical medical data can be applied to map with raw data generated with single-patient data.

## PSO-ANN Model

Here, it is defined as the projected approach for primary prediction and diagnosis of diabetes. In this process, a PSO-optimized NN is employed in the successful prediction of diabetes.

### ANN Model

Every neuron in the input and hidden layer is linked with one another to the next layer by a few weight rates. The neurons of hidden layers are applicable in computing weighted sums of inputs and include a threshold. The architecture of a multilayer perceptron (MLP) with the help of the input layer, hidden layer, and output layer is applied. Initially, the input layer shows the parameters of data sets. The process of the hidden layer implies the parameters of data sets that cannot be linearly isolated while the output layer gives the required results. Also, a threshold node has been included in the input layer that specifies a weight function. Hence, the simulation outcome is employed in sigmoid activation function. It is represented by Eq. (4.1)

where /;, shows the linear integration of inputs *X ,X _{2},...,X_{n}* threshold 0,,vvy, implies connection weight among input neuron

*j,*and

*f)*signifies activation function; and

*nij*demonstrates the result. A sigmoid function is a typical choice of activation function and expressed in Eq. (4.2)

For training the MLP, the back propagation (BP) learning model is applied, which belongs to gradient descent (GD) model to apply the weights. Each weight vector (vv) has been initiated with minimum arbitrary values from a pseudorandom sequence generator, but it is capable of consuming massive steps for training the network, and modified weights are estimated at every iteration. In order to resolve the aforementioned issues, a PSO-centric method has been utilized for evaluating the best value of weight and threshold functions, because PSO is capable of determining optimal solutions.

### Parameter Optimization of ANN Using PSO

It is pointed out that the weight (vv) and bias *(b)* parameters have a higher influence on ANN function. In this process, the PSO technique is applied for optimizing parameters of ANN. Also, it is one of the populated searching frameworks that is derived from the behavior of bird flocking or fish schooling. It is simple to execute the parameters for modifying. PSO operates a searching function named as a swarm of individuals referred to as particles, which is updated for all iterations. For exploring the optimal solution, every particle migrates toward the direction of the existing best position (pbest) and best global position (gbest). The velocity and position of particles are extended by applying Eqs. (4.3) and (4.4)

where *t* is the iteration value; v,y denotes the velocity of the particle / on y'th dimension, where the value is restricted to [ ^min > ^max ]; is a position of the particle /, such

that the range [ A„„_{n}; A_{max} ]; implies a pbest position of a particle *i* on yth dimension; and Xgbest is a gbest position of the swarm onyth dimension.

The inertia weight vv is applied for managing global exploration as well as local exploitation; *r _{t}* and

*r*are arbitrary functions from the range [0,l];

_{2}*b*represents a constraint factor employed to balance the velocity weight, with the value of 1; positive constants C| and

*c*are personal and social learning factors, which have a value of 2; and the particle is comprised of parameters vv and

_{2}*b.*

Fig. 4.2 **implies the task of optimization of ANN parameters using PSO. The major steps of a PSO-relied parameter optimizing task are consolidated as:**

*Step 1: Initialization*

Initially, diverse parameters of PSO are initiated with a population of arbitrary particles as well as velocities.

FIGURE 4.2 Flowchart of the PSO-ANN model.

*Step 2: Train the ANN Model and Evaluate the Fitness Function *The ANN method undergoes training with parameters *c* and *r* from the recent particle. The 10-fold cross-validation (CV) approach is used for evaluating fitness function (FF) values. In 10-fold CV, the training data set has been classified as 10 mutually exclusive subsets with similar size, where 9 subsets can be applied in training the data and the final subset has been utilized for testing 1 data.

The predefined strategy is followed several times such that every subset is applied for testing. The FF is described as 1 - CA_{V}aiida»on of the 10-fold CV technique in the training data set, as depicted in Eqs. (4.5) and (4.6). Additionally, a solution that is higher, ^validation*9* would be composed of minimum FF values.

where, *y _{c}* and

*y*are the count of true and false classifications.

_{f}*Step 3: Update the Global and Personal Best Positions*

Here, the global best, as well as personal best positions of particles, are modified on the basis of FF rates.

*Step 4: Update the Velocity and Position*

The position and velocity for every particle are upgraded under the application of Eqs. (4.3) and (4.4) and attain a novel position of particles to proceed with future estimations.

*Step 5: Termination Condition*

Follow Steps 2-4 until the termination criteria have not been satisfied.

## Proposed Diagnostic Model

The presented analysis method to the initial identifying and forecast of diabetes has been defined in this section. The PSO-ANN depends on classifying the diabetes. In the presented classifying, PSO is performed to optimize the weight as well as bias parameters of the ANN method. In the presented method, a 10-fold CV method is executed that separates the diabetes data into 10 equal parts. The detailed description of this method is provided in another section. In the presented method, 16 input neurons are determined in the input layer equivalent to 16 attributes of the diabetes data set. The hidden layer has 17 neurons, whereas the resultant layer has only 2 neurons matching class labels: diabetes positive as well as diabetes negative. The weight of all neurons is calculated utilizing the PSO method and the best weight is utilized to train the NN. A classifier accuracy as well as confusion matrix is utilized for estimating the action of the presented diagnostic method.