Quasi-Mapping and Satisfying IoT Availability with a Penalty-Based Algorithm

: The Internet of things and medical things (IoT) and (IoMT) technologies have been deployed to simplify humanity’s life, which the complexity of communications between their layers was increased by rising joining the applications to IoT and IoMT-based infrastructures. The issue is challenging for decision-making and the quality of service where some researchers addressed the reward-based methods to tackle the problems by employing reinforcement learning (RL) algorithms and deep neural networks (DNNs). Nevertheless, satisfying its availability remains a challenge for the quality of service due to the lack of imposing a penalty to the defective devices after detecting faults. This paper proposes a quasi-mapping method to transfer the roles of sensors and services onto a neural network’s nodes to satisfy IoT-based applications’ availability using a penalty-backwarding approach into the NN’s weights and prunes weak neurons and synaptic weights (SWs). We reward the sensors and fog services, and the connection weights between them when are covered the defective nodes’ output. Additionally, this work provides a decision-making approach to dedicate the suitable service to the requester using employing a threshold value in the NN’s output layer according to the application. By providing an intelligent algorithm, the study decides to provide a service based on its availability and updating initial information, including faulty devices and new joined components. The observations and results prove decision-making accuracy for different IoT-based applications by approximately 95.8–97% without imposing the cost. The study reduces energy consumption and delay by approximately 64.71% and 47.4% compared without using neural networks besides creating service availability. This idea affects deploying IoT infrastructures to decision-making about providing appropriate services in critical situations because of removing defective devices and joining new components by imposing penalties and rewards by the designer, respectively. to the requesters. We followed the issue to propose a decision-making method, which was utilized the neural network’ features to decide about providing an SP to a requester with high quality. The study presented an availability-aware algorithm that injects the fault to the IoT-based applications’ nodes with different rates for decision-making and dedicating a service provider based on its availability. We mapped the IoT levels’ nodes onto the partial neural network’s neurons to online training the NNs with the updated information in facing faulty components and identifying the joined new nodes or application to the structure. By employing the forwarding chain to detect the faults or the joined new components and the backwarding chain to impose the penalties and reword to the weights, the proposed algorithm pruned the weak neuron and weights and evaluate the service providers’ efﬁciency to dedicate them to the requester. The feature created an opportunity to dedicate a service provider in critical condition with minimal facilities when facing an emergency request and assigned SPs with high availability to other requesters.


Introduction
By increasing smart devices and growing up human requirements to access the network and share their records with the service providers, IoT and IoMT technologies had deployed to respond to the requirements. Due to the dynamic feature of IoT, the service providers faced challenges caused by increasing smart devices, which leads to the loss

•
Deploying the Internet of Things based on increasing IoT infrastructure applications • Rising the different joined applications to IoT and its sensors and service provider's nodes • Increasing the complexity of the relationship between IoT's nodes in different layers and their computational operations • Decision-making to provide a service in facing a huge number of different requests or similar • The neural networks' feature and their efficiency in different IoT-applications After investigating the main problems of deploying IoT and the neural network's features, we propose a quasi-mapping and availability-aware cloud service algorithm (QAC) to decide about dedicating service to requesters based on a penalty-backwarding approach. The study utilizes an NN's structure to describe the relationship between IoT nodes in different layers and maps them onto the neural network's neurons. QAC fines the related weights to the nodes, which are provided a low-quality service or detected as the invisible nodes by monitoring output neuron' feedback. After diagnosing the weak weights and neurons, the algorithm prunes them and assessments the efficiency of the IoT-application. The pruning weak weights and neurons have a highlighted role to improve the performance and cost of a neural network and also are affected decision-making about an SP due to the loss of the faulty nodes [29]. QAC supports the joined sensors, server nodes, and similar applications to the analysis process for assigning a service provider to a requester such as a relationship between the patients with the emergency conditions Mathematics 2021, 9,3286 3 of 29 and nearest available hospitals and medical centers. Before applying other characteristics and features of CAS and the proposed idea, we present the objectives of providing the quasi-mapping the IoT-based applications nodes onto the partial neural networks neurons to clarity its efficiency as follows: • Decision-making based on assessing the service's availability by comparing its value with a threshold • Online training the neural networks based on updating initial information (Detecting defective devices and new joining components or applications) • Imposing the penalty into the related weights to the detected faulty nodes • Imposing the reward into the related weights to the joined new components to the application or replacing defective nodes with them • Pruning the weak weights and neurons and evaluating the service availability after removing them from the IoT-based application • Pruning role in improving energy efficiency and latency besides supporting service availability By dedicating an availability-aware cloud service instead of a trust-aware approach, we define a flexible condition in facing the critical situation when is requested service with minimal features. A trust-aware service provider creates some restitutions against the critical situations, according to complete losing the identified not-trust servers. The proposed algorithm dedicates an SP to the requester using online training the neural networks with the updated information, including the backwarding the penalties, pruning weak neurons and weights, and the joined new components. We also describe the quasimapping IoT nodes on NN's neurons, penalty-backwarding, availability, and neurons' operations by the equations. Figure 1 shows following the steps of QAC and the idea for decision-making about assigning a service provider to the requester. the invisible nodes by monitoring output neuron' feedback. After diagnosing the weak weights and neurons, the algorithm prunes them and assessments the efficiency of the IoT-application. The pruning weak weights and neurons have a highlighted role to improve the performance and cost of a neural network and also are affected decision-making about an SP due to the loss of the faulty nodes [29]. QAC supports the joined sensors, server nodes, and similar applications to the analysis process for assigning a service provider to a requester such as a relationship between the patients with the emergency conditions and nearest available hospitals and medical centers. Before applying other characteristics and features of CAS and the proposed idea, we present the objectives of providing the quasi-mapping the IoT-based applications nodes onto the partial neural networks neurons to clarity its efficiency as follows: • Decision-making based on assessing the service's availability by comparing its value with a threshold • Online training the neural networks based on updating initial information (Detecting defective devices and new joining components or applications) • Imposing the penalty into the related weights to the detected faulty nodes • Imposing the reward into the related weights to the joined new components to the application or replacing defective nodes with them • Pruning the weak weights and neurons and evaluating the service availability after removing them from the IoT-based application • Pruning role in improving energy efficiency and latency besides supporting service availability By dedicating an availability-aware cloud service instead of a trust-aware approach, we define a flexible condition in facing the critical situation when is requested service with minimal features. A trust-aware service provider creates some restitutions against the critical situations, according to complete losing the identified not-trust servers. The proposed algorithm dedicates an SP to the requester using online training the neural networks with the updated information, including the backwarding the penalties, pruning weak neurons and weights, and the joined new components. We also describe the quasi-mapping IoT nodes on NN's neurons, penalty-backwarding, availability, and neurons' operations by the equations. Figure 1 shows following the steps of QAC and the idea for decision-making about assigning a service provider to the requester.  The existing concepts demonstrate that the study's main contribution and its novelty include: • Quasi-mapping the IoT-based application nodes onto the neural networks' neurons • Providing an intelligent availability-aware algorithm to decision-making about dedicating service providers to the requester • Presenting the equations to describe quasi-mapping, availability, neuron operation, and penalty-backwarding • Providing a penalty-backwarding approach to fines the related weight to the faulty or invisible nodes for pruning them after identifying as the weak weights and neurons We describe different Internet of Things applications and map their nodes on the neural networks to analyze QAC efficiency in decision-making with high accuracy. After defining an application, we collect a dataset based on the described sensors and their valid values to import them into the simulated nodes and estimate energy consumption and communication delay. This work utilizes the different rates of fault injection and the nodes' availability assessment to determine a penalty for the identified failure and invisible nodes. By estimating decision-making accuracy and comparing delay and energy before and after performing QAC, the study proves the proposed algorithm and method efficiency to dedicate a service provider to a requester. In comparing other related works, we decide about providing a service to a requester based on analyzing its availability after fining and rewarding the related weights to the identified faulty nodes. The feature has a highlighted role in decision-making when facing critical situations (Such as facing accidents and many emergency requests) and timely dedicating the SPs to requesters compared to the other related works with prioritizing trust and security. By online training partial neural networks with the updated initial information, the service provider availability is estimated due to the pruned weak weights and neurons and joined new components or applications. Therefore, we provide a service to a requester based on evaluating all nodes' availability of the application by imposing penalties and rewards using the backwarding method. The issue leads to the prune weak output neurons (As the cloud services) or re-joined the pruned service to IoT infrastructure after rewarding the related weights to the replaced faulty nodes by the new components, which have an impressive effect to improve providing service with recovering the SPs. The study creates an opportunity to re-join the stopped applications by event-based assessing their availability via alerting about connecting new devices instead of the defective and pruned neurons (IoT nodes) using the forwarding method. The service providers' availability depends on the applications (As an example the healthcare-based applications have higher sensitivity than other applications), which the work defines a threshold value based on their susceptibility. The characteristics create flexibility and scalability for IoT infrastructures developers to provide a suitable service to a requester, which is highlighted in facing critical situations.
We address the purposes to implement the idea in the next sections that are organized as follows: Section 2 reviews the Internet of Things challenges and the presented method tackle them and the related studies to decision-making; We explain the method of collecting a dataset, the quasi-mapping, and an availability-aware cloud service algorithm in Section 3; The observations and simulation results are assessed in Sections 4 and 5 concludes the mentioned concepts of the idea.

Related Work
The related work addresses reviewing the different case studies, which have focused on the IoT and IoMT challenges and have proposed the methods to tackle them. This section assesses their efficiency in improving the Internet of Things performance in different aspects, including security, decision-making, trust, availability, and dependability. Additionally, we review the studies, which have employed neural networks and ML algorithms to follow their purposes and have demonstrated the effective role of NNs in facing complicated structures and communications.
Security was defined as the main challenge of the Internet of Things by sharing private information and records to analyze them and provide the related services to the requesters with high quality. Lv et al. [30] reviewed the security problems in the smart city as an IoT-infrastructure, and proposed a new backoff algorithm, and employed a long-rage approach to wireless communications for protecting private information and satisfying security with minimal cost. Tawalbeh et al. [5] proposed a new structure for classifying the Internet of Things levels to support its security in edge and cloud layers by defining lower nodes via amazon web service. Some case studies defined a model based on ML algorithms to predict the attacks and break up the authentication protocols that were endangered the information security in IoT [7,31]. The works utilized the different machine learning algorithms to learn and face them, including artificial NN, DNN, and RNN. By employing the neural network and RL, the studies could better protect the privacy and satisfy the security with learning different passive and active attacks, malware, and malicious information in authentication protocols, and predict them in facing new cases. Ahmed et al. [32] presented a comprehensive systematic lecture review to analyze the highlighted tole of machine learning algorithms to apply the security information in the Internet of Things. This work classified the security into three main categories of network, physical, and application attacks, which review demonstrated an impressive effect of multi-layer perceptron to predict and tackle them.
Some researchers addressed trust as a challenge of the Internet of Things because of the increasing complexity of communication between nodes in different levels and computational operations. Trust was almost defined to decision about providing a service and support the security in IoT using detecting and predicting the attacks, which the concept can lead to removing an application by identifying losing its dependability [33]. Altaf et al. [34] followed the issue and provided a trust-based method to detect the malicious components and communications between them in a smart city as an IoT-infrastructure. The study mitigated the service-oriented attacks by defining the trust concept and proving a trust-based service to the requesters after identifying the vulnerabilities in communication between nodes of a smart city. A trust-based method had a highlighted role in service-providing electronic-health applications, which can help IoT-based infrastructure developers to present a confident structure and protect the patient's privacy records [35]. To provide a service in risky situations, the trust-based methods affect in improving IoT efficiency because of decision-making about the issue after analyzing and predicting the malicious communications and attacks.
Decision-making is challenging for IoT and IoMT because of increasing the number of the joined applications to the infrastructures, which some case studies followed the problem to present the solutions against it. The effective factors in decision-making were addressed as a purpose to provide a method to decide about assigning service to a requester, including timely provide a service, risky situation, cautiously provide a service, and scalability of providing services with increasing SPs and requesters [36]. Pappas et al. [36] focused on a special IoT-application to decision-making about providing a service based on the characteristics of service requesters and providers, which their method assigned service to a requester by defining the effective parameters. Some researchers tried to propose a decisionmaking method that was supported security besides dedicating service to a requester [37]. Sharma et al. [37] addressed the challenge of decision-making in heterogeneous IoT components and provided the security model to the dependable data transferring and deciding about dedicating a service. The study utilized the learning-based approaches and neural networks for intelligent detecting the anomaly models and malicious devices. The machine learning algorithms and Fuzzy solutions and rules had an impressive effect in following the decision-making, forecasting, detecting, and predicting purposes, which some case studies employed their features to provide a comprehensive analytical Fuzzy-based model to decide about dedicating a service for a special application such as economy's decisions in an IoT-infrastructure [38,39]. Linear Diophantine and Algebraic models simplified the computations of Fuzzy-based systems, which can affect improving decision-making about the uncertain conditions in IoT and IoMT applications [40,41]. Riaz et al. [42] utilized neutrosophic logics (truth, falsehood, and indeterminacy) as a Fuzzy-based approach to map the features of the patients with multiple personality disorder disease for predicting the treatment duration. Additionally, the researchers proposed a bipolar fuzzy-based model to map the initial characteristics of the disease to correct diagnosis and predict a suitable treatment method for the patients [43].
Resource allocation is challenging for proving the services to the requesters in different IoT applications when facing an SP with many requests. Therefore, some case studies aimed to provide the approaches to tackle the problem by presenting different algorithms such as whale optimization that was reduced total runtime and cost besides allocating a service to the requester [44]. Li et al. [45] proposed balancing flow in edge computing and an intelligent algorithm to rapid adaptive offloading to reduce the complexity of the computing and data processing at cloud level and fairness allocate the resources besides employing DNNs to fast deciding. The defective nodes led to the increasing energy consumption in the e-health systems as the popular applications of IoT, which the researchers tackled the problem and fairness allocated the health resources by detecting their routes and bypassing them [46][47][48].
We review the mentioned related works by presenting Table 1 and comparing their weaknesses and advantages [49]. By reviewing the different approaches to face the Internet of Things challenges, the researchers almost followed the security and the related concepts that have helped support the issue, including authentication protocols, trust-based systems, availability, and dependability. The case studies proved the challenge of decision-making in IoT by rising to join new applications to the infrastructure and increasing the complexity of communications between its nodes in different levels. Some researchers proposed the trust-based methods to decision-making that were led to decide about dedicating a secure service by evaluating its confidently. The feature can create some limitations for assigning service to a requester in critical situations where timely services are highlighter than providing a secure service, as facing emergencies conditions and dedicating health and treatment service with minimal facilities. By identifying losing the trust of an SP, it is removed from the SPs' list to decision-making and provide it in the critical situations that can lead to starvation in some service providers. Since we propose an intelligent available-aware algorithm for decision-making, which detects the faulty nodes and imposes the penalties and reward to the related weights to the identified defective device by the forwarding and backwarding chains, respectively. Our method decides about dedicating service to a requester based on its availability value besides supporting providing service in critical situations with minimal facilities.

Data Collection and Quasi-Mapping
To face the challenge of decision-making in IoT, we propose a method to decide about assigning a service provider to a requester that consists of quasi-mapping the Internet of Things nodes onto a NN's neurons. This section presents it and our approach to define an application and collect a dataset, according to the described sensors' valid information.

Defining IoT-Based Applications and Collecting a Dataset
To analyze the efficiency of the proposed algorithm, the study first defines different real applications for mapping their nodes onto a neural network's neurons to dedicate an SP to a requester, as shown in Figure 2a-c. We describe three different applications that are inspired by the real relationship between a set of components in connecting the Internet of Things. Two applications follow medical purposes and the other aims to support road amenities, which are defined to analyze the idea efficiency for the various conditions. As an example, we describe an intensive care unit (ICU) facilities of the hospitals as an IoT-based application that their nodes are included the oxygen condensation, humidity, temperature, and ventilation performance sensors, and some fog and cloud services such as wireless access point (WAP), as shown in Figure 2a. The sensors, and fog and cloud layers nodes are mapped onto the neurons of a NN's input, hidden, output layers, respectively.
We investigate the ICUs and recovery rooms in the different hospitals with various facilities to analyze the sensors' output information in standard and critical situations. This work collects a dataset based on monitoring the described sensors' valid information and generates random values, according to the received information from monitoring the hospitals' ICUs and recovery rooms [50,51]. We simulate the applications and inject the fault with different rates to estimate the service availability and penalty for faulty nodes by the CupCarbon simulator tool [52]. As shown in Figure 3, the collected dataset consists of the sensors' output information, fault injection rate, and availability, which is shared on Github (https://github.com/yasamanhosseini/Quasi-mapping-project (accessed on 20 October 2021)) [53]. We investigate the ICUs and recovery rooms in the different hospitals with various facilities to analyze the sensors' output information in standard and critical situations. This work collects a dataset based on monitoring the described sensors' valid information and generates random values, according to the received information from monitoring the hospitals' ICUs and recovery rooms [50,51]. We simulate the applications and inject the fault with different rates to estimate the service availability and penalty for faulty nodes by the CupCarbon simulator tool [52]. As shown in Figure 3, the collected dataset consists of the sensors' output information, fault injection rate, and availability, which is shared on Github (https://github.com/yasamanhosseini/Quasi-mapping-project (accessed on 20 October 2021)) [53].

Equations to Describe Quasi-Mapping and Availability
QAC decides to assign a service provider to a requester by evaluating some highlighted features of IoT-application nodes, including availability, penalty, and rewards. The subsection describes the features, quasi-mapping, and neuron operations by present- Figure 3. The collected dataset, including monitoring the sensors' valid information, fault injection rate, random generating the sensors' outputs, and nodes availability.

Equations to Describe Quasi-Mapping and Availability
QAC decides to assign a service provider to a requester by evaluating some highlighted features of IoT-application nodes, including availability, penalty, and rewards. The subsection describes the features, quasi-mapping, and neuron operations by presenting the equations for collecting initial information to perform the algorithm. Table 2 describes the existing parameters, which are employed in the equations. Table 2. The existing parameters in equations.

Parameter
Description Condition

L
The set of the input layer's nodes -H The set of the hidden layer's neurons -O The set of the output layer's neurons -S The set of the sensor level's nodes -G The set of the fog level's services -C The set of the cloud level's services - The number of matrix's rows for input layer or sensor level The number of matrix's columns for input layer or sensor level The number of matrix's rows for hidden layer or The number of matrix's columns for hidden layer or fog level 0 ≤ n ≤ n max p The number of matrix's rows for output layer or cloud level The number of matrix's columns for output layer or cloud level 0 ≤ q ≤ n max W Partial neural network's weights d The number of hidden layer's weights The number of output layer's weights The initial valid value of the trained partial NN's weights -

Definition 2.
Describes NeuronOperation (Multiply-accumulate operation), in which V hm,n and V o p,q are defined the located neurons' values in hidden (h m,n ) and output (o p,q ) layers of the neural network. Definition 3. Explains estimating the penalty value for detecting the fault with i number where is indexed with f and S describes as the service by three different situations, including the expected correct service (S expected correct t ) and correct service (S correct t ) at t time.
Definition 4. Applies to impose the estimated penalty value (Penalty f d ) for the hidden layers with d weight numbers, which are related to the hidden layer weights (W d ) and indexed with f.

Definition 5.
Indicates imposing penalty (Penalty f u ) to the related weights of output (W u ) layers for the indexed fault with f where d is weight number. Definition 6. Applies estimating availability of an SP based on identifying the number of correct services (S correct t ) compared to the total number of services (S total ) at t time where 0 ≤ t ≤ t max is met before imposing the penalty value to the related weights to the detected faulty nodes.

Definition 7.
Relates assessing the availability value (Availability Penalty i f ) to the nodes due to the number of expected correct service (S expected correct t ) compared to the total number of services (S total ) at t time after detecting i fault and imposing penalty (Penalty i f ) to the connected weight to the defective or faulty nodes where 0 ≤ t ≤ t max is met.
We describe the sensor, fog, and cloud layers of IoT as the different matrices and also the input, hidden, and output layers of the neural network, which Equation (1) demonstrates quasi-mapping the Internet of Things nodes onto NN's neurons.
Additionally, Figure 4a,b shows the mapping operations that are defined IoT and a neural network based on three-dimensional structures. The red-color pointers illustrate mapping the Internet of Things levels' nodes to a partial neural network's neurons.
After injecting fault with random rates onto the simulated IoT nodes, we define the penalty value for the identified invisible or failed components and impose it into partial NN's weighs, which Equation (3) demonstrates penalty estimation.
This work fines the related weights to the mapped nodes, which are detected as the invisible or faulty components at t time after simulating and injecting fault with random rates on them (Using CupCarbon tool), as shown in Equations (4) and (5) for hidden and output layers.
After injecting fault with random rates onto the simulated IoT nodes, we define the penalty value for the identified invisible or failed components and impose it into partial NN's weighs, which Equation (3) demonstrates penalty estimation.
This work fines the related weights to the mapped nodes, which are detected as the invisible or faulty components at t time after simulating and injecting fault with random rates on them (Using CupCarbon tool), as shown in Equations (4) and (5) for hidden and output layers.
We describe availability based on Equation (6) before imposing the penalty into the related weights to the invisible nodes, in which Equation (7) illustrates the estimated value for the availability of the fined node by the determined penalty.
Availability Penalty i f = ∑ t=t max t=0 S expected correct t S total t − Availability By describing the effective parameters in decision-making via the presented equations, we provide the initial information for QAC to decide about assigning an SP to a requester with the estimated penalty and availability values.

Quasi-Mapping and an Availability-Aware Cloud Service Algorithm
This work presents a three-phase algorithm to decide about assigning a service provider to a requester based on analyzing the SPs' availability, which the subsection addresses the issue. The main three phases of QAC consist of quasi-mapping the nodes of the IoT-application onto a partial neural network's neurons, decision-making, and identifying the joined components or similar applications to the mentioned structure. To clearly explain the algorithm's operations, we focus on application 2 ( Figure 4b) and present two methods for decision-making to demonstrate the algorithm's independence to define a threshold value.
QAC phases are classified into sub-phases to organize their operations per phase and individually describe them, which Algorithm 1 demonstrate the sub-phases of the algorithm's phase 1. QAC phase 1-1 performs quasi-mapping the Internet of Things nodes in the levels of the sensor, fog, and cloud onto the neurons of the partial NN's input, hidden, and output layers, parallel, as shown in Algorithm 1. (Input layer's node) i ← S i 8: end for;

25:
(Output layer's MAC value) p ← if Output layer s MAC value t p < (Threshold's value) p do 51:Penalty t = (Threshold s value) p − (Output layer s MAC value) t p 52: do in parallel 53: Penalty Fault tp // Availability creation on output layer's weights 54: for j in Fog index do

55:
( In phase 1-2, the proposed algorithm addresses the multiply-accumulate operations into the neurons of hidden and output layers and normalizes the estimated MAC's values, which Algorithm 1 demonstrates.
We identify the faults in sensor, fog, and cloud levels' nodes at t time and register them to analyze their availability in QAC's phase 1-3, as shown in Algorithm 1.
After detecting faults in different levels of IoT, the proposed algorithm evaluates the output neuron's value and utilizes the backward chain to apply the estimated penalty's value the related weights in hidden and output layers when (Output layer's MAC value) t p < (Threshold's value) p is met, which Algorithm 1 illustrates the operation in phase 1-4.
Phase 2 of QAC is classified into two sub-phases to decision-making about the services providers based on two methods, as shown in Algorithms 2 and 3. In phase 2-1, we decide about dedicating the service by estimating an average value and performing MAC operation into the output neuron, which has pruned the output with (OutputWeight) 0 condition. Algorithm 2 demonstrates decision-making based on method 2, which defines a threshold value and compares it to the output neuron's value and pruning the output by applying (OutputNeuron's value) 0 condition. Phase 3-1 is dedicated to fault-masking by joining new components to the application's nodes instead of the failed or faulty components. In this phase, we reward the neurons and related weights to the detected faulty nodes in facing a joined new component or receiving the correct service from them, as shown in Algorithm 3.
Algorithm 3 shows phase 3-2, which has included updating the initial information for the proposed algorithm by joining a new application to the structure or new components to run QAC based on the updated information. Reward t = Penalty t − Penalty (t−1) // t =0 and Reward t > 0 10: Fault t i = 0 // Determining new joined sensor at t time and removing penalty from its connected weights to the hidden layer 11: Masked t i = Masked (t−1) i + 1 12: Fault t j = 0 // Determining new joined fog service or received data from the new sensor at t time and removing penalty from its connected weights to the output layer 13: Masked t j = Masked (t−1) j + 1

15:
Fault t p = 0 // Determining new joined cloud service at t time in case of receiving correct information from fog level (hidden layer's nodes) 16: After presenting the algorithm and its operations, this work explains the steps of imposing penalties and reward to the related weights to the detected faulty nodes and the joined new components, respectively, as shown in Figures 5-9.          We impose the estimated penalty value to the related weight to the defective or faulty nodes by employing the backwarding chain, as shown in Figure 6a,b.
The study defines two hypotheses to assess the efficiency of QAC and the idea, including facing the joined new components and applications to the mentioned structure. Figure 7a,b demonstrate diagnosing the joined new sensor instead of the defective sensor with similar characteristics to the application by the forwarding chain.
After detecting the joined new sensor and masking the faulty component, we reward the related weights to the masked node by the backwarding chain, as shown in Figure  8a,b.
By joining a new application with a different feature, QAC decides about dedicating an SP to a requester based on the updated initial information that is related to the application's features and the output neurons' availability condition. Figure 9a,b illustrate the Figure 9. The efficiency of a similar joined application with an additional option for different methods to decision-making about dedicating service to a requester with high quality and forwarding chain to fault detection: (a) Method 1 based on pruning weak weight (output weight) and output neuron in output layer; (b) Method 2 based on pruning weak output neuron in the output layer. Figure 5a,b address the fault detection process based on method 1 and method 2, in which the weak output's neuron and weight are pruned by them using providing the average and threshold values, respectively. The faults are detected by the forwarding chain and penalties are imposed on the weights using the backwarding chain.
We impose the estimated penalty value to the related weight to the defective or faulty nodes by employing the backwarding chain, as shown in Figure 6a,b.
The study defines two hypotheses to assess the efficiency of QAC and the idea, including facing the joined new components and applications to the mentioned structure. Figure 7a,b demonstrate diagnosing the joined new sensor instead of the defective sensor with similar characteristics to the application by the forwarding chain.
After detecting the joined new sensor and masking the faulty component, we reward the related weights to the masked node by the backwarding chain, as shown in Figure 8a,b.
By joining a new application with a different feature, QAC decides about dedicating an SP to a requester based on the updated initial information that is related to the application's features and the output neurons' availability condition. Figure 9a,b illustrate the decisionmaking process by joining a new application to the structure. We demonstrate the process by a flowchart as follows: Mathematics 2021, 9, x FOR PEER REVIEW 22 of 30 decision-making process by joining a new application to the structure. We demonstrate the process by a flowchart as follows: According to the reviewed concepts of the work, QAC was provided as an intelligent algorithm that has detected the faulty components and joined new nodes and applications by the forwarding chain. The algorithm utilized the backwarding chain to impose penalties and reward to the related weights to the detected faulty and new components, which feature created a flexible structure for decision-making in critical situations. Due to the features of the neural networks, this work proposed the quasi-mapping method to transfer the role of IoT-applications' nodes into the NNs' neurons to decide about assigning a service provider to a requester. We provided a service based on analyzing its availability and pruned the weak output neuron and weights by imposing the penalty. The feature also created the opportunity to reconnect the removed SPs with low availability in facing joining new components instead of defective components and masking their fault.

Simulation Results
According to the mentioned purposes and contributions of the idea, we evaluate the dedicated SPs' availability and decision-making accuracy to validate QAC efficiency in improving the Internet of Things performance. This section addresses the issue and proves the highlighted role of decision-making based on the availability-aware algorithm, which reports communication delay and energy consumption caused by transferring data between IoT nodes.
To analyze the quasi-mapping and decision-making performance, we first map an application's nodes onto a neural network's neurons and train it based gradient-distance method. The study describes the neural networks based on python co-design and utilizes the TensorFlow libraries to define the functions by the Jupyter notebook [54,55]. After training the NN by the initial information, we simulate the application nodes and inject the faults with random rates using the CupCarbon simulator tool, which is described based on Java co-design in MAC and Ubuntu LTS 16.04 [52]. By injecting the faults into the nodes and updating the initial information about their situation, the IoT-application components are re-mapped onto the neural network's neurons and are imposed the estimated penalties into the related weights to the faulty devices and are retrained the NN by the updated information. We repeat the operations to analyze service availability by changing the fault injection rate. Additionally, this work defines the randomly joined new According to the reviewed concepts of the work, QAC was provided as an intelligent algorithm that has detected the faulty components and joined new nodes and applications by the forwarding chain. The algorithm utilized the backwarding chain to impose penalties and reward to the related weights to the detected faulty and new components, which feature created a flexible structure for decision-making in critical situations. Due to the features of the neural networks, this work proposed the quasi-mapping method to transfer the role of IoT-applications' nodes into the NNs' neurons to decide about assigning a service provider to a requester. We provided a service based on analyzing its availability and pruned the weak output neuron and weights by imposing the penalty. The feature also created the opportunity to reconnect the removed SPs with low availability in facing joining new components instead of defective components and masking their fault.

Simulation Results
According to the mentioned purposes and contributions of the idea, we evaluate the dedicated SPs' availability and decision-making accuracy to validate QAC efficiency in improving the Internet of Things performance. This section addresses the issue and proves the highlighted role of decision-making based on the availability-aware algorithm, which reports communication delay and energy consumption caused by transferring data between IoT nodes.
To analyze the quasi-mapping and decision-making performance, we first map an application's nodes onto a neural network's neurons and train it based gradient-distance method. The study describes the neural networks based on python co-design and utilizes the TensorFlow libraries to define the functions by the Jupyter notebook [54,55]. After training the NN by the initial information, we simulate the application nodes and inject the faults with random rates using the CupCarbon simulator tool, which is described based on Java co-design in MAC and Ubuntu LTS 16.04 [52]. By injecting the faults into the nodes and updating the initial information about their situation, the IoT-application components are re-mapped onto the neural network's neurons and are imposed the estimated penalties into the related weights to the faulty devices and are retrained the NN by the updated information. We repeat the operations to analyze service availability by changing the fault injection rate. Additionally, this work defines the randomly joined new components instead of defective nodes and a new application with different features to the mentioned structure that simulates them to report delay and energy consumption by the CupCarbon tool. Due to the joined new components and applications, we reward the related weights to them and decide about providing a service to a requester by defining new value for the weights and retraining the neural network using the updated information.
To assess QAC's efficiency for decision-making, this work first analyzes the relationship between fault rates and output neurons' availability because of presenting three different applications and SPs. Figure 10a-f proves the indirect relationship between them for SP1 and SP2 in the presented three applications, which correlation coefficient between fault rates and availability's values is dependent on the applications. The simulation results indicate the availability and fault rate by approximately 0.37 and 0.85 for application 1 and SP2 in time slot 5, which proves the indirect relationship between the mentioned parameters. As shown in Figure 10a-f, the rising time slot affects improving or deteriorating the availability of an SP of the application because of facing faulty nodes and joining new components instead of the defective devices. According to the presented Equation and algorithm, we estimate the availability of a service provider based on the different parameters (Including the expected number of correct services, the total number of services, and the number of correct services) after imposing the penalties and rewards, which the weak weights and neurons are pruned by detecting the defective devices. By increasing the fault rate, the simulation results illustrate a less reducing availability for application 3 than other applications because of its less sensitivity to the occurring faults. We report them in different time slots, which is included the maximum available time (t 1 ≤ t ≤ t max ). Application 3 aims to support the road welfare services such as the distance between vehicles and road resorts or filling stations, which have less sensitivity compared to the medical or healthcare application against the faults rates. We define a threshold value for analyzing the service availability in the output layer of the neural network to prune the weak weights and neurons of the layer and remove the service provider with minimum availability, which its value is determined based on the applications. Therefore, the application sensitivity to the fault rate affects assessing the SPs' availability because of estimating the penalty and reward value based on the feedback of the output neuron's value.
Mathematics 2021, 9, x FOR PEER REVIEW 23 of 30 components instead of defective nodes and a new application with different features to the mentioned structure that simulates them to report delay and energy consumption by the CupCarbon tool. Due to the joined new components and applications, we reward the related weights to them and decide about providing a service to a requester by defining new value for the weights and retraining the neural network using the updated information.
To assess QAC's efficiency for decision-making, this work first analyzes the relationship between fault rates and output neurons' availability because of presenting three different applications and SPs. Figure 10a-f proves the indirect relationship between them for SP1 and SP2 in the presented three applications, which correlation coefficient between fault rates and availability's values is dependent on the applications. The simulation results indicate the availability and fault rate by approximately 0.37 and 0.85 for application 1 and SP2 in time slot 5, which proves the indirect relationship between the mentioned parameters. As shown in Figure 10a-f, the rising time slot affects improving or deteriorating the availability of an SP of the application because of facing faulty nodes and joining new components instead of the defective devices. According to the presented Equation and algorithm, we estimate the availability of a service provider based on the different parameters (Including the expected number of correct services, the total number of services, and the number of correct services) after imposing the penalties and rewards, which the weak weights and neurons are pruned by detecting the defective devices. By increasing the fault rate, the simulation results illustrate a less reducing availability for application 3 than other applications because of its less sensitivity to the occurring faults. We report them in different time slots, which is included the maximum available time (t1 ≤ t ≤ tmax). Application 3 aims to support the road welfare services such as the distance between vehicles and road resorts or filling stations, which have less sensitivity compared to the medical or healthcare application against the faults rates. We define a threshold value for analyzing the service availability in the output layer of the neural network to prune the weak weights and neurons of the layer and remove the service provider with minimum availability, which its value is determined based on the applications. Therefore, the application sensitivity to the fault rate affects assessing the SPs' availability because of estimating the penalty and reward value based on the feedback of the output neuron's value. According to the highlighted role of decision-making accuracy, we evaluate the parameter for the three provided applications after performing the algorithm and imposing the penalties and reward to the related weights to the detected faulty nodes and joined new components. As shown in Figure 11a,b, decision-making accuracy and standard deviations are approximately 97% and 0.03 for application 2, which is also estimated for the other applications by comparing the expected and assigned SP numbers. CAS provides a service to a requester based on analyzing its availability, in which the estimated value is defined as the expected SP by the Equations (6) and (7). The study decides about dedicating a service provider to a requester with high accuracy by providing an availabilityaware algorithm and employing the forwarding and backwarding chains to detect the fault and imposing the penalty and pruning the weak weights and neurons. We estimate the accuracy of decision-making and standard deviation by repeating QACs operations when facing a new request and condition at the available time. According to the highlighted role of decision-making accuracy, we evaluate the parameter for the three provided applications after performing the algorithm and imposing the penalties and reward to the related weights to the detected faulty nodes and joined new components. As shown in Figure 11a,b, decision-making accuracy and standard deviations are approximately 97% and 0.03 for application 2, which is also estimated for the other applications by comparing the expected and assigned SP numbers. CAS provides a service to a requester based on analyzing its availability, in which the estimated value is defined as the expected SP by the Equations (6) and (7). The study decides about dedicating a service provider to a requester with high accuracy by providing an availability-aware algorithm and employing the forwarding and backwarding chains to detect the fault and imposing the penalty and pruning the weak weights and neurons. We estimate the accuracy of decision-making and standard deviation by repeating QACs operations when facing a new request and condition at the available time. Also, this work estimates the total energy and delay by comparing the mentioned parameters before and after pruning the weak weights and neurons, in which the output neurons are available as the service providers at the cloud level. To evaluate the mentioned parameters, we simulate the application nodes and describe their operation based on Java and Python co-designs as the scripts by the CupCarbon tool. The connections between the application's nodes are defined due to the relationship between them after mapping onto the NN's neurons. We utilize the router nodes, in which several nodes have to connect to one device (A located node on the fog or cloud level such as a wireless access point node). The CupCarbon determines a specific area for connecting a set of nodes without using the router. Additionally, the simulator reports the energy consumption, total energy consumption, battery level, and total battery level for each simulated node (In different levels), which we assess the total energy consumption, including all of the reported mentioned parameters. As the setting of the simulator to report delay, we determine the unit of estimating total runtime using CupCarbon, which estimates the parameter based on the communication between nodes after describing their operations and reading input files as a dataset. By assessing the energy consumption and communication delay, we prove increasing the Internet of Things performance with minimal cost before facing invisible an SP. Figure 12a-e illustrates improving total delay and energy by approximately Also, this work estimates the total energy and delay by comparing the mentioned parameters before and after pruning the weak weights and neurons, in which the output neurons are available as the service providers at the cloud level. To evaluate the mentioned parameters, we simulate the application nodes and describe their operation based on Java and Python co-designs as the scripts by the CupCarbon tool. The connections between the application's nodes are defined due to the relationship between them after mapping onto the NN's neurons. We utilize the router nodes, in which several nodes have to connect to one device (A located node on the fog or cloud level such as a wireless access point node). The CupCarbon determines a specific area for connecting a set of nodes without using the router. Additionally, the simulator reports the energy consumption, total energy consumption, battery level, and total battery level for each simulated node (In different levels), which we assess the total energy consumption, including all of the reported mentioned parameters. As the setting of the simulator to report delay, we determine the unit of estimating total runtime using CupCarbon, which estimates the parameter based on the communication between nodes after describing their operations and reading input files as a dataset. By assessing the energy consumption and communication delay, we prove increasing the Internet of Things performance with minimal cost before facing invisible an SP. Figure 12a-e illustrates improving total delay and energy by approximately 47.4% and 64.71% after pruning the weak weights and neurons with losing minimal availability in approximately 1-3%. As shown in Figure 12c,d, we estimate the total delay and energy for the other related works (Without CAS) and compare them with the proposed idea when running the algorithm before pruning them (Before pruning with CAS). The simulation results indicate reducing total energy and delay by approximately 47.3% and 19.9% for CAS compared to the other related works. In comparing the results between other related works and CAS, we simulate application 2 without mapping their nodes (Fore other works) onto the neural network and injecting faults onto the similar nodes with the utilized same rates for the proposed idea by the CupCarbon tool. The proposed algorithm has more efficiency (Improving total delay and energy) than other works because of mapping the applications nodes onto the NN neurons and simulating them based on the connections between the neurons in different layers of a partial neural network. By analyzing the reported results in Figure 12a,d, we prove the highlighted role of pruning weak neurons and the related weights to the detected faulty nodes in improving the performance of the IoT-based applications for the proposed idea compared (After detecting and pruning) to other works (Without CAS).
The simulation results show that the maximum contributions of total energy are related to the routers and switches, and middle nodes with the maximum number of connections, as shown in Figure 13. By occurring faults on the components and imposing the penalty to the related weights to them, we prune the components where their values are close to zero and improve the total delay and energy.  47.4% and 64.71% after pruning the weak weights and neurons with losing minimal availability in approximately 1-3%. As shown in Figure 12c,d, we estimate the total delay and energy for the other related works (Without CAS) and compare them with the proposed idea when running the algorithm before pruning them (Before pruning with CAS). The simulation results indicate reducing total energy and delay by approximately 47.3% and 19.9% for CAS compared to the other related works. In comparing the results between other related works and CAS, we simulate application 2 without mapping their nodes (Fore other works) onto the neural network and injecting faults onto the similar nodes with the utilized same rates for the proposed idea by the CupCarbon tool. The proposed algorithm has more efficiency (Improving total delay and energy) than other works because of mapping the applications nodes onto the NN neurons and simulating them based on the connections between the neurons in different layers of a partial neural network. By analyzing the reported results in Figure 12a,d, we prove the highlighted role of pruning weak neurons and the related weights to the detected faulty nodes in improving the performance of the IoT-based applications for the proposed idea compared (After detecting and pruning) to other works (Without CAS).
The simulation results show that the maximum contributions of total energy are related to the routers and switches, and middle nodes with the maximum number of connections, as shown in Figure 13. By occurring faults on the components and imposing the penalty to the related weights to them, we prune the components where their values are close to zero and improve the total delay and energy.  Comparing availability, the delay and energy before and after detecting the faults in application 2: (a) Comparing the total delay between three phases of before pruning, after detecting fault and pruning, and after detecting fault without pruning; (b) Comparing the total energy between three phases of before pruning, after detecting fault and pruning, and after detecting fault without pruning; (c) Comparing total energy between QAC and other related works (Without CAS); (d) Comparing total delay between QAC and other related works (Without CAS); (e) Comparing availability before and after detecting the fault and pruning for the different available SPs of application 2 (Red colored indexes demonstrate the SP numbers).
By comparing the total delay and energy between three phases, the simulation results prove the highlighted role of pruning the weak weights and neurons in improving IoTapplication performance. We simulate the pruned neural network after imposing the penalties into the related weights to the detected faulty nodes to assess the Internet of Thingsbased application efficiency that the removed nodes led to improve the communication delay and energy consumption. As shown in existing concepts and reported results, we employed the hierarchical approach to assess the idea and QAC efficiency in decision-making by quasi-mapping the Internet of Things levels' nodes onto the partial neural networks' neurons and simulated Comparing availability, the delay and energy before and after detecting the faults in application 2: (a) Comparing the total delay between three phases of before pruning, after detecting fault and pruning, and after detecting fault without pruning; (b) Comparing the total energy between three phases of before pruning, after detecting fault and pruning, and after detecting fault without pruning; (c) Comparing total energy between QAC and other related works (Without CAS); (d) Comparing total delay between QAC and other related works (Without CAS); (e) Comparing availability before and after detecting the fault and pruning for the different available SPs of application 2 (Red colored indexes demonstrate the SP numbers).
By comparing the total delay and energy between three phases, the simulation results prove the highlighted role of pruning the weak weights and neurons in improving IoT-application performance. We simulate the pruned neural network after imposing the penalties into the related weights to the detected faulty nodes to assess the Internet of Things-based application efficiency that the removed nodes led to improve the communication delay and energy consumption.
Mathematics 2021, 9, x FOR PEER REVIEW 27 of (e) Figure 12. Comparing availability, the delay and energy before and after detecting the faults in application 2: (a) Comparing the total delay between three phases of before pruning, after detecting fault and pruning, and after detecting fault without pruning; (b) Comparing the total energy between three phases of before pruning, after detecting fault and pruning, and after detecting fault without pruning; (c) Comparing total energy between QAC and other related works (Without CAS); (d) Comparing total delay between QAC and other related works (Without CAS); (e) Comparing availability before and after detecting the fault and pruning for the different available SPs of application 2 (Red colored indexes demonstrate the SP numbers).
By comparing the total delay and energy between three phases, the simulation resul prove the highlighted role of pruning the weak weights and neurons in improving IoT application performance. We simulate the pruned neural network after imposing the pen alties into the related weights to the detected faulty nodes to assess the Internet of Thing based application efficiency that the removed nodes led to improve the communicatio delay and energy consumption. As shown in existing concepts and reported results, we employed the hierarchic approach to assess the idea and QAC efficiency in decision-making by quasi-mapping th Internet of Things levels' nodes onto the partial neural networks' neurons and simulate the IoT applications by the CupCarbon. After injecting faults with random rates, QAC r As shown in existing concepts and reported results, we employed the hierarchical approach to assess the idea and QAC efficiency in decision-making by quasi-mapping the Internet of Things levels' nodes onto the partial neural networks' neurons and simulated the IoT applications by the CupCarbon. After injecting faults with random rates, QAC remapped the application nodes onto the NN's neurons to impose the estimated penalty value into the related weights to the detected faulty components and analyzed the availability of output neurons (Cloud services). Additionally, we rewarded the related weights to the joined new components and evaluate the service's availability by joining new applications or new nodes instead of the defective devices. Since simulation results first analyzed the relationship between fault rates and availability values for different service providers of the applications to demonstrate that their correlation coefficient depended on the application and its sensitivity to occur the faults. The results proved that the proposed algorithm decided about dedicating service to a requester based on assessing its availability with high accuracy by comparing the expected SPs and assigned service providers. Additionally, we reported the total delay and energy caused by communications between the IoT-application nodes, which illustrated the highlighted role of pruning the related weak weights and neurons to the detected faulty nodes. To verify the reported results, we shared all logs of simulating the applications on Github (https://github.com/yasamanhosseini/Quasimapping-project (accessed on 20 October 2021)) [53].
By reviewing the proposed idea and reported experimental and simulation results, the work can support the different IoT-based applications to decision-making with high accuracy and availability.

Conclusions
The Internet of Things follows gathering the records and creating an infrastructure for communications between different devices and remote control them to service the requesters with high quality. By rising the joined applications to IoT infrastructure, the framework developers faced some problems, including protecting private information, service availability and dependability, and security. Some case studies addressed the problems to provide the different methods and protocols to satisfy the purposes and improve the efficiency of the Internet of Things. Decision-making is also challenging in IoT by increasing the number of service providers with different characteristics and features to dedicate them to the requesters. We followed the issue to propose a decision-making method, which was utilized the neural network' features to decide about providing an SP to a requester with high quality. The study presented an availability-aware algorithm that injects the fault to the IoT-based applications' nodes with different rates for decisionmaking and dedicating a service provider based on its availability. We mapped the IoT levels' nodes onto the partial neural network's neurons to online training the NNs with the updated information in facing faulty components and identifying the joined new nodes or application to the structure. By employing the forwarding chain to detect the faults or the joined new components and the backwarding chain to impose the penalties and reword to the weights, the proposed algorithm pruned the weak neuron and weights and evaluate the service providers' efficiency to dedicate them to the requester. The feature created an opportunity to dedicate a service provider in critical condition with minimal facilities when facing an emergency request and assigned SPs with high availability to other requesters.