1. Introduction
With the rapid development of the Industrial Internet and smart manufacturing, the Industrial Internet of Things (IIoT) has been widely adopted in critical infrastructure sectors, including energy, power, transportation, and chemicals. The IIoT connects a vast array of devices—including sensors, controllers, and smart terminals—to the internet, profoundly transforming traditional industrial production models and management practices. The IIoT enables real-time monitoring, precise control, and intelligent decision-making throughout the entire production process, significantly enhancing the production efficiency, operational flexibility, and resource utilization of industrial systems [
1]. However, as a large number of industrial devices, control systems, and sensors become interconnected via the internet, the attack surface of IIoT systems has expanded significantly, making them more vulnerable to cyberattacks such as asset discovery, unauthorized access, and the injection of control commands. Malicious attacks on critical infrastructure in sectors such as electricity, energy, and manufacturing can lead to production disruptions and equipment damage, which in turn can trigger major safety incidents. Compared to security methods that rely primarily on static protection—such as firewalls, network segmentation, and encryption—the deployment of intrusion detection systems (IDS) [
2] enables continuous monitoring of network traffic and system behavior, supporting the identification of anomalous behavior and attack incidents [
3], and has become a critical technical component of the active defense framework for the IIoT.
Intrusion detection systems rely on sophisticated detection algorithms to identify and classify intrusion attacks. In traditional network environments, where attack patterns are relatively fixed and traffic behavior boundaries are well-defined, detection methods based on rule matching or static classification models can achieve relatively stable results [
4]. However, as industrial environments become increasingly complex in IIoT scenarios, the types of intrusion attacks have also become more diverse. These include a heightened emphasis on the temporal sequence of attacks, significantly improved adversarial capabilities such as evading detection and obfuscating legitimate control commands, as well as dynamic changes in device status, operational load, and communication patterns. Consequently, traditional intrusion detection algorithms face challenges such as high detection latency, insufficient generalization capabilities, and high false negative rates [
5].
As a key technical approach to industrial cybersecurity, intrusion detection has shifted in recent years from traditional methods based on rules and feature engineering to intelligent detection methods such as machine learning and deep learning. However, given the high-dimensional, heterogeneous data and stringent real-time requirements of the IIoT, existing intelligent intrusion detection systems face challenges such as high-dimensional feature processing, high computational complexity, and a lack of adaptive learning capabilities, making them unable to meet the real-time and high-accuracy requirements of industrial environments [
6]. To address the aforementioned issues, this paper proposes an intrusion detection algorithm based on feature optimization and asynchronous advantage actor-critic with adaptive exploration and policy-lag correction (APA3CID), which aims to improve accuracy and real-time performance in industrial IoT intrusion detection while reducing false negative rates. The APA3CID algorithm first preprocesses the dataset through label encoding and normalization, then feeds the processed data into the feature selection module; next, it applies the GSLDWOA algorithm to perform feature selection on the dataset, eliminating redundant and irrelevant features to reduce the dimensionality of the data; Finally, an agent is constructed using A3C, modeling the dynamic industrial IoT environment as a Markov decision process. The policy network and value network are optimized through multi-step cumulative advantage and multi-asynchronous parallel training. An adaptive exploration mechanism is incorporated to enhance early-stage exploration and ensure stable convergence in the later stages of training. Additionally, an asynchronous lag correction strategy is introduced to mitigate policy lag biases caused by asynchronous updates, reduce gradient noise and update oscillations, enabling the agent to rapidly identify known attacks in the dynamic IIoT environment. This approach effectively reduces both training and testing times while improving the model’s detection rate and accuracy. The main contributions of this paper are as follows:
(1) To address the issues of data heterogeneity and high-dimensional redundancy in the IIoT, we have established a data processing workflow that combines preprocessing with GSLDWOA feature selection. By leveraging Gaussian variation and variable-step Lévy flights, we enhance the accuracy of feature screening, effectively filter out noisy features, and provide high-quality, low-dimensional data for subsequent modeling.
(2) To address the demands of complex industrial environments for model robustness and real-time performance, we have developed a modeling framework based on Markov processes. States are represented using sliding-window encoding to capture recent attack behaviors and traffic characteristics, while actions are mapped to specific attack subcategories to align with practical requirements. The reward function incorporates differentiated weights, and a discount factor is introduced to amplify the impact of long-term risks, thereby resolving the challenge that traditional models face in adapting to the dynamic nature of industrial scenarios.
(3) To improve training efficiency and policy stability, we designed an asynchronous parallel training mechanism for multiple subnetworks based on the A3C framework. By incorporating entropy-based annealing and uncertainty-driven exploration, we achieved thorough exploration in the early stages and stable convergence in the later stages. Additionally, we introduced an asynchronous lag correction strategy that utilizes truncated importance weights to mitigate policy lag bias caused by asynchronous updates, thereby reducing gradient noise and update oscillations and further enhancing convergence stability and detection performance.
(4) On the X-IIoTID and WUSTL-IIoT-2021 datasets, we conducted ablation experiments to demonstrate the synergistic advantages of each innovative module. We compared APA3CID with mainstream models such as LR, XGBoost, and DDPG to validate the model’s significant advantages in key metrics such as accuracy and F1-score.
3. Overall Algorithm Architecture
This paper proposes an intrusion detection algorithm based on feature optimization and an asynchronous actor-critic approach, aimed at addressing the issues of insufficient accuracy, lack of real-time performance, and high false negative rates in industrial IoT intrusion detection. The architectural structure of the APA3CID algorithm is shown in
Figure 1. It consists of a data preprocessing module, a GSLDWOA feature selection module, and an APA3CID intrusion detection module. First, the dataset is preprocessed by converting non-numeric features into numerical data through label encoding and applying normalization to eliminate differences in feature scales; subsequently, the GSLDWOA algorithm is employed for feature selection to remove redundant and irrelevant features and reduce the dimensionality of the data; Finally, an agent is constructed using A3C reinforcement learning, incorporating an adaptive exploration mechanism to enhance exploration in the early training phase and ensure stable convergence in the later stages. An asynchronous lag correction strategy is introduced to mitigate policy lag bias caused by asynchronous updates. This approach simultaneously shortens training and testing times while improving detection rates and accuracy and reducing false negative rates. The specific implementation process is as follows:
(1) Preprocess raw IIoT traffic and device status data, including data integration, cleansing, encoding, and normalization. The process then moves on to the feature selection stage, where the GSLDWOA feature selection algorithm is used to screen features. This algorithm simulates the hunting behavior of whales to search for the optimal solution, thereby identifying the optimal subset of features and eliminating redundant and irrelevant features.
(2) We construct APA3CID based on MDP modeling, utilizing a multi-step cumulative advantage function and an asynchronous parameter synchronization mechanism, combined with an adaptive exploration mechanism to enhance convergence stability. Simultaneously, an asynchronous lag correction strategy is introduced, employing truncated importance weights to correct policy gradients and value updates, thereby reducing the bias and gradient noise caused by asynchronous updates. This enables efficient learning of the temporal evolution patterns of attacks and optimal detection strategies, achieving rapid and high-precision identification of attack behaviors.
3.1. Data Preprocessing
This paper employs a standard data preprocessing workflow, which primarily includes:
(1) Data cleaning
Remove duplicate records; exclude samples with a missing value rate exceeding 30%; impute missing values in fields with a low missing rate using the median or mode; and detect and trim outliers using the z-score.
(2) Feature encoding
For discrete features with ≤20 categories, one-hot encoding is used; for features with >20 categories or Boolean fields, label encoding is used. The encoding mapping is fitted only on the training set and applied uniformly to the test set.
(3) Standardization
Min–Max normalization is used to map all numerical features to the interval [0, 1], thereby eliminating differences in units. The normalization formula is shown in Equation (1).
(4) Feature Selection
To address the issue of feature redundancy in high-dimensional industrial IoT data, this paper employs the proposed GSLDWOA feature selection algorithm, whose workflow is shown in
Figure 2. This algorithm enhances the diversity of the initial population through a Gaussian mutation mechanism and employs a nonlinear decreasing contraction factor to balance global exploration and local exploitation, thereby preventing premature convergence. Furthermore, by introducing a variable-step-size Lévy flight operator and a dynamic differential evolution strategy, the algorithm improves search efficiency and convergence accuracy in high-dimensional feature spaces, effectively avoiding the trapping of local optima. For a more in-depth understanding of the algorithm’s structure, parameter settings, and theoretical foundations, please refer to our previous research [
23].
In addition, to support subsequent time-series modeling and reinforcement learning training, this paper sorts and organizes the industrial IoT traffic data into sequences based on sample timestamps after completing data preprocessing. The samples are reconstructed into time-continuous sequences in chronological order, thereby providing the input foundation for subsequent sliding-window state construction and trajectory sampling.
3.2. Modeling Markov Decision Processes
To address challenges in IIoT intrusion detection—such as high-dimensional and heterogeneous data, dynamically evolving attacks, and the need for real-time response—the Markov Decision Process (MDP) serves as the foundation for deep reinforcement learning models. In this section, the detection process for IIoT attack behaviors is modeled as a MDP. The resulting MDP is defined as a quadruple , where represents the state space, represents the action space, represents the reward space, and represents the reward discount factor.
(1) State space
For the state space
, this paper defines the observation vector
at each time step as comprising all features in the dataset except for the label. These features include packet size, protocol type, and traffic rate, among others, and are used to characterize the traffic behavior at that time step. Given that IIoT attacks exhibit significant temporal correlations, this paper represents the state
using a sliding window composed of the feature vectors from the most recent
time steps, ensuring that the state incorporates both current and recent traffic characteristics. The sliding window is constructed independently on the time series of the training set and the test set, respectively; information from the test set is not used to construct the training set window, thereby preventing temporal leakage. The short-term trends in attack evolution and dynamic changes in traffic are reflected as shown in Equation (2).
(2) Operational space
Each action
corresponds to the classification label of the final sample
in the window. Suppose the dataset contains
types of samples, including 1 type of normal sample and
types of attack samples. In this case, the action space can be represented as
, where action
marks the current sample as normal traffic; actions
correspond to different types of intrusion attacks, such as DoS, Probe, U2R, R2L, and so on. In this paper, the action space is defined as the attack phase or category classification of the current state, and its specific instantiation depends on the set of attack labels provided in the dataset. Taking the X-IIoTID dataset as an example, the attack types are divided into nine categories, and the specific definitions of the action space are shown in
Table 2.
(3) Reward function
The reward function is central to guiding the agent in learning the optimal detection strategy; it requires the design of differentiated reward rules that prioritize scene safety while also taking into account production requirements. If the agent is in state
, the true class is
, and the agent performs action
, then the immediate reward
is as shown in Equation (3).
(1) Correctly detect the attack sample: If the sample is indeed attack sample and its action matches the true class (), then , where , representing the maximum positive reward.
(2) Correctly classifying a normal sample: If the sample is indeed normal () and the action matches the true category (), then , where , representing a moderate positive reward.
(3) Misclassification: In addition to the two cases mentioned above, instances where a normal sample is incorrectly classified as an attack, an attack sample is incorrectly classified as normal, or the attack type is misidentified are all assigned a negative reward of , where . Misclassification gives rise to two types of risks: false negatives that lead to security incidents and false positives that cause production disruptions. Both require the use of negative rewards to constrain the agent’s erroneous decisions, and the value of can be dynamically adjusted based on the severity of the risk associated with each type of error. In this method, set , , and .
(4) Discount factor
The discount factor is used to quantify the trade-off between the immediate safety benefits of the current detection decision and the potential risks at a future time. In industrial IoT intrusion detection scenarios, attacks typically exhibit persistent and phased evolution; a false positive at a given moment may accumulate and amplify over multiple subsequent time steps, leading to more severe security risks. Therefore, a discount factor is introduced to capture the long-term impact of detection decisions on future state sequences, enabling the agent to optimize immediate detection performance while also focusing on overall safety gains across time scales.
Traditional MDPs typically include explicit state transition probabilities , which describe the probability that the environment will evolve to the next state given a particular state and action. In the methods described in this chapter, the state is defined as , which is used to characterize the local context of the most recent time steps. Accordingly, the state transition corresponds to a shift of in the sliding window. Since this paper constructs state sequences in chronological order on an offline dataset, is exogenously determined by the data sequence and is independent of the action sequence ; therefore, there is no need to explicitly model transition probabilities.
In the MDP model presented in this paper, the agent’s actions do not directly influence the movement of the sliding window; state transitions are determined exogenously by the temporal sequence of the dataset. However, the value of the A3C framework lies not in its ability to directly control the state of the environment through actions, but in its capacity to model long-range dependencies in time series: through a multi-step cumulative advantage function, the reward from a current observation decision can be propagated backward across multiple future time steps. In industrial IoT scenarios, cyberattacks exhibit distinct phased evolution patterns; security gaps identified at any given moment may lead to cumulative security risks in the future. Therefore, even if the action does not alter the state transition probabilities, A3C can still effectively capture the risk propagation effects of detection decisions over time.
3.3. Design of the APA3CID Method
This paper formalizes the intrusion detection process as an MDP, clearly defining states, actions, and rewards, and unifies detection and classification under a single sequential decision-making optimization objective. Building on this foundation, this section develops an A3C-based deep reinforcement learning intrusion detection agent that learns and improves its intrusion detection and attack classification capabilities through interactive sampling and policy optimization of industrial IoT traffic sample sequences. The agent consists of a shared global Actor-Critic network and multiple parallel Worker subnetworks. The structure of the APA3CID agent is shown in
Figure 3.
As shown in
Figure 3, the global network consists of two components—the Actor and the Critic—which are used to maintain a unified policy and state-value function. Multiple parallel workers independently perform decision learning by dividing the chronologically ordered training sequence into
non-overlapping, contiguous segments of similar length. In each worker, the agent constructs the current state
using a sliding window, takes the sample
at the end of the window as the target, outputs a probability distribution of detection actions via the actor network, and performs the corresponding attack classification; the environment returns an immediate reward
rt based on the true label, while the next state
is determined by the traversal order of the dataset. After sampling
consecutive time steps, the Worker calculates the
N-step return using the state values estimated by the Critic network, and then constructs a reward function to update the parameters of the local Actor and Critic networks. At the same time, the gradients computed by each worker are synchronized asynchronously to the global network, enabling the sharing and updating of policy parameters. This reduces sample correlation and improves model convergence stability while ensuring training efficiency. For each state
, the agent determines a specific action based on the action policy function
, which is shown in Equation (4).
Here, is the unnormalized score for the th action category output by the Actor for state ; is the score corresponding to action ; is the total number of action categories; is the exponential function; and is used for normalization to ensure that the sum of all action probabilities equals 1.
In A3C,
is the state value function, representing the expected long-term cumulative reward that an agent can obtain by following the current policy
when in state
at time
. Its core function is to quantify the safety value of the current state, providing a foundation for advantage function computation and policy optimization, as shown in Equation (5).
Here, represents the expected value under strategy , reflecting the statistical average of the rewards, and is the discount factor, which balances immediate rewards against long-term rewards.
is the action-value function, which quantifies the long-term cumulative reward obtained by following the current policy
when in state
at time
and executing action
, as shown in Equation (6).
Given that Industrial Internet of Things (IIoT) traffic exhibits strong temporal correlations and phased evolution, single-step returns can easily lead to value estimation biases and update noise; therefore,
-step sampling is employed to accumulate return information over a longer time span, enabling more stable learning of the policy and value function. The multi-step cumulative advantage is calculated using reward
, as shown in Equation (7).
Here,
represents the
-step ahead value,
is the preset number of sampling steps,
is the time step offset,
is the discount factor, and
and
are the discount weights for the
th-step reward and the
th-step state value, respectively. The sliding window state is used to characterize short-term traffic and attack evolution patterns, while the
-step sampling mechanism is used to assess the impact of current detection decisions on future multi-step security risks; together, they model the IIoT attack process across different time scales. The global iterative training reward is shown in Equation (8).
Here, represents the average reward value for the th iteration, represents the number of subnetworks, and represents the number of local iterations for each subnetwork.
3.4. Adaptive Search
To prevent the policy from converging prematurely to a local optimum, an entropy regularization term is typically introduced into the actor’s objective function to encourage exploration. However, a fixed entropy coefficient struggles to strike a balance throughout the entire training process; insufficient exploration in the early stages of training can lead to convergence on a suboptimal policy, while excessive exploration in the later stages can make it difficult for the policy to converge stably, introducing unnecessary fluctuations in false positives. To this end, this paper proposes an adaptive exploration mechanism that takes into account both the training phase and sample uncertainty to dynamically adjust the entropy coefficient.
By extending the entropy coefficient from a constant to a function
that varies with the training process, we achieve a training schedule characterized by aggressive exploration in the early stages and strong convergence in the later stages. The entropy coefficient function is shown in Equation (9).
Here, is the initial entropy coefficient, is the lower bound of the entropy coefficient, is the annealing rate, and is the number of global update steps. As training progresses, gradually decreases, causing the strategy to transition from early exploration to later deterministic decision-making, which helps improve convergence stability and suppress fluctuations in false positives.
Outside the training phase, for states where the model exhibits high uncertainty, exploration should be increased to avoid making erroneous decisions driven by overconfidence in handling difficult samples. This paper adopts policy entropy as a measure of uncertainty and normalizes it as shown in Equation (10).
Here,
is the uncertainty metric at time
,
represents the entropy of the actor’s action distribution, and
is the logarithm of the size of the action space. When the strategy distribution is relatively uniform and entropy is high,
is increased to enhance exploration. When the strategy distribution is relatively well-defined and the entropy is low,
approaches
, which promotes convergence. The state-adaptive entropy coefficient is given by Equation (11).
3.5. Asynchronous Lag Correction
In A3C’s asynchronous parallel training, each worker interacts with the environment using local parameters to sample trajectories and periodically synchronizes gradients asynchronously to the global network. Because the global network continues to evolve during the update process involving multiple workers, the policy used by the workers for sampling lags behind the current global target policy, thereby introducing off-policy bias. In long-sequence traffic scenarios within the IIoT, attack chains exhibit phased evolution and strong temporal correlations; class imbalance and cost-sensitive rewards amplify the instability caused by high-probability shifts, leading to cumulative bias.
To mitigate the lag bias in asynchronous policy learning, this paper introduces truncated importance sampling to correct the policy gradient and value objective without altering the original asynchronous training framework. The importance ratio is given by Equation (12).
Here, represents the policy probability of the old parameter generated by the local actor at the worker’s sampling time, and represents the target policy probability of the current global actor.
Given that an excessively large ratio may introduce high variance, the truncated form
is adopted. APA3CID builds upon the Actor-Critic dual-network architecture of A3C, optimizing the parameter update logic based on MDP modeling results to enable collaborative learning of detection strategies and state values. The actor policy network is responsible for outputting a probability distribution
over the action space. Its parameters are updated to maximize cumulative advantage by weighting the advantage term in the original policy gradient, resulting in the corrected loss function for the actor network as shown in Equation (13).
Here, represents the calibrated loss value of the Actor policy network; is the statistical average over the batch data; is the probability that the th subnetwork’s Actor parameter performs action in state at time ; is the natural logarithm of the policy probability; after updating the subnetwork parameters via gradient descent, they are asynchronously synchronized to the main network parameters , ensuring that the global policy aggregated by the main network covers the attack recognition capabilities of each sub-scenario.
Regarding the update of the value network, to ensure consistency between the Critic’s learning objective and the corrected policy, a truncation coefficient
is introduced to robustly correct the TD error, and the corrected TD error is constructed as shown in Equation (14).
where
is the reward at time
,
represents the state representation at time
,
represents the parameters of the
th subnetwork (Critic value network), and
and
represent the value estimates for the future and current states at times
and
, respectively. By minimizing the squared error between the
-step cumulative reward and the current state value, the Critic value network can accurately learn the mapping relationship between state and safety value, providing a reliable value benchmark for the Actor network and preventing decision errors caused by value estimation biases.
The Critic value network is responsible for estimating the state value
. Parameter updates aim to minimize the error between the cumulative reward corresponding to the
-step ahead advantage and the predicted value. The loss function for the Critic value network is defined as shown in Equation (15).
Here,
represents the loss value of the Critic network after calibration, and
represents the statistical mean of the batch data. The loss function of the Critic network for the
th global iteration is shown in Equation (16).
The APA3CID algorithm is shown in Algorithm 1. First, the dataset is preprocessed, and then the GSLDWOA algorithm is applied for feature selection to eliminate redundant and irrelevant features, thereby reducing the dimensionality of the data. By incorporating an adaptive exploration mechanism and an asynchronous lag correction strategy, the model training and testing times are significantly reduced, resulting in improved detection rates and accuracy.
| Algorithm 1. APA3CID: An Intrusion Detection Algorithm Based on Feature Optimization and Asynchronous Actor-Critic Learning |
| Input: Training dataset , Test dataset |
| Output: Test results for test dataset |
| 01: Data Preprocessing |
| 02: Initialize the global actor network policy , the maximum number of iterations for the main network, the main network iteration counter , subnetworks, the maximum number of iterations for each subnetwork, and the local step counter |
| 03: while do |
| 04: for to in parallel do |
| 05: , |
| 06: while do |
| 07: for to do |
| 08: |
| 09: The environment returns a reward and yields the next state |
| 10: end for |
| 11: |
| 12: |
| 13: |
| 14: |
| 15: |
| 16: : |
| 17: : |
| 18: |
| 19: |
| 20: end while |
| 21: end parallel for |
| 22: end while |
| 23: return Test results for test dataset |
5. Conclusions
This paper addresses core challenges in IIoT intrusion detection, such as feature redundancy in high-dimensional data, poor adaptability to attack dynamics, and the difficulty of balancing detection accuracy and efficiency. It proposes an intrusion detection algorithm based on feature optimization and asynchronous actor-critic learning. By establishing a processing workflow that combines data preprocessing with GSLDWOA feature selection, the algorithm accurately identifies key attack features and resolves the issue of noise interference in high-dimensional data; A modeling framework based on Markov processes is designed to address the difficulty traditional models face in adapting to the dynamic nature of industrial scenarios; adaptive exploration mechanisms and asynchronous lag correction strategies are introduced to enhance convergence stability and robustness, while reducing strategy bias caused by asynchronous updates. Experimental results show that APA3CID achieved F1 scores of 92.16% and 93.32% on the X-IIoTID and WUSTL-IIoT-2021 datasets, respectively, significantly outperforming comparison models such as LR, XGBoost, CNN, and the baseline A3C.
APA3CID has demonstrated strong performance in industrial IoT intrusion detection, but it still has its limitations. First, its performance is quite sensitive to reward design and key hyperparameters, so it may require re-tuning across different scenarios. At present, the system has primarily been validated for scenarios with a limited number of categories; further evaluation is needed to identify more complex, fine-grained multi-class attacks. In addition, we will further explore the practicality of the method described in this paper in continuous deployment industrial IoT environments, with a focus on concept drift detection and adaptive update mechanisms.