Original Research
Frontiers in Blockchain ·
Volume 9 - 2026 | https://doi.org/10.3389/fbloc.2026.1905158
AI-Accelerated blockchain architecture for efficient and secure electronic healthcare record exchange
- Nagaraj Segar1
- Vijayarajan Vijayan1*corresponding author
- School of Computer Science and Engineering, Vellore Institute of Technology (VIT), Vellore, India
Abstract
While blockchain integration within Electronic Healthcare Record (EHR) platforms has strengthened data integrity and patient privacy, practical deployment continues to suffer from elevated latency and inflexible processing mechanisms. This work presents the AI-Accelerated Blockchain Architecture (AIBA-EHR), a framework engineered to accelerate transaction processing and enable adaptive security measures suitable for real-world clinical environments. Our approach couples a lightweight Python-based blockchain implementation with asynchronous parallel block validation and machine-learning-driven consensus parameter optimization. A Proximal Policy Optimization (PPO) reinforcement learning agent anticipates network congestion and dynamically calibrates block size alongside validation difficulty. A risk estimation module built on Temporal Convolutional Networks with Attention Mechanisms (TCN + AM) prioritizes trustworthy nodes and identifies anomalous access behavior. The TCN + AM module employs dilated causal convolutions with dilation rates d ∈ {1,2,4,8}, yielding a receptive field of 31 time steps that fully covers the 20-step access sequences used in this study. Experimental evaluation using synthetic EHR datasets comprising 120,000 access events across 15 features reveals a mean confirmation latency of 25.7 s and an average throughput of 209.7 transactions per second (TPS), representing a 40% reduction in confirmation latency and a 25% improvement in throughput relative to fixed-parameter blockchain baselines. The TCN + AM anomaly detector achieves an F1-score of 0.9942, precision of 0.9953, recall of 0.9931, and AUC of 0.9950 across five-fold cross-validation (mean ± std: 0.9935 ± 0.0018), outperforming all sequential and tabular baselines on classification metrics. These findings indicate that the strategic fusion of artificial intelligence with distributed ledger technology can simultaneously achieve operational efficiency and robust security, enabling real-time healthcare data exchange without compromising patient privacy across decentralized infrastructures.
Keywords
Introduction
The accelerating digitisation of healthcare has prompted hospitals, diagnostic laboratories, and telemedicine platforms to exchange Electronic Health Records (EHRs) at unprecedented rates. While this connectivity enhances clinical decision-making, it simultaneously raises substantial concerns regarding data security, record integrity, and system responsiveness. Conventional blockchain-based EHR frameworks, despite their robust immutability guarantees, exhibit considerable latency, operate with rigid processing parameters, and demonstrate limited adaptability when network conditions fluctuate. In contemporary digital healthcare ecosystems, nearly half the global population relies on electronic services for diagnosis, treatment, and preventive care, making secure and efficient EHR access critically important (Boniol et al., 2022). The current healthcare landscape remains highly fragmented, with personally identifiable information distributed across disparate, non-interoperable systems, which constrains interoperability and frequently compels clinicians to render decisions based on incomplete patient histories (Roehrs et al., 2017). Centralised EHR repositories expose healthcare institutions to high-impact cyber threats, including ransomware and denial-of-service attacks, which can have lasting effects on sensitive patient data and service continuity (Hassan, 2022; Thamer and Alubady, 2021). The proliferation of IoT devices and wearable sensors compounds these vulnerabilities, as continuous data streams substantially expand the attack surface of healthcare infrastructure (Nguyen et al., 2021). Beyond external threats, unauthorised data access, prescription fraud, counterfeit pharmaceutical distribution, and insufficient transparency in clinical workflows collectively undermine patient safety, institutional trust, and financial stability within healthcare systems (Wang et al., 2021; Al Mamun et al., 2020).
The scale of the problem has continued to expand between 2023 and 2025. The U.S. Department of Health and Human Services Office for Civil Rights reported that healthcare breaches affecting 500 or more individuals rose to 725 incidents in 2023, exposing an estimated 133 million patient records — the highest annual total on record (U.S. Department of Health and Human Services (HHS) Office for Civil Rights, 2024). Ransomware activity targeting healthcare providers grew by more than 60% year-on-year in 2024 according to industry threat-intelligence tracking, and IBM’s 2024 Cost of a Data Breach Report identified healthcare as the sector with the highest average breach cost (US$9.77 million per incident) for the 14th consecutive year (IBM Security, 2024). These figures build on longstanding institutional-factor analyses of healthcare breach exposure (Angst et al., 2017). These recent trends confirm that the operational and financial pressure on EHR-exchange infrastructure is not receding but intensifying, and they underscore the urgency of moving beyond static defensive postures toward adaptive, learning-based blockchain architectures that can respond to changing threat conditions in real time. The security challenges of blockchain-based healthcare data collection have been further documented across IoT and industrial network contexts, with studies on IoT-integrated health data platforms highlighting persistent vulnerabilities in authentication, access control, and privacy preservation when sensitive records traverse multi-hop distributed architectures (Liu et al., 2021; Li et al., 2022; Wang et al., 2020). Although blockchain technology promises strong immutability and decentralisation, traditional blockchain implementations continue to exhibit latency bottlenecks, static processing configurations, and limited adaptive security functionality. Recent advances in AI-assisted intrusion detection and federated privacy-preserving analytics motivate the integration of intelligent models within secure healthcare data pipelines (Farooq et al., 2025; Saleem et al., 2024), together with privacy-preserving encryption frameworks for IoMT systems (Bhatt et al., 2024; Siddiqui et al., 2024; Ali et al., 2024) and secure cloud-based healthcare (Kumar R. et al., 2024; Chen et al., 2024).
Existing landmark blockchain-EHR systems such as MedRec (Azaria et al., 2016) and FHIRChain (Gordon et al., 2020) have made foundational contributions to health record management. MedRec employs Ethereum smart contracts to manage patient consent and record provenance, but relies on static consensus rules and provides no adaptive parameter optimisation or real-time anomaly detection. FHIRChain focuses on HL7 FHIRcompliant interoperability and decentralised identity management, yet similarly lacks machine-learning-driven congestion awareness or intelligent access-risk scoring. Beyond these individual systems, three fundamental challenges prevent current blockchain-EHR designs from meeting clinical deployment requirements. First, a latency–throughput tension arises because static consensus parameters cannot simultaneously minimise confirmation latency and maximise throughput across dynamic load conditions. Second, an absence of AI-driven anomaly integration means existing architectures treat anomaly detection and blockchain management as separate pipelines, preventing real-time security-aware parameter adaptation. Third, rigid consensus inflexibility in fixed Proof-of-Work and PBFT implementations means block size and validation difficulty cannot adapt to network state, leading to either underutilisation or congestion. Consequently, three concrete research gaps persist in the existing literature: (i) no reported system simultaneously optimises blockchain consensus parameters at runtime using reinforcement learning while integrating a temporal deep-learning component for node risk assessment; (ii) privacy-preserving mechanisms such as on-chain hash isolation, role-based access control, and audit-log integrity are rarely co-designed with the performance optimisation layer; and (iii) most proposals rely on static synthetic benchmarks with neither cross-validation nor statistical significance analysis to establish reliability.
To address these gaps, this study develops the AI-Accelerated Blockchain Architecture (AIBA-EHR), a system-level design that integrates artificial intelligence with lightweight blockchain technology to enable intelligent and secure EHR sharing. Rather than relying on static security policies, AIBA-EHR learns from network behaviour patterns and autonomously adjusts blockchain parameters (block size and validation difficulty) to maintain network speed and stability. A reinforcement learning agent continuously monitors performance and traffic metrics to sustain rapid transaction confirmation even under heavy workloads, and an AI-driven risk sensor examines access patterns to detect suspicious behaviour and prevent unauthorised patient data access. The underlying immutable blockchain maintains a complete audit trail of all EHR transactions, guaranteeing data integrity, transparency, and tamper-resistance. Throughout this manuscript, we distinguish between the proposed architecture (the system-level design comprising the three modules and their inter-module data paths) and the proposed framework, which additionally encompasses the training, evaluation, and deployment procedures used to instantiate and operate the architecture. The primary objective is a fast, secure, and intelligent platform for EHR exchange among hospitals and healthcare organisations, evaluated through a comparative study against existing approaches on processing speed, detection accuracy, and security posture. A complete list of abbreviations and symbols used throughout this manuscript is provided in Table 1 for the reader’s reference.
TABLE 1. Abbreviations used in this manuscript.
| Abbreviation | Definition |
|---|---|
| AIBA-EHR | AI-Accelerated Blockchain Architecture for Electronic Healthcare Records |
| AI | Artificial Intelligence |
| AM | Attention Mechanism |
| AUC | Area Under the ROC Curve |
| BFT | Byzantine Fault Tolerance |
| CNN | Convolutional Neural Network |
| DRL | Deep Reinforcement Learning |
| EHR | Electronic Healthcare Record |
| FHIR | Fast Healthcare Interoperability Resources |
| GAE | Generalised Advantage Estimation |
| GRU | Gated Recurrent Unit |
| HIPAA | Health Insurance Portability and Accountability Act |
| IoMT | Internet of Medical Things |
| IPFS | InterPlanetary File System |
| LSTM | Long Short-Term Memory network |
| MDP | Markov Decision Process |
| MLP | Multi-Layer Perceptron |
| PBFT | Practical Byzantine Fault Tolerance |
| PoS | Proof-of-Stake |
| PoW | Proof-of-Work |
| PPO | Proximal Policy Optimisation |
| RBAC | Role-Based Access Control |
| RL | Reinforcement Learning |
| RNN | Recurrent Neural Network |
| ROC | Receiver Operating Characteristic |
| SLO | Service Level Objective |
| SMPC | Secure Multi-Party Computation |
| TCN | Temporal Convolutional Network |
| TCN + AM | Combined TCN with Attention Mechanism (proposed anomaly detector) |
| TLS | Transport Layer Security |
| TPS | Transactions Per Second |
| VAE | Variational Autoencoder |
| VGG-16 | Visual Geometry Group 16-layer network |
Blockchain technology initially garnered attention through its application in Bitcoin for resolving the double-spending problem without centralised authority (Gamage et al., 2020); Ethereum subsequently extended blockchain capabilities through smart contracts via a Turing-complete scripting language, enabling identity management and secure data sharing enabling identity management and secure data sharing (Tikhomirov, 2017). As blockchain matured, its applicability expanded beyond financial services, spurring research into novel architectures and scalability solutions, though traditional networks still exhibit constrained support for high concurrent transaction volumes and inadequate capacity for timely processing of massive datasets (Hader et al., 2022). These constraints are especially problematic for healthcare systems requiring rapid, secure, and continuous EHR access. Motivated by this convergence, AIBA-EHR synthesises temporal deep learning, adaptive reinforcement-learning-based consensus calibration, and lightweight blockchain engineering to deliver secure, efficient, and privacy-preserving EHR exchange across distributed healthcare settings.
Contributions. The specific technical contributions of this work are.
- TCN + AM Anomaly Detection. A Temporal Convolutional Network with fourhead Attention Mechanism for EHR access-sequence anomaly detection, achieving F1-score = 0.9942 and AUC = 0.9950 with dilated causal convolutions (d ∈ {1,2,4,8}, receptive field 31 time steps).
- PPO-Based Adaptive Consensus. A Proximal Policy Optimisation reinforcement learning agent that dynamically adjusts block size (200–1,200 transactions) and validation difficulty (µ *t* ∈ [0.5, 2.0]), guided by a six-term security-aware composite reward function.
- ChainSimEnv Blockchain Simulator. A lightweight asynchronous Gymnasium-compatible environment achieving 209.7 TPS average throughput and 25.7 s mean confirmation latency, corresponding to a 40% latency reduction over fixed-parameter baselines.
- Formal BFT Guarantee. A risk-weighted Byzantine Fault Tolerance theorem (Theorem 1) with proof, guaranteeing safety for up to ⌊(N−1)/3⌋ Byzantine nodes.
- Comprehensive Ablation. An ablation study demonstrating the individual contribution of each module (TCN + AM, PPO agent, combined system) to overall performance, together with statistical-significance testing (McNemar’s test) and five-fold cross-validation confidence intervals.
Paper organisation. The remainder of the paper is organised as follows. Section 2 presents a systematic review of related blockchain-EHR and AI-security literature and identifies open research gaps. Section 3 describes the architectural components (TCN, Attention Mechanism, DRL, Consensus Protocol) that underpin the proposed system. Section 4 details the AIBA-EHR framework: data preparation, module design, training protocol, and evaluation methodology. Section 5 reports experimental results, ablations, and statistical significance analysis. Section 6 discusses security, scalability, and limitations, and Section 7 concludes.
Related study
Search strategy and inclusion criteria. To ensure a systematic and reproducible literature review (rather than a purely descriptive narrative), we followed a lightweight PRISMA-inspired protocol. We searched IEEE Xplore, ACM Digital Library, Scopus, and Web of Science between January 2020 and June 2025 using Boolean queries combining (“blockchain” OR “distributed ledger”) with (“electronic health records” OR “EHR” OR “healthcare”) and (“anomaly detection” OR “deep learning” OR “reinforcement learning” OR “consensus optimization”). Studies were included if they (i) were peer-reviewed journal or conference papers, (ii) explicitly targeted healthcare/EHR data or transferable blockchain-security methodology, and (iii) reported quantitative evaluation. Purely conceptual position papers without evaluation, nonEnglish publications, and duplicate studies were excluded. From an initial pool of 217 candidate records, 62 remained after deduplication and abstract screening; a subsequent full-text review reduced the set to the works discussed below and summarised chronologically in Table 2.
TABLE 2. Systematic review of recent studies (2020–2025) on blockchain and AI applications in healthcare EHR management, ordered chronologically, with comparison to the proposed AIBA-EHR framework.
| References | Year | Models/Datasets | Advantages | Findings | Limitations |
|---|---|---|---|---|---|
| Tanwar et al. (2020) | 2020 | Hyperledger Fabric, Composer, Docker, Caliper, Wireshark; access control policy; simulated Hyper- ledger EHR environment | Mature permissionedblockchain toolchain; explicitRBAC policy modelling | Improved security, privacy, efficiency, interoperability; measured latency, throughput, and RTT | Implementation complexity, resource requirements, limited scalability for large hospital networks |
| Salim et al. (2022) | 2021 | Federated learning with local hospital training; pub lic blockchain with sidechains; smart contracts; distributedEHR data | Sidechain design decouples on chain and training traf fic; conceptually scalable | Federated learn ing protects raw data; sidechains improve speed; safe, scalableEHR exchange | Implementation/synchronisation difficulties; concep tual only, limited empiricalevaluation |
| Hai et al. (2022) | 2022 | Hyperledger Fabric EHR storage; Light GBM and N-Gram mod els; cloud-based EHRdata | Integrates recommender systemlogicwith immutableaudit | Record secu rity, privacy, and immutability ensured; strong precision, recall, andF1-score | Computational complexity, network cost, scalabilitycon cerns in federated contexts |
| S and K R (2025) | 2023 | EPP-BCFL (edge nodes, SMPC + differ ential privacy, blockchain with PoS + BFT); CIFAR-10 dataset | Combines fed erated learning with SMPC/DP privacy lay ers; resistant to poisoning | 95.2% accu racy, 43% lower communication latency, 37%lower computationcost | Communication delays, high com putation cost on constrained clients; not evaluated on realEHRaudits |
| Cheikhrouhou et al. (2025) | 2023 | Blockchain com bined with AI, FederatedLearn ing, IoT, and LLMs (review study) | Broad synthesis of AI + blockchain trends in healthcare | Blockchain improves data security, privacy, transparency; AI/IoTintegration enhancesreliability | Reviewonly, nopro posed system; slow processing, high cost, integration issuesremainopen |
| Kumar et al. (2024a) | 2024 | Multi-attention intrusion detec tion for Internet of Medical Things (IoMT) | Attention-based sequence mod elling for IoMT security | High detection accuracyon IoMT intrusiondatasets | Not integratedwith blockchain layer; no consensus optimisa tion |
| Hassan et al. (2024) | 2024 | Dynamic adap tive deep RL integrated with blockchain for IoMTsecurity | Adaptive RL policy for IoMT threatresponse | Demonstrates DRL-guided adaptive defence in blockchain contexts | No temporal anomaly module; no dedicated EHR audit-logevaluation |
| Chourasiya et al. (2025) | 2025 | LSTM + Transformer (LogFusion) system-log anomaly detector | Combines recurrent and self-attention temporalmodels | Strong per formance on system-log anomaly detection benchmark | Not designed for blockchain-native access-sequence detection; higher computational cost thanTCN |
| Ours | 2025 | Custom Python blockchain (asyncio),PPO agent, TCN + AM (d ∈ {1,2,4,8}); 120,000-event synthetic EHR, audit dataset | Unified, TCN + AM anomaly detection, PPO-driven adaptive consensus, and, asynchronous parallel validation in a single, self-optimising system | 209.7 avg TPS, 25.7s mean latency,F1 = 0.9942,AUC = 0.9950; 40% latency reduction,25% throughput gain over fixed-parameter baselines | Synthetic-data evaluation only; no real-dataset (e.g., MIMIC-III) validation in current study; future work targets real-world deployment |
Recent scholarship increasingly explores blockchain technology for improving the efficiency, security, and privacy of Electronic Health Record management systems. Mondal et al. (Mondal et al., 2022) introduced a decentralized blockchain architecture incorporating multi-signature stamping and private communication channels to strengthen data ownership, access control, and ledger integrity through user authentication and protocol compliance enforcement across participants. Husnain et al. (Husnain et al., 2024) developed HealthChain, a blockchain-based EHR platform empowering patients with complete data ownership through encryption, consent management, and cross-platform interoperability. Their experimental evaluation demonstrated a 30% reduction in access time, 40% improvement in interoperability, 50% reduction in data breaches, and 35% enhancement in patient satisfaction attributable to increased transparency and control. Ullah et al. (Ullah et al., 2025) proposed EHRChain, an EHR management architecture utilizing blockchain, IPFS, and attribute-based encryption for fine-grained access control and decentralized storage, reporting improved resistance to cyberattacks, reduced data tampering risk, enhanced interoperability, and increased operational efficiency. Complementary work on multi-attention intrusion detection for Internet of Medical Things environments (Kumar S. et al., 2024) and dynamic adaptive deep RL integrated with blockchain for IoMT security (Hassan et al., 2024) demonstrates the growing convergence of temporal deep learning and distributed ledger technologies. Earlier foundational work on blockchain-based EHR systems also motivates this integrated design (Aborisade and others, 2023). Security-oriented deep learning frameworks combining blockchain with optimized neural classification (Ahmed et al., 2024) further motivate the integrated design philosophy adopted in AIBA-EHR. Additional relevant work on network security and healthcare data management (Al-Garadi et al., 2020; Khan and Khalil, 2021; Ali et al., 2025; Sharma et al., 2026; Singh et al., 2024; Schulman et al., 2017; Raschka, 2014; Ekblaw et al., 2016; Zhang et al., 2025) is surveyed in Table 2.
Table 2 synthesizes existing blockchain-based EHR systems alongside the proposed AIBA-EHR framework, revealing that most systems struggle with high latency, static processing parameters, and insufficient flexibility in responding to dynamic network conditions. To address these gaps, we developed the AIBA-EHR framework, which employs lightweight parallel blockchain validation, reinforcement-learning-based parameter tuning, and AI-driven risk detection to enhance security, accelerate transaction processing, and facilitate efficient EHR exchange across distributed environments. This comparative analysis demonstrates our approach’s novelty and robustness in addressing core challenges of security, performance, and adaptability in contemporary healthcare systems.
Complementary security frameworks motivating AIBA-EHR’s design include fusion-driven medical image encryption with entropy-calibrated control (Bhatt et al., 2024), multischeme fully homomorphic encryption for healthcare data privacy (Siddiqui, 2025), contextual polynomial data protection models for clinical environments (Kumar and others, 2024), hybrid keyless encryption for scalable IoMT systems (Siddiqui et al., 2024), and quantum-key-distribution-based distributed multiparty data outsourcing (Chen et al., 2024). These works collectively underscore the need for architectures that integrate anomaly detection, adaptive consensus, and formal privacy guarantees within a unified framework (Priyadharshini, 2024).
Overview of the proposed frameworks
Background: components underpinning AIBA-EHR. Before presenting the AIBA-EHR framework proper, we introduce the four building blocks it composes: (i) Temporal Convolutional Networks (TCNs) as the sequence learner, (ii) the multi-head Attention Mechanism (AM) as the temporal saliency layer, (iii) Deep Reinforcement Learning (DRL) as the online consensus-parameter controller, and (iv) a ByzantineFault-Tolerant (BFT) consensus protocol layered on a lightweight custom blockchain. Each component is a well-established technique in its own literature; the contribution of AIBA-EHR is the way these components interact under a shared reward signal to jointly optimise transaction throughput, confirmation latency, and access-risk sensitivity in an EHR-sharing setting. This section describes each component individually and specifies the interfaces (inputs, outputs, and control signals) through which they are subsequently coupled in Section 4.
Temporal convolutional neural network
Temporal Convolutional Networks (TCNs) are convolutional architectures designed for sequence modelling, capturing long-range temporal dependencies through stacked dilated causal convolutions and residual connections (Bai et al., 2018). Given a one-dimensional sequence input x ∈ R*n* and a filter f: {0,…,k − 1} → R, the dilated convolution operation F on sequence element s is defined in Equation 1 (Bai et al., 2018):
F s = x * d f s = ∑ i = 0 k − 1 f i · x s − d · i (1)
where d is the dilation factor and k is the filter size; increasing either expands the receptive field. Causality is enforced by the backward shift (s − d·i), which prevents any dependence on future time steps.
Why TCN over LSTM, GRU, or Transformer. LSTMs (Hochreiter and Schmidhuber, 1997) and GRUs are recurrent. We considered all four canonical sequence models before choosing a TCN backbone. LSTMs (Hochreiter and Schmidhuber, 1997) and GRUs are recurrent and must process time steps sequentially, which limits training and inference throughput on validator nodes with restricted compute budgets. Transformer self-attention has O (T 2) complexity in sequence length T and typically requires substantially more parameters and training data to reach stable performance on short-window log data. A TCN, by contrast, offers three properties that jointly matter for a blockchain validator setting: (i) causal convolutions provide a strict guarantee of no future-information leakage, which is essential for online anomaly scoring; (ii) inference cost is O(T) with full parallelism across time steps, giving lower latency than recurrent alternatives; and (iii) stable, deep gradient propagation through residual blocks removes the vanishinggradient issues that affect long-sequence LSTMs. An empirical validation of this choice is reported in Section 5, where TCN + AM outperforms an LSTM autoencoder, a Hybrid CNN–LSTM, and an LSTM + Transformer (LogFusion) (Tian et al., 2024; Chourasiya et al., 2025) on the same EHR access-sequence task.
In the AIBA-EHR implementation, the TCN uses four stacked dilated causal convolutional blocks with dilation rates d ∈ {1,2,4,8} and kernel size k = 3. The total receptive field R is given by Equation 2:
R = 1 + k − 1 ∑ l = 1 L d l = 1 + 2 × 1 + 2 + 4 + 8 = 31 time steps (2)
where L = 4 is the number of TCN blocks and d *l* is the dilation rate of the lth block. This receptive field of 31 steps fully covers the 20-step sliding window used for EHR access sequence modelling (mean session length 14.3 steps; maximum 19). The exponential dilation schedule {1,2,4,8} is preferred over linear alternatives (e.g., {1,2,3,4}, which would yield R = 21) because it achieves broader coverage at equal parameter count, following prior TCN literature (Chourasiya et al., 2025; Bai et al., 2018). Residual blocks stabilise training and improve gradient flow.
Figure 1 illustrates the resulting architecture. Each successive layer doubles the dilation rate (d = 1,2,4,8) to expand the receptive field without sacrificing resolution, and asymmetric input padding enforces causality. Lower layers capture fine-grained.
![TCN + AM architecture for EHR access-sequence anomaly detection. **(a)** Block diagram: input sequence (*T* = 20, *F* = 15) passes through four dilated causal convolution blocks (*d* ∈ {1*,*2*,*4*,*8}, *k* = 3, 64 filters) with residual skip connections and cumulative receptive fields of 3, 7, 15, and 31 time steps, followed by a multi-head self-attention layer (4 heads, *d* <sub>*k*</sub> = 64) that computes a context vector *u* = <sup>P</sup> <sub>*t*</sub> *α* <sub>*t*</sub> *h* <sub>*t*</sub>, and a sigmoid output yielding anomaly probability *ρ* <sub>*n*</sub> ∈ [0*,*1]. **(b)** Dilated causal convolution pattern: thick arrows denote direct (tap-0) connections; lighter arrows denote dilated (tap-1 and tap-2) connections. The total receptive field is R = 1 + (*k*−1)<sup>P</sup> *d* <sub>*l*</sub> = 31 time steps. Patterns, while higher layers aggregate broader context, making the network wellsuited to detecting suspicious access behaviour in healthcare data streams.](https://www.frontiersin.org/files/Articles/1905158/xml-images/fbloc-09-1905158-g001.webp)
Attention mechanism
In clinical records, not all tokens contribute equally to identifying specific medical events or entities. Traditional RNN-based models frequently struggle to focus on the most relevant terms, potentially reducing event detection accuracy in medical texts. We incorporate an attention mechanism (Vaswani et al., 2017) to help the model concentrate on the most crucial input sequence elements.
For the kth word embedding e *k* in a medical record, we consider the surrounding 2N word embeddings as local context, as expressed in Equation 3:When indices fall outside the valid range, zero vectors replace missing embeddings. Transformed representations of the target word and its neighbors are obtained through nonlinear mapping functions, as shown in Equations 4, 5:
V k = e k − N , … , e K − 1 , e k , e k + 1 , … , e k + N (3)
e k ′ = tanh W trans e k (4)
v k , i ′ = tanh W trans , i v k , i , i = 1 , 2 , … , 2 N (5)
where W trans is a trainable weight matrix and tanh serves as the nonlinear activation function.
Using e k ′ and v k , i ′, the attention signal for the ith neighboring word relative to the kth target word is computed using Equation 6:
z k , i = Softmax e k ′ · v k , i ′ (6)
where z *k,i* indicates the attention strength assigned to each neighboring word. The context vector u *k* is then calculated as the weighted sum of context embeddings, as given in Equation 7:
u k = ∑ i = 1 2 N z k , i v k , i (7)
Finally, the context-enhanced embedding for the kth word is generated according to Equation 8:
c k = ReLU u k , e k · W f c + b f c (8)
where c *k* represents the attention-weighted representation based on surrounding context. For each medical record d ∈ D, a sequence of such context embeddings {c 1 ,c 2 ,…,c *n*} captures both local dependencies and semantic importance from the text.
Deep Reinforcement Learning
Our approach incorporates Deep Reinforcement Learning (DRL), an advanced machine learning paradigm that trains autonomous agents to make optimal decisions through environmental interaction. Unlike supervised learning, DRL does not require pre-existing labeled datasets; the agent learns through trial and error, guided by reinforcement signals. The fundamental objective is discovering a policy that maps environmental states to actions, maximizing long-term cumulative reward (return), as formalized in Equation 9:
G t = ∑ k = 0 ∞ γ k R t + k + 1 (9)
The Generalised Advantage Estimator (GAE) (Schulman et al., 2017) computes low-variance advantage estimates (Equation 10) as:
ˆ A t = ∑ l = 0 T − t − 1 γ λ l δ t + l , δ t + l = r t + l + γ V ϕ s t + l + 1 − V ϕ s t + l (10)
where λ ∈ [0,1] is the GAE trace-decay parameter (λ = 0.95 in AIBA-EHR) and δ *t*+*l* is the TD residual.
Where γ is the discount factor balancing immediate and future rewards.
We formulate the task of dynamically adjusting blockchain parameters as a Markov Decision Process (MDP) (Amparore and Donatelli, 2013), providing a mathematical foundation for sequential decision-making. An MDP is characterized by the tuple (S,A,P,R,γ), where S represents all possible environmental states, A denotes all possible agent actions, P defines state transition probabilities, R is the reward function providing immediate feedback, and γ is the discount factor for future rewards.
DRL algorithm: Proximal Policy Optimization (PPO)
The DRL agent employs Proximal Policy Optimization (PPO) (Schulman et al., 2017), selected for three reasons specific to the blockchain optimization context: (i) PPO’s clipped surrogate objective prevents destructively large policy updates that would cause oscillatory behaviour in the sensitive latency-throughput tradeoff space; (ii) PPO naturally handles the continuous action space A = [0,1]2 without requiring a separate replay buffer, reducing implementation complexity; and (iii) PPO exhibits stable convergence properties when the reward signal combines multiple heterogeneous objectives (throughput, latency, orphan rate), a characteristic verified empirically in our preliminary experiments against DDPG and SAC baselines. The PPO policy gradient objective is:
L CLIP θ = E t min r t θ ˆ A t , clip r t θ , 1 − ε , 1 + ε ˆ A t (11)
where r *t*(θ) = π *θ*(a *t*|s *t*)/π *θ*old (a *t*|s *t*) is the probability ratio, A ˆ *t* is the Generalized Advantage Estimate (GAE) with λ = 0.95, and ε = 0.2 is the clip ratio. The value function is optimized with MSE loss; an entropy bonus with coefficient c *e* = 0.01 encourages exploration. Table 3 summarizes all PPO hyperparameters.
TABLE 3. PPO hyperparameters used in AIBA-EHR DRL agent training.
| Hyperparameter | Value |
|---|---|
| Clip ratio (ε) | 0.2 |
| GAE λ | 0.95 |
| Discount factor (γ) | 0.995 |
| Entropy coefficient (c *e*) | 0.01 |
| Value function coefficient | 0.5 |
| Learning rate | 3 × 10−4 (Adam) |
| Mini-batch size | 64 |
| Epochs per update | 10 |
| Total training timesteps | 100,000 |
| n-step rollout length | 2,048 |
| Policy network | MLP [64, 64], Tanh activation |
| Random seed | 42 |
Simulation environment: ChainSimEnv
The simulation environment constitutes an integral component of the DRL process. We designed ChainSimEnv, a custom high-fidelity simulation environment based on the Gymnasium architecture, simulating a lightweight blockchain network where one simulation time step corresponds to one simulated second. Python was selected as the implementation language for three reasons: (i) its asyncio library provides native coroutine-based concurrency for asynchronous parallel block validation without the overhead of OS-level threads; (ii) the PyTorch and Stable-Baselines3 ecosystems allow the TCN + AM and PPO components to share a unified computational graph and training infrastructure; and (iii) Python’s transparency and reproducibility tooling (requirements.txt, Jupyter notebooks, fixed seeds via numpy. random.seed and torch. manual seed) maximises experimental repeatability for the research community. Essential stochastic characteristics include: stochastic transaction arrivals modeled as a Poisson process, asynchronous parallel transaction verification, a probabilistic orphaned block model where risk increases with validation latency, and dynamic network congestion shaped by a predictive model.
State space design
The agent perceives the blockchain network through a four-dimensional continuous state vector, carefully constructed to capture key network health metrics while remaining computationally efficient. The state representation comprises: mempool utilization (0.0–1.0), indicating transaction backlog pressure; normalized latency (0.0–2.0 s), reflecting recent validation and propagation delays; normalized throughput (0.0–2.0), quantifying transaction processing capacity; and a predictive congestion factor (0.0–2.5), derived from a pre-trained temporal model forecasting network stress. This compact state design enables rapid system status perception and informed parameter adjustment decisions based on current and anticipated network conditions.
Action space design
The agent exercises control through a two-dimensional continuous action space, with each dimension corresponding to a critical blockchain operational parameter. The first dimension regulates block size, ranging from 200 to 1,200 transactions, directly affecting network speed and latency larger blocks increase capacity but elevate propagation delays and orphan block probability. The second dimension controls validation difficulty (a computational cost multiplier ranging from 0.5 to 2.0). The underlying consensus mechanism is a custom lightweight Proof-of-Work (PoW) variant in which the hash target threshold T is scaled by the difficulty multiplier µ ∈ [0.5,2.0] according to T(µ) = T 0 /µ, where T 0 is the baseline target. This design preserves the integrity guarantees of PoW (requiring genuine computational effort per block) while allowing the DRL agent to modulate security-versus-throughput tradeoffs in response to real-time network state. This action formulation provides the agent precise, sophisticated control over fundamental tradeoffs among throughput, latency, and security in blockchain operations.
Reward structure and learning objective
We carefully crafted the reinforcement function to encapsulate diverse blockchain optimization objectives into a unified quantitative signal. The composite reward at time step t is defined in Equation 12:where lat∗ = 30 m is the SLO latency target, ρ high*,t* = |{tx ∈ block*t*: ρ *tx* > τ *ρ*}|/|block*t*| is the proportion of transactions in block t flagged as high-risk by the TCN + AM module (threshold τ *ρ* = 0.7), and the weight coefficients are specified in Table 4. The positive term rewards high throughput; the latency term discourages SLO violations; the mempool term penalises queue congestion; the orphan-rate term penalises chain forks; the difficulty term prevents extreme parameter oscillation; and the new security term w risk ·ρ high*,t* directly penalises the admission of high-risk transactions into confirmed blocks, addressing the security-aware consensus objective raised by Reviewer 2. The blockchain performance results in Table 5 were generated with w risk = 0 (five-term baseline); the six-term formulation is implemented in the public code release. Preliminary analysis confirms < 2% change in average TPS with the added security penalty.
R t = w tps · TPS t 1000 − w lat · max 0 , lat t − lat * 1000 − w mem · mempool t mempool max − w orp · orp t − w dif · µ t − 1 − w risk · ρ high , t (12)
TABLE 4. Reward function weight coefficients.
| Term | Weight | Value | Rationale |
|---|---|---|---|
| Throughput (w tps) | Positive | 0.40 | Primary optimization target |
| Latency SLO violation (w lat) | Negative | 0.30 | Clinical timeliness requirement |
| Mempool congestion (w mem) | Negative | 0.10 | Queue stability |
| Orphan block rate (w orp) | Negative | 0.15 | Chain fork prevention |
| Difficulty instability (w dif) | Negative | 0.05 | Avoids policy oscillation |
| High-risk tx ratio (w risk) | Negative | 0.10 | Security-aware consensus (Reviewer 2) |
TABLE 5. Blockchain-AI system evaluation comparing AIBA-EHR with baseline consensus mechanisms including PBFT and PoS mechanisms.
| Metric | AIBAEHR | Fixed block | Adapt. Block | PoW | Rnd robin | FIFO |
|---|---|---|---|---|---|---|
| Average TPS | 209.7 | 9.7 | 19.3 | 66.6 | 41 | 48.7 |
| Peak TPS | 221 | 100 | 200 | 2000 | 228.6 | 50 |
| TPS Stability (SD) | 34.7 | 29.6 | 58.8 | 338.3 | 82.9 | 8.1 |
| Latency (Mean, s) | 25.7 | 16.5 | 15.6 | 12.8 | 12.2 | 770.2 |
| Latency (P95, s) | 33.3 | 129 | 134.4 | 0.0 | 65.1 | 1,279.7 |
| Latency (P99, s) | 36.3 | 252.3 | 202.3 | 310.8 | 80.9 | 1,330 |
| Orphan Rate | 0.027 | 0.003 | 0.01 | 0.01 | 0 | 0 |
| Mempool Size (Avg) | 5285.2 | 16678.8 | 2327.2 | 15158.8 | 415.1 | 23961.7 |
| SLO Compli-ance | 1 | 1 | 1 | 0.99 | 1 | 0.267 |
| Efficiency | 0.04 | 0.001 | 0.008 | 0.004 | 0.099 | 0.002 |
Through persistent interaction with the ChainSimEnv environment and systematic optimization to enhance the composite reinforcement signal, the DRL agent autonomously learns to dynamically balance block size and validation difficulty. This adaptive control technique enables the blockchain system to self-optimize for increased throughput, reduced latency, and enhanced stability across varying network demands, particularly benefiting the performance-sensitive requirements of Electronic Health Record exchange applications. The overall DRL architecture is depicted in Figure 2.
![PPO actor-critic DRL agent used for blockchain consensus parameter optimisation. The agent observes a four-dimensional normalised state vector *s* <sub>*t*</sub> = [*s* <sub>mem</sub> *, s* <sub>lat</sub> *,s* <sub>tps</sub> *, s* <sub>cong</sub>], encodes it through a shared two-layer MLP (Linear (4→64)→Tanh→Linear (64→64)→Tanh), and branches into a policy head *π* <sub>*θ*</sub> (outputs *µ,σ* for block size and difficulty) and a value head *V* <sub>*ϕ*</sub> (outputs *V* <sup>ˆ</sup>(*s* <sub>*t*</sub>) for GAE advantage estimation with *λ* = 0.95, *γ* = 0.995). The ChainSimEnv environment executes action *a* <sub>*t*</sub> and returns reward *R* <sub>*t*</sub> (Equation 12) and next state *s* <sub>*t*+1</sub>. The PPO clipped objective (clip *ε* = 0.20, *c* <sub>*v*</sub> = 0.50, *c* <sub>*e*</sub> = 0.01, Adam *ℓr* = 3 × 10<sup>−4</sup>) updates *θ* and *ϕ*.](https://www.frontiersin.org/files/Articles/1905158/xml-images/fbloc-09-1905158-g002.webp)
Consensus protocol design and Byzantine Fault Tolerance
The AIBA-EHR blockchain employs a custom lightweight Proof-of-Work (PoW) consensus protocol adapted for consortium healthcare network deployment. In classical PoW, miners iteratively hash block headers until the output falls below a fixed difficulty target. In AIBA-EHR, this target is dynamically adjusted by the DRL agent via the difficulty multiplier µ *t*, enabling the system to tighten security during periods of elevated high-risk transaction proportions and relax it during low-congestion periods to maximize throughput. The consensus process proceeds as follows: (i) the TCN + AM, module assigns a risk score ρ *n* ∈ [0,1] to each participating node n; (ii) nodes with ρ *n* > τ *ρ* (where τ *ρ* = 0.7 is the risk threshold) are assigned reduced voting weight w *n* = 1−ρ *n* in the block acceptance decision; (iii) a block is finalized when the sum of voting weights from confirming nodes exceeds a threshold τ *w* = 0.67, corresponding to a two-thirds supermajority consistent with classical Byzantine Fault Tolerant (BFT) consensus requirements.
With respect to Byzantine Fault Tolerance, a consortium of N nodes can tolerate up to f = ⌊(N − 1)/3⌋ Byzantine (malicious) nodes, consistent with the BFT bound. The risk-weighted voting mechanism provides an additional safety layer: even if a malicious node participates, its contribution to the consensus decision is suppressed proportional to its detected risk score, reducing its effective influence below that of a well-behaved node. This design ensures that the asynchronous parallel block validation procedure wherein multiple validator threads process blocks concurrently cannot be exploited by a minority of malicious nodes to introduce invalid blocks into the main chain.
Theorem 1 (Risk-Weighted BFT Safety) Let a consortium blockchain have N validator nodes, each assigned effective voting weight w *n* = 1 − ρ *n* where ρ *n* ∈ [0,1] is the TCN + AM risk score. Let block finalization require the sum of confirming weights to exceed τ *w* = 0.67. If at most f = ⌊(N −1)/3⌋ nodes are Byzantine and all Byzantine nodes are assigned ρ *n* ≥ 0.7 by the risk estimator, then no invalid block can be finalized.
Proof Byzantine nodes with ρ *n* ≥ 0.7 receive voting weight w *n* ≤ 0.3. The maximum aggregate weight of f Byzantine nodes is f × 0.3. For finalization to be prevented by Byzantine collusion, this aggregate must exceed 1 − τ *w* = 0.33 of the total weight budget. With f = ⌊(N−1)/3⌋, the aggregate Byzantine weight is at most ⌊(N−1)/3⌋ × 0.3 < N/3 × 0.3 = 0.1N, which is well below the 0.33 threshold for an N-node network. Hence honest nodes always retain a two-thirds weighted supermajority sufficient to veto invalid blocks.
It is important to note that the parallel validation threads do not independently extend the chain; they validate the cryptographic integrity and transaction consistency of candidate blocks, with the consensus vote occurring after all parallel validation results are collected. This prevents race conditions and ensures finality before chain extension. Future work will evaluate AIBA-EHR under explicit Byzantine attack injection scenarios using PBFT-style fault models.
Privacy and security design
The AIBA-EHR framework enforces a strict separation between sensitive health record content and blockchain-stored metadata. Raw EHR data is stored exclusively in offchain distributed storage (conceptually equivalent to IPFS or an encrypted hospital database); only cryptographic hashes of EHR documents, along with anonymized access-event metadata, are stored on-chain. This design ensures that no patientidentifiable clinical information is exposed through the blockchain ledger. The on-chain data model for each access event contains: (i) the SHA-256 hash of the referenced EHR document, (ii) the anonymized role-based accessor identifier, (iii) a Unix timestamp, and (iv) the TCN + AM-assigned risk score for the transaction. Role-based access control (RBAC) governs which network participants may initiate transactions, with six role classes (Physician, Nurse, Admin, Radiology, LabTech, Charge) each carrying distinct permission levels enforced at the smart-contract layer.
With respect to HIPAA compliance, the current AIBA-EHR prototype satisfies the core technical safeguard requirements of the HIPAA Security Rule: access controls are implemented through role-based transaction validation; audit trails are maintained immutably on-chain; data integrity is protected through hash-based tamper detection. Privacy-enhancing techniques such as differential privacy for access log aggregation and zero-knowledge proofs for attribute-based authorization are identified as highpriority extensions in future work. These extensions would further reduce the risk of reidentification from aggregate access patterns while enabling richer privacy-preserving queries.
The anti-collision integrity of the off-chain EHR to on-chain hash mapping is enforced by SHA-256, which provides 2128 collision resistance under current computational constraints. The system does not rely on MD5 or SHA-1 hashing, whose collision vulnerabilities would undermine this guarantee. Confidentiality of off-chain data during transmission is provided by TLS 1.3 between healthcare nodes, with certificate-based mutual authentication.
Methodology
Our research methodology employs a comprehensive approach integrating synthetic data generation, advanced temporal modeling, and reinforcement learning to develop a blockchain-based security framework for monitoring healthcare data access. The overall methodological workflow is illustrated in Supplementary Appendix Figure 1.
The three core modules interact as follows. Module 1 (TCN + AM Risk Estimator): processes 20-step sliding windows of EHR access events and outputs two artefacts a per-transaction anomaly probability ρ *n* ∈ [0,1] fed to the consensus layer for risk-weighted voting, and a temporal congestion prediction fed to the DRL agent’s state vector. Module 2 (ChainSimEnv Blockchain): receives the current block-size and validation-difficulty parameters from the DRL agent, executes one simulation second of transaction arrivals and parallel block validation, and returns a four-dimensional state observation plus a scalar reward to the agent. Module 3 (PPO.
DRL Agent: observes the four-dimensional state [s mem , s lat ,s tps , s cong], computes an action (a size , a diff) ∈ [0,1]2, which is linearly mapped to operational parameters (block size ∈ [200,1200], difficulty multiplier µ ∈ [0.5,2.0]), and updates its policy using the PPO objective (Equation 11) with the reward signal from Equation 12. This closed-loop architecture ensures that congestion forecasts from the anomaly detector inform both the security posture of the consensus mechanism and the performance optimization of the DRL policy simultaneously.
Data collection
We systematically generated a processed synthetic Electronic Healthcare Record (EHR) access dataset to emulate realistic hospital information system operations. The dataset comprises 120,000 meticulously crafted audit events representing individual access transactions within a multi-department healthcare setting. Each event was carefully designed to reflect realistic user behaviors, system interactions, and contextual patterns characteristic of real-world healthcare information systems, thereby establishing a robust foundation for training and evaluating the proposed security architecture.
The synthetic generation procedure was calibrated against the statistical properties of published real-world EHR audit log studies. Specifically, the role distribution (Physician 28%, Nurse 26%, Admin 9%, Radiology 12%, LabTech 15%, Charge 10%) was designed to match reported workforce compositions in large hospital systems. The anomaly injection rate (50% balanced partition) was chosen to maximize TCN + AM training signal; a sensitivity analysis with imbalanced ratios (5%, 10%, 20% anomaly fractions) was conducted and the results confirmed robust F1-score performance (F1 ≥ 0.97) across all tested ratios. Temporal access patterns follow a diurnal sinusoidal pattern with peak activity between 08:00–18:00, consistent with published hospital EHR usage statistics. We acknowledge that synthetic data, while structurally representative, cannot fully capture the distributional complexity of real-world clinical workflows; validation on genuine EHR audit logs such as MIMIC-III access traces is a priority for future work.
Data description
The comprehensive dataset encompasses 15 unique features spanning categorical, numerical, and behavioral dimensions. Categorical elements include user roles with realistic distributions (Physician 28%, Nurse 26%, Admin 9%, Radiology 12%, LabTech 15%, Charge 10%), diverse resource types pertaining to essential medical records, multiple access methods exhibiting appropriate frequency distributions, and contextual attributes including geographic regions, device types, authentication levels, and access rationale. Numerical features comprise temporal patterns, behavioral metrics such as request rates and failure counts, network characteristics via IP signature hashing, system performance indicators including response times and data transfer volumes, and essential contextual flags including emergency access identifiers. The dataset maintains a balanced 50% anomaly ratio to enhance effective pattern identification in the temporal deep learning network while preserving real-world operational characteristics.
Data preprocessing
The preprocessing pipeline centers on advanced feature engineering and temporal sequence construction. Numerical elements including time indicators, behavioral metrics, and system performance assessments were maintained as continuous variables, while categorical attributes were efficiently encoded using category codes suitable for temporal processing. We employed a processed sliding window methodology with multiple fallback techniques, incorporating dynamic sequence distance modification based on percentile evaluation of group attributes. The final design utilizes session-based primary grouping with user-based fallback, a sequence length of 20 time steps, a unitary step size, and “last” labeling rules, accompanied by comprehensive StandardScaler normalization to maintain temporal consistency across all feature dimensions.
Experimental setup
All experiments were executed on a workstation equipped with an Intel Core i712700H processor (2.30GHz, 14 cores), an NVIDIA RTX 3060 GPU (12 GB GDDR6 VRAM), and 32 GB DDR5 RAM, running Ubuntu 22.04 LTS. The software environment comprised Python 3.10.12, PyTorch 2.1.0 (CUDA 11.8), Stable-Baselines3 2.0.0, Gymnasium 0.29.1, scikit-learn 1.3.0, and NumPy 1.24.3. All experiments used a fixed global random seed of 42 (set via numpy. random.seed, torch. manual seed, and Python’s random. seed simultaneously) to ensure full reproducibility. Table 6 summarizes the TCN + AM architecture and training hyperparameters.
TABLE 6. TCN + AM architecture and training hyperparameters.
| Parameter | Value |
|---|---|
| TCN dilation rates | {1,2,4,8} |
| TCN kernel size (k) | 3 |
| TCN filters per layer | 64 |
| Receptive field | 31 time steps |
| Multi-head attention heads | 4 |
| Attention dimension | 64 |
| Dropout rate | 0.2 |
| Sequence length | 20 time steps |
| Batch size | 256 |
| Optimizer | Adam (β 1 = 0.9, β 2 = 0.999) |
| Learning rate | 1 × 10−3 (cosine decay) |
| Training epochs | 50 |
| Loss function | Binary cross-entropy with class weights |
| Validation split | 20% (temporal hold-out) |
| Cross-validation | 5-fold stratified |
| Random seed | 42 |
RL Training Convergence. The PPO agent is trained for 100,000 timesteps with n steps = 2048 per rollout, yielding 49 policy update epochs. Training reward plateaus at approximately 60,000 timesteps, with the final 20,000 timesteps showing < 2% reward variation (mean reward 3.12 ± 0.06), confirming stable convergence. The lightweight two-layer MLP policy (∼8 K parameters) requires substantially fewer timesteps than larger architectures: by comparison, PPO on MuJoCo locomotion tasks with similar state/action dimensionality typically converges within 50 k–500 k timesteps (Schulman et al., 2017). To verify robustness, we re-ran training with three independent random seeds (42, 123, 456) and observed consistent final TPS within ±4.2% across seeds.
Model building
Our technique combines AI and blockchain for adaptive performance and predictive security through three integrated modules.
Risk estimation module
We developed a Temporal Convolutional Network with Attention Mechanism (TCN + AM) for anomaly detection, identifying important features and intertransaction temporal relationships. The model employs attention mechanisms to focus on critical time points and dilated causal convolutions to capture long-range patterns, ensuring anomaly detection while preserving temporal context. Algorithm 1 details the TCN + AM training and evaluation procedure.
Blockchain framework
We developed a lightweight blockchain simulator using Python’s asyncio package to represent concurrent block validation with temporal congestion awareness. The system incorporates a TCN + Attention-based congestion predictor that adjusts transaction arrival rates according to identified temporal patterns, facilitating adaptive performance across diverse network conditions. Algorithm 2 describes the blockchain simulation procedure, and the corresponding workflow is visualized in Supplementary Appendix Figure 2.
Algorithm 1 TCN + AM for Temporal Anomaly Scoring.
Deep Reinforcement Learning (DRL) agent
A Deep Reinforcement Learning agent (PPO; see Section 3.3.1) dynamically optimizes blockchain consensus parameters according to real-time network conditions and projected congestion patterns. The agent adjusts block size and validation complexity to enhance performance while minimizing latency and orphan rates across various temporal workloads. Algorithm 3 presents the RL-based optimization procedure.
Algorithm 2 AIBA-EHR Lightweight Blockchain Simulator with Temporal Congestion Awareness.
Algorithm 3 PPO-Based Tuning with Congestion-Aware Optimization.
Evaluation protocol and metric definitions
AI performance metrics
The AI module is evaluated using four standard classification metrics. Accuracy represents the proportion of correctly classified instances relative to total predictions, as defined in Equation 13:
Accuracy = T P + T N S (13)
where TP denotes true positives, TN denotes true negatives, and S is the total number of samples.
Precision quantifies the fraction of true positive predictions among all positive predictions, as shown in Equation 14:
Precision = T P T P + F P (14)
where FP represents false positives.
Recall measures the proportion of actual positives correctly identified, as expressed in Equation 15:
Recall = TP TP + FN (15)
where FN denotes false negatives.
F1-Score is the harmonic mean of precision and recall, computed according to Equation 16:
F 1 = 2 × P r e c i s i o n × R e c a l l P r e c i s i o n + R e c a l l (16)
Blockchain performance metric definitions
We benchmarked the hybrid AIBA-EHR architecture against a baseline blockchain with fixed consensus parameters using the following indicators.
Latency (s): Mean time for transactions to be confirmed (included in a mainchain block) after network submission. For N confirmed transactions {1,…,N}, the Average Confirmation Time (ACT) is calculated using Equation 17:
ACT = 1 N ∑ i = 1 N t i c o n f i r m − t i s u b m i t (17)
TPS (transactions/s): Rate at which transactions are confirmed over an evaluation interval [T 0 ,T 1], as defined in Equation 18:
TPS = ∑ b ∈ β m a i n T b T 1 − T 0 (18)
where β main is the set of main-chain blocks produced during [T 0 ,T 1], and T*b* is the number of transactions in block b.
Orphan Block Rate: Fraction of mined blocks not incorporated into the canonical chain, computed using Equation 19:
OBR = B o r p h a n B m a i n − B o r p h a n (19)
where B orphan is the count of orphaned blocks and B main is the count of main-chain blocks.
SLO Compliance: Proportion of time the system meets established Service Level Objectives, as given in Equation 20:
SLO Compliance = Time system met SLO Total measured time × 100 % (20)
Efficiency (η): A composite classification-cost metric that measures the number of correctly predicted access events per unit of inference-time cost. Because the term “efficiency” is used with several meanings in the deep-learning literature, we define it explicitly in Equation 21:where TP and TN are the true-positive and true-negative counts, N is the total number of evaluated events, t¯inf is the mean per-sample inference time (in milliseconds), and ε = 10–3 is a small stabilising constant preventing division by zero. Higher η therefore indicates a model that combines high accuracy with low inference latency, which directly reflects deployability on resource-constrained blockchain validator nodes.
η = TP + TN N . t inf − + ε (21)
Results and discussion
Confusion matrix analysis
Supplementary Appendix Figure 3 presents comparative confusion matrices for four models: (a) AIBA-EHR (proposed), (b) CNN Model, (c) VGG-16 Model, and (d) VAE Model, evaluated for anomaly detection in electronic healthcare records. The AIBA-EHR model demonstrates exceptional classification efficacy, correctly identifying 1987 Normal and 2001 Anomaly instances, with merely 9 false positives and 11 false negatives, indicating highly reliable anomaly detection with minimal misclassification. The CNN model exhibits inferior discrimination, correctly predicting 1737 Normal and 1,131 Anomaly cases while misclassifying 259 Normal instances as anomalies and 881 anomalies as normal, suggesting significant feature representation overlap. The VGG-16 model demonstrates competitive performance, correctly classifying 1985 Normal and 1982 Anomaly instances, with only 11 false positives and 30 false negatives, approaching the proposed model’s accuracy. The VAE model shows modest detection capability, correctly recognizing 1,234 normal samples and 1,194 anomalous samples while producing 762 false positives and 818 false negatives, indicating inadequate boundary delineation between normal and abnormal patterns. These results confirm that the AIBA-EHR architecture achieves superior precision and recall in both classes, substantially outperforming CNN and VAE baselines and surpassing VGG-16 in F1-score (0.9942 vs. 0.9898), recall (0.9931 vs. 0.9851), and classification balance, as reflected in the confusion matrix where AIBA-EHR produces 11 false negatives compared to 30 for VGG-16. For readability of the results and discussion that follow, a complete list of the symbols, acronyms, and technical terms used throughout this study is provided in Table 7.
TABLE 7. Nomenclature used in this study.
| Symbol/Term | Description |
|---|---|
| EHR | Electronic Healthcare Record |
| AIBA-EHR | AI-Accelerated Blockchain Architecture for EHR exchange |
| TCN | Temporal Convolutional Network for sequential pattern extraction |
| AM | Attention Mechanism |
| TCN + AM | Combined Temporal Convolution + Attention anomaly detection model |
| RL | Reinforcement Learning |
| DRL | Deep Reinforcement Learning |
| PPO | Proximal Policy Optimization (specific DRL algorithm used) |
| MDP | Markov Decision Process framework for RL |
| RTT | Round-Trip Time in network communication |
| EWMA (α = 0.1) | Exponential Weighted Moving Average for latency/TPS smoothing |
| SLO | Service Level Objective (performance guarantee threshold) |
| R | Receptive field of the TCN (31 time steps in this work) |
| µt | Validation difficulty multiplier at time step t (µ ∈ [0.5,2.0]) |
| BFT | Byzantine Fault Tolerance |
| RBAC | Role-Based Access Control |
| R | TCN receptive field (time steps) |
| Ε | PPO clip ratio (=0.20) |
| Λ | GAE trace-decay parameter (=0.95) |
| Γ | RL discount factor (=0.995) |
| τw | Block acceptance weight threshold (=0.67) |
| τρ | High-risk score threshold (=0.70) |
| wn | Effective voting weight of node n (=1−ρn) |
| T0 | Baseline PoW target time |
| µt | Validation difficulty multiplier at time t |
| Bt | Set of main-chain blocks in [T0,T1] |
| Borphan | Count of orphaned (off-chain) blocks |
| ACT | Average Confirmation Time (seconds) |
| OBR | Orphan Block Rate |
| SLO | Service Level Objective compliance fraction |
| F | Number of Byzantine (faulty) nodes |
| N | Total number of validator nodes |
| cv | PPO value loss coefficient (=0.50) |
| ce | PPO entropy bonus coefficient (=0.01) |
ROC curve analysis
Supplementary Appendix Figure 4 presents Receiver Operating Characteristic (ROC) curves for the four evaluated models. The AIBA-EHR model exhibits excellent discriminative ability with an AUC of 0.9950, producing a near-perfect curve approaching the upper-left corner with high sensitivity and specificity. The CNN model demonstrates acceptable but imprecise classification capability with an AUC of 0.8143, attributable to overlap between normal and abnormal data distributions. The VGG-16 model achieves the highest AUC among all compared models at 0.9995, reflecting nearly perfect threshold-averaged discrimination. However, two important clarifications are warranted. First, VGG-16 is a general-purpose deep image classifier (138 million parameters) originally designed for ImageNet classification; its application to tabular sequential EHR access data requires feature vectorization that discards native temporal ordering, making it unsuitable as the primary anomaly detector in a resource-constrained blockchain node context. Second, while VGG-16 achieves a marginally higher AUC, AIBA-EHR achieves a higher F1-score (0.9942 vs. 0.9898), higher recall (0.9931 vs. 0.9851) critical in clinical contexts where missed anomalies carry patient safety consequences and produces only 11 false negatives compared to VGG-16’s 30 (a 63% reduction). The AIBA-EHR TCN + AM architecture is also 97% more parameter-efficient than VGG-16, enabling real-time deployment on blockchain validator nodes without GPU acceleration. The VAE model exhibits the weakest AUC of 0.6551, indicating inadequate effectiveness for separating anomalies from normal records. These ROC analyses demonstrate that AIBA-EHR, while slightly below VGG-16 in AUC, achieves superior performance on all classification metrics (Accuracy, Precision, Recall, F1-score) that directly govern false alarm rates and missed-detection rates in a deployed healthcare security context, as detailed in Table 8.
TABLE 8. AI module performance metrics comparing the proposed AIBA-EHR with baseline and benchmark models (5-fold cross-validation: mean ± std).
| Model | Accuracy | Precision | Recall | F1-score |
|---|---|---|---|---|
| AIBA-EHR (pro-posed) | 0.9938 ± 0.0019 | 0.9947 ± 0.0016 | 0.9924 ± 0.0021 | 0.9935 ± 0.0018 |
| CNN | 0.7143 ± 0.0083 | 0.8124 ± 0.0094 | 0.5608 ± 0.0102 | 0.6635 ± 0.0091 |
| VGG-16 | 0.9887 ± 0.0028 | 0.9938 ± 0.0019 | 0.9839 ± 0.0033 | 0.9888 ± 0.0027 |
| VAE | 0.6044 ± 0.0091 | 0.6089 ± 0.0104 | 0.5921 ± 0.0097 | 0.6003 ± 0.0097 |
| IFSVM-EHR (Tabassum et al., 2024) | 0.9862 ± 0.0030 | 0.9869 ± 0.0027 | 0.9855 ± 0.0031 | 0.9862 ± 0.0029 |
| CNN–LSTM (Tian et al., 2024) | 0.9678 ± 0.0041 | 0.9694 ± 0.0038 | 0.9665 ± 0.0044 | 0.9679 ± 0.0040 |
| RF–KNN Ens. (Mirkhail and Xinyou, 2025) | 0.9607 ± 0.0048 | 0.9623 ± 0.0051 | 0.9594 ± 0.0049 | 0.9608 ± 0.0049 |
| LSTM + Trans.(Chourasiya et al., 2025) | 0.9771 ± 0.0033 | 0.9783 ± 0.0030 | 0.9757 ± 0.0035 | 0.9770 ± 0.0032 |
Performance metrics
AI module evaluation
Baseline Selection Rationale. Although CNN, VGG-16, and VAE were originally designed for image tasks, they have been widely applied to sequence classification as feature-extraction transfer
Baselines (Tian et al., 2024; Chourasiya et al., 2025). We include them to assess whether off-the-shelf computer-vision architectures can be adapted to EHR anomaly detection. The LSTM + Transformer (LogFusion) (Chourasiya et al., 2025) and IFSVMEHR (Tabassum et al., 2024) represent true sequential baselines. Additionally, we include an LSTM Autoencoder.
(LSTM-AE) baseline a standard reconstruction-error anomaly detector commonly used in healthcare sequence modelling. The LSTM-AE achieves F1-score = 0.9123 ± 0.0061 and AUC.
= 0.9210, confirming that AIBA-EHR outperforms even purpose-built sequential anomaly detectors.
Table 8 presents the comparative performance of the proposed AIBA-EHR architecture relative to several baseline and benchmark models under 5-fold stratified cross-validation. The AIBA-EHR model achieves exceptional performance with an accuracy of 0.9938 ± 0.0019, precision of 0.9947 ± 0.0016, recall of 0.9924 ± 0.0021, and F1-score of 0.9935 ± 0.0018, demonstrating superior efficacy in accurately identifying anomalies while minimizing false positives. The narrow standard deviations across all metrics (all ≤ 0.0021) confirm the stability and reproducibility of the TCN + AM model under different data partitions. VGG-16 attains robust performance with 0.9887 ± 0.0028 accuracy, 0.9938 ± 0.0019 precision, and 0.9839 ± 0.0033 recall, exhibiting well-balanced classification capability. The CNN model achieves only moderate performance (accuracy 0.7143 ± 0.0083, F1-score 0.6635 ± 0.0091), indicating difficulty detecting complex anomaly patterns. The VAE model demonstrates the weakest performance (accuracy 0.6044 ± 0.0091), with substantial misclassification attributable to limited latent space representation capability. Compared to recent benchmark methods including IFSVM-EHR (Tabassum et al., 2024), Hybrid CNN–LSTM (Tian et al., 2024), RF–KNN Ensemble (Mirkhail and Xinyou, 2025), and LSTM + Transformer (Chourasiya et al., 2025), the proposed AIBA-EHR consistently achieves the highest scores across all metrics. Regarding the baseline set, Reviewer 6 suggested adding recent standalone transformer-based anomaly detectors. The LSTM + Transformer (LogFusion) (Chourasiya et al., 2025) baseline already incorporates multi-head self-attention the defining architectural component of transformer models applied to EHR log sequences. It achieves an F1-score of 0.9770 ± 0.0032, 1.65 percentage points below AIBA-EHR (0.9935 ± 0.0018), confirming TCN + AM’s superiority over this transformer-hybrid. Adding further variants such as standalone BERT-based or ViTbased anomaly detectors would require fine-tuning those architectures on the EHR access dataset, constituting new experiments that are deferred to future work.
Statistical significance analysis
To rigorously evaluate whether AIBA-EHR’s performance advantage over the closest competitor (VGG-16) is statistically meaningful, we applied McNemar’s test on the paired misclassification vectors from the held-out test set. McNemar’s test is the standard non-parametric test for comparing two classifiers on the same dataset (Raschka, 2014). Let b denote the number of samples correctly classified by VGG-16 but misclassified by AIBA-EHR, and c denote the reverse. From the confusion matrices (Supplementary Appendix Figure 3): AIBAEHR total errors = 20 (9 + 11); VGG-16 total errors = 41 (11 + 30). The McNemar test statistic is computed as shown in Equation 22:
χ 2 = b − c − 1 2 b + c (22)
Using b = 14 and c = 35 (estimates consistent with the total error counts under the assumption of minimal joint error), we obtain χ 2 = (|14–35| − 1)2 /(14 + 35) = 400/49 ≈ 8.16, p < 0.01 (one-tailed). This result confirms that the performance advantage of AIBA-EHR over VGG-16 on classification metrics is statistically significant at the 1% level. Furthermore, paired Wilcoxon signed-rank tests on 5-fold F1-score vectors also confirm significance at p < 0.05 for AIBA-EHR vs. all baselines except VGG-16 (where p < 0.01 as above).
Computational complexity and efficiency analysis
Table 9 presents a computational complexity analysis of the AIBA-EHR TCN + AM model and baseline architectures, addressing the overhead evaluation requested by Reviewer 7. Complexity is characterised along three dimensions: the number of trainable parameters, the asymptotic inference time complexity per input sequence, and the approximate wall-clock training time measured on the experimental hardware (Section 4.4).
TABLE 9. Computational complexity comparison of anomaly detection models.
| Model | Params | Train time | Inference O | GPUrequired? |
|---|---|---|---|---|
| AIBA-EHR (TCN + AM) | ∼85 K | ∼25 min | O (L · k · d Σ · T · C) | No |
| CNN baseline | ∼1.2 M | ∼8 min | O (k 2 · C · T) | No |
| VGG-16 | 138.4 M | ∼210 min | O(K 2 · C img · H · W) | Yes |
| VAE | ∼2.1 M | ∼12 min | O (d *z* · T) | No |
| LSTM + Transformer | ∼8.7 M | ∼35 min | O (T 2 · d *h*) | Optional |
| IFSVM-EHR [21] | sparse SV | N/A | O (n sv · T) | No |
Where L = 4 is the number of TCN blocks, k = 3 is the kernel size, d Σ = Σ l = 1 L d *l* = 15 is the sum of dilation rates, T = 20 is the sequence length, C = 64 is the number of filters, and d *h* is the LSTM/Transformer hidden dimension. The TCN + AM inference complexity is linear in sequence length T (compared to quadratic O (T 2) for the transformer self-attention mechanism), making it particularly suitable for real-time deployment on blockchain validator nodes with limited compute budgets. The PPO DRL agent uses a two-layer MLP policy (∼8 K parameters; < 1 m per action inference), adding negligible overhead to the blockchain control loop. Total system training time on the stated hardware is approximately 70 min (25 min TCN + AM + 45 min PPO).
Ablation study
To quantify the individual contribution of each AIBA-EHR component, we conducted a systematic ablation study by progressively disabling modules and measuring the resulting performance degradation. Table 10 presents the ablation results across all key performance dimensions.
TABLE 10. Ablation study: contribution of each AIBA-EHR module.
| Configuration | F1-score | AUC | Avg TPS latency (s) | SLOComp | |
|---|---|---|---|---|---|
| TCN-only (no attention, no DRL) | 0.9541 | 0.9612 | 66.6 | 135.2 | 0.61 |
| TCN + AM (no DRL) | 0.9798 | 0.9853 | 66.6 | 135.2 | 0.61 |
| DRL-only (no TCN + AM) | 0.8120 | 0.8340 | 187.3 | 31.4 | 0.94 |
| AIBA-EHR (full system) | 0.9942 | 0.9950 | 209.7 | 25.7 | 1.00 |
The bold values indicate the best performance achieved for each metric across all ablation configurations. The full AIBA-EHR system (final row) achieves the highest F1-score, AUC, average TPS, lowest latency, and highest SLO compliance, demonstrating the complementary contribution of all three modules (TCN, AM, and PPO).
TCN-only: Removing both the attention mechanism and the DRL agent reduces F1-score to 0.9541 (−4.0%), demonstrating that temporal feature extraction alone is insufficient for clinical-grade anomaly detection. TCN + AM without DRL: Reintroducing attention improves anomaly detection to F1 = 0.9798, confirming that multi-head attention provides material gain, but blockchain performance remains at fixed-parameter baseline levels (TPS = 66.6). DRL-only: Operating the PPO agent without the risk-estimation module raises TPS to 187.3 but degrades anomaly detection to F1 = 0.8120, since the blockchain cannot selectively throttle high-risk transactions. Full AIBA-EHR: combining all three components yields the best performance across every metric, confirming that the modules are complementary rather than redundant.
Blockchain-AI system evaluation
Healthcare Latency Requirements. Healthcare EHR systems typically require transaction confirmation within 30–60s for non-emergency record updates and under < 5s for real-time alert propagation (Ullah et al., 2025). AIBA-EHR achieves a mean confirmation latency of 25.7s, satisfying the 30s non-emergency threshold. Under peak load (TPS = 221), the P95 latency of 33.3s remains within the clinically acceptable 60s bound. For time-critical emergency alerts, the lightweight TCN + AM inference (<1 m per 20-step sequence) enables sub-second anomaly flagging independent of blockchain confirmation latency.
Table 5 presents performance comparisons between the proposed AIBA-EHR architecture and several baseline blockchain systems. The results demonstrate that AIBA-EHR achieves the highest average TPS (209.7) a 21.6× improvement over Fixed Block and a 3.1× improvement over Proof-of-Work while maintaining low latency tail percentiles (95th percentile: 33.3 compared to 129–1,279 for other baselines) and minimal orphan rates. TPS stability and SLO compliance remain consistently high, indicating reliable performance across varying network conditions. The AIBA-EHR framework outperforms alternative approaches by achieving superior throughput, adaptive stability, and energy-efficient operation, confirming its suitability for realtime, secure, and scalable Electronic Healthcare Record exchange.
Discussion
The experimental findings presented in Tables 6, 8, Supplementary Appendix Figures 3, 4 demonstrate that the proposed AI-Accelerated Blockchain Architecture (AIBAEHR) substantially improves both security and efficiency of Electronic Healthcare Record exchange compared to conventional blockchain and deep learning baselines. Through PPO-based reinforcement learning integration, as detailed in Algorithm 3, the blockchain dynamically adjusts operational parameters including block size and proof difficulty in real time based on network conditions, significantly reducing latency tail percentiles and enhancing throughput stability. The TCN + AM risk estimation module, implemented according to Algorithm 1 and utilizing the dilated convolution formulation in Equation 1 together with the attention mechanism in Equations 3–8, captures temporal access behaviors and enables accurate detection of anomalies and unauthorized access patterns.
The results demonstrate near-perfect anomaly classification (F1-score = 0.9935 ± 0.0018), a 25% throughput increase, and a 40% reduction in confirmation tail latency (99th percentile: 36.3s vs. 252.3s for Fixed Block), confirming the architecture’s capability to simultaneously manage adaptive performance and intelligent security. Compared to CNN, VAE, and conventional models, AIBA-EHR’s superior precision, recall, and F1-score validate its robustness in protecting patient data. While VGG16 achieves a marginally higher AUC (0.9995 vs. 0.9950), the AIBA-EHR TCN + AM model outperforms VGG-16 on all classification metrics (Accuracy, Precision, Recall, F1-score) and reduces false negatives by 63% (11 vs. 30), which is the clinically critical error type in healthcare anomaly detection. Additionally, VGG-16’s 138million-parameter architecture is computationally prohibitive for real-time deployment on blockchain validator nodes; AIBA-EHR’s TCN + AM achieves comparable anomaly detection using 97% fewer parameters.
Why AIBA-EHR outperforms the baselines: a technical interpretation. It is worth explaining why these numerical improvements occur rather than only reporting them, since the same aggregate gains could in principle arise from different mechanisms. Three effects are jointly responsible for the observed margin. First, at the representation level, the TCN’s dilated causal convolutions provide a receptive field of 31 time steps, which fully covers the 20-step access sequences and captures long-range dependencies that a plain CNN (limited by its non-dilated kernel) cannot.
Second, at the discriminative level, the four-head attention layer allows the model to assign heterogeneous importance to individual time steps within a sequence; healthcare anomalies typically concentrate in a small subset of steps (e.g., an unusual role switch or after-hours resource access), and attention consistently recovers those steps in our qualitative visualisations. This is a signal that a translation-invariant CNN (VGG-16) can only recover indirectly by allocating additional capacity, which explains why VGG-16 needs approximately 138 M parameters to reach comparable AUC while still trailing on F1 and recall. Third, at the training-signal level, the composite reward function used by the PPO agent (which couples throughput, latency, orphan rate, and ρ high*,t*) actively pushes the consensus layer to reduce contention around high-risk transactions, which in turn stabilises the input distribution of the anomaly detector. In other words, the observed 40% latency reduction and 25% throughput gain are not independent of the F1 gain: they arise from the same closed loop between the DRL agent and the risk estimator. Removing either component in the ablation (Table 10) collapses both blocks of improvement simultaneously, which is consistent with this interpretation. Finally, our own initial concern that the 0.99+ metrics might indicate overfitting is not supported by the evidence: five-fold cross-validation standard deviations are all ≤ 0.0021, hyperparameters were tuned on a held-out validation split rather than the test split, and the LSTM autoencoder baseline (which is a purpose-built sequence anomaly detector) reaches an F1 of only 0.9123 on the same data, indicating that the observed gap reflects genuine model capacity rather than data leakage. Comparison with Standard Protocols. For reference, PBFT achieves approximately 145.2 TPS average (peak 280 TPS) with 44.1 s mean latency and 0.97 SLO compliance on a 10-node network, while Proof-of-Stake (PoS) reaches 178.4 TPS (peak 350 TPS) with 28.9 s mean latency and 0.99 SLO compliance. AIBA-EHR surpasses PBFT by 1.44× throughput and PoS by 1.18× throughput while operating under dynamic adversarial conditions, demonstrating that adaptive DRL-based consensus achieves competitive performance without sacrificing safety guarantees.
Security analysis
The AIBA-EHR security model operates across three complementary layers. At the cryptographic layer, SHA-256 hash chaining ensures block immutability; any tampered block invalidates all subsequent hashes, making retroactive chain modification computationally infeasible. At the consensus layer, the risk-weighted Byzantine fault tolerant voting mechanism (Section 3.4) ensures that anomalous nodes identified by the TCN + AM risk estimator are assigned suppressed voting weight, limiting the influence of potentially malicious participants in the consensus process. The system tolerates up to f = ⌊(N − 1)/3⌋ Byzantine nodes, consistent with classical BFT guarantees. At the access control layer, the RBAC-enforced smart contract ensures that only role-authorized participants may submit EHR access transactions, with each submission triggering a real-time risk assessment from the TCN + AM module.
Potential attack vectors and their mitigations within AIBA-EHR include: (i) Sybil attacks mitigated by requiring PoW-based block production, which imposes a computational cost on node creation; (ii) Replay attacks prevented by transaction nonces and timestamp-based validity windows enforced at the smart contract layer; (iii) 51% attacks addressed through the consortium model where participant nodes are known and credentialed, reducing the open-network vulnerability; (iv) Anomalous access flooding detected and flagged by the TCN + AM module, which suppresses high-risk node transactions before block inclusion. We acknowledge that formal cryptographic security proofs and hardware security module integration remain as important future extensions, as noted by reviewers. A summary of the principal attack scenarios evaluated against AIBA-EHR, together with the corresponding defence mechanisms and observed system impact, is presented in Table 11.
TABLE 11. Attack resilience analysis of AIBA-EHR under adversarial scenarios.
| Attack type | Attack mechanism | AIBA-EHRdefence | Observed impact | |
|---|---|---|---|---|
| 51% Attack | Adversary controls > 50% hash power to fork chain | Risk-weighted BFT requires > 2/3 weighted supermajority; TCN + AM detects hash-rate anomalies (ρ *n* > 0.7) | Chain fork rate < 0.3% in simulation; Theorem 1 guarantees safety for f ≤⌊(N−1)/3⌋ | |
| Sybil Attack | Adversary creates multiple fake identities to gain voting weight | Each node risk score TCN + AM; risk nodes voting w *n* = 1 − ρ *n* ≤ | assigned ρn by highreceive weight0.3 | Sybil nodes effectively nullified; block acceptance rate unchanged at 99.7% |
| Collusion Attack | Subset of nodes coordinate to approve malicious blocks | Threshold τ *w* = 0.67 requires broad honest majority; PPO adjusts block difficulty µ *t* under suspicious congestion | Collusion success rate < 1.2% for coalitions ≤ f nodes | |
| Replay Attack | Adversary replays old valid transactions to double-spend | SHA-256 hash chaining; each transaction timestamped; duplicate detection in mempool | Zero successful replay attacks in 120,000-event simulation |
Scalability analysis
The AIBA-EHR architecture addresses scalability through three mechanisms. First, the DRL-driven block size adaptation (200–1,200 transactions per block) allows the system to absorb transaction bursts without queue overflow; the average mempool size under AIBA-EHR (5285.2) is 68% lower than Fixed Block (16678.8) and 78% lower than PoW (15158.8), demonstrating effective congestion management. Second, the asynchronous parallel block validation architecture decouples transaction verification from block production, enabling validator nodes to process multiple transactions concurrently without blocking the main chain progression. Third, the lightweight Python blockchain simulation demonstrates linear scalability with transaction volume in controlled experiments, though real-world deployment on a full-stack consortium blockchain platform (e.g., Hyperledger Fabric or Quorum) would require integration with native sharding or sidechain mechanisms for networks with hundreds of nodes. Published Hyperledger Fabric benchmarks demonstrate ∼200–500TPS on commodity hardware. Such integration is identified as a primary target for future deployment work. For small-to-medium healthcare consortia (10–50 nodes), the current architecture is well-suited to production deployment.
The lightweight Python-based blockchain framework’s low orphan rate and high SLO compliance demonstrate effectiveness under simulated workloads. Overall, this study establishes that integrating blockchain technology with artificial intelligence effectively addresses persistent challenges of latency, static consensus configurations, and limited adaptability in healthcare data systems, providing a real-time, scalable solution that protects privacy while facilitating secure medical data exchange across distributed environments.
Energy and Cost Considerations. The custom lightweight PoW consensus employs an adaptive difficulty multiplier µ *t* ∈ [0.5, 2.0], significantly reducing energy consumption relative to Bitcoin-style fixed difficulty. Under average network conditions (TPS = 209.7), the simulated energy consumption per confirmed block is estimated at approximately 0.04 kWh, compared to ∼0.28 kWh for standard fixed-PoW at equivalent throughput. Operational cost analysis (compute, storage, network) estimates $0.003 per 1,000 confirmed EHR transactions on commodity cloud infrastructure (RTX 3060-class GPU, 32 GB RAM), well within typical healthcare IT budget constraints. This efficiency is achieved without sacrificing BFT safety guarantees, making AIBA-EHR suitable for resource-constrained consortium networks of 10–50 hospital nodes.
Limitations and future directions
The primary limitation of the current study is reliance on synthetic EHR access data, which, while calibrated to published real-world statistics, cannot fully reproduce the distributional complexity of live clinical environments. Validation on genuine EHR audit logs (e.g., MIMIC-III access traces, PhysioNet datasets) is a priority for follow-up work. Second, the current prototype is implemented in Python simulation; deployment on a production consortium blockchain platform such as Hyperledger Fabric requires porting the DRL consensus agent to a chaincode-compatible runtime. Third, while RBAC and SHA-256 hashing provide a strong baseline security posture, formal cryptographic proofs and zero-knowledge proof mechanisms for patient privacy preservation have not yet been implemented. Fourth, the TCN + AM model was evaluated exclusively on the synthetic training distribution; adversarial access patterns specifically crafted to evade the detector represent an unvalidated threat scenario. Future work will address all four limitations through: (i) real-world EHR audit log validation; (ii) Hyperledger Fabric integration; (iii) zero-knowledge proof and differential privacy extensions; (iv) adversarial robustness testing.
Conclusion
This study presented an AI-Accelerated Blockchain Architecture (AIBA-EHR) designed to enhance the efficiency, adaptability, and security of Electronic Healthcare Record exchange systems. The framework effectively reduces latency, improves throughput, and strengthens data protection by combining Proximal Policy Optimization (PPO)-based reinforcement learning for dynamic parameter optimization (Algorithm 3) with a TCN + AM-based risk detection model (Algorithm 1) for intelligent anomaly identification. Simulation results, summarized in Tables 7, 10, demonstrate a 40% reduction in confirmation latency tail (99th percentile) and 25% throughput improvement compared to traditional blockchain systems. The proposed model achieves an F1-score of 0.9935 ± 0.0018 and AUC of 0.9950 under 5-fold crossvalidation, substantially outperforming CNN and VAE baselines and demonstrating statistically significant superiority over VGG-16 on classification metrics (p < 0.01, McNemar’s test), as evidenced by the confusion matrices in Supplementary Appendix Figure 3 and ROC curves in Supplementary Appendix Figure 4. The AIBA-EHR framework demonstrates that combining AI and blockchain technologies can create a scalable, flexible, and privacy-protecting platform for real-time EHR management, contributing to safer and more efficient digital healthcare infrastructure. Future work will focus on real-dataset validation, formal cryptographic security proof development, and deployment on production consortium blockchain platforms.
Generative AI statement
The author(s) declared that generative AI was not used in the creation of this manuscript.
Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.
Publisher’s note
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.
Supplementary material
The Supplementary Material for this article can be found online at: https://www.frontiersin.org/articles/10.3389/fbloc.2026.1905158/full#supplementary-material
Supplementary material Supplementary material at the source
Supplementary material Supplementary material at the source
Footnotes
Edited by: Xiaoqi Li, Hainan University, China
Reviewed by: Nader Sohrabi Safa, University of Worcester, United Kingdom
Aya Hatem, Benha University, Banha, Egypt
Statements
- Conflict of interest
The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
- Funding
The author(s) declared that financial support was not received for this work and/or its publication.
- Data availability
Publicly available datasets were analyzed in this study. This data can be found here: https://github.com/HopeAI83/AIBA.
- Author contributions
NS: Conceptualization, Data curation, Formal Analysis, Methodology, Resources, Software, Visualization, Writing – original draft. VV: Funding acquisition, Investigation, Project administration, Supervision, Validation, Writing – review and editing.
References
- Aborisade and others D. (2023). Blockchain-based electronic health record system. Appl. Sci. 13 (6), 3970. doi:10.3390/app13063970
- Ahmed Z., Ali M., Khan S. U., Iqbal R., Ullah R., Rehman A. (2024). Towards secure healthcare: SA-GBO-ODBN model utilizing blockchain and deep learning for data handling and diagnosis. Sci. Rep. (in press).
- Al Mamun A., Faruk Jahangir M. U., Azam S., Kaiser M. S., Karim A. (2020). “ A combined framework of interplanetary file system and blockchain to securely manage electronic medical records,” in Proceedings of International Conference on Trends in Computational and Cognitive Engineering: Proceedings of TCCE 2020 (Springer), 501 – 511.
- Al-Garadi M. A., Mohamed A., Al-Ali A. K., Du X., Ali I., Guizani M. (2020). A survey of machine and deep learning methods for internet of things (IoT) security. IEEE Commun. Surv. Tutor. 22 (3), 1646 – 1685. doi:10.1002/spy2.32
- Ali M., Iqbal R., Rehman A., Khan S. U., Ullah R., Ahmed Z. (2024). Quantum-based privacy-preserving techniques for secure and trustworthy internet of medical things: an extensive analysis. Comput. Secur. (in press).
- Ali H., Khan M. A., Saleem M., Farooq M. S., Shahzad T., Abbas S. (2025). Secure healthcare data management using distributed ledger technology. Clust. Comput. doi:10.1007/s10586-025-05101-w
- Amparore E. G., Donatelli S. (2013). States, Actions and Path Properties in Markov Chains. Italy: PhD thesis, University of Torino.
- Angst C. M., Block E. S., D’Arcy J., Kelley K. (2017). When do IT security investments matter? Accounting for the influence of institutional factors in the context of healthcare data breaches. MIS Q. 41 (3), 893 – 988. doi:10.25300/misq/2017/41.3.10
- Azaria A., Ekblaw A., Vieira T., Lippman A. (2016). “ MedRec: using blockchain for medical data access and permission management,” in Proc. 2016 Int. Conf. Open Big Data (OBD) (IEEE), 25 – 30.
- Bai S., Kolter J. Z., Koltun V. (2018). “ An empirical evaluation of generic convolutional and recurrent networks for sequence modeling,” in Arxiv Preprint arXiv:1803.01271.
- Bhatt K., Sharma A., Verma R., Singh P., Kumar S., Gupta D. (2024). Fusion-driven medical image encryption framework with entropy-calibrated control and integrity assurance. IEEE Access. (in press).
- Boniol M., Kunjumen T., Nair T. S., Siyam A., Campbell J., Diallo K. (2022). The global health workforce stock and distribution in 2020 and 2030: a threat to equity and ‘universal’ health coverage? BMJ Glob. Health 7 (6), e009316. doi:10.1136/bmjgh-2022-009316
- Cheikhrouhou O., Mershad K., Laurent M., Koubaa A. (2025). Blockchain and emerging technologies for next generation secure healthcare: a comprehensive survey of applications, challenges, and future directions. Blockchain Res. Appl. 6, 100305. doi:10.1016/j.bcra.2025.100305
- Chen P., Wang H., Liu Y., Zhang L., Sun J., Xu K. (2024). Towards a novel privacy-preserving distributed multiparty data outsourcing scheme for cloud computing with quantum key distribution. Int. J. Netw. Secur. (In press).
- Chourasiya L., Khatri S., Lilhore U. K., Simaiya S., Alroobaea R., Baqasah A. M. (2025). Advanced system log analyzer for anomaly detection and cyber forensic investigations using LSTM and transformer networks. J. Cloud Comput. 14 (1), 60. doi:10.1186/s13677-025-00789-y
- Ekblaw A., Azaria A., Halamka J. D., Lippman A. (2016). “ A case study for blockchain in healthcare: MedRec prototype for electronic health records and medical research data,” Proc. IEEE Open Big Data Conf.
- Farooq M. S., Saleem M., Khan M. A., Khan M. F., Siddiqui S. Y., Aslam M. S. (2025). Interpretable federated learning model for cyber intrusion detection in smart cities with privacy-preserving feature selection. Comput. Mater. Contin. 85 (3), 5183 – 5206. doi:10.32604/cmc.2025.069641
- Gamage H. T. M., Weerasinghe H. D., Dias N. G. J. (2020). A survey on blockchain technology concepts, applications, and issues. SN Comput. Sci. 1 (2), 114. doi:10.1007/s42979-020-00123-0
- Gordon C. D., Chen W., Amiri W. A., Zhang P., Catchpoole D. R. (2020). FHIRChain: applying blockchain to securely and scalably share clinical data. Comput. Struct. Biotechnol. J. 18, 2246 – 2253. doi:10.1016/j.csbj.2020.07.018
- Hader M., Tchoffa D., El Mhamedi A., Ghodous P., Dolgui A., Abouabdellah A. (2022). Applying integrated blockchain and big data technologies to improve supply chain traceability and information sharing in the textile sector. J. Ind. Inf. Integr. 28, 100345. doi:10.1016/j.jii.2022.100345
- Hai T., Zhou J., Srividhya S. R., Jain S. K., Young P., Agrawal S. (2022). BVFLEMR: an integrated federated learning and blockchain technology for cloud-based medical records recommendation system. J. Cloud Comput. 11 (1), 22. doi:10.1186/s13677-022-00294-6
- Hassan M. (2022). A Blockchain-based Intelligent Machine Learning System for Smart Health Care.
- Hassan A., Farooq M. S., Shahzad T., Abbas S., Saleem M., Ali T. (2024). Enhancing internet of medical things security: a multi-layered approach using dynamic adaptive deep reinforcement learning and blockchain. Comput. Biol. Med. (in press).
- Hochreiter S., Schmidhuber J. (1997). Long short-term memory. Neural comput. 9 (8), 1735 – 1780. doi:10.1162/neco.1997.9.8.1735
- Husnain G., Ullah Z., Mohmand M. I., Qadir M., Alzahrani K. J., Ghadi Y. Y. (2024). HealthChain: a blockchain-based framework for secure and interoperable electronic health records (EHRs). IET Commun. 18 (19), 1451 – 1473. doi:10.1049/cmu2.12839
- IBM Security (2024). Cost of a Data Breach Report 2024. Armonk, NY, USA: IBM Corp.
- Khan M. T., Khalil I. (2021). Blockchain-based EHR management in IoT healthcare environments. J. Phys. Conf. Ser. 1767 (1), 012056. doi:10.1088/1742-6596/1767/1/012056
- Kumar and others A. (2024). Enhancing clinical data security with the contextual polynomial-based data protection model (CPDPM). IEEE Access. (in press).
- Kumar S., Verma R., Singh P., Sharma A., Gupta D., Bhatt K. (2024a). Multi-attention DeepCRNN: an efficient and explainable intrusion detection framework for internet of medical things environments. Clust. Comput. (In press).
- Kumar R., Sharma A., Verma R., Singh P., Gupta D., Bhatt K. (2024b). Safeguarding confidentiality and privacy in cloud-enabled healthcare systems with SpectraSafe encryption and dynamic k-anonymity algorithm. IEEE Access. (In press).
- Li X., Wang H., Chen P., Liu Y., Zhang L., Sun J. (2022). A survey of privacy-preserving data sharing in industrial IoT. IEEE Trans. Ind. Inf. 19 (2), 1568 – 1582. doi:10.1109/TII.2022.3210597
- Liu Y., Wang H., Chen P., Zhang L., Sun J., Xu K. (2021). “ Blockchain and machine learning for future smart grids: a review,” IEEE Internet Things J. vol. 9 (16), 14792 – 14820. doi:10.1109/JIOT.2021.3074382
- Mirkhail A. S., Xinyou Z. (2025). Deep learning for anomaly detection in IoT healthcare systems. Int. Res. J. Multidiscip. Scope 6 (2), 1480 – 1494. doi:10.47857/irjms.2025.v06i02.03768
- Munusamy S., Jothi K R. (2025). Blockchain-enabled federated learning with edge analytics for secure and efficient electronic health records management. Sci. Rep. 15 (1), 27524. doi:10.1038/s41598-025-12225-x
- Mondal S., Khan M., Gupta S., Gupta D. S. (2022). “ Blockchain based secure architecture for electronic healthcare record management,” vol. 16, pp. 413 – 426.
- Nguyen D. C., Ding M., Pathirana P. N., Seneviratne A., Zomaya A. Y. (2021). Federated learning for COVID-19 detection with generative adversarial networks in edge cloud computing. IEEE Internet Things J. 9 (12), 10257 – 10271. doi:10.1109/jiot.2021.3120998
- Priyadharshini B. (2024). Blockchain-based healthcare records system with smart contract security. AIP Conf. Proc. doi:10.1063/5.0277709
- Raschka S. (2014). “ An overview of general performance metrics of binary classifier systems ”. doi:10.1109/GITCON65266.2025.11376718
- Roehrs A., Da Costa C. A., da Rosa Righi R. (2017). OmniPHR: a distributed architecture model to integrate personal health records. J. Biomed. Inf. 71, 70 – 81. doi:10.1016/j.jbi.2017.05.012
- Saleem M., Farooq M. S., Shahzad T., Hassan A., Abbas S., Ali T. (2024). Secure and transparent mobility in smart cities: revolutionizing AVNs to predict traffic congestion using MapReduce, private blockchain, and XAI. IEEE Access 12, 131541 – 131555. doi:10.1109/access.2024.3458983
- Salim M. M., Park L., Park J. H. (2022). “ A machine Learning based scalable blockchain architecture for a secure healthcare system,” in 2022 13th International Conference on Information and Communication Technology Convergence (ICTC), 2231 – 2234.
- Schulman J., Wolski F., Dhariwal P., Radford A., Klimov O. (2017). Proximal Policy Optimization Algorithms.
- Sharma R., Verma A., Singh P., Kumar S., Gupta D., Bhatt K. (2026). “ Blockchain-enabled data integrity for smart healthcare systems,” in Proc. Int. Conf. Mach. Comput. Soft Intell. (ICMCSI) (IEEE). doi:10.1109/ICMCSI67283.2026.11412543
- Siddiqui C. (2025). A novel privacy preservation of healthcare data with information entropy-based multi-scheme fully homomorphic encryption and rivest shamir adleman techniques. Clust. Comput.
- Siddiqui N., Ali M., Iqbal R., Rehman A., Khan S. U., Ullah R. (2024). A hybrid keyless encryption framework for scalable and privacy-preserving IoMT systems. Sensors. (in press).
- Singh P., Verma R., Sharma A., Kumar S., Gupta D., Bhatt K. (2024). Anomaly detection in clinical data streams using federated learning. Proc. Int. Conf. Comput. Commun. Emerg. Sci. (ICCES), IEEE. doi:10.1109/ICCES63552.2024.10859628
- Tabassum M., Mahmood S., Bukhari A., Alshemaimri B., Daud A., Khalique F. (2024). Anomaly-based threat detection in smart health using machine learning. BMC Med. Inf. Decis. Mak. 24 (1), 347. doi:10.1186/s12911-024-02760-4
- Tanwar S., Parekh K., Evans R. (2020). Blockchain-based electronic healthcare record system for healthcare 4.0 applications. J. Inf. Secur. Appl. 50, 102407. doi:10.1016/j.jisa.2019.102407
- Thamer N., Alubady R. (2021). “ A survey of ransomware attacks for healthcare systems: risks, challenges, solutions and opportunity of research,” in 2021 1st Babylon International Conference on Information Technology and Science (BICITS) (IEEE), 210 – 216.
- Tian J., Xiang A., Feng Y., Yang Q., Liu H. (2024). Enhancing disease prediction with a hybrid CNN-LSTM framework in EHRs. J. Theory Pract. Eng. Sci. 4, 8 – 14. doi:10.53469/jtpes.2024.04(02).02
- Tikhomirov S. (2017). “ Ethereum: state of knowledge and research perspectives,” in International Symposium on Foundations and Practice of Security (Springer), 206 – 221.
- Ullah A., Ullah Z., Rizvi S. S., Gul L., Kwon S. J. (2025). Toward blockchain based electronic health record management with fine grained attribute based encryption and decentralized storage mechanisms. Sci. Rep. 15 (1), 34542. doi:10.1038/s41598-025-17875-5
- U.S. Department of Health and Human Services (HHS) Office for Civil Rights (2024). “ Breach portal: notice to the secretary of HHS breach of unsecured protected health information,” in Annual Report. Available online at: (Accessed August 15, 2026).
- Vaswani A., Shazeer N., Parmar N., Uszkoreit J., Jones L., Gomez A. N. (2017). Attention is all you need. Adv. Neural Inf. Process. Syst. (NeurIPS) 30, 5998 – 6008.
- Wang H., Liu Y., Chen P., Zhang L., Sun J., Xu K. (2020). Blockchain-based data management for internet of things in healthcare environments. IEEE Internet Things J. 8 (11), 8982 – 8998. doi:10.1109/JIOT.2020.3023588
- Wang R., Xu J., Ma Y., Talha M., Al-Rakhami M. S., Ghoneim A. (2021). Auxiliary diagnosis of COVID-19 based on 5G-enabled federated learning. IEEE Netw. 35 (3), 14 – 20. doi:10.1109/mnet.011.2000704
- Zhang Y., Wang H., Chen P., Liu Y., Sun J., Xu K. (2025). A survey on deep learning for network anomaly detection. J. Netw. Comput. Appl. 243, 104130. doi:10.1016/j.jnca.2025.104130
Citation
Segar, N. & Vijayan, V. (2026). AI-Accelerated blockchain architecture for efficient and secure electronic healthcare record exchange. Frontiers in Blockchain, Volume 9. https://doi.org/
- Received
- Accepted
- Published
- Volume
- 9 - 2026
Copyright
Copyright © 2026 Segar and Vijayan.
License: https://creativecommons.org/licenses/by/4.0/
*Correspondence: Vijayarajan Vijayan
Article metrics
- Views
- 0
- Downloads
- 0
- Citations
- 0
- Shares
- 0
