@epfml/discojs 2.1.2-p20240617140649.0 → 2.1.2-p20240627125649.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,13 +8,15 @@ export const cifar10 = {
8
8
  displayInformation: {
9
9
  taskTitle: 'CIFAR10',
10
10
  summary: {
11
- preview: 'In this challenge, we ask you to classify images into categories based on the objects shown on the image.',
12
- overview: 'The CIFAR-10 dataset is a collection of images that are commonly used to train machine learning and computer vision algorithms. It is one of the most widely used datasets for machine learning research.'
11
+ preview: 'CIFAR-10 is a classic image classification task, and one of the most widely used datasets for machine learning research.',
12
+ overview: "The dataset contains 60,000 32x32 color images in 10 different classes: airplanes, cars, birds, cats, deer, dogs, frogs, horses, ships, and trucks. The official CIFAR-10 website can be found <a class='underline text-blue-400' href='https://www.cs.toronto.edu/~kriz/cifar.html' target='_blank'>here</a>. You can find a link to a sample dataset at the next step (Connect Your Data)."
13
13
  },
14
- dataFormatInformation: 'Images should be of .png format and of size 32x32. <br> The label file should be .csv, where each row contains a file_name, class. <br> <br> e.g. if you have images: 0.png (of a frog) and 1.png (of a car) <br> labels.csv contains: (Note that no header is needed)<br> 0.png, frog <br> 1.png, car',
14
+ model: 'The model is a pretrained <a class="underline text-blue-400" target="_blank" href="https://github.com/tensorflow/tfjs-models/tree/master/mobilenet">MobileNetV1 model</a> trained in Tensorflow.js. The last output layer is replaced with a fully connected layer with softmax activation and one output neuron per CIFAR10 category. The data preprocessing reshapes images into 224x224 pixels and normalizes values between 0 and 1. The neural network is optimized via Stochastic Gradient Descent and a categorical Cross Entropy loss.',
15
+ dataFormatInformation: 'Images should be of .png format and of size 32x32. <br> The CSV file should start with the exact header "filename,label", and each row should contain an image filename (without extension) and its label.<br><br> For example if you have images: 0.png (of a frog) and 1.png (of a car) <br> The CSV file should be: <br>filename, label <br><br> 0, frog <br> 1, car',
15
16
  dataExampleText: 'Below you can find 10 random examples from each of the 10 classes in the dataset.',
16
17
  dataExampleImage: 'https://storage.googleapis.com/deai-313515.appspot.com/example_training_data/cifar10-example.png',
17
- sampleDatasetLink: 'https://www.kaggle.com/competitions/cifar-10/data'
18
+ sampleDatasetLink: 'https://storage.googleapis.com/deai-313515.appspot.com/example_training_data.tar.gz',
19
+ sampleDatasetInstructions: 'Opening the link should start downloading a zip file which you can unzip. To connect the data, use the CSV option below and select the file named "cifar10-labels.csv". You can now connect the images located in the "CIFAR10" folder. Note that there are only 24 images in this sample dataset which is far too few to successfully train a machine learning model.'
18
20
  },
19
21
  trainingInformation: {
20
22
  modelID: 'cifar10-model',
@@ -23,7 +25,7 @@ export const cifar10 = {
23
25
  validationSplit: 0.2,
24
26
  batchSize: 10,
25
27
  dataType: 'image',
26
- preprocessingFunctions: [data.ImagePreprocessing.Resize],
28
+ preprocessingFunctions: [data.ImagePreprocessing.Resize, data.ImagePreprocessing.Normalize],
27
29
  IMAGE_H: 224,
28
30
  IMAGE_W: 224,
29
31
  LABEL_LIST: ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'],
@@ -1,6 +1,5 @@
1
1
  export { cifar10 } from './cifar10.js';
2
2
  export { lusCovid } from './lus_covid.js';
3
- export { skinCondition } from './skin_condition.js';
4
3
  export { mnist } from './mnist.js';
5
4
  export { simpleFace } from './simple_face.js';
6
5
  export { titanic } from './titanic.js';
@@ -1,6 +1,5 @@
1
1
  export { cifar10 } from './cifar10.js';
2
2
  export { lusCovid } from './lus_covid.js';
3
- export { skinCondition } from './skin_condition.js';
4
3
  export { mnist } from './mnist.js';
5
4
  export { simpleFace } from './simple_face.js';
6
5
  export { titanic } from './titanic.js';
@@ -5,16 +5,17 @@ export const lusCovid = {
5
5
  return {
6
6
  id: 'lus_covid',
7
7
  displayInformation: {
8
- taskTitle: 'COVID Lung Ultrasound',
8
+ taskTitle: 'COVID-19 Diagnosis from Lung Ultrasounds',
9
9
  summary: {
10
- preview: 'Do you have a data of lung ultrasound images on patients <b>suspected of Lower Respiratory Tract infection (LRTI) during the COVID pandemic</b>? <br> Learn how to discriminate between COVID positive and negative patients by joining this task.',
11
- overview: "Don't have a dataset of your own? Download a sample of a few cases <a class='underline' href='https://drive.switch.ch/index.php/s/zM5ZrUWK3taaIly' target='_blank'>here</a>."
10
+ preview: "Medical images are a typical example of data that exists in huge quantity yet that can't be shared due to confidentiality reasons. Medical applications would immensely benefit from training on data currently locked. More data diversity leads to better generalization and bias mitigation.",
11
+ overview: "Disco allows data owners to collaboratively train machine learning models using their respective data without any privacy breach. This example problem is about diagnosing whether patients are positive or negative to COVID-19 from lung ultrasounds images. <br>Don't have a dataset of your own? You can find a link to a sample dataset at the next step."
12
12
  },
13
- model: "We use a simplified* version of the <b>DeepChest model</b>: A deep learning model developed in our lab (<a class='underline' href='https://www.epfl.ch/labs/mlo/igh-intelligent-global-health/'>intelligent Global Health</a>.). On a cohort of 400 Swiss patients suspected of LRTI, the model obtained over 90% area under the ROC curve for this task. <br><br>*Simplified to ensure smooth running on your browser, the performance is minimally affected. Details of the adaptations are below <br>- <b>Removed</b>: positional embedding (i.e. we don’t take the anatomic position into consideration). Rather, the model now does mean pooling over the feature vector of the images for each patient <br>- <b>Replaced</b>: ResNet18 by Mobilenet",
14
- dataFormatInformation: 'This model takes as input an image dataset. It consists on a set of lung ultrasound images per patient with its corresponding label of covid positive or negative. Moreover, to identify the images per patient you have to follow the follwing naming pattern: "patientId_*.png"',
15
- dataExampleText: 'Below you can find an example of an expected lung image for patient 2 named: 2_QAID_1.masked.reshaped.squared.224.png',
13
+ model: "The model is a simple Convolutional Neural Network composed of two convolutional layers with ReLU activations and max pooling layers, followed by a fully connected output layer. The data preprocessing reshapes images into 100x100 pixels and normalizes values between 0 and 1",
14
+ dataFormatInformation: 'This model takes as input an image dataset of lung ultrasounds. The images are resized automatically.',
15
+ dataExampleText: 'Below you can find an example of an expected lung image.',
16
16
  dataExampleImage: 'https://storage.googleapis.com/deai-313515.appspot.com/example_training_data/2_QAID_1.masked.reshaped.squared.224.png',
17
- sampleDatasetLink: 'https://drive.switch.ch/index.php/s/zM5ZrUWK3taaIly'
17
+ sampleDatasetLink: 'https://drive.switch.ch/index.php/s/zM5ZrUWK3taaIly',
18
+ sampleDatasetInstructions: 'Opening the link will take you to a Switch Drive folder. You can click on the Download button in the top right corner. Unzip the file and you will get two subfolders: "COVID-" and "COVID+". You can connect the data by using the Group option and selecting each image group in its respective field.'
18
19
  },
19
20
  trainingInformation: {
20
21
  modelID: 'lus-covid-model',
@@ -1,30 +1,32 @@
1
1
  import * as tf from '@tensorflow/tfjs';
2
- import { models } from '../index.js';
2
+ import { data, models } from '../index.js';
3
3
  export const mnist = {
4
4
  getTask() {
5
5
  return {
6
6
  id: 'mnist',
7
7
  displayInformation: {
8
- taskTitle: 'MNIST',
8
+ taskTitle: 'Handwritten Digit Recognition',
9
9
  summary: {
10
- preview: "Test our platform by using a publicly available <b>image</b> dataset. <br><br> Download the classic MNIST imagebank of hand-written numbers <a class='underline text-primary-dark dark:text-primary-light' href='https://www.kaggle.com/scolianni/mnistasjpg'>here</a>. <br> This model learns to identify hand written numbers.",
11
- overview: 'The MNIST handwritten digit classification problem is a standard dataset used in computer vision and deep learning. Although the dataset is effectively solved, we use it to test our Decentralised Learning algorithms and platform.'
10
+ preview: "The MNIST handwritten digit classification problem is a classic dataset used in computer vision and deep learning. The objective is to classify handwritten digits from 28x28 pixel images.",
11
+ overview: "Download the classic MNIST dataset of hand-written numbers <a class='underline text-blue-400' target='_blank' href='https://www.kaggle.com/scolianni/mnistasjpg'>here</a>. You can also find a sample dataset at the next step."
12
12
  },
13
- model: 'The current model is a very simple CNN and its main goal is to test the app and the Decentralizsed Learning functionality.',
14
- dataFormatInformation: 'This model is trained on images corresponding to digits 0 to 9. You can upload each digit image of your dataset in the box corresponding to its label. The model taskes images of size 28x28 as input.',
13
+ model: "The model is a simple Convolutional Neural Network composed of three convolutional layers with ReLU activations and max pooling layers, followed by two fully connected layers. The data preprocessing simply normalizes values between 0 and 1. The neural network is optimized via RMSProp and a categorical cross-entropy loss.",
14
+ dataFormatInformation: 'This model is trained on images corresponding to digits 0 to 9. You can connect your own images of each digit in the box corresponding to its label. The model takes images of size 28x28 as input.',
15
15
  dataExampleText: 'Below you can find an example of an expected image representing the digit 9.',
16
- dataExampleImage: 'http://storage.googleapis.com/deai-313515.appspot.com/example_training_data/9-mnist-example.png'
16
+ dataExampleImage: 'http://storage.googleapis.com/deai-313515.appspot.com/example_training_data/9-mnist-example.png',
17
+ sampleDatasetLink: 'https://storage.googleapis.com/deai-313515.appspot.com/MNIST_samples.tar.gz',
18
+ sampleDatasetInstructions: 'Opening the link should start downloading a zip file which you can unzip. You can connect the data with the CSV option below using the CSV file named "mnist_labels.csv". After selecting in the CSV file, you will be able to connect the data under in the "images" folder.'
17
19
  },
18
20
  trainingInformation: {
19
21
  modelID: 'mnist-model',
20
- epochs: 10,
22
+ epochs: 20,
21
23
  roundDuration: 10,
22
24
  validationSplit: 0.2,
23
25
  batchSize: 30,
24
26
  dataType: 'image',
25
27
  IMAGE_H: 28,
26
28
  IMAGE_W: 28,
27
- preprocessingFunctions: [],
29
+ preprocessingFunctions: [data.ImagePreprocessing.Normalize],
28
30
  LABEL_LIST: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
29
31
  scheme: 'decentralized',
30
32
  noiseScale: undefined,
@@ -9,11 +9,13 @@ export const simpleFace = {
9
9
  taskTitle: 'Simple Face',
10
10
  summary: {
11
11
  preview: 'Can you detect if the person in a picture is a child or an adult?',
12
- overview: 'Simple face is a small subset of face_task from Kaggle'
12
+ overview: 'Simple face is a small subset of the public face_task dataset from Kaggle'
13
13
  },
14
14
  dataFormatInformation: '',
15
15
  dataExampleText: 'Below you can find an example',
16
- dataExampleImage: 'https://storage.googleapis.com/deai-313515.appspot.com/example_training_data/simple_face-example.png'
16
+ dataExampleImage: 'https://storage.googleapis.com/deai-313515.appspot.com/example_training_data/simple_face-example.png',
17
+ sampleDatasetLink: "https://storage.googleapis.com/deai-313515.appspot.com/example_training_data.tar.gz",
18
+ sampleDatasetInstructions: 'Opening the link should start downloading a zip file which you can unzip. Inside the "example_training_data" directory you should find the "simple_face" folder which contains the "adult" and "child" folders. To connect the data, select the Group option below and connect adults and children image groups.'
17
19
  },
18
20
  trainingInformation: {
19
21
  modelID: 'simple_face-model',
@@ -5,14 +5,14 @@ export const titanic = {
5
5
  return {
6
6
  id: 'titanic',
7
7
  displayInformation: {
8
- taskTitle: 'Titanic',
8
+ taskTitle: 'Titanic Prediction',
9
9
  summary: {
10
- preview: "Test our platform by using a publicly available <b>tabular</b> dataset. <br><br> Download the passenger list from the Titanic shipwreck here: <a class='underline text-primary-dark dark:text-primary-light' href='https://github.com/epfml/disco/raw/develop/example_training_data/titanic_train.csv'>titanic_train.csv</a> (more info <a class='underline text-primary-dark dark:text-primary-light' href='https://www.kaggle.com/c/titanic'>here</a>). <br> This model predicts the type of person most likely to survive/die in the historic ship accident, based on their characteristics (sex, age, class etc.).",
11
- overview: 'We all know the unfortunate story of the Titanic: this flamboyant new transatlantic boat that sunk in 1912 in the North Atlantic Ocean. Today, we revist this tragedy by trying to predict the survival odds of the passenger given some basic features.'
10
+ preview: "The Titanic classification task is one of the main entrypoints into machine learning. Using passenger data (name, age, gender, socio-economic class, etc), the goal is to identify who was more likely to survive the infamous shipwreck.",
11
+ overview: "The original competition can be found on <a target='_blank' class='underline text-blue-400' href='https://www.kaggle.com/c/titanic'>Kaggle</a> and a link to the training set can be found here <a target='_blank' class='underline text-blue-400' href='https://storage.googleapis.com/deai-313515.appspot.com/example_training_data/titanic_train.csv'>here</a>."
12
12
  },
13
- model: 'The current model does not normalize the given data and applies only a very simple pre-processing of the data.',
14
- dataFormatInformation: 'This model takes as input a CSV file with 12 columns. The features are general information about the passenger (sex, age, name, etc.) and specific related Titanic data such as the ticket class bought by the passenger, its cabin number, etc.<br><br>pclass: A proxy for socio-economic status (SES)<br>1st = Upper<br>2nd = Middle<br>3rd = Lower<br><br>age: Age is fractional if less than 1. If the age is estimated, it is in the form of xx.5<br><br>sibsp: The dataset defines family relations in this way:<br>Sibling = brother, sister, stepbrother, stepsister<br>Spouse = husband, wife (mistresses and fiancés were ignored)<br><br>parch: The dataset defines family relations in this way:<br>Parent = mother, father<br>Child = daughter, son, stepdaughter, stepson<br>Some children travelled only with a nanny, therefore parch=0 for them.<br><br>The first line of the CSV contains the header:<br> PassengerId, Survived, Pclass, Name, Sex, Age, SibSp, Parch, Ticket, Fare, Cabin, Embarked<br><br>Each susequent row contains the corresponding data.',
15
- dataExampleText: 'Below one can find an example of a datapoint taken as input by our model. In this datapoint, the person is young man named Owen Harris that unfortunnalty perished with the Titanic. He boarded the boat in South Hamptons and was a 3rd class passenger. On the testing & validation page, the data should not contain the label column (Survived).',
13
+ model: 'The model is a simple 5-layer feedforward network with ReLU activations. The model is optimized with Adam and binary cross-entropy loss. The preprocessing only fills missing value with a placeholder value (0).',
14
+ dataFormatInformation: 'The expected format for the tabular dataset is exactly the same as the sample data provided above or in the Kaggle competition. It is a CSV file with 12 columns. The features are general information about the passenger (sex, age, name, etc.) and specific related Titanic data such as the ticket class bought by the passenger, its cabin number, etc.<br>The first line of the CSV contains the header: "PassengerId, Survived, Pclass, Name, Sex, Age, SibSp, Parch, Ticket, Fare, Cabin, Embarked"<br>Each subsequent row contains passenger data.',
15
+ dataExampleText: "Here's an example of one data point:",
16
16
  dataExample: [
17
17
  { columnName: 'PassengerId', columnData: '1' },
18
18
  { columnName: 'Survived', columnData: '0' },
@@ -40,11 +40,13 @@ export const titanic = {
40
40
  'Cabin',
41
41
  'Embarked',
42
42
  'Pclass'
43
- ]
43
+ ],
44
+ sampleDatasetLink: "https://storage.googleapis.com/deai-313515.appspot.com/example_training_data/titanic_train.csv",
45
+ sampleDatasetInstructions: 'Opening the link should start downloading a CSV file which you can drag and drop in the field below.'
44
46
  },
45
47
  trainingInformation: {
46
48
  modelID: 'titanic-model',
47
- epochs: 20,
49
+ epochs: 40,
48
50
  roundDuration: 10,
49
51
  validationSplit: 0.2,
50
52
  batchSize: 30,
@@ -79,7 +81,7 @@ export const titanic = {
79
81
  model.add(tf.layers.dense({ units: 32, activation: 'relu' }));
80
82
  model.add(tf.layers.dense({ units: 1, activation: 'sigmoid' }));
81
83
  model.compile({
82
- optimizer: tf.train.sgd(0.001),
84
+ optimizer: 'adam',
83
85
  loss: 'binaryCrossentropy',
84
86
  metrics: ['accuracy']
85
87
  });
@@ -2,20 +2,22 @@ import { data, models } from '../index.js';
2
2
  export const wikitext = {
3
3
  getTask() {
4
4
  return {
5
- id: 'wikitext-103',
5
+ id: 'llm_task',
6
6
  displayInformation: {
7
- taskTitle: 'Language modelling on wikitext',
7
+ taskTitle: 'GPT Language Modeling',
8
8
  summary: {
9
- preview: 'In this challenge, we ask you to do next word prediction on a dataset of Wikipedia articles.',
10
- overview: 'Wikitext-103-raw is a dataset comprising unprocessed text excerpts from Wikipedia articles, designed for tasks related to natural language processing and language modeling.'
9
+ preview: 'Train a language model (L)LM in your browser, collaboratively and from scratch.',
10
+ overview: "You can train a GPT-2 model in your browser and in a collaborative manner on any textual dataset. As an example, you can try the Wikitext-103 dataset, composed of Wikipedia articles, widely used in natural language modeling, which you can download <a class='underline text-blue-400' target='_blank' href='https://dax-cdn.cdn.appdomain.cloud/dax-wikitext-103/1.0.1/wikitext-103.tar.gz'>here</a>. More information on how to connect the dataset at the next step."
11
11
  },
12
- dataFormatInformation: 'The dataset is organized as a large text file, with each line representing a segment of raw text from Wikipedia articles.',
13
- dataExampleText: 'An example excerpt from the dataset could be: "The history of artificial intelligence dates back to ancient times, with philosophical discussions on the nature of thought and reasoning."',
14
- sampleDatasetLink: 'https://dax-cdn.cdn.appdomain.cloud/dax-wikitext-103/1.0.1/wikitext-103.tar.gz'
12
+ model: 'The model follows the exact GPT-2 architecture and is implemented in TensorFlow.js. The tokenizer used for preprocessing is the GPT-2 Byte-Pair encoding tokenizer. The model is trained via an Adam optimizer with unit gradient clipping and softmax cross-entropy loss. To accommodate all devices, the context length is currently kept at 128 and the batch size at 1.',
13
+ dataFormatInformation: 'You can use any natural language (text) dataset you like. For example the Wikitext-103 dataset is organized as a large text file, with each line representing a segment of raw text from Wikipedia articles.',
14
+ dataExampleText: 'An example excerpt from the dataset is: <i>"For the first twenty years of its existence , the only staged performances of Parsifal took place in the Bayreuth Festspielhaus , the venue for which Wagner conceived the work ( except eight private performances for Ludwig II at Munich in 1884 and 1885 ) ."</i>',
15
+ sampleDatasetLink: 'https://dax-cdn.cdn.appdomain.cloud/dax-wikitext-103/1.0.1/wikitext-103.tar.gz',
16
+ sampleDatasetInstructions: 'Opening the link should start downloading a zip file. Unzip it and drag and drop the training set named "wiki.train.tokens" in the field below (or use the "Select File" button). Even though the file extension is ".tokens" it is indeed a text file. You can use "wiki.test.tokens" at the evaluation step after training a language model.'
15
17
  },
16
18
  trainingInformation: {
17
19
  dataType: 'text',
18
- modelID: 'wikitext-103-raw-model',
20
+ modelID: 'llm-raw-model',
19
21
  preprocessingFunctions: [data.TextPreprocessing.Tokenize, data.TextPreprocessing.LeftPadding],
20
22
  scheme: 'federated',
21
23
  epochs: 5,
@@ -23,7 +25,7 @@ export const wikitext = {
23
25
  // But if set to 0 then the webapp doesn't display the validation metrics
24
26
  validationSplit: 0.1,
25
27
  roundDuration: 2,
26
- batchSize: 1, // If set too high (e.g. 16) then firefox raises a WebGL error
28
+ batchSize: 1, // If set too high (e.g. 16) firefox raises a WebGL error
27
29
  tokenizer: 'Xenova/gpt2',
28
30
  maxSequenceLength: 128,
29
31
  tensorBackend: 'gpt'
@@ -10,5 +10,6 @@ export interface DisplayInformation {
10
10
  headers?: string[];
11
11
  dataExampleImage?: string;
12
12
  sampleDatasetLink?: string;
13
+ sampleDatasetInstructions?: string;
13
14
  }
14
15
  export declare function isDisplayInformation(raw: unknown): raw is DisplayInformation;
@@ -4,13 +4,14 @@ export function isDisplayInformation(raw) {
4
4
  if (typeof raw !== 'object' || raw === null) {
5
5
  return false;
6
6
  }
7
- const { dataExample, dataExampleImage, dataExampleText, dataFormatInformation, sampleDatasetLink, headers, model, summary, taskTitle, } = raw;
7
+ const { dataExample, dataExampleImage, dataExampleText, dataFormatInformation, sampleDatasetLink, sampleDatasetInstructions, headers, model, summary, taskTitle, } = raw;
8
8
  if (typeof taskTitle !== 'string' ||
9
9
  (dataExampleText !== undefined && typeof dataExampleText !== 'string') ||
10
10
  (sampleDatasetLink !== undefined && typeof sampleDatasetLink !== 'string') ||
11
11
  (dataFormatInformation !== undefined && typeof dataFormatInformation !== 'string') ||
12
12
  (model !== undefined && typeof model !== 'string') ||
13
- (dataExampleImage !== undefined && typeof dataExampleImage !== 'string')) {
13
+ (dataExampleImage !== undefined && typeof dataExampleImage !== 'string') ||
14
+ (sampleDatasetInstructions !== undefined && typeof sampleDatasetInstructions !== 'string')) {
14
15
  return false;
15
16
  }
16
17
  if (!isSummary(summary)) {
@@ -46,6 +47,7 @@ export function isDisplayInformation(raw) {
46
47
  dataExampleText,
47
48
  dataFormatInformation,
48
49
  sampleDatasetLink,
50
+ sampleDatasetInstructions,
49
51
  headers,
50
52
  model,
51
53
  summary,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epfml/discojs",
3
- "version": "2.1.2-p20240617140649.0",
3
+ "version": "2.1.2-p20240627125649.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,2 +0,0 @@
1
- import type { TaskProvider } from '../index.js';
2
- export declare const skinCondition: TaskProvider;
@@ -1,80 +0,0 @@
1
- import * as tf from '@tensorflow/tfjs';
2
- import { data, models } from '../index.js';
3
- const IMAGE_SIZE = 128;
4
- const LABELS = ['Eczema', 'Allergic Contact Dermatitis', 'Urticaria'];
5
- export const skinCondition = {
6
- getTask() {
7
- return {
8
- id: 'skin_condition',
9
- displayInformation: {
10
- taskTitle: 'Skin Condition Classification',
11
- summary: {
12
- preview: "Identify common skin conditions from volunteer image contributions. You can find a sample dataset of 400 images <a class='underline text-primary-dark dark:text-primary-light' href='https://storage.googleapis.com/deai-313515.appspot.com/scin_sample.zip'>here</a> or see the full <a class='underline text-primary-dark dark:text-primary-light' href='https://github.com/google-research-datasets/scin/tree/main'>SCIN dataset</a>. You can find how to download and preprocess the dataset <a class='underline text-primary-dark dark:text-primary-light' href='https://github.com/epfml/disco/blob/develop/docs/examples/scin_dataset.ipynb'>in this notebook</a>.",
13
- overview: "The <a class='underline text-primary-dark dark:text-primary-light' href='https://github.com/google-research-datasets/scin/tree/main'>SCIN (Skin Condition Image Network) open access dataset</a> aims to supplement publicly available dermatology datasets from health system sources with representative images from internet users. To this end, the SCIN dataset was collected from Google Search users in the United States through a voluntary, consented image donation application. The SCIN dataset is intended for health education and research, and to increase the diversity of dermatology images available for public use. The SCIN dataset contains 5,000+ volunteer contributions (10,000+ images) of common dermatology conditions. Contributions include Images, self-reported demographic, history, and symptom information, and self-reported Fitzpatrick skin type (sFST). In addition, dermatologist labels of the skin condition are provided for each contribution. You can find more information on the dataset and classification task <a class='underline text-primary-dark dark:text-primary-light' href='https://arxiv.org/abs/2402.18545'>here</a>."
14
- },
15
- dataFormatInformation: "There are hundreds of skin condition labels in the SCIN dataset. For the sake of simplicity, we only include the 3 most common conditions in the sample dataset: 'Eczema', 'Allergic Contact Dermatitis' and 'Urticaria'. Therefore, each image is expected to be labeled with one of these three categories.",
16
- sampleDatasetLink: 'https://storage.googleapis.com/deai-313515.appspot.com/scin_sample.zip'
17
- },
18
- trainingInformation: {
19
- modelID: 'skin-condition-model',
20
- epochs: 10,
21
- roundDuration: 2,
22
- validationSplit: 0.3,
23
- batchSize: 8,
24
- preprocessingFunctions: [data.ImagePreprocessing.Resize, data.ImagePreprocessing.Normalize],
25
- dataType: 'image',
26
- IMAGE_H: IMAGE_SIZE,
27
- IMAGE_W: IMAGE_SIZE,
28
- LABEL_LIST: LABELS,
29
- scheme: 'federated',
30
- noiseScale: undefined,
31
- clippingRadius: undefined,
32
- tensorBackend: 'tfjs'
33
- }
34
- };
35
- },
36
- async getModel() {
37
- const imageChannels = 3;
38
- const numOutputClasses = LABELS.length;
39
- const model = tf.sequential();
40
- model.add(tf.layers.conv2d({
41
- inputShape: [IMAGE_SIZE, IMAGE_SIZE, imageChannels],
42
- filters: 8,
43
- kernelSize: 3,
44
- strides: 1,
45
- kernelInitializer: 'varianceScaling',
46
- activation: 'relu'
47
- }));
48
- model.add(tf.layers.maxPooling2d({ poolSize: [2, 2] }));
49
- model.add(tf.layers.dropout({ rate: 0.2 }));
50
- const convFilters = [16, 32, 64, 128];
51
- for (const filters of convFilters) {
52
- model.add(tf.layers.conv2d({
53
- filters: filters,
54
- kernelSize: 3,
55
- strides: 1,
56
- kernelInitializer: 'varianceScaling',
57
- activation: 'relu'
58
- }));
59
- model.add(tf.layers.maxPooling2d({ poolSize: [2, 2] }));
60
- model.add(tf.layers.dropout({ rate: 0.2 }));
61
- }
62
- model.add(tf.layers.flatten());
63
- model.add(tf.layers.dense({
64
- units: 64,
65
- kernelInitializer: 'varianceScaling',
66
- activation: 'relu',
67
- }));
68
- model.add(tf.layers.dense({
69
- units: numOutputClasses,
70
- kernelInitializer: 'varianceScaling',
71
- activation: 'softmax'
72
- }));
73
- model.compile({
74
- optimizer: tf.train.adam(),
75
- loss: 'categoricalCrossentropy',
76
- metrics: ['accuracy']
77
- });
78
- return Promise.resolve(new models.TFJS(model));
79
- }
80
- };