users
sequence
num_samples
sequence
user_data
dict
["THE_LIFE_OF_KING_HENRY_THE_FIFTH_ORLEANS","THE_FIRST_PART_OF_KING_HENRY_THE_FOURTH_BARD","A_MIDSUM(...TRUNCATED)
[1386,724,8455,4653,14305,30618,1336,927,4878,929,1214,3437,899,1606,5903,958,8477,16488,2538,1143,1(...TRUNCATED)
{"THE_LIFE_OF_KING_HENRY_THE_FIFTH_ORLEANS":{"x":["You have an excellent armour; but let my horse ha(...TRUNCATED)
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/datasets-cards)

Introduction: Briefly explain federated learning, FedAvg, and FedProx.

1. Federated Learning:

Federated learning is a machine learning approach that enables training a global model across multiple decentralized clients without exchanging raw data. In federated learning, the model is trained locally on each client using its own data, and only the model updates are shared with the central server. This decentralized training process allows for privacy-preserving machine learning, as the raw data remains on the client devices and is not shared with the central server. Federated learning is particularly useful in scenarios where data privacy is a concern, such as healthcare, finance, and other sensitive domains.

Hiệu quả của việc các local clients chia sẻ random seed cho initialize weights. Đây là ý tưởng cơ bản của FedAvg để server shared weight model cho các clients

2. FedAvg:

  • Điểm mạnh:

    • Một số experimental results trong FedAvg paper cho thấy rằng algorithm cần ít số lần commnunication rounds hơn SGD và tùy ý điều chỉnh các tham số như learning rate, batch size, và batch size. Điều này giúp cho việc training model trở nên nhanh hơn khi giữa local clients và server communication ở mỗi round.
  • Điểm hạn chế:

    • Có thể thấy algorithm cần nhiều tùy chỉnh tham số để đạt được hiệu quả tốt nhất. Điều này có thể làm cho việc triển khai trở nên phức tạp hơn.

Pseudocode:

3. FedProx:

Dataset and Data Partitioning: Describe the CIFAR-10 dataset and your data partitioning

  1. CIFAR-10 Dataset: The CIFAR-10 dataset is a widely used benchmark dataset for image classification tasks. It consists of 60,000 32x32 color images in 10 different classes, with 6,000 images per class. The dataset is divided into 50,000 training images and 10,000 test images. Each image is labeled with one of the following classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, and truck. The CIFAR-10 dataset provides a diverse set of images that allows for the evaluation of various image classification algorithms.

  2. Data Partitioning Strategy for IID and Non-IID Scenarios:

  • Trước đó tôi có fixed # clients là 100 do size của client cuối có mật độ cao hơn khoảng x10 lần nên tôi fixed lại về 50 như kết quả cho cả IID và Non-IID dataset.

  • Trong trường hợp IID, với việc định nghĩa # clients, # classes, # class_per_client, số client được chọn để chia data tương ứng với mỗi class được tính M = (# clients/ # classes)* # class_per_client. Do ta mong muốn mỗi client có data chứa toàn bộ các class, khi đó M = # clients. Khi đó # client - 1 sẽ được chia đều nhau tương ứng với class i theo n_i / # clients, client cuối sẽ lấy số data còn lại. Ta tiếp tục như thế cho đến khi mỗi client đều có đủ # classses.

  • Còn với trường hợp Non-IID, Cách lấy data unbalance cho non-I.I.D dataset, với việc định nghĩa # clients, # classes, # classper_client, số client được chọn để chia data tương ứng với mỗi class được tính M = (# clients/ # classes) # classper_client (e.g lần lượt 50 clients, 10 classes, 2 per client) thì n_i số lượng sample chứa class i sẽ chia cho 10 clients. Tiếp tục cho đến khi 10 clients có sample đủ 2 class, thì ta sẽ xét tiếp 10 clients khác tiếp theo. Kết quả nhận được M clients được xét sẽ có 2 class liền kề nhau và các M', M'' tiếp theo sẽ được phân 2 class liền kề còn lại. Đặc biệt, để đảm bảo mỗi client luôn có data thì tác giả của repo PFllib có định nghĩa số lượng samples ít nhất là $\min(\frac{\text{batch_size}}{1-\text{train_ratio}}, \frac{\text{# data}}{2 \text{# clients}})$

Example of data partitioning for Non-IID scenario

Command:

$python generate_Cifar10.py noniid - pat 50

Result

Number of classes: 10
Client 0	 Size of data: 433	 Labels:  [0 1]
         Samples of labels:  [(0, 97), (1, 336)]
--------------------------------------------------
Client 1	 Size of data: 609	 Labels:  [0 1]
         Samples of labels:  [(0, 295), (1, 314)]
--------------------------------------------------
Client 2	 Size of data: 549	 Labels:  [0 1]
         Samples of labels:  [(0, 132), (1, 417)]
--------------------------------------------------
Show more ``` Client 3 Size of data: 732 Labels: [0 1] Samples of labels: [(0, 204), (1, 528)] -------------------------------------------------- Client 4 Size of data: 501 Labels: [0 1] Samples of labels: [(0, 189), (1, 312)] -------------------------------------------------- Client 5 Size of data: 1118 Labels: [0 1] Samples of labels: [(0, 568), (1, 550)] -------------------------------------------------- Client 6 Size of data: 908 Labels: [0 1] Samples of labels: [(0, 450), (1, 458)] -------------------------------------------------- Client 7 Size of data: 616 Labels: [0 1] Samples of labels: [(0, 341), (1, 275)] -------------------------------------------------- Client 8 Size of data: 801 Labels: [0 1] Samples of labels: [(0, 238), (1, 563)] -------------------------------------------------- Client 9 Size of data: 5733 Labels: [0 1] Samples of labels: [(0, 3486), (1, 2247)] -------------------------------------------------- Client 10 Size of data: 914 Labels: [2 3] Samples of labels: [(2, 538), (3, 376)] -------------------------------------------------- Client 11 Size of data: 415 Labels: [2 3] Samples of labels: [(2, 146), (3, 269)] -------------------------------------------------- Client 12 Size of data: 525 Labels: [2 3] Samples of labels: [(2, 201), (3, 324)] -------------------------------------------------- Client 13 Size of data: 944 Labels: [2 3] Samples of labels: [(2, 453), (3, 491)] -------------------------------------------------- Client 14 Size of data: 583 Labels: [2 3] Samples of labels: [(2, 67), (3, 516)] -------------------------------------------------- Client 15 Size of data: 510 Labels: [2 3] Samples of labels: [(2, 379), (3, 131)] -------------------------------------------------- Client 16 Size of data: 1041 Labels: [2 3] Samples of labels: [(2, 594), (3, 447)] -------------------------------------------------- Client 17 Size of data: 887 Labels: [2 3] Samples of labels: [(2, 373), (3, 514)] -------------------------------------------------- Client 18 Size of data: 946 Labels: [2 3] Samples of labels: [(2, 573), (3, 373)] -------------------------------------------------- Client 19 Size of data: 5235 Labels: [2 3] Samples of labels: [(2, 2676), (3, 2559)] -------------------------------------------------- Client 20 Size of data: 831 Labels: [4 5] Samples of labels: [(4, 575), (5, 256)] -------------------------------------------------- Client 21 Size of data: 642 Labels: [4 5] Samples of labels: [(4, 557), (5, 85)] -------------------------------------------------- Client 22 Size of data: 530 Labels: [4 5] Samples of labels: [(4, 103), (5, 427)] -------------------------------------------------- Client 23 Size of data: 617 Labels: [4 5] Samples of labels: [(4, 86), (5, 531)] -------------------------------------------------- Client 24 Size of data: 738 Labels: [4 5] Samples of labels: [(4, 396), (5, 342)] -------------------------------------------------- Client 25 Size of data: 439 Labels: [4 5] Samples of labels: [(4, 357), (5, 82)] -------------------------------------------------- Client 26 Size of data: 712 Labels: [4 5] Samples of labels: [(4, 526), (5, 186)] -------------------------------------------------- Client 27 Size of data: 414 Labels: [4 5] Samples of labels: [(4, 75), (5, 339)] -------------------------------------------------- Client 28 Size of data: 565 Labels: [4 5] Samples of labels: [(4, 124), (5, 441)] -------------------------------------------------- Client 29 Size of data: 6512 Labels: [4 5] Samples of labels: [(4, 3201), (5, 3311)] -------------------------------------------------- Client 30 Size of data: 824 Labels: [6 7] Samples of labels: [(6, 416), (7, 408)] -------------------------------------------------- Client 31 Size of data: 465 Labels: [6 7] Samples of labels: [(6, 215), (7, 250)] -------------------------------------------------- Client 32 Size of data: 735 Labels: [6 7] Samples of labels: [(6, 373), (7, 362)] -------------------------------------------------- Client 33 Size of data: 437 Labels: [6 7] Samples of labels: [(6, 226), (7, 211)] -------------------------------------------------- Client 34 Size of data: 729 Labels: [6 7] Samples of labels: [(6, 348), (7, 381)] -------------------------------------------------- Client 35 Size of data: 907 Labels: [6 7] Samples of labels: [(6, 478), (7, 429)] -------------------------------------------------- Client 36 Size of data: 652 Labels: [6 7] Samples of labels: [(6, 339), (7, 313)] -------------------------------------------------- Client 37 Size of data: 668 Labels: [6 7] Samples of labels: [(6, 147), (7, 521)] -------------------------------------------------- Client 38 Size of data: 832 Labels: [6 7] Samples of labels: [(6, 303), (7, 529)] -------------------------------------------------- Client 39 Size of data: 5751 Labels: [6 7] Samples of labels: [(6, 3155), (7, 2596)] -------------------------------------------------- Client 40 Size of data: 1082 Labels: [8 9] Samples of labels: [(8, 514), (9, 568)] -------------------------------------------------- Client 41 Size of data: 844 Labels: [8 9] Samples of labels: [(8, 574), (9, 270)] -------------------------------------------------- Client 42 Size of data: 365 Labels: [8 9] Samples of labels: [(8, 209), (9, 156)] -------------------------------------------------- Client 43 Size of data: 652 Labels: [8 9] Samples of labels: [(8, 323), (9, 329)] -------------------------------------------------- Client 44 Size of data: 207 Labels: [8 9] Samples of labels: [(8, 137), (9, 70)] -------------------------------------------------- Client 45 Size of data: 474 Labels: [8 9] Samples of labels: [(8, 135), (9, 339)] -------------------------------------------------- Client 46 Size of data: 604 Labels: [8 9] Samples of labels: [(8, 392), (9, 212)] -------------------------------------------------- Client 47 Size of data: 639 Labels: [8 9] Samples of labels: [(8, 103), (9, 536)] -------------------------------------------------- Client 48 Size of data: 1068 Labels: [8 9] Samples of labels: [(8, 592), (9, 476)] -------------------------------------------------- Client 49 Size of data: 6065 Labels: [8 9] Samples of labels: [(8, 3021), (9, 3044)] -------------------------------------------------- Total number of samples: 60000 The number of train samples: [324, 456, 411, 549, 375, 838, 681, 462, 600, 4299, 685, 311, 393, 708, 437, 382, 780, 665, 709, 3926, 623, 481, 397, 462, 553, 329, 534, 310, 423, 4884, 618, 348, 551, 327, 546, 680, 489, 501, 624, 4313, 811, 633, 273, 489, 155, 355, 453, 479, 801, 4548] The number of test samples: [109, 153, 138, 183, 126, 280, 227, 154, 201, 1434, 229, 104, 132, 236, 146, 128, 261, 222, 237, 1309, 208, 161, 133, 155, 185, 110, 178, 104, 142, 1628, 206, 117, 184, 110, 183, 227, 163, 167, 208, 1438, 271, 211, 92, 163, 52, 119, 151, 160, 267, 1517] ```

Example of data partitioning for IID scenario: Command:

$python generate_Cifar10.py iid balance - 50

Result

Number of classes: 10
Client 0	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
         Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 1	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
         Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 2	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
         Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Show more
Client 3	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 4	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 5	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 6	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 7	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 8	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 9	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 10	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 11	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 12	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 13	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 14	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 15	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 16	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 17	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 18	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 19	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 20	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 21	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 22	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 23	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 24	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 25	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 26	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 27	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 28	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 29	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 30	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 31	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 32	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 33	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 34	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 35	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 36	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 37	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 38	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 39	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 40	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 41	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 42	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 43	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 44	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 45	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 46	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 47	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 48	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Client 49	 Size of data: 1200	 Labels:  [0 1 2 3 4 5 6 7 8 9]
        Samples of labels:  [(0, 120), (1, 120), (2, 120), (3, 120), (4, 120), (5, 120), (6, 120), (7, 120), (8, 120), (9, 120)]
--------------------------------------------------
Total number of samples: 60000
The number of train samples: [900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900, 900]
The number of test samples: [300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300]

Model Architecture: Specify the CNN architecture used for the image classification task.

Với data CIFAR-10, tôi sử dụng kiến trúc CNN cơ bản được đề xuất trong FedAvg paper. Kiến trúc bao gồm 2 convolutional layers 5x5 lần lượt là 32 và 64 channels, mỗi convolutional layer được kết hợp với một max pooling layer 2x2. Sau đó là fully connected layers với 512 units cùng với ReLU activation. Cuối cùng là một softmax layer với 10 classes. (Tổng có 1,663,370 parameters). Tôi có sử dụng các kĩ thuật transform được đề xuất trong FedAvg paper như crop về size 24x24, randomly horizontal flip, adjusting the contrast, brightness and whitening nhưng không đạt hiệu suất mong muốn so với việc chỉ normalize pixel như đề của repo PFllib nên tôi giữ nguyên transform từ library.

Federated Learning Setup: Explain the chosen FL framework, number of clients, commu-

nication rounds, and any other relevant hyperparameters.

Results: Present the obtained test accuracy for FedAvg and FedProx under both data distri-

bution scenarios, preferably with visualizations (e.g., plots showing accuracy over communica- tion rounds).

Analysis and Discussion: Analyze the results and discuss the impact of data distribution

and different aggregation methods on model performance.

Instructions to run the code: Provide clear instructions to reproduce your results.


Downloads last month
95
Edit dataset card