Secured framework for IoT based healthcare application Authors: Vidhya Nagavel, P. T. V. Bhuvaneswari, Parameswaran Ramesh, K. Tamaraiselvi Published: 2026 ABSTRACT The Internet of Things (IoT) allows continuous health monitoring through the interconnection of wearable and medical devices with computing and storage infrastructures. As cyber threats grow and the sensitivity of healthcare information increases, data integrity, privacy, and access control become critical concerns in digital healthcare environments. This paper proposes a secure IoT-based healthcare framework that integrates machine learning and blockchain techniques for data protection and intelligent health risk assessment.The proposed framework uses cryptographic hashing, Merkle tree construction, digital signatures, and a threshold-based blockchain validation mechanism to enhance the integrity and secure handling of healthcare data in a permissioned simulation environment. The blockchain validation mechanism is evaluated through simulated tampering, replay, and high-load scenarios to assess the integrity verification capability of the proposed framework.Various machine learning models are trained and evaluated on medical datasets to predict disease risk, and their performance is measured using accuracy, precision, recall, and F1-score metrics. The framework is implemented in Python and deployed in a scalable cloud-based environment. Experimental results demonstrate that the proposed framework improves healthcare data integrity verification and supports reliable predictive performance for secure digital healthcare applications. Introduction The Internet of Things (IoT)1 refers to the network of physical objects embedded with electronics, enabling them to communicate and interact with each other and their environment. This technology is expected to bring transformative changes in the coming years by offering advanced services across various domains. IoT is driving innovations in fields such as healthcare, power management, and gene therapies. It is also revolutionizing agriculture by improving efficiency and sustainability. Smart cities and homes are becoming increasingly reliant on IoT for automation and connectivity2. The integration of IoT in these areas is enhancing functionality and improving quality of life. Advancements in IoT technology are reshaping industries and driving progress. Its applications are transforming traditional systems into intelligent and adaptive networks. IoT continues to expand its role in shaping a smarter and more interconnected world. IoT security3,4 in healthcare is the process of protecting the confidentiality, integrity, and availability of healthcare information collected and transmitted between IoT devices. Healthcare systems are increasingly targeted by cyberattacks due to vulnerabilities that can be exploited to compromise sensitive data, create fraudulent identities, or manipulate IoT devices. These actions can lead to significant disruptions and harmful outcomes. Despite the critical nature of healthcare data, the industry often under invests in cyber security, focusing primarily on patient care. This limited emphasis on security increases exposure to threats such as ransomware, data breaches, and denial-of-service (DoS) attacks.By addressing these vulnerabilities, healthcare organizations5 can safeguard data, protect systems from threats, and ensure the reliability of critical services. Ensuring the security of digital healthcare systems is essential to protect sensitive data from cyber-attacks6. The healthcare sector faces significant threats, including ransomware, tampering, phishing, data breaches, and DoS attacks. These attacks not only compromise patient information but also disrupt critical healthcare services7. To address these challenges, cryptographic techniques, blockchain-based data validation, and machine learning models are integrated into IoT-enabled systems. Cryptography ensures data confidentiality and integrity, while machine learning enhances threat detection and response capabilities8. This combination strengthens the security of the framework, making healthcare systems more resilient to evolving cyber threats11. By advancing the efficiency of communication within IoT-enabled systems, the risk of unauthorized access is minimized. The focus is on safeguarding patient data and maintaining the reliability of healthcare operations. A secure framework is developed to address the challenges and limitations of traditional healthcare systems. Advanced cryptographic techniques are incorporated to protect sensitive healthcare data and prevent unauthorized access. Machine learning models are used to detect and mitigate potential security threats within the framework. This integration enhances the scalability, efficiency, and adaptability of the framework. It aims to provide a dynamic and resilient solution that can address emerging cyber security challenges. It ensures secure data storage and transmission, maintaining the integrity of healthcare information. The framework strengthens the overall security of digital healthcare systems. By combining cryptography and machine learning, it offers comprehensive protection for patient data. It is designed to optimize performance and improve the safety and privacy of healthcare data14,15. The healthcare dataset was organized into distinct age groups for both male and female patients, ensuring comprehensive categorization for analysis. The data was then structured into multiple blocks, each containing relevant metadata and a series of transactions. To maintain data integrity, healthcare records are organized into blocks and linked through cryptographic hash chaining and a threshold-based validator verification mechanism. This structure forms a blockchain-inspired secure data validation framework for healthcare records, which was processed in a Jupyter Notebook environment and subsequently transferred to the cloud in a standard format for further analysis. To test the security of the blockchain, cyberattacks were simulated within the blocks, assessing the frameworks resilience against various threats. The data was transferred to the cloud after that retrieval and encoding processes were performed, followed by the application of machine learning models. These models were utilized to analyze the healthcare data, evaluating their ability to make predictions. This process ensured the robustness of the system, with a focus on maintaining the integrity and privacy of sensitive healthcare data throughout the analysis. Contributions of the Work: The proposed work develops a permissioned IoT-based healthcare architecture that ensures security features using cryptographic hashing, Merkle tree construction, digital signatures, and threshold-based block validation.The research proposes a systematic methodology for the validation of blockchain by artificially inducing tampering, replay and high-load attacks to evaluate the integrity of block chain against various attacks.The blockchain-validated healthcare data is used for disease risk prediction through a tightly coupled blockchain–machine learning pipeline.Extensive experiments with various machine learning models are performed, analyzing the security performance and prediction accuracy using standard metrics. The proposed work develops a permissioned IoT-based healthcare architecture that ensures security features using cryptographic hashing, Merkle tree construction, digital signatures, and threshold-based block validation. The proposed work develops a permissioned IoT-based healthcare architecture that ensures security features using cryptographic hashing, Merkle tree construction, digital signatures, and threshold-based block validation. The research proposes a systematic methodology for the validation of blockchain by artificially inducing tampering, replay and high-load attacks to evaluate the integrity of block chain against various attacks. The research proposes a systematic methodology for the validation of blockchain by artificially inducing tampering, replay and high-load attacks to evaluate the integrity of block chain against various attacks. The blockchain-validated healthcare data is used for disease risk prediction through a tightly coupled blockchain–machine learning pipeline. The blockchain-validated healthcare data is used for disease risk prediction through a tightly coupled blockchain–machine learning pipeline. Extensive experiments with various machine learning models are performed, analyzing the security performance and prediction accuracy using standard metrics. Extensive experiments with various machine learning models are performed, analyzing the security performance and prediction accuracy using standard metrics. The rest of the paper is organized as follows: The literature survey provides a detailed review of previous work, highlighting the advancements in blockchain technology and machine learning. The proposed methodology involves creating a secure blockchain-based validation framework by organizing healthcare data into blocks and integrating the validated data with machine learning models.The results and discussion demonstrate the framework’s robustness against cyber threats and its high efficiency in data analysis. The study concludes by highlighting its potential as a scalable solution for enhancing security and analytical capabilities in healthcare systems. Literature survey Internet of Things (IoT) technologies have become integrated into healthcare systems, thus providing a chance to continuously monitor patients, diagnose them remotely, and obtain data in real time, which has greatly enhanced healthcare service delivery. Nevertheless, the challenge posed by the sensitive nature of medical data creates severe issues concerning the security, privacy protection, access control and trust management. In a bid to overcome these barriers, some of the strategies have been investigated by the researchers cryptographic methods, blockchain technology, fog and cloud computing, as well as smart analytics to develop safe healthcare systems. Wazid et al.3 suggested an AI-based secure communication solution to a fog computing-based healthcare setup, prioritizing minimal-weight cryptography operations and efficiency. The scheme shows a lower overhead of computation and communication and has a higher degree of security; still, it is more focused on the transmission of secure data than an immutable data storage or validation based on blockchains. A blockchain-based key management scheme of fog-enabled IoT systems proposed by Chen et al.4 with decentralized conditional broadcast encryption to support the secure group communication and authentication was introduced. Although the methodology guarantees confidentiality, anonymity, and the administration of key, it is more concerned with the cryptographic key delivery instead of end-to-end validation of healthcare data. Electronic health record (EHR) sharing and access control based on blockchain has received extensive research. Wang et al.5 suggested an individualized and verifiable EHR-sharing structure with blockchain and ciphertext-policy attribute-based encryption, backed by smart contracts and IPFS to minimize the storage load. In6, Khan et al. introduced a blockchain-based IoT architecture in healthcare industry that incorporates encryption and lightweight blockchain to enhance data security and resource usage. Despite the fact that these methods enhance the integrity and privacy of data, their consideration of the blockchain resilience in realistic terms of attack conditions is scarce.Fog assisted and cloud assisted blockchain healthcare system have also been considered to tackle the issue of scalability and latency. Li et al.7 suggested a framework of access control with the help of blockchain and the use of multi-authority attribute-based encryption, where the fog nodes contain operations that demand high computation, so the burden of using the IoT devices does not dominate. Dewangan et al.8 proposed an IoMT architecture that is GDPR compliant and stores healthcare data on a blockchain and assesses the robustness against the chosen communication attacks. These models enhance privacy and scalability but primarily pay attention to protocol security, and not systematic blockchain validation. A number of studies have covered the topic of how to securely share data and conduct a searchable encryption in the IoT healthcare setting. Gupta et al.9 and Oh et al.10 suggested fog-based searchable encryption models that can largely save computational and storage costs of resource-limited gadgets. These solutions do not include blockchain-based integrity verification or analysis of attack-resilience, which can enhance efficiency, though. The recent studies have integrated blockchain with machine learning and artificial intelligence to healthcare security and analytics. Alzubi et al.12 suggested a federated learning architecture with blockchain to improve the privacy protection in electronic health records whereas Wazid et al.13 suggested a blockchain security system to reduce the ransom attacks in smart healthcare systems. These researches indicate the possibilities of combining blockchain and smart analytics, but machine learning is frequently used separately following data search, and the direct blockchain validation in the form of attack simulations is not thoroughly studied. In16, the authors provided a telehealth framework, which is a blockchain-based framework known as Block Heal, which consolidates the most crucial healthcare services into a single and trusted platform. This is done by first examining the current telehealth systems with an aim of identifying the important constraints that have influenced their usage. The proposed framework will eliminate these drawbacks by engaging all stakeholders in the healthcare ecosystem and guarantee secure, transparent, and timely provision of services. The system is based on blockchain technology, which offers fault tolerance, immutability of data and transparency, and decentralized storage with Hyperledger Fabric and distributed applications increases reliability. The use cases of the framework are proven by several applications. The paper17 presented a blockchain system to authenticate the IoT healthcare devices with particular emphasis on remote patient monitoring to manage chronic diseases. The frame focuses on the security, scalability, and processing efficiency through integrating data encryption with a re-encryption proxy system of controlled data access. To enhance scalability, healthcare data are off-chained in the Interplanetary File System (IPFS), and an Ethereumblockchain is based on a Proof-of-Authority (PoA) consensus mechanism to speed up the data storage process. The findings of the experiment show that healthcare data security is significantly enhanced in comparison to solutions available at the moment. The authors introduced in18 a key agreement protocol based on blockchain to implement an efficient privacy and secure communication in cloud-based medical network systems. The protocol was tested based on both formal and informal security analysis, and verification was done with the help of AVISPA tool to review the resistance to man in the middle and replay attacks. The findings show that the protocol is able to provide secure and efficient communication with low computational overhead. The solution can provide a strong and lightweight key-management solution to ensure cloud-enabled healthcare settings by taking advantage of the trust and data-security characteristics of blockchain. To allow the process of secure and efficient data sharing in the context of IoT in healthcare, a certificate less redactable signature scheme (RSS) was offered in19. The scheme also facilitates privacy-preserving redaction of data without compromising original signatures by removing the traditional methods of managing public keys, as well as eliminating any key escrow concerns. It contains a batch verification to minimize the computational cost and is proved by formal security analysis to be robust on standard cryptography assumptions, rendering it usable in resource-constrained IoT devices. In20, a security service architecture using blockchain and fog-computing was proposed to reduce the latency and security constraints that were associated with the cloud-based Industry 4.0 systems. The architecture devolves security services to fog nodes near the sources of data so as to minimize the communication delays and to remove single points of failure. The Hyperledger Fabric-based blockchain technology guarantees the ability to provide tamper-resistant authentication, validate transactions at the highest level of security, and privacy is preserved. Similarly21 developed architecture of data synchronization using a fog that improves privacy and minimizes latency in IoTs. The use of differential synchronization and of a ReedSolomon code allows it to offload the computation and storage tasks on the cloud onto the fog servers, which enhances data integrity, resilience to partial corruption, and local safe management of data. The current literature shows that advances in cryptography as a security measure of healthcare systems, blockchain-supported access control, and smart analytics are made. However, most existing works focus on single aspects such as secure communication, access control, or data sharing, while only a few studies evaluate blockchain-based data validation under different attack conditions together with machine learning-based healthcare risk forecasting. Although there is significant advancement in the preceding studies, there are still some pressing issues that are yet to be addressed. A lot of blockchain-based healthcare systems do not critically assess blockchain resilience in realistic adversarial conditions, such as tampering, replay, and high transaction load attacks. Additionally, the elements of machine learning are often applied without blockchain security measures, limiting the possibility to consider data integrity and predictive performance in unison. There also exist the problems of computational overhead, scalability, and compatibility with the real-world healthcare structures. These weaknesses underscore the necessity to have a singular healthcare system that incorporates secure blockchain validation, organized attack analysis, and machine learning-based healthcare analytics coordination. Proposed system model The system architecture proposes a five-layer IoT-based healthcare architecture incorporating blockchain and cloud intelligence to develop a secure, scalable intelligent and complex health data management in Fig. 1. Under this architecture, wearable and medical sensors constantly record real-time physiological data on patients and send it wirelessly to be additional processed. Data obtained is preprocessed and stored to eliminate noise, normalization of values, and organize the information in order to enable sound analysis.To protect privacy and build trust, blockchain is used to enhance the security of healthcare records through encryption, block creation, and threshold-based validation mechanisms to ensure data integrity and immutability. Fig. 1System Architecture of IoT based healthcare framework. System Architecture of IoT based healthcare framework. The data is then encrypted and saved in the cloud under the secured capability, where Machine Learning(ML) is implemented to help identify the health trends and reinforce in disease prediction and decision making. Lastly, the administrators or users entitled to access the system engage the system via the application layer, where approved data requests are translated and responses are safely decrypted and sent. In general, the architecture guarantees end-to-end security, privacy maintenance, effective data processing, and access control rendering it appropriate in the current IoT-enabled healthcare setting. The system diagram shows that the healthcare architecture of the IoT with Blockchain and cloud based ML intelligence integrated to provide safe data processing and access has five layers described below: Perception layer Perception layer is the basic layer in the proposed IoT-based healthcare structure22 and it is essential in real-time acquisition of health information of patients. It also covers a broad spectrum of wearable and medical sensing products, such as smartwatches, heart-rate monitors, eye sensors, skin sensors, blood pressure sensor, glucometer and smartphones that constantly measure key physiological parameters such as heart rate, blood glucose level, blood pressure, and skin condition among other vital signs. The sensed information is relayed wirelessly using IoT communication technologies to the higher levels to have additional processing and analysis, guaranteeing the timely, reliable, and non-invasive health monitoring23,24. As the main point of interaction between the patients and the healthcare system, the perception layer will facilitate quick disease detection, ongoing health evaluation, and proactive medical care provision, which will become an excellent foundation in the event of safe data processing, intelligent analysis, and efficient clinical decision-making in the proposed architecture. Data layer The data layer is charged with the responsibility of handling and organising the health care data sent to it by the perception layer to ensure secure storage and processing. The raw physiological data of different IoT sensors is retained in this layer as a collected healthcare dataset and is then subjected to necessary data preprocessingprocedures25. These initial processing actions involve data cleaning to eliminate noisy and missing data, categorical attributes encoding, normalization to make various sensor measurements related in similar ways, and the elimination of irrelevant or redundant data26. These processes turn the heterogeneous sensor data to a structured and trustworthy dataset, and then it is ready to be integrated to secure blockchain and analyzed later using the cloud-based machine learning. Permissioned blockchain security and validation layer This layer encrypts the preprocessed healthcare dataset27, organizes the records into blocks, and performs threshold-based validator verification before appending the validated block to the blockchainledger.All these functions ensure that healthcare records remain secure, tamper-resistant, and protected from unauthorized modifications28.This is followed by a block header that is generated by adding the previous block hash, the Merkle tree root, and a timestamp, thereby securely linking the new block with the existing blockchain29. Figure 2 shows the step-wise operation of the suggested blockchain security scheme. It starts by encrypting preprocessed healthcare data that is received by the IoT sensors in order to maintain confidentiality and privacy of the patient.The encrypted healthcare records are treated as transactions and grouped together to form a candidate block. These transactions are then formed into a Merkle tree and the corresponding Merkle root is then calculated to guarantee data integrity. Fig. 2Blockchain security layer flow diagram. Blockchain security layer flow diagram. Digitally signing the block ensures authenticity and non-repudiation, after which the candidate block is evaluated through a simulated validator verification process30,31. A threshold-based validator approval mechanism is applied, where a block is accepted when at least 75% of validator nodes approve the block after verification. After successful validator approval, the validated block is appended to the blockchain ledger maintained in the system. The proposed validation mechanism enhances the integrity verification and tamper detection capability of healthcare records within the simulated blockchain validation framework.In the simulation environment, validator nodes are modelled as logical validation agents responsible for verifying block hash consistency, Merkle root integrity, and digital signatures before participating in the threshold-based block approval process. Each validator node verifies the candidate block by performing hash recomputation, Merkle root validation, digital signature verification, and previous block hash consistency before participating in the threshold-based block approval process.The timestamp records the exact time of block creation, enabling chronological ordering of healthcare records and supporting traceability within the blockchainledger. The validator-based block verification algorithm used in the proposed blockchain security layer is shown in Fig. 3. A candidate block is sent to a group of validator nodes for verification when it is created. Each validator independently verifies the candidate block for integrity and authenticity.The validator checks the hash of the previous block to make certain the candidate block is linked to the existing blockchain correctly. Next, the Merkle root is checked to ensure all transactions in the block are valid. Then, the digital signature on the block is checked to ensure it is real and cannot be denied. Fig. 3Threshold-based block validation algorithm. Threshold-based block validation algorithm. After that, the validator recalculates the block hash and compares it to the stored hash value to make sure the block data has not changed.If all of the verification steps proceed perfectly, the validator votes approve. If not, the validator votes reject. Once all validators have finished checking the votes, the system uses a threshold-based approval rule to check the results. The block is valid and is added to the blockchain ledger if at least 75% of the validators agree with it. Otherwise, the block is rejected and not added to the chain.This validation system makes sure that blocks are complete, transactions are consistent, and tampering can be found in the simulated permissioned blockchain framework. Block creation Data management is one of the most important aspects of the study on predicting the risk of diabetes and requires the use of a block generation technique for optimal data security and data management efficiency. The records of the dataset are divided into blocks by age for each of the male and female patients. Each block can contain up to eight transactions, which means it can contain up to eight different patient records (rows) in the dataset. For the purposes of developing and testing the procedure, Table 1 describes the criteria and their respective meanings for the block header. The criteria for the block payload are listed in Table 2. Table 3 shows, by age, the number of blocks and transactions contained in each block that were created for male patients. Table 4 is a comparative analysis of female patients for the same age breakdown. Each block in a blockchain is comprised of multiple crucial components necessary for securing the credibility, authenticity, and consistency of the ledger and its connections. Each block contains a version number, specifying what protocol structure the block is constructed under, and the prior block hash, which cryptographically confirms this block’s position as the successor to the prior block, thus ensuring immutability and sequentiality. The Merkle root provides proof of inclusion for the transactions and is computed to represent all the processed and encrypted transactions in the block and is verified to prove the integrity of the included transactions. The time the block is created is recorded as a timestamp in the Unix epoch time format and is utilized for the purpose of record ordering32,33. The block possessor determines the participant who manages to produce or validate a block, and the associated public key of the block owner will serve to authenticate the block’s digital signature. The nonce serves as a measure to ensure uniqueness in the context of a given block, allowing hash collisions to be avoided by adding additional entropy to the hash computations of the block. The block payload for encrypted healthcare transactions secures the privacy of data both at rest and in transit. The current block hash provides the singular fingerprint of the block’s content and structure, while the block signature obtained through the block owner’s private key provides a non-repudiation, integrity, and authenticity assurance. Table 1Lists the notation and its significance used in block header.BlockheaderNotationSignificanceHPBPreviousBlockHashValueHCBCurrentBlockHashValueTSTimestampOBBlockOwnerXFSIPublicKeyOwner Table 1Lists the notation and its significance used in block header.BlockheaderNotationSignificanceHPBPreviousBlockHashValueHCBCurrentBlockHashValueTSTimestampOBBlockOwnerXFSIPublicKeyOwner Lists the notation and its significance used in block header. Table 2Lists the notation and its significance used in block payload.BlockpayloadNotationSignificanceEXFSI(Tx1)Encrypted Transaction1EXFSI(Tx2)Encrypted Transaction2EPubFSI(Txnt)Encrypted TransactionntSIGBLKiBlock Signature Table 2Lists the notation and its significance used in block payload.BlockpayloadNotationSignificanceEXFSI(Tx1)Encrypted Transaction1EXFSI(Tx2)Encrypted Transaction2EPubFSI(Txnt)Encrypted TransactionntSIGBLKiBlock Signature Lists the notation and its significance used in block payload. Table 3List the number of blocks created for male persons.AgegroupMalecountNo. of blocksNo.oftransactions per blockBELOW2011121–4093121-11blocks = 812th block = 541–60176228ABOVE605678 Table 3List the number of blocks created for male persons.AgegroupMalecountNo. of blocksNo.oftransactions per blockBELOW2011121–4093121-11blocks = 812th block = 541–60176228ABOVE605678 List the number of blocks created for male persons. 1-11blocks = 8 12th block = 5 Table 4List the number of blocks created for female persons.Age groupFemale countNo.ofBlocksNo.of transactionsperblockBELOW 2000021–406991-8blocks = 89th block = 541–6094121-11blocks = 812th block = 6ABOVE602438 Table 4List the number of blocks created for female persons.Age groupFemale countNo.ofBlocksNo.of transactionsperblockBELOW 2000021–406991-8blocks = 89th block = 541–6094121-11blocks = 812th block = 6ABOVE602438 List the number of blocks created for female persons. 1-8blocks = 8 9th block = 5 1-11blocks = 8 12th block = 6 Blockchain implementation A blockchain is formed through the development of a chain of connected blocks using cryptographic links34. Each block has a unique hash and is unique, depending on the contents in the icon, including transactions, MTR, TS, and cryptographic nonce. Moreover, each block stores the hash of the previous block (HPB), forming a cryptographic link between blocks.This dependence means that when any data in a block is changed, the hash of the block is then changed, and this invalidates all the following blocks.This design ensures immutability and data integrity, since any form of tampering is instantly noticed. The genesis block, the initial block in the chain, has a default or predefined value of the HPB. The block is connected to the chain by adding the hash of the previous block and thus the blocks are chained together. This design provides a secure, tamper-resistant, and strongly connected ledger suitable for permissioned healthcare environments, where block integrity is maintained through cryptographic hash chaining and controlled validation rather than open consensus mechanisms. The code that is applied in connecting blocks in the blockchain consists of two major sections are Block class and Block chain class.The Block class is responsible for initializing a block with essential attributes such as version, HPB, transactions, and SIGBLKi. The SIGBLKi acts as the block unique identifier or hash. The Blockchain class manages a list (chain) that stores the blocks in sequential order. A new block is added to the chain using the add block method, ensuring the blockchain continues to grow sequentially. It links each block by setting the HPB of the current block to the SIGBLKi in the chain, establishing the cryptographic linkage between blocks. In the code, blocks data represents a set of block attributes, such as OB, XFSI, TS and EPubFSI(Txnt). The message encryption using a random nonce (RNl) and timestamp(tl) can be formulated as:1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{Emessage}}={\mathrm{Encrypt}}({\mathrm{message}},{\mathrm{R}}{{\mathrm{N}}_{\mathrm{l}}},{{\mathrm{t}}_{\mathrm{l}}})$$\end{document} For each block, the code retrieves the respective data, creates a Block instance, and adds it to the blockchain. If the blockchain already contains blocks, the signature of the most recent block is used as the prior HCB, effectively linking the blocks in a secure, immutable sequence. This process ensures that the blockchain maintains its integrity and the cryptographic linkage between consecutive blocks. Retrieval and decoding of blockchain data Once the blockchain data is successfully stored in the cloud, it is connected to a cloud-based analytics environment to securely retrieve and process the data35.Blockchain information consisting of several validated blocks is retrieved out of the assigned cloud storage bucket. All blocks are sequentially processed in order to identify and recover encrypted transaction records. The ciphertext data is decrypted by means of authorized decryption tools in the secure cloud environment and organized into a readable format. The computer-generated coded healthcare data is then transformed into CSV format, which guarantees the interoperability and compatibility with the machine learning frameworks. Such organized transformation allows storing data effectively, analytically processing it, and making informed healthcare decisions, at the same time maintaining the privacy of data and access control. Blockchain validation In order to test the resilience and safety of the proposed blockchain system, several scenarios of cyberattacks were modeled under controlled conditions. The implementation and execution of the blockchain system were performed locally using Python and the cloud integration to provide storage capabilities36,37. The main goal of this validation phase was to identify possible vulnerabilities and evaluate the resilience of this blockchain to typical attack vectors within a healthcare setting. The attacks simulated were tampering attacks, Denial-of-Service (DoS) attacks38 and replay attacks. In the tampering attack case, the tampering was introduced by manually inserting unauthorized changes into a block and the attack was detected through a hash mismatch. In the DoS simulation, the system experienced a high number of transaction requests in order to test its performance under high load environment. In the replay attack simulation, transactions that were earlier confirmed were replayed in identical form in the replay attack simulation39. As the cryptographic hashes and the Merkle roots were not altered, the system did not include the replayed transactions due to duplicate verification mechanisms and false positives were avoided, which ensured that ledger consistency was preserved in the system. This research shows that the blockchain layer emphasizes checking the security and accuracy of healthcare records before using them for cloud-based analysis, instead of creating a complete decentralized application that uses smart contracts40. The attack simulations primarily evaluate the integrity verification capability of the blockchain validation layer rather than full network-level blockchain resilience. Cloud access layer The layer of cloud access enables scalable storage with controlled access to blockchain-validated healthcare data41,42. After encryption and validation at the blockchain security layer, a serialized copy of the validated blockchain record is stored in encrypted form in the cloud for secure storage and downstream analytics. By storing validated blockchain records in cloud storage, the scalability, availability and responsiveness of system performance is improved without affecting the tamper-resistance of blockchain. Cloud storage creates a redundant back up for data retrieval without affecting the blockchain integrity and confidentiality guarantees. Restricted access-control policies and encryption mechanisms ensure that only authorized entities can access stored healthcare data. A secure programmatic interface is used to access cloud object storage. The integration of the blockchain layer with the cloud platform uses this library. Secure authentication mechanisms are used to establish communication with the cloud storage system. Blockchain metadata includes block ID, version, timestamp, encrypted transactions, hash value, and digital signature.These are organized in some dictionaries and stored in a JSON object. Using an authenticated object-upload operation, the serialized block record is uploaded to a secured cloud storage bucket. The cloud access layer allows verified blockchain data to be securely retrieved and synced in the cloud. In addition, downstream machine learning analytics can be performed on integrity-verified datasets. Machine learning process The processing flow of our proposed system is implemented in two basic stages as shown in Fig. 4, Security processing based on blockchain and then machine learning analytics. In the first stage, blockchain-based validation is applied to incoming healthcare data, where only records that satisfy the predefined threshold-based validation criteria are accepted. These verified records are then securely retrieved from the cloud storage. The encrypted transaction payloads are subsequently decrypted and transformed into a structured tabular format, which serves as the input to the machine learning pipeline for further analysis and prediction43. Fig. 4Machine Learning Process. Machine Learning Process. The machine learning process is represented by second stage. First step of Data Preprocessing is dealing missing values, Normalizing numeric features, and Encoding categorical attributes44. After preprocessing, feature selection is performed to identify the most informative attributes before model training. The data is then split by train–test split and k-fold cross-validation is applied on it to enhance robustness and reproducibility. In the next phase, numerous machine learning models are trained and tested, with the objective of using the trained model for prediction analysis of diabetes risk45. Healthcare analytics utilizes standard evaluation metrics to assess their predictive performance for reliability and interpretation. Data preprocessing In the preprocessing stage, raw healthcare data from both datasets are transformed into a format suitable for machine learning. Missing values are handled using appropriate strategies such as removal or imputation depending on feature importance46. Categorical attributes (e.g., gender, symptoms, medication status) are encoded into numerical representations, while binary features are converted into 0/1 values. Numerical features are normalized using standard scaling to ensure uniform feature ranges and to improve the performance of distance and margin-based classifiers. Feature selection The essential features of patients are selected through a mutual information–based univariate filtering approach which reduces dimensionality47. This technique measures the statistical dependence of each feature with respect to the target variable by selecting that feature which contributes maximally to the risk of diabetes. Mutual information can be applied to non-linear relationships and mixed-type features48. The method is computationally efficient and scalable, thus suitable for small Early Stage Diabetes Risk Prediction dataset as well as the large Diabetes 130-US Hospitals database. Eliminating unnecessary or redundant features improves a generalization of the system ability. The model will be less subject to overfitting and will work similarly on either a large dataset or a small one. Train–test split and cross-validation The dataset is divided into training and testing subsets by performing train–test split after preprocessing and feature selection. Five-fold cross-validation is used on the training data to ensure robustness and reproducibility. This technique involves the equal partitioning of training set into five different folds whereby four folds are used for training and one fold is used for validation. The method reduces overfitting and yields a good estimate of the algorithm’s performance on small and large datasets. In order to facilitate smart healthcare analytics and reliable diabetes risk prediction, various machine learning models49 were implemented and evaluated. These models were selected to capture both linear and non-linear relationships present in healthcare data and to ensure robust classification performance across datasets of different scales. To improve generalization and reproducibility, a k-fold cross-validation strategy (k = 5) was employed on the training data, allowing each model to be evaluated across multiple data partitions and reducing the risk of overfitting, particularly for the smaller dataset.The adopted models entail: K-Nearest Neighbors (KNN): A distance-based, non-parametric classifier that assigns class labels based on the majority vote of the nearest neighbors. Logistic Regression: A statistical model used for binary classification that estimates outcome probabilities using a logistic function. Naive Bayes: A probabilistic classifier based on Bayes theorem, particularly effective for high-dimensional datasets. Support Vector Machine (SVM): A supervised learning model employing linear and RBF kernels to identify optimal hyperplanes for class separation. Decision Tree: A hierarchical model that splits data based on feature values to generate interpretable decision rules for classification. Random Forest: An ensemble learning approach that constructs multiple decision trees and aggregates their outputs to enhance accuracy and reduce overfitting. XGBoost: A gradient boosting-based ensemble model that sequentially improves performance by minimizing prediction errors. AdaBoost: An ensemble technique that iteratively adjusts the weights of misclassified instances to strengthen weak learners. Stacked Ensemble: A hybrid ensemble learning model that integrates Random Forest and XGBoost to enhance prediction performance.After applying the machine learning models, the system performs prediction on the processed data, where Dataset 1 is used for early-stage diabetes risk classification and Dataset 2 is used for diabetes outcome prediction, and the final labelled results are generated and stored for performance evaluation and clinical decision support. Application layer The layer through which an end user interacts with the proposed secured healthcare system is application layer. Healthcare professionals with authorization can safely access, validate and analyze patient data on the cloud. The layer provides a machine-learning-based interpretative presentation of prediction results such as diabetes risk outcome to help in the decision-making. Role-based access control mechanisms only allow the access of healthcare information only to permitted users. The application layer works only with verified integrity data and does not change any stored data. It can also help visualize, report, and alert to facilitate effective monitoring and smart healthcare analytics without compromising on data privacy and system reliability. Results Datasets description The first dataset used in this study is the Early Stage Diabetes Risk Prediction dataset obtained from the UCI Machine Learning Repository. It is a structured, symptom-based clinical dataset intended for early diabetes screening. The dataset contains 521 patient records with 17 attributes, including age, gender, and multiple binary indicators representing the presence or absence of diabetes-related symptoms such as polyuria, polydipsia, sudden weight loss, weakness, polyphagia, visual blurring, delayed healing, alopecia, and obesity. Each record corresponds to a single patient observation, and the class label indicates whether the patient is diabetic or non-diabetic. The dataset is clean, balanced, and clinically interpretable, making it suitable for controlled machine learning evaluation and blockchain-based data modeling. The second dataset used in this work is the Diabetes 130-US Hospitals dataset (1999–2008), also sourced from the UCI Machine Learning Repository. This dataset consists of 101,767 patient-related hospital encounter records collected from healthcare institutions across the United States. Each record represents patient demographic and health-related information associated with diabetes care and hospital admission. The dataset reflects real-world patient diversity and large-scale healthcare data characteristics. Its size enables evaluation of model robustness and performance consistency for diabetes classification under realistic patient data distributions. Data layer processing At the data layer, both datasets are handled as structured tabular data comprising numerical, categorical, and binary attributes. Each record represents a single instance corresponding to patient-level healthcare information. Prior to blockchain storage and machine learning analysis, initial preprocessing is performed to ensure data consistency and usability.Categorical attributes such as gender and clinical indicators are encoded into numerical form, while binary symptom features are mapped to 0/1 representations. Numerical attributes, including age and selected clinical measurements, are normalized to maintain uniform feature scales. Missing values present in the large-scale hospital dataset are handled using appropriate imputation or filtering strategies based on feature relevance.This preprocessing at the data layer ensures that healthcare records are standardized before being encrypted, grouped into transactions, and stored within blockchain blocks. The cleaned and structured data produced at this stage forms a reliable input for subsequent blockchain validation and machine learning processing, enabling accurate, secure, and scalable diabetes risk prediction. Block chain processing Simulation parameters The dataset used in the simulation were the Early Stage Diabetes Risk Prediction dataset and Diabetes 130-US Hospitals dataset that was retrieved on the UCI Machine Learning Repository. The dataset1 had 17 features and 520 instances and the target is indicated in the final column. The data was classified as four age groups, namely: below 20, 21–40, 41–60 as well as above 60 years. The number of transactions per blockchain block was set to eight and thus, the blockchain simulation had 66 blocks. Block version, previous block hash, Merkle tree root, timestamp, block owner identifier, nonce, encrypted transactions, current block hash, block signature and other important blockchain properties were included in each block. A threshold-based consensus validation system controlled block inclusion such that a block was permitted to be included when it received approval by at least 75% of the validator nodes, and this guaranteed both data integrity and the reliability to validate. All simulations were written in Python in the Google Colaboratory environment, a Jupyter Notebook platform on the cloud, wherein experiments can be reproducible and can run on increased scale. After the successful validation, the validated blockchain information was safely stored in the AWS S3 to be accessed and analyzed later. In the case of machine learning, to evaluate predictive performance, standard performance metrics, (accuracy, precision, recall, F1-score), were used to determine the performance of a machine learning model. The parameters of the simulation to create a block are depicted in Fig. 5. Fig. 5Simulation parameters involved in Block Creation. Simulation parameters involved in Block Creation. Simulation scenario The implementation of the blockchain simulation was performed in Python in the Google Colaboratory environment that offers a cloud-based Jupyter Notebook platform to perform reproducible and scalable experiments. A number of standard python libraries were used to facilitate blockchain transactions and cryptography functions, such as json, hashlib, datetime, and the elliptic curve cryptography (ECC) sub-module of the cryptography library, and data processing serialization libraries. Eight patient records of the dataset were picked as single transactions of each block. Creation of block was initiated by generation of an ECC secret key with the ec.generateprivatekey() method after which the public key was derived. The pub key was coded and represented in hexadecimal form to identify the owner of the public key with the block. The random.randint() was used to develop a random nonce to add entropy and uniqueness to each block. A Merkle tree was built by computing the hash of individual transactions and repeatedly joining pairs of hashs until a single Merkle root was produced to guarantee integrity of transactions. The entire block data together with the Merkle root and metadata were then serialised as a JSON and hashed with the hash algorithm of SHA − 256 in order to produce the block hash. Digest the block contents with the help of ECC, which generated a digital signature, thus providing cryptographic validation of the block contents. This was done on each of the blocks created in the simulation. A threshold-based consensus validation mechanism that was implemented in the security layer was used to connect the validated blocks in sequence. The block is evaluated using a simulated multi validator verification mechanism and candidate block by its hash and Merkle root verification. The addition of a block to a blockchain was only achieved when the specified validation threshold was met. The block verification mechanism was used to guarantee that the discrepancies in block hash values or the Merkle roots lead to a rejection before the ledger is included. It is a simulation of a permissioned blockchain setting that illustrates the decentralized block verification and the safe ledger maintenance and the cloud infrastructure was employed to execute and support storage. Blockchain validation – simulation flow and parameter mapping The validation process on blockchain adheres to a systematic simulation procedure that is aimed at analyzing the integrity, strength and effectiveness of the suggested security layer in both normal and adversarial circumstances. The total cryptographic validation process is outlined by the parameters of the simulation as shown in Fig. 6 which stipulates the block structure and cryptographic elements and consensus threshold employed during the experiments. As it is illustrated in Fig. 6, preprocessed and encrypted healthcare records are clustered in the form of transactions and arranged in blocks with a specific number of transactions in each block. Cryptographic variables such as Merkle tree root, block hash, time, nonce, and digital signature are created to each block. These parameters are the foundation of the integrity verification in the validation phase. After creating a candidate block, it passes through the threshold based consensus validation in the security layer. Validator nodes will independently recalculate block hash and Merkle root and test the connection of the block with the last block. Only at the condition of meeting the predefined threshold of operational validation, a block is accepted and rejected in case otherwise. This verification is what defines the behavior of the blockchain, when all things are running well. In order to test the efficiency of the validation mechanism, the attack scenarios are artificially caused in the block level. The replay attack simulation, which takes place in the simulation, involves re-submission of the blocks or transactions created in the past without altering the contents of these blocks. With no integrity violation, the recalculated cryptographic values will be consistent and the block will be rightly recognized as a valid block as indicated in Fig. 7. This proves that validation mechanism eliminates false positives, because it accepts legit, unmodified blocks. Fig. 6DoS attack simulation output. DoS attack simulation output. Fig. 7Replay attack simulation output. Replay attack simulation output. Conversely, in the tampering attack simulation, encrypted transaction data or block metadata is altered intentionally after the creation of the blocks. The validation stage identifies discrepancies between the original and re-computed hash value and Merkle roots and therefore the compromised block is identified and rejected immediately as shown in Fig. 8. This demonstrates the ability of the validation mechanism to detect integrity violations within the simulated environment. Fig. 8Accuracy dataset2 ML model analysis. Accuracy dataset2 ML model analysis. A high load of transactions is also simulated in order to further evaluate system robustness under conditions of DoS-like stress. The transactions are submitted in a sequence of rapid chain transactions and the performance metrics in which are transaction throughput, block validation time and system latency are measured. The findings presented in Fig. 9 suggest that the blockchain validation system is stable and it is capable of validating the blocks correctly without affecting the data integrity. With the defined parameters of the simulation plotted against the observed results of the validation with replay, tampering and high-load conditions Figs. 5, 7, 9 and 6, the obtained results show that the developed blockchain framework is capable of reliably separating the legitimate and malicious block modifications along with preserving the acceptable processing efficiency and validation accuracy. Fig. 9Tampering attack simulation output. Tampering attack simulation output. Table 5 shows the most important performance indicators during the course of experimental analysis of the suggested blockchain framework. These findings have revealed that the rate of tamper detection in the system is 100, which proves that the system can detect any null alteration of healthcare records by verifying the hash and Merkle root. The optimal latency (between 180 and 320 ms) implies that the mechanism of achieving consensus based on the threshold proves to be efficient with the suggested block validation. Table 5Blockchain performance summary.MetricObserved ValueTamper detection rate100%Consensus latency180–320 msBlock acceptance ratio95%Throughput23 TPSBlock creation time150 msEnd-to-end latency450–700 msStorage overhead~ 0.5 MB Table 5Blockchain performance summary.MetricObserved ValueTamper detection rate100%Consensus latency180–320 msBlock acceptance ratio95%Throughput23 TPSBlock creation time150 msEnd-to-end latency450–700 msStorage overhead~ 0.5 MB Blockchain performance summary. Under typical operating circumstances, a block acceptance ratio of 95% indicates consistent and dependable validation behavior. The ability of the system to process healthcare data effectively was demonstrated by its average throughput of 23 transactions per second. The low computational overhead involved in block formation is highlighted by the block creation time of roughly 150 ms. Furthermore, the end-to-end latency, which is appropriate for near real-time healthcare applications, ranged from 450 to 700 ms from transaction submission to block inclusion. The feasibility of implementing the blockchain framework in cloud-based healthcare environments with low storage requirements is confirmed by the observed storage overhead of roughly 0.5 MB. The cloud access layer acts as a safeguard between the cloud and the blockchain connected machines. After threshold-based validation on the blockchain, only healthcare records that have been verified and integrity are only presented on the cloud storage layer. The cloud allows management, access, and authentication of verified data. Securely transport the encrypted transaction payloads to decoding and structure data in the analytics environment. To ensure that sensitive healthcare data are secured at rest, while at the same time allowing scalable, reliable, validated access to downstream machine learning. The ability to separate storage from analytics increases security of the system and allow for efficient handling of small and large datasets related to healthcare. Machine learning analysis Table 6Machine learning processing flow for both datasets.DatasetInput sizeSelected featuresTrain-Test SplitPrediction OutputEarly Stage Diabetes(UCI)520 records1180%-train20%-test(5-fold CV)Early Diabetic(Yes/No)Diabetes 130-US101,7671480%-train20%-test(5-fold CV)Diabetic(Yes/No) Table 6Machine learning processing flow for both datasets.DatasetInput sizeSelected featuresTrain-Test SplitPrediction OutputEarly Stage Diabetes(UCI)520 records1180%-train20%-test(5-fold CV)Early Diabetic(Yes/No)Diabetes 130-US101,7671480%-train20%-test(5-fold CV)Diabetic(Yes/No) Machine learning processing flow for both datasets. 80%-train 20%-test (5-fold CV) 80%-train 20%-test (5-fold CV) The machine learning processing pipeline used on both datasets is summarized in Table 6. The Early Stage Diabetes dataset is a small, symptom-based clinical dataset which consists of 520 records and after preprocessing 11 relevant features were selected for early diabetes risk prediction. Conversely, the Diabetes 130-US Hospitals dataset is an enormous real-world healthcare dataset, consisting of 101,767 patient records, where 14 clinically relevant features are identified for diabetes classification. Both datasets utilized an 80%−20% train-test split, and 5-fold cross-validation was used on the training set in order to ensure robustness and reproducibility. Even though there is a marked difference in dataset size and complexity, the same learning pipeline is used to ensure fair comparison. The machine learning models ultimately produce binary outputs indicating if a patient is diabetic or non-diabetic. Table 7Features name and description of dataset1.NoFeaturesDescription1AgeDiabetes risk increases with age2PolyuriaExcess urination- primary diabetic symptom3PolydipsiaExcess thirst – core glucose imbalance indicator4Sudden Weight lossStrong sign of insulin deficiency5PolyphagiaExcess hunger due to poor glucose uptake6WeaknessCommon metabolic symptom7Delayed healingIndicates chronic high blood sugar8ObesityMajor risk factor for type-2 diabetes Table 7Features name and description of dataset1.NoFeaturesDescription1AgeDiabetes risk increases with age2PolyuriaExcess urination- primary diabetic symptom3PolydipsiaExcess thirst – core glucose imbalance indicator4Sudden Weight lossStrong sign of insulin deficiency5PolyphagiaExcess hunger due to poor glucose uptake6WeaknessCommon metabolic symptom7Delayed healingIndicates chronic high blood sugar8ObesityMajor risk factor for type-2 diabetes Features name and description of dataset1. Table 8Features name and description of dataset2.NoFeaturesDescription1AgeStrong risk factor for diabetes progression2GenderInfluences metabolic and hormonal risk3Number of diagnosesReflects comorbidity burden4Max glucose serumDirect indicator of blood glucose abnormality5A1C resultLong-term diabetes marker6InsulinIndicates diabetic treatment requirement7MetforminPrimary diabetes medication8Time in HospitalProxy for severity of diabetic condition9Number of medicationsReflects treatment intensity10DiabetesMedConfirms diabetes- specific medication usage Table 8Features name and description of dataset2.NoFeaturesDescription1AgeStrong risk factor for diabetes progression2GenderInfluences metabolic and hormonal risk3Number of diagnosesReflects comorbidity burden4Max glucose serumDirect indicator of blood glucose abnormality5A1C resultLong-term diabetes marker6InsulinIndicates diabetic treatment requirement7MetforminPrimary diabetes medication8Time in HospitalProxy for severity of diabetic condition9Number of medicationsReflects treatment intensity10DiabetesMedConfirms diabetes- specific medication usage Features name and description of dataset2. The clinical features selected from Dataset 1 and Dataset 2 that have shown significant utility for predicting diabetes as presented in Tables 7 and 8, respectively. The features that are chosen for dataset 1 are mostly symptoms that appear during the early stages of diabetes. Polyuria, polydipsia, suddenly losing weight and delayed healing are the most common ones. The features that are well-known risk factors of diabetes are age and obesity. The metabolic imbalance and insulin dysfunction are directly reflected by these characteristics. Hence, they can be useful for early diabetes screening. Conversely, Dataset 2 is made of hospital-level clinical indicators that depict diabetes severity and management. The chosen features are demographic variables, biochemical parameters such as maximum glucose serum and maximum A1C level, use of medications (insulin and metformin), and hospitalization features. These characteristics reflect the advancement of disease the complexity of treatment and the burden of comorbidity and are strong classifiers of diabetes under large-scale and clinically heterogeneous conditions. Table 9Performance metrics of dataset 1 using various machine learning models.Machine Learning ModelsAccuracyPrecisionRecallF1-ScoreDecision Tree0.940.940.940.93K-Nearest Neighbors0.880.900.880.88Logistic Regression0.930.930.930.93Support VectorMachine0.930.930.930.93Random Forest0.980.980.980.98Xg boost0.960.960.960.96Adaboost0.930.930.930.93Naïve Bayes0.900.900.900.90Stacked Ensemble0.960.960.960.96 Table 9Performance metrics of dataset 1 using various machine learning models.Machine Learning ModelsAccuracyPrecisionRecallF1-ScoreDecision Tree0.940.940.940.93K-Nearest Neighbors0.880.900.880.88Logistic Regression0.930.930.930.93Support VectorMachine0.930.930.930.93Random Forest0.980.980.980.98Xg boost0.960.960.960.96Adaboost0.930.930.930.93Naïve Bayes0.900.900.900.90Stacked Ensemble0.960.960.960.96 Performance metrics of dataset 1 using various machine learning models. The performance results of all the models used on the Early Stage Diabetes Risk Prediction Dataset are shown in Table 9. The dataset is organized based on symptoms and not very imbalanced. The results show optimal predictive performance from most classifiers. The accuracy, precision, recall, and F1-score of ensemble classifiers and well-tuned classifiers are much better in identifying early-diagnosed diabetes in comparison to single classifiers. The high performance values also represent the impact of effective pre-processing, effective feature selection and effective cross-validation in this study. Table 10Performance metrics of dataset 2 using various machine learning models.Machine Learning ModelsAccuracyPrecisionRecallF1-ScoreDecision Tree0.810.800.780.79K-Nearest Neighbors0.790.780.770.77Logistic Regression0.840.830.820.82Support VectorMachine0.860.860.850.85Random Forest0.890.880.870.87Xg boost0.900.890.880.88Adaboost0.850.840.830.83Naïve Bayes0.780.770.760.76Stacked Ensemble0.910.900.890.89 Table 10Performance metrics of dataset 2 using various machine learning models.Machine Learning ModelsAccuracyPrecisionRecallF1-ScoreDecision Tree0.810.800.780.79K-Nearest Neighbors0.790.780.770.77Logistic Regression0.840.830.820.82Support VectorMachine0.860.860.850.85Random Forest0.890.880.870.87Xg boost0.900.890.880.88Adaboost0.850.840.830.83Naïve Bayes0.780.770.760.76Stacked Ensemble0.910.900.890.89 Performance metrics of dataset 2 using various machine learning models. The performance of different machine learning models carried out on the Diabetes 130-US Hospitals dataset is detailed in Table 10. The predictive performance across all models is moderately lower than Dataset 1. This is mainly because hospital data is large-scale and from the real-world. Thus, it has noise, missing values and an inherent class imbalance. The ensemble-based models such as Random Forest and XGBoost, and the Stacked Ensemble achieve the highest accuracy and F1-score despite challenges. They have strong accuracy and robust generalization capability. The findings demonstrate that the machine learning pipeline works well on realistic datasets, allowing for effective diabetes classification in clinical settings. The accuracy of employing different machine learning models on the Early Stage Diabetes Risk Prediction dataset is demonstrated in Fig. 10. The results yielded very consistent performances indicated on most models courtesy to a clean, balanced, and symptom-driven dataset. Ensemble-based methods have the best performance over each classifier. The Random Forest model achieves the highest accuracy, followed closely by the Stacked Ensemble model. Standard models such as Logistic Regression and SVM also appear to perform well as the classes are clearly separable in Dataset 1. The relatively lower accuracy of KNN is due to being influenced by feature scaling and local data. Fig. 10Accuracy dataset1 ML model analysis. Accuracy dataset1 ML model analysis. The Diabetes 130-US Hospitals dataset has been used to assess the performance of different ML models in Fig. 8. The accuracy values in comparison with Dataset 1 are generally lower, which is expected as the data from hospitals are heterogeneous, real-world data, of a significantly larger scale and are known to include noise, missing values, and class imbalance. Ensemble-based methods give better results than the others. The stacked model (Random Forest + XGBoost) performs the best with a high accuracy score followed closely by XGBoost and Random Forest due to their ability to capture complex non-linear relations in high-dimensional clinical data. The support vector machine and logistic regression achieved a moderate accuracy in terms of their generalization capabilities. However, it shows that these techniques are limited in their ability to manage difficult processes. Simply models like K-Nearest Neighbors and Naïve Bayes achieve relatively lower accuracy as they are sensitive to data distribution and independence. The results overall show that advanced ensemble models are more effective and more robust than other classical models to predict diabetes on large real hospital datasets be scalable and useable within healthcare analytics. Figure 11 compares the F1 scores of all the models for both the datasets. It measures the accuracy of the model accuracy and the balance between the precision and recall of the models. Dataset 1 nearly always shows a higher F1-score due to symmetric classes and based on symptoms. In comparison, Dataset 2 has low F1-scores, mainly due to class imbalance and heterogeneous clinical data. The Stacked Ensemble, Random Forest, and XGBoost have robust F1-scores in both datasets, signalling their stability in healthcare-wide and healthcare-specific scenarios. The comparison illustrates that Dataset 1 is biased toward near-optimal classification while Dataset 2 is a better reflection of model generalization and robustness. Fig. 11F1score analysis of dataset1 and dataset2. F1score analysis of dataset1 and dataset2. Comparison analysis Table 9Comparison of blockchain-based healthcare models.FeatureWazid et al. [3]Wang et al. [5]Khan et al. [6]Proposed ModelIoT-based healthcare supportYesYesYesYesBlockchain for data securityYesYesYesYesPermissioned blockchainYesYesYesYesMerkle tree for integrityYesYesNoYesDigital signaturesYesYesYesYesAttack simulation (tampering/replay/DoS)NoPartialPartialYesCloud integrationYesYesYesYesMachine learning integrationYesNoNoYes Table 9Comparison of blockchain-based healthcare models.FeatureWazid et al. [3]Wang et al. [5]Khan et al. [6]Proposed ModelIoT-based healthcare supportYesYesYesYesBlockchain for data securityYesYesYesYesPermissioned blockchainYesYesYesYesMerkle tree for integrityYesYesNoYesDigital signaturesYesYesYesYesAttack simulation (tampering/replay/DoS)NoPartialPartialYesCloud integrationYesYesYesYesMachine learning integrationYesNoNoYes Comparison of blockchain-based healthcare models. Table 9 provides a comparative view of some of the blockchain-based healthcare frameworks adopted in the literature and the proposed model. Among the key features contrasted include the integration of IoT, data protection using blockchain, permission deployment, mechanisms of integrity checks, the support of attack simulation, the integration with clouds, and the use of machine learning. In contrast to the previous researches where the focus is mainly on efficient data storage or access control, the suggested framework integrates both explicit blockchain verification in the conditions of simulated attacks and machine learning-based prediction of healthcare risks. Such a combined solution proves to be more appropriate with regard to safe, scaled, and smart data management of healthcare in permissioned settings. Conclusion and future work The research introduced an intelligent and secure healthcare framework which incorporates validation through permissioned blockchain with diabetes risk prediction through machine learning. Most blockchain based healthcare solutions encrypt patient health records or regulate access to them. The Proposed Integrated approach combines rigorous blockchain attack validation with machine learning based healthcare risk prediction in a single pipeline to advance the field. This method employs threshold based block validation, explicit tampering, replay attack simulation, and integrity-verified data analytics. The layer on the blockchain uses a cryptographic hash with the help of a Merkle tree. It also provides a digital signature and threshold for block verification of data. As the simulation results show, it is possible to effectively identify all replay attack, tampering attack and high-load attack scenarios with throughput and latency that are acceptable. Machine learning models were assessed on a balanced symptom-based dataset and a large real-world hospital dataset. The findings demonstrate that the predictive performance of secure blockchain validation remains unaffected. The accuracy of ensemble models was consistently high in both datasets. The differences in performance that occur between the datasets signify the impact of noise along with real-world situation interference as well as class imbalance. The framework is proved to be feasible for secure health analytics in permissioned settings. Future work will concentrate on real-time IoT data integration and edge-based processing. Moreover, it will include privacy-preserving learning techniques. These techniques include federated learning and secure multi-party computation. These measures enhance scalability and practical deployment.Same framework will be extended and deployed in real-world deployments to perform scalable, interoperable, and feasible tasks in healthcare environments.