Next Article in Journal
FAIRHiveFrames-1K: A Public FAIR Dataset of 1265 Annotated Hive Frame Images with Preliminary YOLOv8 and YOLOv11 Baselines
Next Article in Special Issue
Intelligent DDoS Attack Detection in Software-Defined Networks Using Explainable Machine Learning
Previous Article in Journal
Kolmogorov–Arnold Networks for Sensor Data Processing: A Comprehensive Survey of Architectures, Applications, and Open Challenges
Previous Article in Special Issue
Minimum Vertex Cut with Reachable Set (MVCRS) Problem for Suppressing Botnet Propagation in IoT Networks: Complexity and Algorithms
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Reinforcement Learning-Enhanced Botnet Defense System in Grid Topology Networks Using the SIRO Framework

by
Mohd Hafizuddin Bin Kamilin
1,*,
Shingo Yamaguchi
2,* and
Sena Yoshioka
2
1
Department of Intelligent System Engineering, National Institute of Technology, Ube College, Yamaguchi 755-8555, Japan
2
Graduate School of Sciences and Technology for Innovation, Yamaguchi University, Yamaguchi 753-8511, Japan
*
Authors to whom correspondence should be addressed.
Sensors 2026, 26(8), 2517; https://doi.org/10.3390/s26082517
Submission received: 18 February 2026 / Revised: 13 April 2026 / Accepted: 14 April 2026 / Published: 19 April 2026

Abstract

Digitalizing essential services opens up a new risk of exposing critical infrastructure to botnet infections. In a grid topology network, the neighbor-to-neighbor paths can be used by the malicious botnet to spread the infection. Previous white-hat worm launchers used heuristics and supervised learning to exterminate botnets, which demand specific conditions or a suitable dataset to be effective. Although reinforcement learning addressed these issues, it requires a longer time to train. This article proposes a framework to shorten training and improve the effectiveness of reinforcement learning. The framework applies four key principles: (1) surveying the network status with multi-tensor input, (2) removing irrelevant actions via a novel Chebyshev-based masking strategy, (3) reinforcing key actions with rewards, and (4) optimizing rewards for winning. Four reinforcement learning algorithms are implemented to evaluate the framework, which are vanilla policy gradient, deep Q-network, proximal policy optimization, and MuZero in a stylized grid topology network simulation. An ablation study indicates that the masking used in identify accounts for the majority of the improvement, whereas multi-channel in Survey alone can reduce performance without complementary masking, rewards, and optimization. With the mean winning rate improved by 49.129% and mean win efficiency improved by 118.8031% against our previous work, the framework effectiveness is confirmed in stylized simulations.

1. Introduction

As digitalization accelerates the implementation of Internet of Things (IoT) services in essential sectors, the growing use of connected devices creates a new challenge [1]. For example, grid topology networks are frequently utilized in wireless sensor network (WSN) applications for environmental monitoring due to their simplicity and reliability for low-powered devices [2]. Although the neighbor-to-neighbor connections that allow dynamic routing are attributed to their reliability and simplicity, their use also poses a cybersecurity risk for the spread of botnets [3,4].
Botnet infections in grid topology networks not only drain the resources, such as battery power, memory, and bandwidth, but also cause expensive downtime for patching the vulnerabilities, increased latency due to optimized routes that are not traversable, and rapid propagation potentially overwhelming containment strategies [5]. Furthermore, botnets could be remotely controlled by a botmaster to perform distributed denial-of-service (DDoS) attacks to take important services offline [6,7].
Several methods have been proposed to tackle this problem. Muthukumar et al. [8] implemented a waning-immunity infection model, which they use to develop an optimal control strategy to allocate immunization resources to reduce infections and maintain immunity. Rodríguez et al. [9] applied heuristic link pruning with the aim to isolate the infected devices and make infections die out faster. Asadi et al. [10] presented the green worm concept as a defense mechanism against infection by detecting and patching the vulnerabilities, using epidemic modeling to control and maintain green worm reproduction.
Similar methods have been previously explored by our group, which extend the Botnet Defense System (BDS) to eliminate botnet infection using white-hat worms. While the immunization strategy is effective, it requires a longer time step to eliminate infections, in addition to resources to maintain the antibody population [11]. Additionally, to stop the infection from spreading, the devices must be connected in a certain way to be effective [12]. Lastly, other research group highlight that using worms requires centralized control and infection lifespan to avoid uncontrolled propagation [13].
Machine learning (ML) tackles these issues by strategically deploying the white-hat worms to eliminate the botnets without relying on antibodies, previous white-hat worm populations, or network topology. However, supervised learning (SL)-based BDS [14] requires a balanced dataset with predefined strategies to be effective [15]. In addition, because it only supports a single bulk deployment of white-hat worms, it cannot adapt to changes in botnet infections. While reinforcement learning (RL)-based BDS [16] addressed the dataset quality and adapted to the botnet infection by launching the white-hat worms based on the infection progression, it required more training episodes to be effective.
To strengthen the RL, this article proposed the survey–identify–reinforce–optimize (SIRO) framework to reduce the number of training episodes needed for the agents to be effective. In comparison with existing research summarized in Table 1, the framework acts as a guide to implement RL workflows for eliminating botnets based on four key principles:
  • Survey: Surveyed network vulnerabilities, infection state, and changes must be encoded as a multi-channel tensor to help the agent monitor the situation;
  • Identify: Irrelevant actions must be identified and masked while allowing leniency for the agent to explore new extermination strategies;
  • Reinforce: Key actions that contribute to the agent winning must be reinforced with rewards and penalties to teach the agent;
  • Optimize: Rewards and penalties must be adjusted to consistently guide the agent to the ideal win condition.
The main contribution is the implementation of a Chebyshev-based masking strategy used in the Identify component to reduce the complexity. Consistent with our ablation results, identify contributes the largest performance gain, while Survey provides benefits primarily in combination with other components due to added complexity. To further demonstrate the generality of our approach, the framework is tested on vanilla policy gradient (VPG), deep Q-network (DQN), proximal policy optimization (PPO), and MuZero to highlight its effectiveness [17]. Compared to our previous works [16], which relies on single-channel input, illegal-move masking, and suboptimal rewards, SIRO systematically redesigns observation, action, reward, and tuning to improve the learning curve.
With the introduction concluded in Section 1, Section 2 provides the preliminaries. Then, Section 3 defines the simulation and SIRO framework implementation. The results are presented in Section 4, with the generability of this framework discussed in Section 5. Finally, Section 6 provides the conclusion and describes future works.

2. Preliminary

2.1. Grid Topology Network

A square grid topology network is a finite square lattice L ( m , n ) where the edges are parallel to the x-axis and y-axis [18], in addition to m = n . Each of the vertices represents the device location, and the edge between the neighboring vertices is a potential communication link. Figure 1 is an example of a grid topology network.
In this topology, two vertices are adjacent if and only if they differ by 1 in exactly one coordinate [19], which excludes any diagonal link.

2.2. White-Hat Worm

A white-hat worm is a type of worm designed to combat botnet infections, aiming to safeguard the devices that are not feasible to be managed manually. The key differences that separate it from typical botnets are secondary infectivity to remove the botnet from the compromised devices and a built-in lifespan to delete itself. Figure 2 shows the white-hat worm behaviors in a 4 × 4 grid topology network.

2.3. Reinforcement Learning Algorithms

VPG is a model-free and policy-gradient method that uses Monte Carlo returns to optimize a stochastic policy directly [20]. By default, it lacks value function learning and planning, which contributes to high variance. DQN is a model-free and value-based method that uses temporal-difference updates to learn action values [21]. The training stability comes from the experience replay and target networks. PPO is a model-free and actor–critic method that combines the actor as the policy and the value estimator as the critic [22]. It uses a clipped objective to bound the per-update policy changes to improve training stability while retaining simplicity.
MuZero is a model-based method that learns the representation, dynamic, and reward by itself [23]. It achieves strong performance via off-policy training using a replay buffer. While VPG, DQN, and PPO require no planning, MuZero uses Monte Carlo Tree Search to plan. Table 2 summarizes the differences between each RL used in this article.
These algorithms are chosen because they are from four commonly used techniques in RL, which are policy-based, value-based, actor–critic, and model-based planning.

3. Implementation

Figure 3 shows the typical RL workflow, which involves observing the environment state (Survey), prioritizing certain actions (Identify), rewarding and penalizing key actions (Reinforce), and tuning the hyperparameters (Optimize) [24]. The SIRO framework focuses on enhancing the workflow to allow adaptability to different algorithms in solving botnet infection rather than focusing on the specific policies or values of an algorithm.
The following subsections discuss the grid topology network simulation, in addition to how the SIRO framework assists the agent in understanding the network state, masking unimportant actions, reinforcing key actions with rewards, and fine-tuning the rewards to win the simulation.

3.1. Grid Simulation Implementation

The simulated network and infection model are simplified and deterministic, where the infection state is s { 0 , 1 , 2 } , the device resistance is defined as 0 r 1 , and comparison operator decide if the botnet’s infectability exceeds the device resistance, as shown in Figure 4. To avoid overlapped numerical representation in the simulation, these values are expressed in separate 2D arrays, as shown in Figure 5.
In the simulation, botnet insertion happen once at step 0. For the subsequent steps, the simulation will insert the white-hat worm, simulate the botnet spread, and simulate the white-hat worm spread in a predetermined sequence, which is useful for debugging and evaluating the agent’s behaviors. Figure 6 shows the simulation timeline of the grid topology network.
The botnet and white-hat worm infections spread with a Manhattan distance [25] of 1, where they infect all neighboring connected devices. While the propagation follows the same concept as other infection models [26,27,28,29], the infection model implemented in this article is simplified to infect neighboring devices where r < 0.5 . The stylized implementation is to speed up the simulation and shorten the time taken to train RL.
Figure 7 shows the process for simulating the botnets’ and white-hat worms’ infection, with  r e s i l i e n c e _ m a p and i n f e c t i o n _ m a p denoting the 2D arrays of device resiliency and infection state maps. The detailed implementation is defined in Appendix A, which includes the infection simulation in Algorithm A2 and the Manhattan distance of 1 in Algorithm A2. These algorithms only simulate the propagation of botnets and white-hat worms on a 2D array, with no malicious code included to adhere to the EC-Council Code of Ethics [30].
The terminal state for the simulation is shown in Equation (1), where the agent won if all botnets are removed or contained. Conversely, it loses if any botnet reaches a boundary device or the total steps taken exceed the maximum step, where t o t a l _ s t e p > m a x _ s t e p .
Terminal state = W i n , if all botnets are removed or contained L o s e , if a botnet reaches the boundary or t o t a l _ s t e p > m a x _ s t e p
The initial botnet placement and the infection resiliency of each device are randomly created using unique seeds for every episode to prevent overfitting and allow the agent to develop various winning strategies. To avoid unresolvable and unfair simulations, the simulation enforces a minimum grid size solvable by the RL agents and skips training on unfair networks. Figure 8, Figure 9, Figure 10 and Figure 11 are examples of unresolvable, resolvable, and unfair simulations.
To ensure the white-hat worm can catch up to the botnet, the width and height of the grid must be more than 7, as shown in Equation (2). In addition, the initial botnet insertion coordinate from the nearest coordinate must have at least a Manhattan distance of 3. With the initial botnet coordinate as i n i t i a l = ( i , j ) , where 1 i m and 1 j n , the minimum distance from the nearest boundary is shown in Equation (3).
min ( m , n ) 7
min ( i 1 , m i , j 1 , n j ) 3
To ensure fairness, the  i n i t i a l must be able to reach at least one traversable boundary device. With  L T denoting the set of traversable boundary nodes, let b be an element of this set. We define Reach G T ( i n i t i a l _ b o t n e t , b ) to be true if and only if there exists a path in G T consisting only of traversable nodes from i n i t i a l to b, as shown in Equation (4).
b L T : Reach G T i n i t i a l , b
The simulation was implemented using Python 3.13.5 and NumPy 2.1.2 [31], where the numerical values to represent the infection state and the device’s resistance toward the infection are represented as Float 32 in NumPy’s 2D arrays. The rationale for using NumPy is to skip the step required to convert the data type to be compatible for the agent to process, shortening the time taken between each step.

3.2. Surveying the Situation

In RL, the agent must be able to observe and discern the situation, such as infection resistance and its state. Additionally, it will be advantageous for the agent to be able to see the past infection state and understand how the botnet infection spread.
With timestep as t, let i n f e c t i o n _ m a p t 1 and i n f e c t i o n _ m a p t be the grid topological network state in the previous and current timesteps. Then, the framework defined the input for the agent in Equation (5), with multi-channel tensor visualization in Figure 12.
i n p u t = ( r e s i l i e n c y _ m a p , i n f e c t i o n _ m a p t 1 , i n f e c t i o n _ m a p t )
This technique is similar to stacking multiple past board states found in AlphaZero [32], with few caveats. Firstly, the framework to help the agent discern the situation does not stack the replay buffer or Markov property enforcement, which means it only provides pairs of consecutive network states compiled at times t 1 and t. The rationale for this approach is that the illegal move checks in a grid topology network depend solely on the current board state, which differs from chess and other board games. Secondly, instead of treating the r e s i l i e n c y _ m a p t 1 and r e s i l i e n c y _ m a p t as a different set of data, they are stacked along with the board states for simplicity.

3.3. Identify Irrelevant Actions

Let the discrete action space be denoted as A , with the total number of actions in the discrete action space as N. In a grid topology network, the discrete action space can be described in Equation (6). However, the number of moves for the agent will constantly change, depending on the number of legal moves remaining and its priorities.
A = { 1 , 2 , , N } , where N = n · m
A simple mask can be created to tell the agent to avoid inserting the white-hat worm into certain devices that it cannot infect, where the infection resiliency is r 0.5 , and if the devices are not empty, as shown in Figure 13. While it reduced the complexity in discrete action space, where the total number of actions in discrete action space is N i l l e g a l N , it does not consider the distance from the infected devices. Hence, more training episodes are needed for the agent to identify the optimal placements on the L ( 7 , 7 ) grid.
To reduce the number of actions, a masking that uses a Manhattan distance of 1 from the infected devices to the infectable neighbors further reduced the complexity in discrete action space, where N m a n h a t t a n N i l l e g a l , as shown in Figure 14. However, such a masking will hinder the agents from exploring different strategies to contain and eliminate the botnets. Figure 15 shows a scenario where agents lost due to Manhattan-based masking prevents them from diagonally inserting the white-hat worm, which causes the botnet infection to split into two uncontainable paths on the L ( 7 , 7 ) grid.
To avoid unresolvable simulation, the framework uses a Chebyshev distance of 1 from the infected devices to the infectable neighbors to help the agent recognize important actions while allowing different winning strategies to be explored. While N m a n h a t t a n N c h e b y s h e v , it allows the white-hat worm to be inserted vertically, horizontally, and diagonally from the botnets, as shown in Figure 16. Figure 17 serves as another example where the agent won due to strategic diagonal insertion of the white-hat worms, similar to Figure 10.
Figure 18 is the masking process implemented to guide the agent, where a Chebyshev distance of 1 is used to find neighboring infectable devices. The detailed implementation is defined in Appendix A, which includes the masking process in Algorithm A3 and the chebyshev_coordinate () function in Algorithm A4.
A Manhattan distance of 1 directs the agent to position the white-hat worm either vertically or horizontally relative to the infected devices, while a Chebyshev distance of 1 directs the agent to place the white-hat worm either vertically, horizontally, or diagonally. In a scenario where the infection path could split off, the diagonal placement of the white-hat worm obstructs two infection pathways in a single move, avoiding the branching paths issue. For this reason, the framework uses a Chebyshev distance of 1.

3.4. Reinforce Agent Decisions

While masking helps the agent focus on important actions to take, it does not indicate how much those actions contribute to winning. Hence, it is necessary to establish rewards or penalties for specific actions. In RL, rewards and penalties can be classified into two types: episodic reward and step-based reward [33].
Episodic reward is often used for games or simulations with a terminal condition to let the agent know if it won or lost. Based on the terminal state in Equation (1), the winning reward w i n _ r e w a r d and losing penalty l o s e _ p e n a l t y are defined as constant values. Additionally, to force the agent to win with a lesser number of turns, an additional winning reward is used, where the a c t i o n _ e f f i c i e n c y reward decreases as the t o t a l _ s t e p to win increases. The framework for the episodic reward is defined in Equation (7).
t e r m i n a l = win = w i n _ r e w a r d + a c t i o n _ e f f i c i e n c y 1 t o t a l _ t u r n m a x _ t u r n lose = l o s e _ p e n a l t y
While setting up the episodic reward is straightforward, the step-based rewards are dynamically calculated based on how the network’s state changes with each step. Furthermore, while episodic rewards focus on teaching the agent how to win the game, the step-based reward teaches the agent how it should behave throughout the episode, making it possible to win with optimized actions.
To ensure the white-hat worm does not spread more than it should and to force the agent to win the game as soon as possible, the agent is penalized as the total white-hat worm count increases. With  p r e s e n c e _ s c a l e as a constant value, w h i t e h a t _ c o u n t t as the total white-hat worm count on the current step, and  w h i t e h a t _ c o u n t t 1 as the total white-hat worm count on the previous step, the framework to penalize as the total white-hat worm count increases is shown in Equation (8).
p r e s e n c e = p r e s e n c e _ s c a l e w h i t e h a t _ c o u n t t w h i t e h a t _ c o u n t t 1
To teach the agent that the actions it takes succeed in reducing the botnet infection, the agent is rewarded if it manages to reduce the botnet count from the previous step. Conversely, the agent is penalized if the botnet count increases from the previous step. With  p r o g r e s s _ s c a l e as a constant value, b o t n e t _ c o u n t t as the total botnet count on the current step, and  b o t n e t _ c o u n t t 1 as the total botnet count on the previous step, the framework to reward or penalize as the total botnet count changes is shown in Equation (9).
p r o g r e s s = p r o g r e s s _ s c a l e b o t n e t _ c o u n t t 1 b o t n e t _ c o u n t t
To tell the agent if it is successful in controlling the botnet’s infection, the reward is given only if white-hat worms block the shortest botnet infection path to the boundary devices, with bonus rewards given for additional blocked paths. With  b l o c k _ s c a l e as a constant value, bfs_boundary() as the helper function to find the shortest distance to the boundary devices using breadth-first search, and group_helper() as a helper function to classify the measured distance, the framework to reward the white-hat worms that block infection paths is shown in Algorithm 1.
Algorithm 1 Calculate the rewards for blocking the botnet infection paths.
Input: 
Current mask m a s k e d _ m a p t , previous mask m a s k e d _ m a p t 1 , r e s i l i e n c e _ m a p
Output: 
Blocked path rewards b l o c k
  1:
blocking_rewards ( m a s k e d _ m a p t , m a s k e d _ m a p t 1 , r e s i l i e n c e _ m a p )
  2:
   Initialize the reward scale: b l o c k _ s c a l e
  3:
   Initialize a list to store the results: r e s u l t s [ ]
  4:
   Initialize an integer to count blocked paths: p a t h s 0
  5:
   Initialize a dictionary to group the results: g r o u p s { shortest : [ ] , else : [ ] }
  6:
   Find t unmasked coordinates: c u r r e n t _ i n d i c e s find_true ( m a s k e d _ m a p t )
  7:
   Find t 1 unmasked coordinates: p r e v i o u s _ i n d i c e s find_true ( m a s k e d _ m a p t 1 )
  8:
   for  x , y in p r e v i o u s _ i n d i c e s  do
  9:
      Find the shortest distance to boundary: d i s t a n c e bfs_boundary ( x , y )
10:
      Save the results: r e s u l t s . append ( [ ( x , y ) , d i s t a n c e ] )
11:
   end for
12:
   Group the results based on distance: g r o u p s group_helper ( r e s u l t s )
13:
   Find missing coordinates: m i s s i n g set ( p r e v i o u s _ i n d i c e s ) set ( c u r r e n t _ i n d i c e s )
14:
   Convert set into a list: m i s s i n g list ( m i s s i n g )
15:
   for  c o o r d i n a t e , d i s t a n c e in g r o u p s [ shortest ]  do
16:
      if  c o o r d i n a t e in m i s s i n g  do
17:
         Count the blocked paths: p a t h s p a t h s + 1
18:
   end for
19:
   if  p a t h s > 0  do
20:
      for  c o o r d i n a t e , d i s t a n c e in g r o u p s [ else ]  do
21:
         if  c o o r d i n a t e in m i s s i n g  do
22:
            Count the blocked paths: p a t h s p a t h s + 1
23:
   end for
24:
   Calculate the rewards: b l o c k b l o c k _ s c a l e · p a t h s
25:
   return  b l o c k
26:
End Function
The total reward given at the end of each step is shown in Equation (10), where the episodic reward is only given when the simulation reaches its terminal state. Furthermore, the hand-tuned hyperparameters for the rewards are defined in Table 3.
t o t a l _ r e w a r d = p r e s e n c e + p r o g r e s s + b l o c k + t e r m i n a l , if terminal 0 , otherwise
While the rewards are designed to incentivize the agent for efficiently eliminating or containing the botnet infection, there is a risk that changes in network size and device resiliency could cause the step-based rewards to overshadow the episodic rewards, leading the agent to intentionally increase the number of steps taken to accumulate more step-based rewards.

3.5. Optimize Rewards Incentives

Although the rewards and penalties can be hand-tuned to consistently guide the agent to win with the most optimized moves, it took a long time for a human to fine-tune them for each RL algorithm. To automate the process and avoid brute-forcing the entire combinations, Optuna 4.6.0 [34] was utilized to implement Bayesian optimization, as shown in Figure 19.
Specifically, Optuna was used to implement Tree-Structured Parzen Estimator, which is a Bayesian optimization that utilizes probabilistic models as the objective function to search the hyperparameter space efficiently. With a total of 30 trials, the agent is trained with 250 episodes and evaluated with 50 episodes, where seeded randomization is used to generate networks. The value ranges for Optuna to optimize are shown in Table 4.
Once the best reward coefficients are found, the agent will undergo training and evaluation, which will be discussed further in the following section.

4. Evaluation

In this section, the hyperparameters used to configure the RL algorithms and the ML architectures are defined. Next, the experiments on the previous RL-based BDS launcher [16] against the SIRO framework are compared. Then, the scalability of the SIRO framework on DQN is tested. Finally, an ablation study was conducted to evaluate how the components in SIRO impact accuracy.

4.1. Reinforcement Learning Configuration

In this article, the RL algorithms are configured with the same hyperparameters throughout the experiments, as shown in Table 5 for VPG, Table 6 for DQN, Table 7 for PPO, and Table 8 for MuZero. These hyperparameters represent the default values used to initialize the algorithms with no fine-tuning, except for the number of simulations in MuZero, which was reduced to 10 for shorter training times.
For consistency, all RL algorithms utilized the same convolutional neural network (CNN)-based encoder model. The CNN-based encoder model is chosen because it helps the RL algorithms to capture the spatial pattern in 2D networks, where neighboring nodes influence each other. This rationale aligns with the past research done in AlphaZero to solve the board game problems [32].
It utilized three 2D convolution layers (Conv2D), with padding set to same to retain the dimension size, followed by kernel k, filter f, and stride s values shown in Figure 20. The rectified linear unit (ReLU) is used for the first and second Conv2D layers, while the leaky rectified linear unit (LeakyReLU) of 0.1 is used in the final layer to avoid the vanishing gradient problem. Once flattened, the data is parsed to the dense layer with the unit number of u = 2 · m · n to reduce the dimensionality. A sigmoid activation then converts the output into a probability-like value between 0 and 1 to place the white-hat worm before the final dense layer of u = m · n adjusts the output to match the network.
For RL algorithms that utilize multiple ML models, like PPO and MuZero, additional ML models are implemented, as shown in Figure 21. The critic network in PPO reused the CNN-based encoder model, where the output was changed into one unit in Figure 21a. Meanwhile, the prediction network and the dynamic network in MuZero are implemented with multi-task learning models shown in Figure 21b,c.
In this article, PyTorch 2.8.0 [35] is used to implement the RL algorithms. Furthermore, the hyperparameters for the algorithms were purposely not fine-tuned, and the ML models used were standardized to highlight the improvements from using the SIRO framework.

4.2. Performance Comparison Study

To compare the performance against the SIRO framework, the rewards and penalties designs, illegal moves masking, and single-channel tensor for representing the current infection state that are used in the previous RL-based BDS launcher [16] were implemented on VPG, DQN, PPO, and MuZero. While the illegal moves masking and current infection state tensor have been discussed in Section 3, the rewards and penalties for the previous RL setup are discussed in Appendix B, with total reward computation in Equation (A6).
The agents configured with the previous configurations from the RL-based BDS launcher and improved with the SIRO framework are trained on 1000 seeded grid topology networks with dimensions L ( 7 , 7 ) , with the initial botnet being inserted at the center to guarantee the simulation’s solvability. The agents are evaluated at 10-episode training intervals using 100 untrained seeded episodes to determine the performance. The training and evaluation were conducted three times to obtain the mean.
Figure 22 is the winning rate score, with a range band showing the minimum and maximum values observed during the evaluations. In Figure 22a, some of the agents configured with the previous RL setup slowly improve as the number of training episodes increases. However, the winning rate mostly plateaued for these agents, and they struggled to exceed 85%. In contrast, all agents improved with the SIRO framework in Figure 22b exceeding 90%, with DQN and PPO successfully achieving a 100% winning rate in shorter training episodes.
The results show that agents that used the previous RL setup could not learn winning strategies within 1000 training episodes because of the sheer complexity of the discrete action space in the grid topology network. Conversely, the Chebyshev-based masking strategy used in the SIRO framework helped the agents focus on important actions, while rewards and penalties optimized using Optuna encourage the agents to make decisions that increase their chances of winning.
In addition to this, the step taken to win the game, aptly named “step-to-win,” is also measured and visualized using a line plot with a range band in Appendix C, Figure A1, with detailed analysis in Table A1. While agents implemented with the SIRO framework are faster in winning the game, the step-to-win metric does not take into account the simulations the agents lost. With 1 as the smallest possible step to win and max _ s t e p = 10 , the step-to-win can be expressed as win efficiency using Equation (11).
w i n _ e f f i c i e n c y = w i n n i n g _ r a t e · 10 s t e p _ t o _ w i n 10 1
Figure 23 is the mean win efficiency score, with minimum and maximum values observed during the evaluations shown as the range band. In Figure 23a, the agents configured with the previous RL setup struggle to improve their win efficiency beyond 60%. However, the agents improved with the SIRO framework in Figure 23b and exceeded and maintained win efficiency above 70%. The results indicate that SIRO agents win faster and more efficiently.
While Figure 22 and Figure 23 are intuitive for visualizing the mean, minimum, and maximum values, it is difficult to numerically compare the standard deviation between the agents configured using the previous RL setup and the SIRO framework. To solve this, the normalized area under the learning curve (AULC) [36] for each run was calculated before using it to obtain the standard deviation.
Since the agents evaluated at 10-episode training intervals yield 100 results, with y representing the measured performance, the AULC can be calculated using the trapezoidal rule in Equation (12). Then, with evaluation starting from the tenth episode and each evaluation containing 100 untrained episodes, the normalized AULC can be calculated using Equation (13). Finally, the standard deviation was calculated from the normalized AULCs.
AULC = e p i s o d e = 1 100 1 y e p i s o d e + y e p i s o d e + 1 2 · 10
Normalized AULC = AULC 100 1000 10
Table 9 is the normalized mean AULC with standard deviation. The results confirmed the observations in Figure 22, showing that the agents who improved with the SIRO framework had mean and normalized AULC values closer to 1, indicating ideal learning behavior. Additionally, most agents that were improved with the SIRO framework exhibit lower standard deviation values.
Similarly, Table 10 shows that agents who improved using the SIRO framework had normalized mean AULC values closer to 1 and exhibited lower deviation. The results show that the SIRO framework is much more efficient in winning the game with fewer steps, which confirms the observation in Figure 23 and Figure A1.
Finally, to obtain the mean improvement between the previous RL setup and the SIRO framework, the mean percentage change for each agent was computed and shown in Table 11. The results show that the mean SIRO framework improvement across the RL algorithms on the winning rate is 49.1293% and the win efficiency is 118.8031%, confirming the effectiveness of the SIRO framework in improving the agents.

4.3. Network Scalability Study

To test the scalability of the SIRO framework, a DQN-based agent was chosen due to having less computational complexity while having good performance compared to other algorithms. The DQN-based agent is tested on grid topology network sizes from L ( 7 , 7 ) to L ( 28 , 28 ) , with the ML model in Figure 20 scaled to the network size.
The training and evaluation using the same parameters in Section 4.2 were repeated three times, where the normalized AULCs were measured and the mean and standard deviation were computed. In this test, the initial botnet was inserted at the center for L ( 7 , 7 ) . For  L ( 8 , 8 ) onward, it was randomized while adhering to the requirement in Equation (3).
Table 12 is the computed mean and standard deviation for the DQN-based agents, in addition to the line plot with error bars shown in Figure 24. The winning rate slightly increases from L ( 15 , 15 ) to L ( 20 , 20 ) before oscillating at L ( 21 , 21 ) onward. Similar patterns are observed in win efficiency. Both metrics display a small standard deviation.
The winning rate for DQN with the SIRO framework increases as the network size grows because larger grids provide more opportunities for DQN to place the white-hat worms, which help eliminate the botnet and prevent it from reaching the boundary devices. The oscillation of the area under the learning curves on L ( 21 , 21 ) is due to a limitation of the ML model in DQN itself, not the SIRO framework. Although the input and output of the ML model are designed to dynamically adjust to the network size, the number of layers remains constant, which could hinder DQN with the SIRO framework from scaling up.

4.4. Reward Ablation Study

To evaluate the contribution of each of the components and their combinations in SIRO framework, an ablation study was conducted using DQN-based agents on an L ( 7 , 7 ) grid network by implementing individual and different combinations of the components. Then, the training and evaluation using the same parameters in Section 4.2 were repeated three times, where the normalized AULCs were measured.
Table 13 shows the mean and standard deviations for the normalized AULCs on each of the components and their combinations. The result on DQN utilizing only the Survey component has the lowest mean normalized AULC, which is lower than the previous RL setup. The reason for this result is that using multi-channel tensor input increases complexity without support from other components. Conversely, the identify component provides the highest mean AULC improvements, highlighting the advantage of using a Chebyshev-based masking strategy.
The differences in AULC scores from combining multiple components from the SIRO framework are less noticeable. Hence, Figure 25 and Figure 26, which represent the scatter plot with error bars, are used to visualize the winning rate and win efficiency.
Both figures show that combining the components slightly improves the winning rate and win efficiency, with the exception of a complete SIRO framework implementation. While it has the highest mean AULC on winning rate, the mean AULC on win efficiency is slightly lower when compared to the DQN-based agent implemented with Survey, Identify, and Reinforce components. The reason for this result is that Optuna optimizes the scale to achieve a higher winning rate instead of winning efficiency. In other words, at the cost of slightly increasing the step-to-win, the DQN agent will have a higher chance to win.
In addition to the ablation study on each of the components in the SIRO framework, the scales used for rewards and penalties are also evaluated. With the same parameters where all the components in SIRO were utilized, the training and evaluation were repeated three times, and the normalized AULCs were measured.
The baseline result, which represents the conditions where all step-based rewards and penalty optimized by Optuna are enabled, followed by the results of each optimized step-based reward and penalty optimized by being disabled, is shown in Table 14.
As anticipated, the mean winning rate is higher when all step-based rewards and penalty are enabled in the baseline, followed by the individual scales of b l o c k _ s c a l e , p r e s e n c e _ s c a l e , a c t i o n _ e f f i c i e n c y , and  p r o g r e s s _ s c a l e . The result shows that blocking the path has a great influence on the winning rate, followed by the rewards and penalties that force the agent to win with fewer steps. In other words, reinforcing the DQN-based agent to win as soon as possible help to reduce the chance of botnet from spreading.
To visualize the standard deviations, Figure 27 and Figure 28 represent the scatter plot with error bars for the winning rate and win efficiency. From these figures, p r e s e n c e _ s c a l e has the highest level of variability or inconsistency in both winning rate and win efficiency. This result occurs because the DQN-based agent is rewarded for winning as quickly as possible, which may lead it to make suboptimal decisions that only temporarily contain the botnets in the long term.
These results confirmed the contribution of each component in the SIRO framework and the step-based rewards and penalty to ensure a high winning rate and win efficiency.

5. Discussion

The evaluation conducted in Section 4.3 shows that the agent reinforced with the SIRO framework could be scaled up until L ( 20 , 20 ) before the winning rate starts to oscillate on L ( 21 , 21 ) onward. However, the previous evaluation has only been done from L ( 7 , 7 ) to L ( 28 , 28 ) , which poses new questions about scaling beyond L ( 28 , 28 ) and when m n .
To answer these, as long as the network’s grid topology meets the requirement outlined in Equation (2), it can be partitioned into smaller grids, provided that no partition contains two infected devices. Additionally, each infected device is at least three steps away from the new boundary, as outlined in Equation (3) and shown in Figure 29.
While this article focuses on the grid topology network due to ease of interpretation, simulation, and implementation, scale-free networks are more commonly used, especially in IoT environments [37,38,39]. To use the SIRO framework on the scale-free networks, the ML model must learn the network connection, in addition to adapting the Chebyshev distance mask to the scale-free network.
To capture the spatial pattern in a scale-free network, the ML model employed by the agent should use a graph neural network (GNN) to represent the connection of the scale-free network and substitute the convolutional block in Figure 20. This approach could shorten the training time needed because the edges and vertices inside the GNN already represent the network connection, eliminating the need for the agent to painstakingly learn the connection with more training episodes.
However, this technique assumes that the links between the devices in the scale-free network are fixed throughout the training and evaluation. If the connection between the devices changes, the edges inside the GNN must be updated and retrained for it to be effective in dealing with the botnet threat in a scale-free network. This limitation also prevents the partitioning technique for handling larger scale-free networks from being effective, as the time taken to update and retrain the model is long enough for the botnet infection to spread.
To emulate the Chebyshev distance behavior for finding vertically, horizontally, or diagonally neighboring devices, a breadth-first search (BFS) algorithm could be used to anticipate the botnet spread in a scale-free network [40]. Algorithm 2 is the Chebyshev distance of 1 emulation using BFS on a scale-free network.
Algorithm 2 Chebyshev distance of 1 emulation on a scale-free network.
Input: 
Graph G = ( V , E ) as adjacency lists Adj [ · ] ; source device s V ; threshold k 2
Output: 
Set N ( s ) : nodes considered at Chebyshev distance 1 from s
  1:
bfs_neighbors ( G , s , k )
  2:
   Initialize empty set of 1-hop neighbors: N 1
  3:
   Initialize empty dictionary of sets: parents [ u ] for all u V
  4:
   Initialize queue: Q [ ]
  5:
   // tuple: (node, depth, first_hop), ⊥=none
  6:
   Enqueue ( s , 0 , ) into Q
  7:
   while Q is not empty do
  8:
       ( v , d , f h ) Q . dequeue ( )
  9:
      if  d = 0  do
10:
         for each  w Adj [ v ]  do
11:
            Enqueue ( w , 1 , w ) into Q
12:
         end for
13:
      else if  d = 1  do
14:
         // Find neighboring devices (vertical and horizontal)
15:
          N 1 . add ( v )
16:
         for each  u Adj [ v ]  do
17:
            if  u = s  then continue
18:
             parents [ u ] . add ( v )
19:
            Enqueue ( u , 2 , v ) into Q
20:
         end for
21:
      else if  d = 2  then
22:
         continue
23:
   end while
24:
   // Find devices at distance 2 with ≥k distinct first-hop parents (diagonal)
25:
    N 2 { u V u s u N 1 | parents [ u ] | k }
26:
   return  N ( s ) N 1 N 2
27:
End Function
Using BFS to identify first-hop neighboring devices from an infected device retrieves all devices directly connected to it in a scale-free network. This emulates identifying devices that are connected vertically and horizontally in a grid topology using a Chebyshev distance of 1. Furthermore, BFS finds second-hop devices that are reachable from at least two distinct first-hop neighboring devices, which can be used to block two or more infection routes in the scale-free network. This behavior is analogous to identifying diagonally positioned devices in a grid topology using a Chebyshev distance of 1.
These workarounds on GNN and masking show the possibilities of adapting the SIRO framework to scale-free networks, with scalability limitations reserved for future works.

6. Conclusions

In this article, the SIRO framework is proposed to improve the RL-based BDS launcher to eliminate botnet infections in the stylized grid-topology network simulation. An efficient RL-based BDS launcher is achievable within 1000 episodes by following four key principles: (1) survey, (2) identify, (3) reinforce, and (4) optimize.
When compared to the previous RL setup [16], the SIRO framework successfully increases the mean winning rate by 49.1293% and improves the mean win efficiency by 118.8031% in L ( 7 , 7 ) , with the best performers achieving 100% botnet elimination within 2.3500 steps, as shown in Table A1. Furthermore, a DQN-based agent that utilizes the SIRO framework has a higher winning rate from L ( 15 , 15 ) to L ( 20 , 20 ) . The masking utilized by the SIRO framework is the primary reason for performance gains by reducing discrete action space complexity. Complementing this, the Bayesian optimization done by Optuna to fine-tune the rewards and penalties gives an additional boost in performance. This helps to avoid the step-based rewards from overshadowing the episodic rewards, leading the agent to increase the number of steps taken to accumulate more rewards.
While the article proposes the SIRO framework to address the long training time and low effectiveness of RL-based BDS launchers in a grid topology network, the same framework could be adapted to a scale-free network. By emulating the Chebyshev distance of 1 using the BFS algorithm, it is possible to identify the optimal white-hat placement that could effectively block multiple infection routes. Furthermore, by adapting the GNN as a replacement for the CNN layers, with the edges and vertices representing the connections and devices in the scale-free network, the number of training episodes required could be reduced. However, the partitioning technique that addresses the scalability issue in grid topology networks is not effective in scale-free networks.
In future work, we aim to expand the RL-based BDS launcher strategies to handle multiple botnet insertions and evaluate their performance on scale-free networks, including the use of partitioning techniques and addressing adversarial attacks [41]. Furthermore, we aim to improve the environment’s source code, provide the documentation, and release it as a Python module to make it more accessible in the future.

Author Contributions

Conceptualization, M.H.B.K., S.Y. (Shingo Yamaguchi) and S.Y. (Sena Yoshioka); methodology, M.H.B.K. and S.Y. (Shingo Yamaguchi); software, M.H.B.K. and S.Y. (Sena Yoshioka); validation, M.H.B.K.; formal analysis, M.H.B.K.; investigation, M.H.B.K.; resources, S.Y. (Shingo Yamaguchi); data curation, M.H.B.K.; writing—original draft preparation, M.H.B.K.; writing—review and editing, S.Y. (Shingo Yamaguchi); visualization, M.H.B.K.; supervision, S.Y. (Shingo Yamaguchi); project administration, S.Y. (Shingo Yamaguchi); funding acquisition, S.Y. (Shingo Yamaguchi). All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by JSPS KAKENHI Grant Numbers JP22K12028.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original data presented in this study are openly available in GitHub at: https://github.com/yamaguchishingo/siro_mdpi2026 (accessed on 8 April 2026).

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

    The following abbreviations are used in this manuscript:
IoTInternet of Things
WSNWireless sensor network
DDoSDistributed denial of service
BDSBotnet Defense System
MLMachine learning
SLSupervised learning
RLReinforcement learning
SIROSurvey–identify–reinforce–optimize
CNNConvolutional neural network
Conv2D2D convolutional layer
AULCArea under the learning curve
GNNGraph neural network
BFSBreadth-first search

Appendix A

To simulate the propagation of botnet and white-hat worm infection, Algorithm A1 utilizes the manhattan_coordinate() function to determine the vertically and horizontally neighboring device coordinates to be scanned to see if the devices are infectable or not. The manhattan_coordinate() implementation is shown in Algorithm A2.
Algorithm A1 Simulate the propagation of botnet and white-hat worm infection.
Input: 
Device resiliency r e s i l i e n c e _ m a p , infection state i n f e c t i o n _ m a p , m, n
Output: 
Updated infection state i n f e c t i o n _ m a p
  1:
simulate_infection( r e s i l i e n c e _ m a p , i n f e c t i o n _ m a p , m , n )
  2:
   Copy the infection state: i n f e c t i o n _ m a p i n f e c t i o n _ m a p
  3:
   // Simulate the botnet infection first
  4:
   for  i = 0 to m 1  do
  5:
      for  j = 0 to n 1  do
  6:
         if  i n f e c t i o n _ m a p [ i , j ] = 1  do
  7:
            Get neighbors: c o o r d i n a t e s manhattan_coordinate ( i , j , m , n )
  8:
            for  d x , d y in c o o r d i n a t e s  do
  9:
               if  r e s i l i e n c e _ m a p [ d x , d y ] < 0.5 and i n f e c t i o n _ m a p [ d x , d y ] = 0  do
10:
                  Insert botnet: i n f e c t i o n _ m a p [ d x , d y ] 1
11:
            end for
12:
      end for
13:
   end for
14:
   Copy the infection state: i n f e c t i o n _ m a p i n f e c t i o n _ m a p
15:
   // Followed by the white-hat worm infection
16:
   for  i = 0 to m 1  do
17:
      for  j = 0 to n 1  do
18:
         if  i n f e c t i o n _ m a p [ i , j ] = 2  do
19:
            Get neighbors: c o o r d i n a t e s manhattan_coordinate ( i , j , m , n )
20:
            for  d x , d y in c o o r d i n a t e s  do
21:
               if  r e s i l i e n c e _ m a p [ d x , d y ] < 0.5  do
22:
                  if  i n f e c t i o n _ m a p [ d x , d y ] = 0 or i n f e c t i o n _ m a p [ d x , d y ] = 1  do
23:
                     Insert white-hat worm: i n f e c t i o n _ m a p [ d x , d y ] 2
24:
            end for
25:
      end for
26:
   end for
27:
   return  i n f e c t i o n _ m a p
28:
End Function
Algorithm A2 Find the neighboring coordinates with Manhattan distance of 1.
Input: 
x, y, m, n { 0 x < m , 0 y < n }
Output: 
Neighboring coordinates c o o r d i n a t e s
  1:
manhattan_coordinate ( x , y , m , n )
  2:
   Initialize list: c o o r d i n a t e s [ ]
  3:
   if  x + 1 < m  then
  4:
      // Scan neighboring coordinates
  5:
       c o o r d i n a t e s . append ( ( x + 1 , y ) ) // Right
  6:
   if  x 1 0  then
  7:
       c o o r d i n a t e s . append ( ( x 1 , y ) ) // Left
  8:
   if  y + 1 < n  then
  9:
       c o o r d i n a t e s . append ( ( x , y + 1 ) ) // Up
10:
   if  y 1 0  then
11:
       c o o r d i n a t e s . append ( ( x , y 1 ) ) // Down
12:
   return  c o o r d i n a t e s
13:
End Function
To create a mask that reduces discrete action space complexity and enables the agent to explore various winning strategies, Algorithm A3 uses the chebyshev_coordinate() function to identify the device coordinates that are vertically, horizontally, and diagonally neighboring to the infected devices.
The chebyshev_coordinate() function in Algorithm A4 is an extended version of Algorithm A2. The only difference is the additional conditionals added in lines 12 to 20, which ensure that the diagonally neighboring devices are both empty and indefectible. By unmasking the diagonally neighboring devices, the RL could efficiently block two infection routes at the same time.
Algorithm A3 Use Chebyshev distance of 1 from the infected devices to create the mask.
Input: 
Current infection state i n f e c t i o n _ m a p t , r e s i l i e n c e _ m a p , m, n
Output: 
Masked action space m a s k e d _ m a p
  1:
chebyshev_mask ( r e s i l i e n c e _ m a p , i n f e c t i o n _ m a p t , m , n )
  2:
   Initialize preapplied masked action space: m a s k e d _ m a p [ m ] [ n ] F a l s e
  3:
   // Scan for the infected devices
  4:
   for  i = 0 to m 1  do
  5:
      for  j = 0 to n 1  do
  6:
         if  i n f e c t i o n _ m a p t [ i , j ] = 1  do
  7:
            Get neighbors: c o o r d i n a t e s chebyshev_coordinate ( i , j , m , n )
  8:
            for  d x , d y in c o o r d i n a t e s  do
  9:
               if  r e s i l i e n c e _ m a p [ d x , d y ] < 0.5 and i n f e c t i o n _ m a p t [ d x , d y ] = 0  do
10:
                  Remove mask: m a s k e d _ m a p [ d x , d y ] T r u e
11:
            end for
12:
      end for
13:
   end for
14:
   return  m a s k e d _ m a p
15:
End Function
Algorithm A4 Find the neighboring coordinates with Chebyshev distance of 1.
Input: 
x, y, m, n
Output: 
Neighboring coordinates list c o o r d i n a t e s
  1:
chebyshev_coordinate ( x , y , m , n )
  2:
   Initialize list to store the coordinates: c o o r d i n a t e s [ ]
  3:
   // Generate vertically and horizontally neighboring coordinates
  4:
   if  0 x + 1 < m  do
  5:
      Right: c o o r d i n a t e s . append(( x + 1 , y ))
  6:
   if  0 x 1 < m  do
  7:
      Left: c o o r d i n a t e s . append(( x 1 , y ))
  8:
   if  0 y + 1 < n  do
  9:
      Up: c o o r d i n a t e s . append(( x , y + 1 ))
10:
   if  0 y 1 < n  do
11:
      Down: c o o r d i n a t e s . append(( x , y 1 ))
12:
   // Generate diagonally neighboring coordinates
13:
   if  0 x + 1 < m and 0 y + 1 < n  do
14:
      Right-up: c o o r d i n a t e s . append(( x + 1 , y + 1 ))
15:
   if  0 x + 1 < m and 0 y 1 < n  do
16:
      Right-down: c o o r d i n a t e s . append(( x + 1 , y 1 ))
17:
   if  0 x 1 < m and 0 y + 1 < n  do
18:
      Left-up: c o o r d i n a t e s . append(( x 1 , y + 1 ))
19:
   if  0 x 1 < m and 0 y 1 < n  do
20:
      Left-down: c o o r d i n a t e s . append(( x 1 , y 1 ))
21:
   return  c o o r d i n a t e s
22:
End Function

Appendix B

The rewards and penalties of the previous RL-based BDS launcher proposed by Yoshioka et al. [16] are designed to optimize the insertion of white-hat worms while using masked illegal moves and single tensor input. Appendix B discussed the implementations used in Section 4.2.
Compared to the episodic reward proposed by the SIRO framework in Equation (7), the episodic reward used by the previous RL-based BDS launcher utilized static values for both winning and losing the simulation, as shown in Equation (A1). While it is simple, the agents must rely on step-based rewards to know how well they perform during the simulations.
t e r m i n a l o l d = win = 1 lose = 1
For the step-based rewards, the previous RL-based BDS launcher utilized three key principles to optimize the white-hat insertion under:
  • Placement distance reward;
  • Edge closeness penalty;
  • Path-blocking reward.
The placement distance reward aims to reinforce the agents to insert the white-hat worms as close as possible to the botnet. It works by calculating the shortest distance d s h o r t e s t from the newly placed white-hat worm and the set of b o t n e t s coordinates before normalizing and using it as the reward, as shown in Equation (A2).
d i s t a n c e = 0.3 1 d s h o r t e s t m · n where d s h o r t e s t = min b o t b o t n e t s x x b + y y b
Meanwhile, the edge closeness penalty aims to discourage the agents from letting the botnets move closer to the network boundaries. For each botnet coordinate i , j , the distance to the closest boundary is calculated in Equation (A3) to obtain R e d g e . Then, the average is calculated and multiplied by the penalty scale in Equation (A4).
R e d g e = 1 d e d g e 1 where d edge = min m 1 j , ( right boundary ) , j , ( left boundary ) , i , ( top boundary ) , n 1 i , ( bottom boundary ) .
c l o s e n e s s = 0.1 · 1 b o t n e t _ c o u n t t c o u n t R e d g e c o u n t
Finally, the path-blocking reward aims to reinforce the agents to block the shortest traversable path to the boundary. With L prior and L after representing the path length prior to and after the white-hat worm insertion, the path-blocking reward is calculated as shown in Equation (A5).
t r a v e r s e = 0.5 L after L prior
The total reward given at the end of each step is shown in Equation (A6), where the episodic reward is only given when the simulation reaches its terminal state.
t o t a l _ r e w a r d o l d = d i s t a n c e + c l o s e n e s s + t r a v e r s e + t e r m i n a l o l d , if terminal 0 , otherwise

Appendix C

Figure A1 shows that the SIRO framework reduced the step-to-win to within three steps, with the DQN-based agent having the lowest step-to-win shown in Table A1.
Figure A1. The mean line plot with range band on step-to-win. (a) The agents configured with previous reinforcement learning setup slightly lowered the step-to-win before plateauing above three steps. (b) The agents configured with the survey–identify–reinforce–optimize quickly reduced and maintained the step-to-win under three steps.
Figure A1. The mean line plot with range band on step-to-win. (a) The agents configured with previous reinforcement learning setup slightly lowered the step-to-win before plateauing above three steps. (b) The agents configured with the survey–identify–reinforce–optimize quickly reduced and maintained the step-to-win under three steps.
Sensors 26 02517 g0a1
Table A1. The highest winning rates achievable by each reinforcement learning and their step-to-win metrics.
Table A1. The highest winning rates achievable by each reinforcement learning and their step-to-win metrics.
AlgorithmImplementationHighest Winning Rate [%]Step-to-Win
Vanilla policy gradientPrevious793.9114
Improved992.3030
Deep Q-networkPrevious793.4177
Improved1002.3500
Proximal policy optimizationPrevious775.4026
Improved1002.3600
MuZeroPrevious713.9718
Improved972.6289

References

  1. Gelgi, M.; Guan, Y.; Arunachala, S.; Samba Siva Rao, M.; Dragoni, N. Systematic Literature Review of IoT Botnet DDOS Attacks and Evaluation of Detection Techniques. Sensors 2024, 24, 3571. [Google Scholar] [CrossRef] [Scilit]
  2. Jain, S.; Verma, R.K. A Taxonomy and Survey on Grid-Based Routing Protocols Designed for Wireless Sensor Networks. ACM Comput. Surv. 2024, 56, 1–41. [Google Scholar] [CrossRef] [Scilit]
  3. Acarali, D.; Rajarajan, M.; Komninos, N.; Zarpelão, B.B. Modelling the Spread of Botnet Malware in IoT-Based Wireless Sensor Networks. Secur. Commun. Netw. 2019, 2019, 3745619. [Google Scholar] [CrossRef] [Scilit]
  4. Choo, K.K.R.; Gai, K.; Chiaraviglio, L.; Yang, Q. A Multidisciplinary Approach to Internet of Things (IoT) Cybersecurity and Risk Management. Comput. Secur. 2021, 102, 102136. [Google Scholar] [CrossRef] [Scilit]
  5. Nwokoye, C.H.; Madhusudanan, V. Epidemic Models of Malicious-Code Propagation and Control in Wireless Sensor Networks: An Indepth Review. Wirel. Pers. Commun. 2022, 125, 1827–1856. [Google Scholar] [CrossRef] [Scilit]
  6. Fathima, A.; Devi, G.S.; Faizaanuddin, M. Improving Distributed Denial of Service Attack Detection Using Supervised Machine Learning. Meas. Sens. 2023, 30, 100911. [Google Scholar] [CrossRef] [Scilit]
  7. Adedeji, K.B.; Abu-Mahfouz, A.M.; Kurien, A.M. DDoS Attack and Detection Methods in Internet-Enabled Networks: Concept, Research Perspectives, and Challenges. J. Sens. Actuator Netw. 2023, 12, 51. [Google Scholar] [CrossRef] [Scilit]
  8. Muthukumar, S.; Senthilkumar, M.; Veeramani, C. Optimal Control of Computer Virus Spreading Model with Partial Immunization. Wirel. Pers. Commun. 2024, 134, 2287–2313. [Google Scholar] [CrossRef] [Scilit]
  9. Rodríguez Lucatero, C. Analysis of Epidemic Models in Complex Networks and Node Isolation Strategie Proposal for Reducing Virus Propagation. Axioms 2024, 13, 79. [Google Scholar] [CrossRef] [Scilit]
  10. Asadi, E.; Hosseini, S. Worm Propagation Modeling Considering Green Worm Defense Mechanism in Complex Networks. Clust. Comput. 2025, 28, 148. [Google Scholar] [CrossRef] [Scilit]
  11. Okawa, M.; Yamaguchi, S. On Development of Immune Function for Botnet Defense System. In 2024 International Conference on Consumer Electronics—Taiwan (ICCE-Taiwan); IEEE: Piscataway, NJ, USA, 2024; pp. 291–292. [Google Scholar] [CrossRef] [Scilit]
  12. Tatebatake, G.; Yamaguchi, S. Network Hardening Method by Small-Scale Reconfiguration with Vulnerability Consideration. In 2024 IEEE International Conference on Consumer Electronics-Asia (ICCE-Asia); IEEE: Piscataway, NJ, USA, 2024; pp. 1–5. [Google Scholar] [CrossRef] [Scilit]
  13. Jia, C.; Liu, X.; Hu, Z.; Liu, G.; Wang, Z. Defending P2P Networks against Malicious Worms Based on Benign Worms. In Advances in Electric and Electronics; Hu, W., Ed.; Springer: Berlin/Heidelberg, Germany, 2012; pp. 653–660. [Google Scholar]
  14. Pan, X.; Yamaguchi, S.; Kageyama, T.; Bin Kamilin, M.H. Machine-Learning-Based White-Hat Worm Launcher in Botnet Defense System. Int. J. Softw. Sci. Comput. Intell. (IJSSCI) 2022, 14, 1–14. [Google Scholar] [CrossRef] [Scilit]
  15. Ghosh, K.; Bellinger, C.; Corizzo, R.; Branco, P.; Krawczyk, B.; Japkowicz, N. The Class Imbalance Problem in Deep Learning. Mach. Learn. 2024, 113, 4845–4901. [Google Scholar] [CrossRef] [Scilit]
  16. Yoshioka, S.; Yamaguchi, S.; Bin Kamilin, M.H. Chronological White-Hat Worm Launcher using Reinforcement Deep Learning. In 2025 IEEE/IEIE International Conference on Consumer Electronics-Asia (ICCE-Asia); IEEE: Piscataway, NJ, USA, 2025; pp. 1–5. [Google Scholar] [CrossRef] [Scilit]
  17. Terven, J. Deep Reinforcement Learning: A Chronological Overview and Methods. AI 2025, 6, 46. [Google Scholar] [CrossRef] [Scilit]
  18. Zhang, L.; Cai, L.; Pan, J. Connectivity in Two-Dimensional Lattice Networks. In 2013 Proceedings IEEE INFOCOM; IEEE: Piscataway, NJ, USA, 2013; pp. 2814–2822. [Google Scholar] [CrossRef] [Scilit]
  19. Yingtaweesittikul, H.; Panma, S.; Rochanakul, P. An Algorithm for the Numbers of Homomorphisms from Paths to Rectangular Grid Graphs. Mathematics 2023, 11, 2587. [Google Scholar] [CrossRef] [Scilit]
  20. Xiao, L. On the Convergence Rates of Policy Gradient Methods. J. Mach. Learn. Res. 2022, 23, 12887–12922. [Google Scholar]
  21. Zhang, S.; Li, H.; Wang, M.; Liu, M.; Chen, P.Y.; Lu, S.; Liu, S.; Murugesan, K.; Chaudhury, S. On the Convergence and Sample Complexity Analysis of Deep Q-Networks with ϵ-Greedy Exploration. In Proceedings of the Advances in Neural Information Processing Systems; Oh, A., Naumann, T., Globerson, A., Saenko, K., Hardt, M., Levine, S., Eds.; Curran Associates, Inc.: Red Hook, NY, USA, 2023; Volume 36, pp. 13064–13102. [Google Scholar]
  22. Garg, S.; Zhanson, J.; Parisotto, E.; Prasad, A.; Kolter, Z.; Lipton, Z.; Balakrishnan, S.; Salakhutdinov, R.; Ravikumar, P. On Proximal Policy Optimization’s Heavy-tailed Gradients. In Proceedings of the 38th International Conference on Machine Learning; Meila, M., Zhang, T., Eds.; PMLR: Cambridge, MA, USA, 2021; Volume 139, pp. 3610–3619. [Google Scholar]
  23. Schrittwieser, J.; Hubert, T.; Mandhane, A.; Barekatain, M.; Antonoglou, I.; Silver, D. Online and Offline Reinforcement Learning by Planning with a Learned Model. In Proceedings of the Advances in Neural Information Processing Systems; Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., Vaughan, J.W., Eds.; Curran Associates, Inc.: New York, NY, USA, 2021; Volume 34, pp. 27580–27591. [Google Scholar]
  24. Morales, E.F.; Murrieta-Cid, R.; Becerra, I.; Esquivel-Basaldua, M.A. A Survey on Deep Learning and Deep Reinforcement Learning in Robotics With a Tutorial on Deep Reinforcement Learning. Intell. Serv. Robot. 2021, 14, 773–805. [Google Scholar] [CrossRef] [Scilit]
  25. Ahmad, I. 40 Algorithms Every Programmer Should Know: Hone Your Problem-Solving Skills by Learning Different Algorithms and Their Implementation in Python; Packt Publishing: Birmingham, UK, 2020. [Google Scholar]
  26. Chernikova, A.; Gozzi, N.; Perra, N.; Boboila, S.; Eliassi-Rad, T.; Oprea, A. Modeling Self-Propagating Malware with Epidemiological Models. Appl. Netw. Sci. 2023, 8, 52. [Google Scholar] [CrossRef] [Scilit]
  27. Zhou, Y.; Wang, Y.; Zhou, K.; Shen, S.F.; Ma, W.X. Dynamical Behaviors of an Epidemic Model for Malware Propagation in Wireless Sensor Networks. Front. Phys. 2023, 11, 1–9. [Google Scholar] [CrossRef] [Scilit]
  28. Hasan Kabla, A.H.; Anbar, M.; Manickam, S.; Abdulrahman Alwan, A.A.; Karuppayah, S. Monitoring Peer-to-Peer Botnets: Requirements, Challenges, and Future Works. Comput. Mater. Contin. 2023, 75, 3375–3398. [Google Scholar] [CrossRef] [Scilit]
  29. Liu, M.; Teng, F.; Zhang, Z.; Ge, P.; Sun, M.; Deng, R.; Cheng, P.; Chen, J. Enhancing Cyber-Resiliency of DER-Based Smart Grid: A Survey. IEEE Trans. Smart Grid 2024, 15, 4998–5030. [Google Scholar] [CrossRef] [Scilit]
  30. EC-Council. Code of Ethics|EC-Council. Available online: https://www.eccouncil.org/code-of-ethics/ (accessed on 27 March 2026).
  31. Harris, C.R.; Millman, K.J.; van der Walt, S.J.; Gommers, R.; Virtanen, P.; Cournapeau, D.; Wieser, E.; Taylor, J.; Berg, S.; Smith, N.J.; et al. Array Programming with NumPy. Nature 2020, 585, 357–362. [Google Scholar] [CrossRef] [Scilit]
  32. Silver, D.; Hubert, T.; Schrittwieser, J.; Antonoglou, I.; Lai, M.; Guez, A.; Lanctot, M.; Sifre, L.; Kumaran, D.; Graepel, T.; et al. Mastering Chess and Shogi by Self-Play With a General Reinforcement Learning Algorithm. arXiv 2017, arXiv:1712.01815. [Google Scholar] [CrossRef] [Scilit]
  33. Yildirim, N.; Cao, M.; Yun, M.; Park, J.; Ogras, U.Y. EcoWild: Reinforcement Learning for Energy-Aware Wildfire Detection in Remote Environments. Sensors 2025, 25, 6011. [Google Scholar] [CrossRef] [Scilit]
  34. Akiba, T.; Sano, S.; Yanase, T.; Ohta, T.; Koyama, M. Optuna: A Next-generation Hyperparameter Optimization Framework. In KDD ’19: Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining; Association for Computing Machinery: New York, NY, USA, 2019; pp. 2623–2631. [Google Scholar] [CrossRef] [Scilit]
  35. Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Proceedings of the Advances in Neural Information Processing Systems; Wallach, H., Larochelle, H., Beygelzimer, A., d’Alché-Buc, F., Fox, E., Garnett, R., Eds.; Curran Associates, Inc.: New York, NY, USA, 2019; Volume 32. [Google Scholar]
  36. Viering, T.; Loog, M. The Shape of Learning Curves: A Review. IEEE Trans. Pattern Anal. Mach. Intell. 2023, 45, 7799–7819. [Google Scholar] [CrossRef] [Scilit]
  37. Mishra, R.; Sharma, D. A PDF Based Scale-Free Topology Construction Model for Wireless Sensor Networks. Wirel. Pers. Commun. 2023, 131, 2371–2397. [Google Scholar] [CrossRef] [Scilit]
  38. Khan, Z.A.; Awais, M.; Alghamdi, T.A.; Javaid, N. Employing Topology Modification Strategies in Scale-Free IoT Networks for Robustness Optimization. Computing 2024, 106, 1845–1872. [Google Scholar] [CrossRef] [Scilit]
  39. Papastergiou, G.; Xenakis, A.; Chaikalis, C.; Kosmanos, D.; Chatzimisios, P.; Samaras, N.S. Sensor Topology Optimization in Dense IoT Environments by Applying Neural Network Configuration. Sensors 2023, 23, 5422. [Google Scholar] [CrossRef] [Scilit]
  40. Yeh, W.C.; Lin, E.; Huang, C.L. Predicting Spread Probability of Learning-Effect Computer Virus. Complexity 2021, 2021, 6672630. [Google Scholar] [CrossRef] [Scilit]
  41. Zhang, Z.; Liu, M.; Sun, M.; Deng, R.; Cheng, P.; Niyato, D.; Chow, M.Y.; Chen, J. Vulnerability of Machine Learning Approaches Applied in IoT-Based Smart Grid: A Review. IEEE Internet Things J. 2024, 11, 18951–18975. [Google Scholar] [CrossRef] [Scilit]
Figure 1. A grid topology network is defined as a network in which devices are positioned at the vertices, and the connections between neighboring vertices are bidirectional links.
Figure 1. A grid topology network is defined as a network in which devices are positioned at the vertices, and the connections between neighboring vertices are bidirectional links.
Sensors 26 02517 g001
Figure 2. A white-hat worm is defined by its ability to cause secondary infections that reinfect and eliminate botnets from devices, and it also has a lifespan that allows it to delete itself.
Figure 2. A white-hat worm is defined by its ability to cause secondary infections that reinfect and eliminate botnets from devices, and it also has a lifespan that allows it to delete itself.
Sensors 26 02517 g002
Figure 3. The framework augments the typical reinforcement learning workflow to ensure wider compatibility across different algorithms.
Figure 3. The framework augments the typical reinforcement learning workflow to ensure wider compatibility across different algorithms.
Sensors 26 02517 g003
Figure 4. The simulation expresses the infection resistance as a decimal between 0 and 1, with uninfected devices represented as 0, botnets as 1, and white-hat worms as 2.
Figure 4. The simulation expresses the infection resistance as a decimal between 0 and 1, with uninfected devices represented as 0, botnets as 1, and white-hat worms as 2.
Sensors 26 02517 g004
Figure 5. (a) A 2D array is used to represent the infection resiliency of each device. (b) Another 2D array is used to represent the infection state of each device.
Figure 5. (a) A 2D array is used to represent the infection resiliency of each device. (b) Another 2D array is used to represent the infection state of each device.
Sensors 26 02517 g005
Figure 6. The insertion and infection spread in the simulation are predetermined to maintain determinism for debugging and evaluation. The ellipsis indicates continuation.
Figure 6. The insertion and infection spread in the simulation are predetermined to maintain determinism for debugging and evaluation. The ellipsis indicates continuation.
Sensors 26 02517 g006
Figure 7. The process for simulating the botnets’ and white-hat worms’ infection in a grid topology network for every timestep.
Figure 7. The process for simulating the botnets’ and white-hat worms’ infection in a grid topology network for every timestep.
Sensors 26 02517 g007
Figure 8. Unresolvable simulation with the botnet starting one step from the grid boundary.
Figure 8. Unresolvable simulation with the botnet starting one step from the grid boundary.
Sensors 26 02517 g008
Figure 9. Unresolvable simulation with the botnet starting two steps from the grid boundary.
Figure 9. Unresolvable simulation with the botnet starting two steps from the grid boundary.
Sensors 26 02517 g009
Figure 10. Resolvable simulation with the botnet starting three steps from the grid boundary.
Figure 10. Resolvable simulation with the botnet starting three steps from the grid boundary.
Sensors 26 02517 g010
Figure 11. Unfair simulation where botnet was surrounded by uninfectable devices ( r = 0.5 ) at step 0.
Figure 11. Unfair simulation where botnet was surrounded by uninfectable devices ( r = 0.5 ) at step 0.
Sensors 26 02517 g011
Figure 12. A multi-channel tensor is used to represent the current infection state, the prior infection state, and the infection resiliency of each device.
Figure 12. A multi-channel tensor is used to represent the current infection state, the prior infection state, and the infection resiliency of each device.
Sensors 26 02517 g012
Figure 13. Using a comparison operator to mask illegal moves reduces the complexity in discrete action space on the L ( 7 , 7 ) grid.
Figure 13. Using a comparison operator to mask illegal moves reduces the complexity in discrete action space on the L ( 7 , 7 ) grid.
Sensors 26 02517 g013
Figure 14. Using a Manhattan-based masking strategy further reduces the complexity, at the cost of preventing the agent from exploring different winning strategies on the L ( 7 , 7 ) grid.
Figure 14. Using a Manhattan-based masking strategy further reduces the complexity, at the cost of preventing the agent from exploring different winning strategies on the L ( 7 , 7 ) grid.
Sensors 26 02517 g014
Figure 15. The white-hat worm placed using the Manhattan-based masking strategy could cause the botnet infection trajectory to split on the L ( 7 , 7 ) grid, which makes containment impossible.
Figure 15. The white-hat worm placed using the Manhattan-based masking strategy could cause the botnet infection trajectory to split on the L ( 7 , 7 ) grid, which makes containment impossible.
Sensors 26 02517 g015
Figure 16. Using a Chebyshev distance of 1 to detect infectable neighboring devices slightly reduces the complexity, allowing the agent to explore different winning strategies on L ( 7 , 7 ) .
Figure 16. Using a Chebyshev distance of 1 to detect infectable neighboring devices slightly reduces the complexity, allowing the agent to explore different winning strategies on L ( 7 , 7 ) .
Sensors 26 02517 g016
Figure 17. The white-hat worm placed using a Chebyshev-based masking strategy could block multiple paths when the white-hat worm spread, effectively containing the botnets.
Figure 17. The white-hat worm placed using a Chebyshev-based masking strategy could block multiple paths when the white-hat worm spread, effectively containing the botnets.
Sensors 26 02517 g017
Figure 18. The process for masking the devices relies on a Chebyshev-based masking strategy to identify infection paths that need to be blocked.
Figure 18. The process for masking the devices relies on a Chebyshev-based masking strategy to identify infection paths that need to be blocked.
Sensors 26 02517 g018
Figure 19. The process to optimize the reward and penalty coefficients utilized Optuna to tune the b l o c k _ s c a l e , w i n _ r e w a r d , l o s e _ p e n a l t y , p r e s e n c e _ s c a l e , p r o g r e s s _ s c a l e , and a c t i o n _ e f f i c i e n c y .
Figure 19. The process to optimize the reward and penalty coefficients utilized Optuna to tune the b l o c k _ s c a l e , w i n _ r e w a r d , l o s e _ p e n a l t y , p r e s e n c e _ s c a l e , p r o g r e s s _ s c a l e , and a c t i o n _ e f f i c i e n c y .
Sensors 26 02517 g019
Figure 20. The convolutional neural network-based encoder model is used on all reinforcement learning algorithms for consistency in analyzing the grid-topology network.
Figure 20. The convolutional neural network-based encoder model is used on all reinforcement learning algorithms for consistency in analyzing the grid-topology network.
Sensors 26 02517 g020
Figure 21. (a) The convolutional neural network-based encoder is used as the critic network in proximal policy optimization. (b) The multi-task prediction network is used to predict the next hidden state and reward in MuZero. (c) The multi-task dynamic network is used to estimate the policy and value of a hidden state in MuZero.
Figure 21. (a) The convolutional neural network-based encoder is used as the critic network in proximal policy optimization. (b) The multi-task prediction network is used to predict the next hidden state and reward in MuZero. (c) The multi-task dynamic network is used to estimate the policy and value of a hidden state in MuZero.
Sensors 26 02517 g021
Figure 22. The mean line plot with minimum and maximum values as a range band on the winning rate. (a) Most of the agents configured with the previous reinforcement learning setup improve slowly and plateau below a 80% winning rate. (b) The agents improved with the survey–identify–reinforce–optimize framework exceeded 90%, with some achieving a 100% winning rate.
Figure 22. The mean line plot with minimum and maximum values as a range band on the winning rate. (a) Most of the agents configured with the previous reinforcement learning setup improve slowly and plateau below a 80% winning rate. (b) The agents improved with the survey–identify–reinforce–optimize framework exceeded 90%, with some achieving a 100% winning rate.
Sensors 26 02517 g022
Figure 23. The mean line plot with minimum and maximum values as a range band on the win efficiency. (a) The agents that are configured using the previous reinforcement learning setup struggle to improve their win efficiency beyond 60%. (b) The agents improved with the survey–identify–reinforce–optimize framework, maintaining a mean win efficiency above 70%.
Figure 23. The mean line plot with minimum and maximum values as a range band on the win efficiency. (a) The agents that are configured using the previous reinforcement learning setup struggle to improve their win efficiency beyond 60%. (b) The agents improved with the survey–identify–reinforce–optimize framework, maintaining a mean win efficiency above 70%.
Sensors 26 02517 g023
Figure 24. The plotted area under the learning curves for the deep Q-network agent shows slight improvement as the network size increases, before oscillating on L ( 21 , 21 ) onward.
Figure 24. The plotted area under the learning curves for the deep Q-network agent shows slight improvement as the network size increases, before oscillating on L ( 21 , 21 ) onward.
Sensors 26 02517 g024
Figure 25. The winning rate is represented by the mean and normalized area under the learning curves, with error bars indicating the standard deviation of each component.
Figure 25. The winning rate is represented by the mean and normalized area under the learning curves, with error bars indicating the standard deviation of each component.
Sensors 26 02517 g025
Figure 26. The win efficiency is represented by the mean and normalized area under the learning curves, with error bars indicating the standard deviation of each component.
Figure 26. The win efficiency is represented by the mean and normalized area under the learning curves, with error bars indicating the standard deviation of each component.
Sensors 26 02517 g026
Figure 27. The winning rate is represented by the mean and normalized area under the learning curves, with error bars indicating the standard deviation of each reinforcement.
Figure 27. The winning rate is represented by the mean and normalized area under the learning curves, with error bars indicating the standard deviation of each reinforcement.
Sensors 26 02517 g027
Figure 28. The win efficiency is represented by the mean and normalized area under the learning curves, with error bars indicating the standard deviation of each reinforcement.
Figure 28. The win efficiency is represented by the mean and normalized area under the learning curves, with error bars indicating the standard deviation of each reinforcement.
Sensors 26 02517 g028
Figure 29. To scale beyond the grid topology network it was not trained with and m n , grid partitioning is recommended for generalization.
Figure 29. To scale beyond the grid topology network it was not trained with and m n , grid partitioning is recommended for generalization.
Sensors 26 02517 g029
Table 1. Existing research that requires specific conditions and high-quality datasets to be effective against the framework proposed in this article.
Table 1. Existing research that requires specific conditions and high-quality datasets to be effective against the framework proposed in this article.
AuthorsDevice
Immunity
Network
Topology
Benign
Worms
White-Hat Worm Launcher
BulkTimestep
Muthukumar et al. [8]
Rodríguez et al. [9]
Asadi et al. [10]
Okawa et al. [11]
Tatebatake et al. [12]
Jia et al. [13]
Pan et al. [14]
Yoshioka et al. [16] ✓*
This article
* It requires more training episodes to be effective.
Table 2. The reinforcement learning algorithms used to evaluate the effectiveness of the proposed framework.
Table 2. The reinforcement learning algorithms used to evaluate the effectiveness of the proposed framework.
AlgorithmModelDataOptimizationPlanning
Vanilla policy gradientModel-freeOn-policyPolicy-gradientNo
Deep Q-networkModel-freeOff-policyQ-learningNo
Proximal policy optimizationModel-freeOn-policyActor-criticNo
MuZeroModel-basedOff-policyPolicy, value, and modelYes
Table 3. The hand-tuned hyperparameter values for the scales are used to obtain the episodic and step-based reinforcement, with a positive sign for rewards and a negative sign for penalties.
Table 3. The hand-tuned hyperparameter values for the scales are used to obtain the episodic and step-based reinforcement, with a positive sign for rewards and a negative sign for penalties.
ScaleSignValueType
b l o c k _ s c a l e +0.05Reward
w i n _ r e w a r d +0.5Reward
l o s e _ p e n a l t y 1Penalty
p r e s e n c e _ s c a l e 0.005Penalty
p r o g r e s s _ s c a l e +0.2Reward
a c t i o n _ e f f i c i e n c y +0.5Reward
Table 4. The reward and penalty value ranges used by Optuna to identify the optimal reward coefficient over 30 trials, with a positive sign for rewards and a negative sign for penalties.
Table 4. The reward and penalty value ranges used by Optuna to identify the optimal reward coefficient over 30 trials, with a positive sign for rewards and a negative sign for penalties.
ScaleSignValue RangeType
b l o c k _ s c a l e +0–0.2Reward
w i n _ r e w a r d +0.1–2Reward
l o s e _ p e n a l t y 0.5–2Penalty
p r e s e n c e _ s c a l e 0–0.05Penalty
p r o g r e s s _ s c a l e +0–1Reward
a c t i o n _ e f f i c i e n c y +0.1–1Reward
Table 5. The hyperparameters used to configure the vanilla policy gradient.
Table 5. The hyperparameters used to configure the vanilla policy gradient.
Vanilla Policy Gradient’s HyperparametersValue
Gamma0.99
Batch size64
Epoch number10
Adam’s learning rate0.0003
Table 6. The hyperparameters used to configure the deep Q-network.
Table 6. The hyperparameters used to configure the deep Q-network.
Deep Q-network’s HyperparametersValue
Epsilon1
Gamma0.99
Batch size64
Memory size100,000
Epsilon decay0.995
Update interval1000
Minimum epsilon0.05
Adam’s learning rate0.0003
Table 7. The hyperparameters used to configure the proximal policy optimization.
Table 7. The hyperparameters used to configure the proximal policy optimization.
Proximal Policy Optimization’s HyperparametersValue
Gamma0.99
Batch size64
Policy clip0.2
Epoch number10
Adam’s learning rate0.0003
Generalized advantage estimation0.95
Table 8. The hyperparameters used to configure the MuZero.
Table 8. The hyperparameters used to configure the MuZero.
MuZero’s HyperparametersValue
Gamma0.8
Unroll steps5
Latent dimension128
Maximum memory50,000
Adam’s learning rate0.001
Number of simulation10
Maximum episodes kept2000
Embedded action dimension32
Predictor-based upper confidence tree constant1
Table 9. The normalized area under the learning curve for winning rate with standard deviation across different reinforcement learning agent implementations.
Table 9. The normalized area under the learning curve for winning rate with standard deviation across different reinforcement learning agent implementations.
AlgorithmImplementationMeanStandard Deviation
Vanilla policy gradientPrevious0.67650.0206
Improved0.94560.0129
Deep Q-networkPrevious0.65810.0815
Improved0.96550.0039
Proximal policy optimizationPrevious0.64760.0098
Improved0.96010.0041
MuZeroPrevious0.58850.0149
Improved0.95210.0212
Table 10. The normalized area under the learning curve for win efficiency with standard deviation across different reinforcement learning agent implementations.
Table 10. The normalized area under the learning curve for win efficiency with standard deviation across different reinforcement learning agent implementations.
AlgorithmImplementationMeanStandard Deviation
Vanilla policy gradientPrevious0.40010.0547
Improved0.80370.0065
Deep Q-networkPrevious0.43860.0931
Improved0.82260.0057
Proximal policy optimizationPrevious0.32530.0069
Improved0.80940.0047
MuZeroPrevious0.32630.0348
Improved0.77640.0200
Table 11. The mean percentage change for the area under the learning curve on winning rate and win efficiency.
Table 11. The mean percentage change for the area under the learning curve on winning rate and win efficiency.
AlgorithmWinning Rate Improvement [%]Win Efficiency Improvement [%]
Vanilla policy gradient39.7780100.8822
Deep Q-network46.712987.5708
Proximal policy optimization48.2453148.8404
MuZero61.7809137.9191
Mean49.1293118.8031
Table 12. The area under the learning curves for the deep Q-network agent slightly improves as the network size increases, before oscillating on L ( 21 , 21 ) and onward.
Table 12. The area under the learning curves for the deep Q-network agent slightly improves as the network size increases, before oscillating on L ( 21 , 21 ) and onward.
Network Size
L ( m , n )
Winning RateWin Efficiency
MeanStandard DeviationMeanStandard Deviation
70.96550.00390.82260.0057
80.96110.00160.79610.0006
90.96970.00260.77730.0045
100.95710.01060.77010.0042
110.95770.00530.77710.0011
120.94630.00820.75440.0077
130.95660.00980.75880.0107
140.96710.00480.78420.0076
150.99260.00450.80640.0025
160.97530.01150.77760.0063
170.98750.00440.79340.0055
180.98580.00520.80080.0032
190.98870.00630.81090.0074
200.98540.00120.79010.0024
210.96570.00960.77860.0093
220.97500.00480.79780.0052
230.98580.00090.79570.0029
240.95140.01480.77970.0180
250.98350.00470.80190.0057
260.95170.01200.77300.0110
270.96080.00350.78450.0026
280.97080.00590.78690.0050
Table 13. The mean and normalized area under the learning curves represents the contributions and the combinations of each component in the survey–identify–reinforce–optimize framework.
Table 13. The mean and normalized area under the learning curves represents the contributions and the combinations of each component in the survey–identify–reinforce–optimize framework.
ImprovementWinning RateWin Efficiency
MeanStandard DeviationMeanStandard Deviation
Survey only0.59040.02120.32550.0286
Identify only0.96520.00690.80390.0018
Reinforce only0.66580.04530.43780.0525
Optimize only0.63790.01900.37940.0310
Survey and identify0.95510.01200.81360.0072
Survey, identify, and reinforce0.96160.00820.83290.0094
Survey, identify, reinforce, and optimize0.96550.00390.82260.0057
Table 14. The mean and normalized area under the learning curves represents the contributions on the scales used for the optimized rewards and penalties.
Table 14. The mean and normalized area under the learning curves represents the contributions on the scales used for the optimized rewards and penalties.
Optimized
Reinforcement
Winning RateWin Efficiency
MeanStandard DeviationMeanStandard Deviation
b l o c k _ s c a l e only0.95950.00560.82370.0029
p r o g r e s s _ s c a l e only0.94660.00200.82060.0010
p r e s e n c e _ s c a l e only0.95770.00330.82460.0070
a c t i o n _ e f f i c i e n c y only0.95400.00830.82260.0070
Enabled all reinforcements0.96550.00390.82260.0057
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Bin Kamilin, M.H.; Yamaguchi, S.; Yoshioka, S. Reinforcement Learning-Enhanced Botnet Defense System in Grid Topology Networks Using the SIRO Framework. Sensors 2026, 26, 2517. https://doi.org/10.3390/s26082517

AMA Style

Bin Kamilin MH, Yamaguchi S, Yoshioka S. Reinforcement Learning-Enhanced Botnet Defense System in Grid Topology Networks Using the SIRO Framework. Sensors. 2026; 26(8):2517. https://doi.org/10.3390/s26082517

Chicago/Turabian Style

Bin Kamilin, Mohd Hafizuddin, Shingo Yamaguchi, and Sena Yoshioka. 2026. "Reinforcement Learning-Enhanced Botnet Defense System in Grid Topology Networks Using the SIRO Framework" Sensors 26, no. 8: 2517. https://doi.org/10.3390/s26082517

APA Style

Bin Kamilin, M. H., Yamaguchi, S., & Yoshioka, S. (2026). Reinforcement Learning-Enhanced Botnet Defense System in Grid Topology Networks Using the SIRO Framework. Sensors, 26(8), 2517. https://doi.org/10.3390/s26082517

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop