The dynamic metaverse paradigm integrates emerging technologies and offers transformative opportunities to enhance consumer healthcare applications through immersive, connected experiences. However, this paradigm faces substantial cybersecurity challenges, such as distributed denial-of-service attacks, probing, and port scanning. This undermines the trustworthiness and resilience of healthcare analytics frameworks. To address these threats, intrusion detection systems that support proactive anomaly detection are essential for securing metaverse-based healthcare applications. Conventional anomaly detection techniques face challenges such as low interpretability, suboptimal feature selection, class imbalance, and inefficient hyperparameter tuning. These challenges limit their reliability in practical cyber threat intelligence settings. To solve these challenges, this paper presents an anomaly-detection framework for Internet of Things-enabled metaverse healthcare environments. The proposed framework leverages an off-policy proximal policy optimization (PPO) algorithm that incorporates SHapley Additive exPlanations-based feature selection and class-specific reward adjustments to address imbalance. The reinforcement learning-based off-policy PPO enables adaptive, sample-efficient learning by leveraging prior experience during policy updates. The hyperparameters of the model are optimized using the Bayesian Optimization Hyperband algorithm to accelerate training and enhance performance. This optimization technique combines Bayesian search with the Hyperband method to improve efficiency and convergence during model tuning. The performance of our model is evaluated on NSL-KDD, MAWI, and CICIoT2023 datasets. The results depict that the model outperformed its contemporaries with state-of-the-art results where accuracy, F-measure, G-means, and area under the curve reached 88.005%, 87.271%, 87.986%, and 0.870; 92.184%, 88.992%, 89.738%, and 0.873; and 89.368%, 88.312%, 89.039%, and 0.836, respectively. The results confirm the effectiveness of the framework in cyber threat scenarios. They also show their potential for explainable, trustworthy intelligence in metaverse healthcare.
| 1. | This research adopts an off-policy PPO algorithm that uses both past and current policy data. This improves learning efficiency, stability, and generalization in metaverse healthcare. |
| 2. | SHAP values are integrated into the PPO reward function to guide feature selection. This boosts accuracy, lowers dimensionality, and improves interpretability in sensitive healthcare contexts. |
| 3. | To handle class imbalance, the model assigns higher rewards to minority-class predictions. This increases sensitivity to rare anomalies and reduces bias toward majority classes. |
| 4. | The BOHB algorithm is used for hyperparameter tuning. By combining BO with HB, it improves scalability and performance in dynamic 6G-IoT settings. |
| • | State: The state space represents the agent observation at timestep . It includes the following: (a) the current data instance , representing physiological or behavioral sensor readings from wearable or VR devices; (b) the score vector produced by the MLP, encoding both feature relevance and predicted class labels; and (c) the active feature subset , which evolves as the agent selects features sequentially. The state is designed to reflect characteristics of metaverse healthcare data. It captures patterns common in asynchronous, multimodal sensor streams, including delayed signals and short bursts of interaction. Overall, the state space dynamically encodes both static input characteristics and the history of agent decisions in environments with nonstationary and irregular data flows. |
| • | Action and reward: The action set A in our model consists of 2 main types of actions: selecting a feature () or predicting an outcome (). When a feature is selected from , it expands the existing feature set F, thereby modifying the space for potential predictions. To encourage the selection of informative features, the agent receives a reward signal when a feature is selected. Specifically, the reward for feature selection is defined as , where denotes the SHAP value of feature , and serves as a balancing hyperparameter. Since SHAP values can be either positive or negative, this formulation naturally provides positive rewards for informative features and negative rewards for uninformative or harmful ones. The feature is identified by the MLP as having the highest score. Actions that lead to predictions move the model to a terminal state. The agent is rewarded or penalized with ±1 for correct or incorrect predictions for the majority class and for the minority class. The reward function is structured to capture these interactions and incentives: where shows the predicted label for sample x. and denote the minority and majority classes, respectively. This reward system ensures an equitable learning approach that emphasizes accurate identification across different classes. It particularly focuses on the minority class to guarantee fair treatment across diverse groups. |
| • | Identifying the optimal point where the acquisition function reaches its maximum, defined as: |
| • | Determining the accurate value of the objective function at the chosen point is depicted as: |
| • | Incorporating the new observation into the current dataset D, thus updating the model with fresh data: |
| • | Each iteration builds on the previous, enhancing the precision of the model and its capacity to pinpoint the most advantageous observation, referred to as . The overarching aim is to converge upon: |
| 科 Family | 属数 Number of genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) | 属 Genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) |
|---|---|---|---|---|---|---|
| 鹅膏菌科Amanitaceae | 2 | 11 | 5.26 | 鹅膏菌属 Amanita | 10 | 4.78 |
| 小菇科 Mycenaceae | 2 | 12 | 5.74 | 丝盖伞属 Inocybe | 5 | 2.39 |
| 多孔菌科 Polyporaceae | 8 | 14 | 6.70 | 蜡蘑属 Laccaria | 5 | 2.39 |
| 红菇科 Russulaceae | 3 | 23 | 11.00 | 小皮伞属 Marasmius | 6 | 2.87 |
| 小菇属 Mycena | 11 | 5.26 | ||||
| 光柄菇属 Pluteus | 5 | 2.39 | ||||
| 红菇属 Russula | 17 | 8.13 | ||||
| 栓菌属 Trametes | 5 | 2.39 |