Distributed learning of genAI embedded whole slide images for digital pathology projections (Praful).
Demo code: https://github.com/cloud4bio/cloud4bio.github.com/wiki/Federation-Demo
...
Let's go through Praful's embedding, and distributed learning, step by step.
...
WebNN is the basis for native AI deployment in the browser: https://webmachinelearning.github.io/webnn-intro/
Praful - simpleNN - https://github.com/episphere/tfjs/wiki
```javascript
const { TFJSModel } = await import("https://episphere.github.io/tfjs/modelBuilder.js");
const model = new TFJSModel({});
await model.loadData({
"datasetURL": "https://episphere.github.io/ai/data/irisOHE.json",
"labelFieldName": "species",
"trainTestRatio": 0.8
});
await model.build();
await model.train();
await model.test();
```
A simplified decentralized learning demo:
// Data Loading:
const tfjsModelBuilder = await import("https://episphere.github.io/tfjs/modelBuilder.js")
const m = new tfjsModelBuilder.TFJSModel({})
await m.loadData({
'datasetURL': "https://episphere.github.io/ai/data/irisOHE.json",
"labelFieldName": "species",
"trainTestRatio": 0.8
})
document.addEventListener("webFed_newPeer", (event)=>{
const delta = event.detail
const newPeerOperations = delta.filter(operation => {
return operation.hasOwnProperty("insert")
})
if (newPeerOperations.length > 0) {
const newPeerNames = newPeerOperations.map(operation => {
const insertOperations = operation.insert.filter(insertOp => insertOp.hasOwnProperty("name") && insertOp.hasOwnProperty("_webRTCPeerId"))
return insertOperations.map(op => op.name)
}).flat()
newPeerNames.forEach(newPeer => {
console.log(`New Peer ${newPeer} joined.`)
})
}
})
const webFed = await import("https://episphere.github.io/lab/webFed_yjs.js")
const fed = new webFed.WebFed({
'signalingServer': "https://signalyjs-df59a68bd6e6.herokuapp.com",
'selfName': "Chrome",
'federationName': "testFederation",
'dataset': m.dataset
})
document.addEventListener("webFed_synced", (event) =>{
if (event.detail.synced) {
const allPeers = fed.getAllPeers()
allPeers.forEach(peer => {
if (!peer.isSelf)
console.log(`Connected to peer ${peer.name}`)
})
}
})
// Modeling + Federation
await fed.initializeModel({
'framework': "tfjs",
'inputShape': [4],
'architecture': [5, 3, 3],
'activation': "tanh",
'bias': true,
'outputActivation': "softmax",
'optimizer': "adam",
'lossFunc': "categoricalCrossentropy",
'metrics': ["accuracy"],
'batchSize': 30
})
await fed.setTrainingParams({})
await fed.startTraining()
Heterogeneous Federated Learning: State-of-the-art and Research Challenges: https://arxiv.org/pdf/2307.10616
Braid HTTP Proposal: https://github.com/braid-org/braid-spec
Braid Interactive Demo: https://braid.org/demo/interact
Note also that October 15th-16th, 2024, the NCI Office of Data Sharing (ODS) has been hosting the Annual Data Sharing Symposium titled Driving Cancer Advances through Impactful Research.