-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
491 lines (430 loc) · 15.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digit recognition with CNN</title>
<link rel="icon" type="image/svg+xml" href="../logo/favicon.svg" sizes="any">
<meta name="application-name" content="Digit recognition with CNN">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Digit recognition with CNN">
<meta name="msapplication-TileColor" content="#aaa">
<meta name="theme-color" content="#aaa">
<meta name="apple-mobile-web-app-status-bar-style" content="#aaa">
<meta name="msapplication-config" content="../logo/browserconfig.xml?v=190925022706">
<link rel="apple-touch-icon" sizes="57x57" href="../logo/apple-touch-icon-57x57.png?v=190925022706">
<link rel="apple-touch-icon" sizes="60x60" href="../logo/apple-touch-icon-60x60.png?v=190925022706">
<link rel="apple-touch-icon" sizes="72x72" href="../logo/apple-touch-icon-72x72.png?v=190925022706">
<link rel="apple-touch-icon" sizes="76x76" href="../logo/apple-touch-icon-76x76.png?v=190925022706">
<link rel="apple-touch-icon" sizes="114x114" href="../logo/apple-touch-icon-114x114.png?v=190925022706">
<link rel="apple-touch-icon" sizes="120x120" href="../logo/apple-touch-icon-120x120.png?v=190925022706">
<link rel="apple-touch-icon" sizes="144x144" href="../logo/apple-touch-icon-144x144.png?v=190925022706">
<link rel="apple-touch-icon" sizes="152x152" href="../logo/apple-touch-icon-152x152.png?v=190925022706">
<link rel="apple-touch-icon" sizes="180x180" href="../logo/apple-touch-icon-180x180.png?v=190925022706">
<link rel="icon" type="image/png" href="../logo/android-chrome-36x36.png?v=190925022706" sizes="36x36">
<link rel="icon" type="image/png" href="../logo/android-chrome-48x48.png?v=190925022706" sizes="48x48">
<link rel="icon" type="image/png" href="../logo/android-chrome-72x72.png?v=190925022706" sizes="72x72">
<link rel="icon" type="image/png" href="../logo/android-chrome-96x96.png?v=190925022706" sizes="96x96">
<link rel="icon" type="image/png" href="../logo/android-chrome-144x144.png?v=190925022706" sizes="144x144">
<link rel="icon" type="image/png" href="../logo/android-chrome-192x192.png?v=190925022706" sizes="192x192">
<link rel="icon" type="image/png" href="../logo/favicon-16x16.png?v=190925022706" sizes="16x16">
<link rel="icon" type="image/png" href="../logo/favicon-32x32.png?v=190925022706" sizes="32x32">
<link rel="icon" type="image/png" href="../logo/favicon-96x96.png?v=190925022706" sizes="96x96">
<link rel="shortcut icon" type="image/x-icon" href="../logo/favicon.ico?v=190925022706">
<meta name="msapplication-TileImage" content="../logo/mstile-150x150.png?v=190925022706">
<meta name="msapplication-square70x70logo" content="../logo/mstile-70x70.png?v=190925022706">
<meta name="msapplication-square150x150logo" content="../logo/mstile-150x150.png?v=190925022706">
<meta name="msapplication-wide310x150logo" content="../logo/mstile-310x150.png?v=190925022706">
<meta name="msapplication-square310x310logo" content="../logo/mstile-310x310.png?v=190925022706">
<link href="../logo/apple-touch-startup-image-320x460.png?v=190925022706" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<link href="../logo/apple-touch-startup-image-640x920.png?v=190925022706" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<link href="../logo/apple-touch-startup-image-640x1096.png?v=190925022706" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<link href="../logo/apple-touch-startup-image-748x1024.png?v=190925022706" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 1) and (orientation: landscape)" rel="apple-touch-startup-image">
<link href="../logo/apple-touch-startup-image-750x1024.png?v=190925022706" media="" rel="apple-touch-startup-image">
<link href="../logo/apple-touch-startup-image-750x1294.png?v=190925022706" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<link href="../logo/apple-touch-startup-image-768x1004.png?v=190925022706" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 1) and (orientation: portrait)" rel="apple-touch-startup-image">
<link href="../logo/apple-touch-startup-image-1182x2208.png?v=190925022706" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" rel="apple-touch-startup-image">
<link href="../logo/apple-touch-startup-image-1242x2148.png?v=190925022706" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" rel="apple-touch-startup-image">
<link href="../logo/apple-touch-startup-image-1496x2048.png?v=190925022706" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" rel="apple-touch-startup-image">
<link href="../logo/apple-touch-startup-image-1536x2008.png?v=190925022706" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" rel="apple-touch-startup-image">
<script src="../js_libraries/jquery-3.3.1.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"> </script> -->
<script src="../js_libraries/tf.beautified.js"> </script>
<!-- Import the data file -->
<script src="data.js" type="module"></script>
<!-- Import the main script file -->
<script src="script.js" type="module"></script>
<style>
html, body{
font-family: arial;
padding: 0;
margin: 0;
width: 1023px;
height: 767px;
cursor: default;
}
#title{
padding: 15px;
background-color: #d5d5d5;
font-size: 20pt;
font-weight: bold;
text-align: center;
}
#sidebar{
height:100%;
width: 226px;
padding: 10px;
vertical-align: top;
text-align: center;
background-color: #e9e9e9;
}
#canvasTitle{
width: 224px;
padding: 8px 0;
border-top:black 1px solid;
border-left:black 1px solid;
border-right:black 1px solid;
background-color: #ffffff;
}
#clearCanvas{
width: 224px;
padding: 8px 0;
border:black 1px solid;
background-color: #ffffff;
}
#clearCanvas:hover{
background-color: #f5f5f5;
}
#probabilities{
margin-top: 10px;
width: 226px;
padding: 8px 0;
border:black 1px solid;
background-color: #ffffff;
}
#probabilities td:first-child{
padding-left: 10px;
}
.probability_column{
height: 30px;
}
.bar_chart{
background-color: #555555;
height: 20px;
display: inline-block;
}
#mainbar{
vertical-align: top;
overflow: auto;
}
#menuBar{
padding-top: 10px;
background-color: #e9e9e9;
}
.menuItem{
display: inline-block;
width: 150px;
padding: 8px;
border:black 1px solid;
border-radius: 10px 10px 0 0;
background-color: #ffffff;
}
.menuItem:hover{
background-color: #f5f5f5;
}
.activeMenuItem{
background-color: #e0e0e0 !important;
}
canvas{
border:black 1px solid;
background-color: white;
}
#mainContent{
padding: 20px 0 0 20px;
}
#saveModel, #loadModel, #newModel, #trainModel{
display: inline-block;
padding: 8px;
margin-bottom: 10px;
border:black 1px solid;
background-color: #ffffff;
border-radius: 3px;
}
#saveModel:hover, #loadModel:hover, #newModel:hover, #trainModel:hover{
background-color: #f5f5f5;
}
.architectureNode{
padding: 8px;
margin-bottom: 10px;
border:black 1px solid;
background-color: #ffffff;
}
.lastNode{
margin-bottom: 0 !important;
}
.hiddenLayerOutputNode{
padding: 8px;
border:black 1px solid;
background-color: #ffffff;
border-radius: 8px;
display: block;
font-size: 11pt;
}
body > div:last-child {
display: none !important;
}
#credit_mark{
font-size: 8pt;
padding: 0 15px;
margin: 0;
margin-top: 18px;
color: gray;
}
#credit_mark a{
color: gray;
}
</style>
</head>
<body>
<div id="title">Convolutional neural network for hand-written digit recognition</div>
<table cellspacing=0 cellpadding=0 style="width:1023px;height:706px;"><tr>
<td id="sidebar"><center>
<div id="canvasTitle">Input</div>
<canvas id="canvas" width="224" height="224" style="border: solid 1px #333;"></canvas><br>
<div id="clearCanvas">Clear</div>
<table id="probabilities" cellspacing=0>
<tr><td>0: </td><td class="probability_column"></td><td><div class="bar_chart"></div></td></tr>
<tr><td>1: </td><td class="probability_column"></td><td><div class="bar_chart"></div></td></tr>
<tr><td>2: </td><td class="probability_column"></td><td><div class="bar_chart"></div></td></tr>
<tr><td>3: </td><td class="probability_column"></td><td><div class="bar_chart"></div></td></tr>
<tr><td>4: </td><td class="probability_column"></td><td><div class="bar_chart"></div></td></tr>
<tr><td>5: </td><td class="probability_column"></td><td><div class="bar_chart"></div></td></tr>
<tr><td>6: </td><td class="probability_column"></td><td><div class="bar_chart"></div></td></tr>
<tr><td>7: </td><td class="probability_column"></td><td><div class="bar_chart"></div></td></tr>
<tr><td>8: </td><td class="probability_column"></td><td><div class="bar_chart"></div></td></tr>
<tr><td>9: </td><td class="probability_column"></td><td><div class="bar_chart"></div></td></tr>
</table>
<p id="credit_mark">by <a href="../">Elias Leon Foramitti</a></p>
</center></td>
<td id="mainbar">
<div id="menuBar">
<div class="menuItem activeMenuItem" id="menuArchitecture">Network architecture</div><div class="menuItem" id="menuHiddenLayerOutput">Hidden Layer Output</div><div class="menuItem" id="menuTrainingData">Training data</div><div class="menuItem" id="menuTraining">Training</div>
</div>
<div id="mainContent">
<div id="training" style="display:none;">
<div id="saveModel">Save Model</div>
<div id="loadModel">Load Model</div>
<div id="newModel">Create Model</div><br>
Model Name: <input id="nameModel"><br>
<div id="modelState"></div>
<br>
<div id="trainModel">Train Model</div><br>
Epochs: <input type="number" id="trainingEpochs" value="1"><br>
Batch Size: <input type="number" id="trainingBatchSize" value="512"><br>
Training Data Size: <input type="number" id="trainingTrainDataSize" value="55000"><br>
<div id="trainingProgress"></div>
</div>
<div id="hiddenLayerOutput" style="display:none;">
<table>
<tr><td class="hiddenLayerOutputNode">Input</td><td id="canvasWrapperInput"></td></tr>
<tr><td style="height:30px;"></td></tr>
<tr>
<td class="hiddenLayerOutputNode">Convolution<br>
Layer 1<br>
Kernels</td>
<td class="canvasWrappers5"></td>
<td class="canvasWrappers5"></td>
<td class="canvasWrappers5"></td>
<td class="canvasWrappers5"></td>
<td class="canvasWrappers5"></td>
<td class="canvasWrappers5"></td>
<td class="canvasWrappers5"></td>
<td class="canvasWrappers5"></td>
</tr>
<tr style="font-size:10pt;">
<td></td>
<td>reference:</td>
<td>-1 <div style="width:12px; height:12px; display:inline-block; vertical-align:middle; border:black 1px solid; background-color:#e1e1e1;"></div></td>
<td>0 <div style="width:12px; height:12px; display:inline-block; vertical-align:middle; border:black 1px solid; background-color:#808080;"></div></td>
<td>1 <div style="width:12px; height:12px; display:inline-block; vertical-align:middle; border:black 1px solid; background-color:#1e1e1e;"></div></td>
</tr>
<tr>
<td class="hiddenLayerOutputNode">Convolution<br>
Layer 1</td>
<td class="canvasWrappers0"></td>
<td class="canvasWrappers0"></td>
<td class="canvasWrappers0"></td>
<td class="canvasWrappers0"></td>
<td class="canvasWrappers0"></td>
<td class="canvasWrappers0"></td>
<td class="canvasWrappers0"></td>
<td class="canvasWrappers0"></td>
</tr>
<tr><td style="height:10px;"></td></tr>
<tr>
<td class="hiddenLayerOutputNode">MaxPool<br>
Layer 2</td>
<td class="canvasWrappers1"></td>
<td class="canvasWrappers1"></td>
<td class="canvasWrappers1"></td>
<td class="canvasWrappers1"></td>
<td class="canvasWrappers1"></td>
<td class="canvasWrappers1"></td>
<td class="canvasWrappers1"></td>
<td class="canvasWrappers1"></td>
</tr>
<tr><td style="height:30px;"></td></tr>
<tr>
<td class="hiddenLayerOutputNode">Convolution<br>
Layer 3</td>
<td>
<div class="canvasWrappers2"></div>
<div class="canvasWrappers2"></div>
</td>
<td>
<div class="canvasWrappers2"></div>
<div class="canvasWrappers2"></div>
</td>
<td>
<div class="canvasWrappers2"></div>
<div class="canvasWrappers2"></div>
</td>
<td>
<div class="canvasWrappers2"></div>
<div class="canvasWrappers2"></div>
</td>
<td>
<div class="canvasWrappers2"></div>
<div class="canvasWrappers2"></div>
</td>
<td>
<div class="canvasWrappers2"></div>
<div class="canvasWrappers2"></div>
</td>
<td>
<div class="canvasWrappers2"></div>
<div class="canvasWrappers2"></div>
</td>
<td>
<div class="canvasWrappers2"></div>
<div class="canvasWrappers2"></div>
</td>
</tr>
<tr><td style="height:10px;"></td></tr>
<tr>
<td class="hiddenLayerOutputNode">MaxPool<br>
Layer 4</td>
<td>
<div class="canvasWrappers3"></div>
<div class="canvasWrappers3"></div>
</td>
<td>
<div class="canvasWrappers3"></div>
<div class="canvasWrappers3"></div>
</td>
<td>
<div class="canvasWrappers3"></div>
<div class="canvasWrappers3"></div>
</td>
<td>
<div class="canvasWrappers3"></div>
<div class="canvasWrappers3"></div>
</td>
<td>
<div class="canvasWrappers3"></div>
<div class="canvasWrappers3"></div>
</td>
<td>
<div class="canvasWrappers3"></div>
<div class="canvasWrappers3"></div>
</td>
<td>
<div class="canvasWrappers3"></div>
<div class="canvasWrappers3"></div>
</td>
<td>
<div class="canvasWrappers3"></div>
<div class="canvasWrappers3"></div>
</td>
</tr>
</table>
</div>
<div id="trainingData" style="display:none;">
30 examples of the 60.000 training samples in the MNIST data set:<br>
<br>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div id="networkArchitecture">
<div class="architectureNode">
<b>Input</b><br>
28x28 pixels
</div>
<div class="architectureNode">
<b>Convolution 1</b><br>
8 filters each 5x5 pixel<br>
activation: ReLU<br>
output: 8 images each 24x24 pixel
</div>
<div class="architectureNode">
<b>MaxPool 2</b><br>
2x2 pixel segmentation<br>
output: 8 images each 12x12 pixel
</div>
<div class="architectureNode">
<b>Convolution 3</b><br>
16 filters each 5x5 pixel<br>
activation: ReLU<br>
output: 16 images each 8x8 pixel
</div>
<div class="architectureNode">
<b>MaxPool 4</b><br>
2x2 pixel segmentation<br>
output: 16 images each 4x4 pixel
</div>
<div class="architectureNode">
<b>Dense 5</b><br>
Full Connection (2560 weights)<br>
activation: softmax<br>
<b>output:</b> 10 neurons (values between 0 and 1)
</div>
<div class="architectureNode lastNode" style="margin-top: 20px;">
<b>Loss function:</b> Categorial Cross Entropy<br>
<b>Optimizer:</b> Adam
</div>
</div>
</div>
</td>
</tr></table>
</body>
</html>