Table 2 Pseudocode for local server model training and global server model aggregation.

From: Secure and interpretable lung cancer prediction model using mapreduce private blockchain federated learning and XAI

Steps

Description

1

Start

2

Collect lung cancer data (CT scans, X-rays) from the dataset83

3

Perform data preprocessing:

• Histogram

• Noise Reduction

• Edge Detection

• Color Space Transmission

4

Split data into Training Dataset (70%) and Testing Dataset (30%).

5

Apply MapReduce for distributed processing:

• Map Phase: Divide training data into smaller chunks and process locally.

• Shuffle Phase: Group intermediate results by key.

• Reduce Phase: Aggregate the processed data into meaningful outputs.

6

Store the preprocessed Training Dataset and Testing Dataset securely using Private Blockchain Technology to ensure data integrity and secure sharing.

7

Initialization layer weights \(\:{m}_{ij}\) & \(\:{u}_{jk}\)), Error, \(\:E=\:0\), and the number of epochs \(\epsilon=0\)

8

For each training pattern, \(\:p\), do:

9

a. Feedforward phase (calculate hidden layer error):

Calculate \(\:{{\Delta\:}}_{j}\) using the equation:

\(\:{{\Delta\:}}_{j}=\:{f{\prime\:}(net}_{j})\times\:{\sum\:}_{k}{w}_{jk}{{\Delta\:}}_{k}\) (8)

Calculate \(\:{{\Delta\:}}_{j}\) using the equation:

\(\:{{\Delta\:}}_{k}=\:{f{\prime\:}(net}_{k})\times\:{(target}_{k}-{output}_{k})\) (9)

10

b. Backpropagation (update weights using):

\(\:{{\Delta\:}u}_{jk}=\eta\:{{\Delta\:}}_{k}{y}_{j}\) (10)

\(\:{{\Delta\:}m}_{ij}=\eta\:{{\Delta\:}}_{j}{x}_{i}\) (11)

11

Increment the epoch count: \(\epsilon=\epsilon+1\)

12

Check Learning Rate: If the desired learning rate is achieved, store the trained model in the Cloud System. If not, retrain the model using local data.

13

Send the optimized local model weights \(\:{m}_{ij}\) and \(\:{u}_{jk}\) to the Global Cloud for model aggregation.

14

Perform Global Model Aggregation in the cloud using inputs from all local models.

15

Synchronize the aggregated global model back to local nodes.

16

Validation Phase:

• Import the trained global model from the cloud.

• Use the Testing Dataset to predict lung cancer.

17

If lung cancer is predicted, display a “Lung Cancer Found” message. If not, discard the results or refine the model.

18

Stop