Recurrent Neural Network-Based Optimal Sensing Duty Cycle Control Method for Wireless Sensor Networks

With the development of Internet of Things (IoT) technologies, environmental monitoring systems using wireless sensor networks (WSNs) have received considerable attention. Reliable object detection and tracking is an important research issue in various WSN applications, such as environment and disaster monitoring, disaster propagation tracking, and intruder monitoring and tracking. Generally, because batteries are used as energy sources for sensors in WSNs, a highly energy-efficient operation is needed to prolong the life of the sensors and networks. To save energy, sensors usually manage multi-mode sensing operations, in which they periodically switch between active and inactive periods. A tradeoff exists between object detection accuracy and energy efficiency when we select a sensing schedule. Depending on the object speed, direction, and sensor deployment topology, different sensing schedules should be dynamically applied to individual sensors. In this paper, we propose a novel recurrent neural network (RNN)-based dynamic duty cycle control method for sensor nodes. For RNN training, a target optimal duty cycle for a given network condition is derived from the proposed digital twin-space analytic solution. Simulation results show that the proposed model provides accurate object detection performance and achieves high energy efficiency.

can be applied to many application areas. An object tracking sensor network monitors both indoor and outdoor environments and tracks various objects, such as forest fires, polluted air, bio-chemical materials, automobiles, and animals [3]- [6]. WSN sensor nodes can monitor combustion gases and preemptive fire conditions to define alert zones. In addition to preventive measures, early detection of fires is the only way to minimize damage and casualties. Pollution monitoring and display to citizens are essential to compare the impact of measures taken by municipalities and public institutions, and to raise public awareness. WSNs are also widely used for wildlife monitoring and tracking of different species. For intrusion detection, autonomous sensors equipped with video cameras enable the development of new security, surveillance, and military applications.
In WSNs, sensor nodes depend on limited battery capacity, and it is generally unrealistic to supplement or replace sensors in real-world applications [7], [8]. Thus, it is very important VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ to increase the energy efficiency of the sensors needed, in order to prolong the life of the sensors and networks. Different methods for sensor operation in terms of sensor-activation scheduling have been studied. The most basic method is naïve activation, which always turns on the sensors [9]. In this case, the energy consumption of the sensor increases, and the lifetime of the network and sensor is shortened. Random activation is a method of operating sensors stochastically, which has the disadvantage that object tracking may not be smooth. Selective activation is a method of predicting the location of the target and activating only a few sensors around the target in the tracking mode. It has the advantage of saving more energy compared to other methods. The duty-cycle operation activates sensors at a constant time interval. The ratio of the active period to the sensing interval is called the duty cycle [10], [11]. Many studies are being conducted on how to activate sensors around objects with duty-cycled activation to efficiently use energy.
There is a problem in that maximizing the inactive period to save energy causes severe data transmission delays and prevents the network from performing proper object detection functions [12], [13]. In object tracking of WSNs, it is very important to dynamically determine the optimal sensing duty cycle. The accuracy of object tracking and energy conservation is a trade-off relationship. A higher duty cycle results in a better object detection performance but lower energy efficiency. The optimal sensing schedule (i.e., duty cycle) of each sensor node depends on the object's moving speed and direction, movement pattern, neighbor sensor node deployment topology, and object detection requirements. An individual sensor node is unable to properly change its sensing duty cycle in advance based only on its measurement because it does not know whether the object is approaching or moving away from itself until the object enters the sensing coverage of the node. Furthermore, even a server cannot easily calculate the optimal duty cycle for each node in real time with measurement information from sensors.
In this paper, we propose a novel recurrent neural network (RNN)-based optimal duty cycle control method for WSNs, in which the optimal sensing schedule is dynamically determined for each sensor node. We use an RNN learning structure because it can capture the sequential and temporal dynamic behavior well [14]. Based on the neighbor node's object detection results, in the proposed method, the server determines the node that must change its duty cycle and defines the optimal duty cycle that can meet the detection requirements with minimum energy consumption. We define multiple discrete duty cycle operation modes. In our long short-term memory (LSTM)-based RNN architecture, the input is defined as the network-wise sensor deployment topology and each sensor node's object observation history. The output of the RNN model is the optimal duty cycle of each sensor node. The proposed model can achieve efficient energy consumption with high object-tracking accuracy.
The main contributions of this paper can be summarized as follows: • We derive an optimal duty-cycle computing method to obtain the target values (i.e., labels) for RNN-based supervised learning. For the ideal condition, in which object movements are known in advance, the optimal duty cycle of each node that satisfies the object tracking requirements is calculated.
• We implement a digital twin model to generate a training dataset for the RNN model, and to obtain the corresponding label set (i.e., for the given condition, the corresponding optimal duty cycle for each node).
• Using the data generated from the digital twin space, we perform learning for the proposed RNN model, and confirm the performance in terms of object detection and energy efficiency. The remainder of this paper is organized as follows.
In Section II, we discuss related work. The proposed RNN-based duty cycle control method for object tracking is presented in Section III. In Section IV, the simulation results are presented, and we conclude this paper in Section V.

II. RELATED WORK
Several approaches for object tracking in WSNs have been proposed in recent years. In [15], Luo et al. proposed a cooperative target localization and tracking algorithm to reliably track objects in indoor wireless sensor networks, in which they considered and collaborated with the different characteristics of multiple networks. In [16], Lui et al. proposed a diffusion-distance-based predictive tracking algorithm for continuous objects such as fire and gas in industrial WSNs (IWSNs). They predicted the spread range of continuous objects by establishing the relationship between the diffusion radius and time, based on the assumption that the motion of continuous objects follows the appropriate diffusion model. Mohajerzadeh et al. proposed an algorithm for tracking mobile targets using directional sensor networks (DSNs) [17]. Unlike omnidirectional sensors, DSNs are networks consisting of directional sensors, such as image sensors, video sensors, and infrared sensors. As such, object tracking using WSNs is being studied for various environments, including indoor or outdoor, and various types of sensor situations.
Studies on how to efficiently control the sensing schedule of sensors have been conducted to reduce the energy consumption of sensors. Zhang et al. [18] proposed a new sleep scheduling method based on the decentralized partially observable Markov decision process and a sleep scheduling algorithm in online planning. They set up compensation for sleep scheduling problems by considering four factors: coverage, connectivity, tracking, and energy cost. In addition, the method makes decisions optimized for the entire cluster rather than for individual sensors. Jiang et al. [19] presented a probability-based prediction and sleep scheduling protocol to improve energy efficiency in single-object tracking. They not only predict the next position of the object based on kinematics and probability but also derive the probability of moving along all directions; based on this, the nodes to be activated are selected, and the active time is controlled. Medagliani et al. [20] proposed an analytical framework that can maximize the lifetime of a network using a duty cycle method that considers the probability of missing object detection, detection delay, transmission delay, and average energy consumption. All nodes in the network use the same duty cycle. Kim et al. [21] proposed a mobility-aware adaptive duty-cycling mechanism for tracking objects during tunnel excavation. It tunes the duty-cycle ratio by adjusting the sleep time depending on the changes in the received signal strength indication (RSSI) value.
Recently, as research on machine learning has become more active, various studies have been conducted to combine machine learning to improve WSN performance [22], [23]. Na and Yoo [24] dynamically derived unmanned aerial vehicle (UAV) optimal locations using a particle swarm optimization (PSO)-based bio-inspired algorithm for collecting sensor data from WSNs. Yun and Yoo [25] proposed a Q-learning-based data-aggregation-aware energyefficient routing algorithm for WSNs. They showed that it effectively reduces the amount of duplicated data and extends the lifetime of the network. Wei et al. [26] proposed an RNN-based delay-guaranteed monitoring framework in underwater WSNs considering delay, energy, and data quality to solve the problem of longer delay times for packet retransmission due to the high data loss rate during underwater acoustic transmission. Mohanti et al. [27] proposed a deep learning-based distributed data mining (DDM) model for energy efficiency and optimal load balancing, which reduces the energy consumption, signaling overhead, and average delay, and maximizes the overall throughput compared to other methods.
Most research on WSNs is limited to certain situations and applications; thus, it is often difficult to apply flexibly to other situations. Furthermore, there is a lack of machine learning-based research on adaptively controlling the duty cycle according to the movement of objects and sensor node deployment topology and efficiently using use the energy of sensors in WSNs simultaneously.
Unlike the existing object tracking methods in WSNs that require accurate mathematical target object location estimation, movement speed, direction estimation, or information on the sensing operation statistics of sensors, the method proposed in this paper requires only the sensors' location information and their object detection history for actual object tracking in real environments. The optimal duty cycle of each sensor is obtained using the proposed RNN learning architecture with digital twin logical space solutions that reflect various object movements and sensor network topology situations.

III. PROPOSED RNN-BASED DYNAMIC DUTY CYCLE CONTROL METHOD FOR OBJECT TRACKING A. SYSTEM MODEL
We propose an RNN-based system model that dynamically controls the activation schedule of each sensor to accurately detect objects and to use energy efficiently in situation, where one or more objects move freely in a WSN area. The symbols presented in Table 1 are used in the remainder of this paper.
The structure of the proposed system model is shown in Fig. 1. The proposed system consists of a digital twin model and a learning model. A digital twin is a virtual world that is implemented on a computer. It enables the simulation of environments, machines, equipment, and objects in the real world by implementing them in virtual space. A digital twin can efficiently predict the effects of product and process development without the need to create a costly and time-consuming physical model. In this study, a digital twin model is used to derive the set of sensing situation data and target labels (the optimal duty cycle modes for the corresponding sensing situations) in various environments necessary for learning the RNN-based model. As shown in Fig. 1, the sensor field environment, object movement, and sensing capability are modeled and implemented in the digital twin space; it also considers object detection requirements, and a predefined number of sensing duty cycle modes. Because a large number of sensor nodes can be deployed in a large physical space in the entire sensor field, in order to consider only the correlated regions in object tracking for learning, instead of modeling the entire WSN field, we use a predefined limited-size area for learning, which is defined as the training sensor field in this study. To model object movements, existing movement models can be used, but for the limited-size training sensor field, relatively simple mobility models can be applied.
The optimal sensing duty cycle for each sensor node for various sensor topologies and object movement conditions in the digital twin space is calculated using the optimal duty cycle derivation method proposed in this paper. The optimal sensing duty cycle mode that satisfies the given sensing requirements is determined by considering the time for entering and leaving the sensing coverage of a specific sensor in consideration of the moving direction and speed of a moving object. At this time, the positions of the sensors and their object detection results in accordance with the derived optimal duty cycle modes in the training sensor field are collected as a dataset for learning.
As shown in Fig. 1, the RNN-based learning model of the proposed system is trained using the sequential dataset and labels generated from the digital twin model. In a real WSN environment, the RNN model trained in this way can dynamically predict the most energy-efficient duty cycle mode that can meet the object detection requirements.

B. PROPOSED OPTIMAL DUTY CYCLE DERIVATION METHOD FOR SUPERVISED LEARNING
In this section, we derive the optimal duty cycle mode for each sensor under the given condition, in which each sensor should satisfy object detection requirements in accordance with the movement of the object. The duty cycle is the ratio of the active sensing time to the active sleep cycle time (i.e., sensing interval) [28]. We assume that the sensors use a discrete number of duty cycles. In this paper, we define K sensor duty cycle operation modes from 0 to (K − 1) . The time duration for which a sensor is active is defined as T wake , and it is assumed that it is the same for all modes; T k sleep is the sleep time duration of mode k when a sensor is not active. The sensing interval (i.e., the cycle time) for mode k is defined as T mode k , which is the sum of the times T wake and T k sleep . Therefore, when the sensor is in mode k, the duty cycle and T mode k are defined as follows: When the mode number k is closer to zero, it has a higher duty cycle. In contrast, if the mode number is closer to (K − 1), it has a lower duty cycle. When the mode is zero, the sensor is always active. From mode 1 to mode (K − 1) , the sensor activation time T wake is fixed to an appropriate value. In this study, we assume that objects can always be detected correctly if objects enter the sensing area when the sensor is activated. Fig. 2(a) illustrates the definition of the duty cycle. We adjust the duty cycle by adjusting the length of T k sleep according to mode k. Thus, a longer T k sleep length results in a lower duty cycle, which results in a mode closer to (K − 1) . It should be noted that a higher duty cycle (i.e., lower mode number) requires more energy for sensor operation, but it can achieve higher object detection and tracking performance. We define three different types of areas, as shown in Fig. 2(b). The coverage where a sensor can detect objects is called the ''sensing area''. Sensors should satisfy object detection requirements when objects enter their sensing area. We call the area where a sensor cannot detect objects because the objects are located outside the sensing area of the sensor, but are within a predefined distance d from the sensor as an ''uncertain area''. In this area, even though the objects are outside the sensing coverage of the sensor, the sensor should be prepared for object detection because the objects may enter the sensing area in a short time. The outside of the uncertain area is called the ''outer area''. In this case, the objects are not nearby, so that the sensor can maintain the lowest duty cycle. The relationship between T mode k and duty cycle according to the location of the objects is shown in Fig. 2(c).
If an object is in the outer area, the lowest duty cycle T mode (K −1) is selected as the optimal sensor activation cycle. If an object is in an uncertain area, in which the object is outside of the sensing area but within a predefined constant distance d, the sensor needs to change to the next higher duty cycle, T mode (K −2) to properly detect the object when it enters the sensor's coverage. Eventually, when an object enters the sensing area, the optimal duty cycle should be dynamically determined to satisfy the predefined object detection and tracking requirements. The optimal duty cycle mode of each sensor node depends on the locations of the object and sensors, the speed and movement direction of the object, the sensor coverage, and the detection and tracking requirements. When an object passes through the sensing area of a sensor node i, the exact entry and exit times to and from the sensing area are defined as t i in and t i out , respectively. Therefore, the object passing time of sensor i's sensing area is denoted as t i pass = t i out − t i in . In this paper, we define the object detection and tracking requirements as follows.
i) Minimal detection count requirement 1: If the object passing time t i pass is less than t min , then the sensor should detect the object at least N min times during the object passing time. ii) Minimal detection count requirement 2: If the object passing time t i pass is greater than or equal to t min , then the sensor should detect the object at least N req times during the object passing time. iii) Minimal detection interval requirement: As long as the object stays within the sensing area, the sensor should detect the object at least at every t req time. The terms t min , N min , N req , and t req are predefined in accordance with the object detection and tracking objectives for different WSN application scenarios.
The maximum sensing interval when an object enters the sensing area can be determined as T mode (K −3) to satisfy requirement (iii) as If the moving speed of an object is too fast or passes close to the boundary of the sensing area, then the object may stay for a shorter time in the sensing area than t min . In this case, the sensor should detect the object at least N min times to satisfy requirement (i). Otherwise, the sensor duty cycle should be able to detect the object at least N req times to satisfy requirement (ii). The minimum required number of detection times N i for node i can be represented as in (4).

VOLUME 9, 2021
For any node i, in which the object is in its sensing area, the maximum sensing interval (t i SI ), to meet all requirements is derived as Therefore, the optimal duty cycle mode k i * for node i among the predefined discrete duty cycle modes can be derived as in (6).
The derived optimal duty cycle mode k i * guarantees not only satisfying the object detection and tracking requirements but also selecting the most energy-efficient sensing mode operation. When the mode is determined according to this formula, the sensor satisfies the detection requirements as follows: Fig. 3 shows the proposed optimal sensing schedule derivation scenarios for different object speeds and directions. Fig. 3(a) shows the case where an object passes the boundary of the sensing area very fast, such that the derived optimal duty cycle mode is mode 0 (always active). The object passing time in Fig. 3(b) is shorter than that in Fig. 3(c), so that the duty cycle in Fig. 3(b) is higher than that in Fig. 3(c). The object moving speed in Fig. 3(d) is very slow, so that the selected duty cycle is the lowest. In all cases, the derived duty cycle modes guarantee the object detection and tracking requirements.
Therefore, in the digital twin space, the optimal duty cycle of each sensor is determined in various sensor arrangement topologies and object movement situations, and these data are used to train the proposed RNN model in the next section. In the digital twin environment, each sensor operates in the derived optimal duty cycle mode to save energy, and at each unit time step (t obs , observation interval), the sensing results (detection or non-detection) of all sensors are stored together with the positions of the sensors. In addition, the derived optimal modes of the sensors are stored as labels for RNN learning. sample random (x i t y i t , r i t , k i_T t ) from replay memory M if exit (t − l + 1) ∼ t data trace then make an RNN input data in (11) using all sensor's stored data in replay memory M from (t − l + 1) to t make an RNN output target data in (12) using all sensor's optimal duty cycle modes for training at time t end if obtain the outputk i t (i = 1, · · · n s ) of RNN update RNN weight parameter θ to minimize cross entropy loss function L (θ ) end while

C. RNN LEARNING MODEL
The proposed optimal duty-cycle decision method described in Section 3(B) is computed under the assumption that we know the exact time when an object enters and exits the sensing area. However, in a real environment, it is difficult to calculate the optimal duty cycle by predicting the exact moving trajectory and time because only the object detection results observed by each sensor can be known. Therefore, in this study, we use deep learning to predict the optimal duty cycle using sequential data containing object detection results. RNN is a class of artificial neural networks in which connections between nodes form a directed graph along a temporal sequence; this allows it to exhibit temporal dynamic behavior. Vanilla RNNs suffer from the problem of vanishing gradients when it has long data sequences, which results in poor learning [29], [30]. The LSTM was designed to alleviate this vanishing gradient problem. In this study, we predict the optimal duty cycle using an LSTM-based RNN architecture.
Because LSTM-based RNN uses supervised learning, it requires a true label for the input. In our WSN environment, the label is the optimal duty cycle of each sensor for the given condition. In the digital twin space, the object detection results of sensors, in which sensors operate with their optimal modes, implicitly reflect the object movements in the WSN. In RNN-based training, we use the location information of the sensors and object detection results for predefined time steps (RNN sequence length) as input data. The output label of the proposed RNN model corresponds to the optimal duty cycle of the sensors for the given input data.
One time step in an RNN corresponds to the observation interval (t obs ) for reporting the sensing result at a sensor to the server, and for updating the overall detection status at the server. To generate the RNN training dataset, in the digital twin space, at every time t obs , sensor node i's position x i , y i and its object detection result r i are stored, as shown in Fig. 4(a). The object detection result is represented as binary information (i.e., 0 is for ''undetected,'' and 1 is for ''detected''). In this study, we assume a simple binary sensor network [31]. Moreover, if we use more complex sensors that can obtain different resolutions of object detection (e.g., different detection values, such as the distance between the sensor and the object within the sensor coverage), then it results in a more accurate optimal duty cycle prediction in the RNN structure.
At each time step t, the input time step vector is defined as where x i t , y i t , r i t represent the x coordinate, y coordinate and object detection results of node i at time step t, respectively; and n s is the number of sensors in the training field.
In this study, as the input of the RNN model, we only use the information that can be obtained with minimum constraints in real sensor network environments, sensor locations, and binary object detection results. This simple RNN input data type has the advantage of being generally applicable to any scenario without complex calculations, additional functional modules, or any cooperative protocols with adjacent nodes in the real environment. However, it may be difficult to accurately predict the maximum sensing interval of (5), which is derived analytically with t i in and t i out estimation in a digital twin space. In this paper, although it may cause little additional energy consumption, the sensing interval margin δ is introduced as in (9) to conservatively set the maximum sensing period of node i for training, t i_T SI . This allows the use of the actual sensing interval that is conservatively reduced by δ(0 ≤ δ ≤ 1) from the ideal optimal maximum sensing interval that satisfies the object detection requirements. When an object enters the sensing area of node i at time step t, the target label k i_T t for RNN model training considering the sensing interval margin δ is derived as in (10).
As we mentioned, at time step t, if the object is in the outer area, then k i_T t = (K − 1) is selected; if the object is in an uncertain area, then k i_T t = (K −2) is determined as the target label.
As shown in Fig. 4(b), the input dataset D for the LSTM-based model with sequence length l and the corresponding target label T are defined as in (11) and (12), as shown at the bottom of the next page, respectively.
The target T vector indicates the optimal duty cycles at time step t for all sensor nodes based on the last l input data conditions from (t − l + 1) to t. For training, n d number of datasets is used. Fig. 4(c) shows the LSTM-based RNN structure for learning the duty cycle derivation;k i t is the output of the RNN for node i at time t.
The optimal duty cycle mode derivation and RNN learning algorithm proposed in this paper are presented in Algorithm 1. In the digital twin simulation, we obtained simulation traces to train the RNN model using different WSN sensor topologies and object movements. In LSTM-based RNN learning, we randomly sample data with sequence length l from the replay memory and update the RNN weight parameter θ to minimize the cross-entropy loss function L(θ ).
In real WSN environments, we apply the trained RNN model to dynamically determine the optimal duty cycle model for each sensor. The RNN input, sensor location information, and past object detection sequence are used. According to the RNN output, each sensor dynamically changes its duty cycle mode. If the server knows that the pre-arranged sensor topology or sensors do not move, then the initial sensor location information can be used as the RNN input information.

IV. SIMULATION RESULTS
In this section, we evaluate and analyze the performance of the proposed RNN-based optimal duty cycle control method in terms of mode decision accuracy, energy VOLUME 9, 2021 The digital twin simulation parameters and values used in this study are listed in Table 2, in which the unit time and unit distance are used. We used a random-type grid topology for the WSN, in which sensor nodes were deployed in the form of a grid.
An example topology case is shown in Fig. 5, where 40 sensors are placed in a 20 × 20 WSN training sensor field.
The sensing area radius and uncertain area radius are set to 5 and 10, respectively. The number of objects is 1 for singleobject scenarios, and 2 for multi-object scenarios. To model the object movement, we implemented a modified random waypoint model in which mobile objects move randomly and freely without restrictions [32]. Unlike the original random waypoint model, in which objects begin by pausing for a fixed number of seconds, in the modified model, objects pause for a random time between 0 and 5 units. Then, the objects select a random destination within the simulation range and choose a random speed in a predefined range [V min , V max ].
x n s t , y n s t , r n s t       Each object moves in the direction of the destination, and if it reaches the destination, it pauses for a random time and repeats the process. Objects move within a 30 × 30 range that is slightly larger than the 20 × 20 training area to capture the different mode selection scenarios for the boundary sensors. The observation interval to report the sensing results to the server was set to 0.25. The number of duty cycle modes (K ) were six and nine. In the lowest mode (mode 0), sensors are always active, so that they can detect objects all the time; however, they require the highest energy consumption. In the sensing area, the optimal mode between mode 0 and mode (K − 3) was selected. In the uncertain area and outer area, modes (K −2) and (K −1) were selected. The sensing interval margin δ used for the LSTM model training was set to 0.1. This reduces the actual sensing interval by 10% from the ideal maximum sensing interval that satisfies the object detection requirements. Table 3 lists the sensing intervals for different duty cycle modes when K = 6 and 9. The hyperparameter values used in the LSTM implementation are listed in Table 4. Table 5 shows the distribution of datasets corresponding to the optimal duty cycle modes for 500000 datasets when the sequence length l was 10. Although 500000 datasets have been generated for learning in digital twin space, it is rare  for objects to move very fast and/or pass through the boundaries of sensing coverage. Moreover, most of the datasets are for scenarios where the objects are in the outer area of the sensors. There is a problem with unbalanced training data. Data imbalance refers to the situation where the classes in a dataset are not equally distributed, which can lead to potential risks in training a model. Therefore, it is necessary to adjust the balance between the datasets of different duty cycle modes. If the dataset is balanced based on the mode with the smallest number of datasets, then the RNN learning model may suffer from insufficient data for training. In this simulation study, to create balanced datasets, we used the under-and over-sampling method. However, the datasets for modes 0 and 1 were still smaller than others, even after balancing preprocessing. For the validation and test datasets, we did not perform any preprocessing for balancing. For performance evaluation, among the datasets created by the digital twin, the test datasets corresponding to 20% of the total datasets were used.
To evaluate the performance of the proposed LSTM-based RNN dynamic duty cycle mode decision method, two methods using fixed duty cycles were compared. The ''compared_model_1'' is a method in which the sensors use mode 1, in a fixed manner. Because mode 0 always maintains an active state, mode 1 is the mode with the highest duty cycle (i.e., the shortest sensing interval) among the modes that repeat the awake and sleep states. The ''compared_model_2'' is a method in which sensors always maintain duty cycle mode (K − 3). Mode (K − 3) has the lowest duty cycle (i.e., the longest sensing interval) among the duty cycles used when the object is in the sensing area.
First, we evaluated the performance of ''mode accuracy'' for the cases of K = 6 and K = 9 with different VOLUME 9, 2021 RNN sequence lengths. In this paper, the mode accuracy was defined as a measure to evaluate how precisely the RNN outputs for the test datasets match the true optimal modes derived by (10). We define two mode-accuracy measures. First, ''mode_accuracy_1'' (MA1) is derived as in (13), and is the probability that the RNN output mode is the same with the true label.
where |TD| is the number of test datasets; I (a, b) is the identity operator that returns 1 when a and b are identical; otherwise, it returns 0. Next, ''mode_accuracy_2'' (MA2) is defined as in (14), and shows how close the RNN output mode is derived to the true label.
Fig . 6 shows the mode accuracy performance of the proposed method for two accuracy measures at different numbers of modes (K ), RNN sequence lengths (l), and numbers of objects. As shown in Fig. 6(a), the proposed method achieves 81-92% mode_MA1 accuracy. Specifically, for the single object and K = 6 cases, the proposed method shows up to 92% accuracy. As shown in Fig. 6(b), MA2 for the proposed method is approximately 96-98%. This high performance is due to the fact that even though the mode classification of the RNN is not equal to the target, the misclassified mode has only one mode distance from the true value. For both mode accuracy measures, a smaller K (=6) results in a better accuracy than that of a larger K (=9). This is because the classifier accuracy using LSTM increases when the number of classes is small. The accuracy of the single-object tracking case was higher than that of the multi-object tracking case. We can also observe that as the RNN sequence length is increased, the accuracy performance tends to increase as well, except for some exceptional experimental results. This is because the longer the sequence length, the better the prediction of object movement.
The purpose of dynamic duty cycle control is to minimize the energy consumption while satisfying the object detection requirements. Therefore, the efficient use of energy is an important performance indicator. To evaluate the energy efficiency, we compared the energy required for each method with the mode (K − 1), which is the lowest duty cycle mode (i.e., the lowest sensing energy consumption mode). We considered only the energy required for sensing and did not include additional energy consumption for reporting the sensing results or exchanging control messages.
The energy consumed in a specific duty cycle mode k is E k = T wake T mode k P s , where P s is the sensing power. Therefore, the energy efficiency of mode k compared with that of mode (K − 1) is defined as  In this paper, we define ''energy_efficiency'' (EE) for compared duty cycle methods, as in (16).
where T mode y i t is the cycle time of the derived RNN output duty cycle mode, mode y i t , for node i. Fig. 7 shows the energy efficiency of each sensor in the sensor field for different values of K (6 and 9), and different numbers of objects (1 and 2 for single-and multi-object cases). In the proposed method, the RNN sequence length was set to 10. In the graph, the red, blue, green, and turquoise points represent the results from the proposed model, optimal model, compared_model_1, and compared_model_2, respectively. The proposed LSTM-based RNN model shows an energy efficiency similar to that of the optimal model. For the multi-object cases, the energy efficiency of the proposed model is approximately 50% higher than that of compared_model_1 and is approximately 30-35% higher than that of compared_model_2. For single-object cases, the energy efficiency of the proposed method was approximately 70% higher than that of compared_model_1, and 50% higher than that of compared_model_2. In the proposed method, the energy efficiency of the multi-object case is lower than that of the single-object case, because as the number of objects increases, more objects enter the sensing area of the sensors and, accordingly, the sensors have to wake up more frequently. Fig. 8 shows the average energy efficiencies of the compared models. The proposed LSTM-based RNN model shows an energy efficiency similar to that of the ideal optimal model that satisfies the detection requirements and operates in a mode that consumes the minimum sensing energy. The compared_model_1 operating with the highest duty cycle mode 1 in a fixed manner shows the lowest energy efficiency. We can also see that the energy efficiency of the proposed model is slightly higher for K = 9 than for K = 6. This means that when the mode is more subdivided, the RNN model can determine the required duty cycle mode with high resolution, so that the energy can be saved slightly more than that in the lower resolution. However, the mode decision accuracy slightly decreases when a large K is used, as shown in Fig. 6. An energy-efficient dynamic duty cycle mode operation must meet the object detection requirements. The optimal model always guarantees satisfying the object detection requirements, in which it is assumed that we perfectly know the object movement, so that we can compute (5) and (6). In the proposed LSTM-based RNN model, because we only use sequential binary sensing results from sensors, there is little decision error compared with the true optimal modes, as shown in Fig. 6. However, the mode decisions from the RNN model, which are different from the optimal modes, do not always result in an unsatisfactory object detection requirement. If the duty cycle mode from the RNN model is smaller than the optimal mode, then it has a shorter sensing interval, so that the energy efficiency decreases, but the object detection performance is better than the requirements.
In this simulation study, we defined two detection performance measures. First, ''detection_performance_1'' (DP1) is the percentage of satisfaction of the detection requirements, as expressed by (17).
where N i_RNN t is the number of object detection times using the derived duty cycle mode from the proposed RNN model for sensor i at the t-th test; and N i t is the exactly computed required object detection time using (4) for sensor i at the tth test. Next, ''detection_performance_2'' (DP2) is defined as the average ratio of N i_RNN t to N i t for all test datasets, as expressed by (18).
We can see how close the number of detections by the selected mode is to the required number of detections with DP2. Fig. 9 and Fig. 10 show DP1 and DP2, respectively, for K = 6 and K = 9. In the proposed RNN model, the sequence length, l, is 10. For DP1 evaluation, the proposed method showed 93.55%-95.26% satisfaction with the required detection performance. In the proposed method, the DP1 performance for K = 6 was slightly higher than that for K = 9. However, the difference was only approximately 1%. Compared with compared_model_2, DP1 for the proposed method is approximately 25% higher. For DP2, the detection performance of the proposed method is approximately 97%, which is very close to the optimal model performance, as shown in Fig. 10.

V. CONCLUSION
In this paper, we proposed a new RNN-based learning method that dynamically performs optimal duty cycle operation mode control for individual sensor nodes to monitor and track moving objects in WSNs. Determination of the optimal duty cycle aims to maximize energy efficiency, while satisfying the requirements for object detection. To derive the optimal duty cycle solution in the given environment for RNN supervised learning, we proposed an optimal solution derivation method based on a simulation model in the digital twin space. The current environment was expressed in the form of the position of the sensor nodes and the object detection result of each sensor node in sequential time steps. We presented a structure for LSTM-based RNN learning using the training data obtained in the digital twin space. We evaluated the performance of the proposed RNN-based model in terms of the optimal mode decision accuracy, energy efficiency, and object detection requirement satisfaction through simulations of various object movement conditions. The performance of the proposed model was compared with that of an ideal optimal model and two conventional models using fixed duty cycles. In the evaluation of mode decision accuracy from two perspectives, the proposed method showed an accuracy of 81-98%. In the comparison of energy efficiency, the proposed method showed a performance improvement of 50-70% for the single-object case, and 30-50% for the multi-object case, compared to the methods using the existing fixed duty cycle modes. In addition, in the evaluation of the satisfaction ratio for the object detection requirements, the proposed method showed 93-97% compliance performance. We demonstrated that the dynamic duty cycle control method proposed in this paper satisfies the object detection requirements at a high level, with minimal information in various object movements and sensor placement environments, while achieving energy efficiency close to the theoretical optimal performance.