Spaces:
Running
Running
File size: 41,832 Bytes
d2a2589 39a9803 | 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 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>From Data to Defense — NIDS Survey Results</title>
<link href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Sora:wght@300;400;600;700;800&display=swap" rel="stylesheet">
<style>
:root {
--bg: #040c14;
--bg2: #071622;
--bg3: #0a1f2e;
--cyan: #00d4ff;
--cyan2: #00a8cc;
--green: #00ff9d;
--orange: #ff6b35;
--yellow: #ffd700;
--red: #ff3d5a;
--text: #d4eaf7;
--muted: #5a7a8a;
--border: rgba(0,212,255,0.15);
--mono: 'Share Tech Mono', monospace;
--sans: 'Sora', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
background: var(--bg);
color: var(--text);
font-family: var(--sans);
overflow-x: hidden;
cursor: default;
}
/* ── SCANLINE OVERLAY ── */
body::before {
content: '';
position: fixed;
inset: 0;
background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.07) 2px, rgba(0,0,0,0.07) 4px);
pointer-events: none;
z-index: 9999;
}
/* ── GRID BACKGROUND ── */
.grid-bg {
position: fixed;
inset: 0;
background-image:
linear-gradient(rgba(0,212,255,0.04) 1px, transparent 1px),
linear-gradient(90deg, rgba(0,212,255,0.04) 1px, transparent 1px);
background-size: 60px 60px;
pointer-events: none;
z-index: 0;
}
/* ── NAV ── */
nav {
position: fixed;
top: 0; left: 0; right: 0;
z-index: 100;
background: rgba(4,12,20,0.92);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border);
padding: 0 2rem;
display: flex;
align-items: center;
justify-content: space-between;
height: 56px;
}
.nav-logo {
font-family: var(--mono);
font-size: 0.8rem;
color: var(--cyan);
letter-spacing: 2px;
text-transform: uppercase;
}
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
}
.nav-links a {
font-family: var(--mono);
font-size: 0.72rem;
color: var(--muted);
text-decoration: none;
letter-spacing: 1px;
text-transform: uppercase;
transition: color 0.2s;
}
.nav-links a:hover { color: var(--cyan); }
/* ── SECTIONS ── */
section {
position: relative;
z-index: 1;
padding: 6rem 2rem;
max-width: 1200px;
margin: 0 auto;
}
/* ── HERO ── */
#hero {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
max-width: 100%;
padding: 6rem 4rem;
position: relative;
overflow: hidden;
}
.hero-tag {
font-family: var(--mono);
font-size: 0.72rem;
color: var(--cyan);
letter-spacing: 4px;
text-transform: uppercase;
margin-bottom: 1.5rem;
opacity: 0;
animation: fadeUp 0.8s 0.2s forwards;
}
h1 {
font-size: clamp(2.5rem, 6vw, 5.5rem);
font-weight: 800;
line-height: 1.05;
letter-spacing: -2px;
max-width: 900px;
opacity: 0;
animation: fadeUp 0.8s 0.4s forwards;
}
h1 span { color: var(--cyan); }
.hero-sub {
margin-top: 2rem;
font-size: 1rem;
color: var(--muted);
max-width: 600px;
line-height: 1.7;
opacity: 0;
animation: fadeUp 0.8s 0.6s forwards;
}
.hero-stats {
display: flex;
gap: 3rem;
margin-top: 4rem;
opacity: 0;
animation: fadeUp 0.8s 0.8s forwards;
}
.stat-item { text-align: left; }
.stat-num {
font-family: var(--mono);
font-size: 2.8rem;
color: var(--cyan);
line-height: 1;
}
.stat-label {
font-size: 0.72rem;
color: var(--muted);
letter-spacing: 2px;
text-transform: uppercase;
margin-top: 0.3rem;
}
/* Glowing orb */
.hero-orb {
position: absolute;
right: -100px;
top: 50%;
transform: translateY(-50%);
width: 600px;
height: 600px;
border-radius: 50%;
background: radial-gradient(circle, rgba(0,212,255,0.08) 0%, transparent 70%);
animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { transform: translateY(-50%) scale(1); opacity: 0.6; }
50% { transform: translateY(-50%) scale(1.1); opacity: 1; }
}
/* ── SECTION HEADERS ── */
.section-label {
font-family: var(--mono);
font-size: 0.68rem;
color: var(--cyan);
letter-spacing: 4px;
text-transform: uppercase;
margin-bottom: 0.75rem;
}
h2 {
font-size: clamp(1.8rem, 4vw, 3rem);
font-weight: 700;
letter-spacing: -1px;
margin-bottom: 0.5rem;
line-height: 1.15;
}
.section-desc {
color: var(--muted);
font-size: 0.9rem;
line-height: 1.7;
max-width: 640px;
margin-bottom: 3rem;
}
/* ── DIVIDER ── */
.divider {
border: none;
border-top: 1px solid var(--border);
margin: 0;
}
/* ── DATASET CARDS ── */
.dataset-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
margin-top: 2rem;
}
.card {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: 12px;
padding: 2rem;
position: relative;
overflow: hidden;
transition: border-color 0.3s, transform 0.3s;
}
.card:hover {
border-color: rgba(0,212,255,0.4);
transform: translateY(-2px);
}
.card::before {
content: '';
position: absolute;
top: 0; left: 0; right: 0;
height: 2px;
background: linear-gradient(90deg, var(--cyan), transparent);
}
.card-title {
font-family: var(--mono);
font-size: 0.78rem;
color: var(--cyan);
letter-spacing: 2px;
text-transform: uppercase;
margin-bottom: 1.2rem;
}
.card h3 {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 0.5rem;
}
.card p {
font-size: 0.85rem;
color: var(--muted);
line-height: 1.6;
margin-bottom: 1.5rem;
}
.dataset-stat {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem 0;
border-top: 1px solid var(--border);
font-size: 0.82rem;
}
.dataset-stat span:first-child { color: var(--muted); }
.dataset-stat span:last-child { font-family: var(--mono); color: var(--cyan); }
/* ── TABS ── */
.tabs {
display: flex;
gap: 0;
border: 1px solid var(--border);
border-radius: 8px;
overflow: hidden;
margin-bottom: 2rem;
width: fit-content;
}
.tab-btn {
background: transparent;
border: none;
color: var(--muted);
font-family: var(--mono);
font-size: 0.72rem;
letter-spacing: 2px;
text-transform: uppercase;
padding: 0.7rem 1.5rem;
cursor: pointer;
transition: all 0.2s;
border-right: 1px solid var(--border);
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active {
background: rgba(0,212,255,0.1);
color: var(--cyan);
}
.tab-btn:hover:not(.active) {
background: rgba(0,212,255,0.05);
color: var(--text);
}
.tab-content { display: none; }
.tab-content.active { display: block; }
/* ── CHART AREA ── */
.chart-wrap {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: 12px;
padding: 2rem;
margin-bottom: 2rem;
}
.chart-title {
font-family: var(--mono);
font-size: 0.72rem;
color: var(--muted);
letter-spacing: 2px;
text-transform: uppercase;
margin-bottom: 1.5rem;
}
.bar-chart { display: flex; flex-direction: column; gap: 0.65rem; }
.bar-row {
display: grid;
grid-template-columns: 130px 1fr 70px;
align-items: center;
gap: 0.75rem;
}
.bar-label {
font-family: var(--mono);
font-size: 0.72rem;
color: var(--muted);
text-align: right;
white-space: nowrap;
}
.bar-track {
height: 20px;
background: rgba(255,255,255,0.04);
border-radius: 4px;
overflow: hidden;
}
.bar-fill {
height: 100%;
border-radius: 4px;
width: 0;
transition: width 1s cubic-bezier(.16,1,.3,1);
position: relative;
}
.bar-fill::after {
content: '';
position: absolute;
top: 0; right: 0; bottom: 0;
width: 6px;
background: rgba(255,255,255,0.3);
border-radius: 0 4px 4px 0;
}
.bar-val {
font-family: var(--mono);
font-size: 0.72rem;
color: var(--text);
}
/* ── DATA TABLE ── */
.table-wrap {
overflow-x: auto;
border: 1px solid var(--border);
border-radius: 12px;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 0.8rem;
}
thead th {
background: var(--bg3);
font-family: var(--mono);
font-size: 0.65rem;
letter-spacing: 2px;
text-transform: uppercase;
color: var(--cyan);
padding: 0.9rem 1rem;
text-align: left;
border-bottom: 1px solid var(--border);
white-space: nowrap;
}
tbody td {
padding: 0.7rem 1rem;
border-bottom: 1px solid var(--border);
color: var(--text);
font-family: var(--mono);
font-size: 0.78rem;
white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(0,212,255,0.04); }
.best { color: var(--green); font-weight: 700; }
.worst { color: var(--red); }
.mid { color: var(--yellow); }
.badge {
display: inline-block;
padding: 0.15rem 0.5rem;
border-radius: 3px;
font-size: 0.65rem;
letter-spacing: 1px;
text-transform: uppercase;
}
.badge-ml { background: rgba(0,255,157,0.1); color: var(--green); border: 1px solid rgba(0,255,157,0.2); }
.badge-dl { background: rgba(0,212,255,0.1); color: var(--cyan); border: 1px solid rgba(0,212,255,0.2); }
.badge-smote { background: rgba(255,107,53,0.1); color: var(--orange); border: 1px solid rgba(255,107,53,0.2); }
/* ── FINDING CARDS ── */
.findings-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1.5rem;
margin-top: 2rem;
}
.finding-card {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: 12px;
padding: 1.75rem;
position: relative;
overflow: hidden;
transition: all 0.3s;
}
.finding-card:hover {
border-color: rgba(0,212,255,0.35);
transform: translateY(-3px);
}
.finding-icon {
font-size: 1.8rem;
margin-bottom: 1rem;
}
.finding-card h4 {
font-size: 1rem;
font-weight: 700;
margin-bottom: 0.6rem;
color: var(--text);
}
.finding-card p {
font-size: 0.82rem;
color: var(--muted);
line-height: 1.6;
}
/* ── COMPUTATIONAL COST ── */
.compute-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
margin-top: 2rem;
}
/* ── GUIDELINES TABLE ── */
.guidelines-wrap {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: 12px;
overflow: hidden;
margin-top: 2rem;
}
.gl-row {
display: grid;
grid-template-columns: 2fr 1.2fr 1.2fr 2fr;
gap: 0;
border-bottom: 1px solid var(--border);
}
.gl-row:last-child { border-bottom: none; }
.gl-header .gl-cell {
background: var(--bg3);
font-family: var(--mono);
font-size: 0.65rem;
color: var(--cyan);
letter-spacing: 2px;
text-transform: uppercase;
}
.gl-cell {
padding: 1rem 1.2rem;
font-size: 0.82rem;
border-right: 1px solid var(--border);
line-height: 1.5;
}
.gl-cell:last-child { border-right: none; }
.gl-row:not(.gl-header):hover .gl-cell { background: rgba(0,212,255,0.03); }
/* ── ANIMATIONS ── */
@keyframes fadeUp {
from { opacity: 0; transform: translateY(24px); }
to { opacity: 1; transform: translateY(0); }
}
.reveal {
opacity: 0;
transform: translateY(30px);
transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
opacity: 1;
transform: translateY(0);
}
/* ── FOOTER ── */
footer {
position: relative;
z-index: 1;
border-top: 1px solid var(--border);
padding: 2rem 4rem;
display: flex;
justify-content: space-between;
align-items: center;
}
footer p {
font-family: var(--mono);
font-size: 0.68rem;
color: var(--muted);
letter-spacing: 1px;
}
.dot {
display: inline-block;
width: 6px; height: 6px;
border-radius: 50%;
background: var(--cyan);
margin-right: 0.5rem;
animation: blink 1.2s step-end infinite;
}
@keyframes blink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
@media (max-width: 768px) {
#hero { padding: 6rem 2rem; }
.hero-stats { flex-wrap: wrap; gap: 2rem; }
.dataset-grid, .findings-grid, .compute-grid { grid-template-columns: 1fr; }
.gl-row { grid-template-columns: 1fr 1fr; }
nav { padding: 0 1rem; }
.nav-links { display: none; }
h1 { letter-spacing: -1px; }
}
</style>
</head>
<body>
<div class="grid-bg"></div>
<!-- NAV -->
<nav>
<div class="nav-logo"><span class="dot"></span>NIDS Survey 2024</div>
<ul class="nav-links">
<li><a href="#datasets">Datasets</a></li>
<li><a href="#results">Results</a></li>
<li><a href="#compute">Compute Cost</a></li>
<li><a href="#findings">Findings</a></li>
<li><a href="#guidelines">Guidelines</a></li>
</ul>
</nav>
<!-- HERO -->
<div id="hero">
<div class="hero-orb"></div>
<div class="hero-tag">Conference Presentation · NIDS Survey</div>
<h1>From <span>Data</span><br>to Defense</h1>
<p class="hero-sub">An analytical overview of machine and deep learning models for Network Intrusion Detection Systems, evaluated across two benchmark datasets under a unified experimental framework.</p>
<div class="hero-stats">
<div class="stat-item">
<div class="stat-num">7</div>
<div class="stat-label">Models Evaluated</div>
</div>
<div class="stat-item">
<div class="stat-num">2</div>
<div class="stat-label">Benchmark Datasets</div>
</div>
<div class="stat-item">
<div class="stat-num">8</div>
<div class="stat-label">Evaluation Metrics</div>
</div>
<div class="stat-item">
<div class="stat-num">4M+</div>
<div class="stat-label">Records Processed</div>
</div>
</div>
</div>
<hr class="divider">
<!-- DATASETS -->
<section id="datasets">
<div class="reveal">
<div class="section-label">// Section 01</div>
<h2>Benchmark Datasets</h2>
<p class="section-desc">Two widely-used intrusion detection datasets selected to represent both classical and modern network traffic environments.</p>
</div>
<div class="dataset-grid reveal">
<div class="card">
<div class="card-title">Dataset 01</div>
<h3>KDD Cup 99</h3>
<p>One of the earliest and most widely-used IDS benchmarks. Contains diverse attack types across 41 features, enabling systematic ML evaluation despite its age.</p>
<div class="dataset-stat"><span>Total Records</span><span>~4,000,000</span></div>
<div class="dataset-stat"><span>Features</span><span>41</span></div>
<div class="dataset-stat"><span>Attack Types</span><span>10 (after filtering)</span></div>
<div class="dataset-stat"><span>Largest Class</span><span>smurf · 2,807,886</span></div>
<div class="dataset-stat"><span>Normal Traffic</span><span>972,781</span></div>
</div>
<div class="card">
<div class="card-title">Dataset 02</div>
<h3>UNSW-NB15</h3>
<p>A modern dataset with realistic traffic patterns and diverse attack categories. Reflects contemporary network environments with significant class imbalance.</p>
<div class="dataset-stat"><span>Total Records</span><span>~2,367,624</span></div>
<div class="dataset-stat"><span>Attack Categories</span><span>9</span></div>
<div class="dataset-stat"><span>Benign Traffic</span><span>2,237,731</span></div>
<div class="dataset-stat"><span>Rarest Class</span><span>Worms · 158</span></div>
<div class="dataset-stat"><span>Imbalance Ratio</span><span>High</span></div>
</div>
</div>
</section>
<hr class="divider">
<!-- RESULTS -->
<section id="results">
<div class="reveal">
<div class="section-label">// Section 02</div>
<h2>Model Performance Results</h2>
<p class="section-desc">Comprehensive metrics including balanced accuracy, F1-macro, G-Mean, precision, and recall evaluated across all models on both datasets — with and without SMOTE oversampling.</p>
</div>
<div class="reveal">
<div class="tabs">
<button class="tab-btn active" onclick="switchTab(event,'unsw-raw')">UNSW · Raw</button>
<button class="tab-btn" onclick="switchTab(event,'unsw-smote')">UNSW · SMOTE</button>
<button class="tab-btn" onclick="switchTab(event,'kdd-raw')">KDD Cup · Raw</button>
<button class="tab-btn" onclick="switchTab(event,'kdd-smote')">KDD Cup · SMOTE</button>
</div>
<!-- UNSW RAW -->
<div id="unsw-raw" class="tab-content active">
<div class="chart-wrap">
<div class="chart-title">// Balanced Accuracy — UNSW-NB15 (Raw)</div>
<div class="bar-chart" id="chart-unsw-raw"></div>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Model</th><th>Type</th><th>Accuracy</th><th>Balanced Acc.</th><th>Precision</th><th>Recall</th><th>F1-Macro</th><th>G-Mean</th>
</tr>
</thead>
<tbody>
<tr><td>Random Forest</td><td><span class="badge badge-ml">ML</span></td><td>0.9757</td><td class="best">0.5657</td><td class="best">0.6197</td><td class="best">0.5657</td><td class="best">0.5810</td><td class="best">0.4822</td></tr>
<tr><td>XGBoost</td><td><span class="badge badge-ml">ML</span></td><td>0.9738</td><td>0.4247</td><td>0.6435</td><td>0.4247</td><td>0.4510</td><td class="worst">0.0180</td></tr>
<tr><td>Decision Tree</td><td><span class="badge badge-ml">ML</span></td><td>0.9753</td><td>0.4703</td><td>0.5760</td><td>0.4703</td><td>0.4850</td><td>0.0238</td></tr>
<tr><td>LSTM-CNN</td><td><span class="badge badge-dl">DL</span></td><td>0.9729</td><td>0.3823</td><td>0.4673</td><td>0.3823</td><td>0.3950</td><td>0.0001</td></tr>
<tr><td>ANN</td><td><span class="badge badge-dl">DL</span></td><td>0.9589</td><td>0.3744</td><td>0.3568</td><td>0.3744</td><td>0.2990</td><td class="worst">≈0</td></tr>
<tr><td>LSTM</td><td><span class="badge badge-dl">DL</span></td><td>0.9673</td><td>0.3287</td><td>0.3546</td><td>0.3287</td><td>0.3250</td><td class="worst">≈0</td></tr>
<tr><td>CNN</td><td><span class="badge badge-dl">DL</span></td><td class="worst">0.9524</td><td class="worst">0.2781</td><td class="worst">0.3386</td><td class="worst">0.2781</td><td class="worst">0.2730</td><td class="worst">≈0</td></tr>
</tbody>
</table>
</div>
</div>
<!-- UNSW SMOTE -->
<div id="unsw-smote" class="tab-content">
<div class="chart-wrap">
<div class="chart-title">// Balanced Accuracy — UNSW-NB15 (After SMOTE) — Degradation observed</div>
<div class="bar-chart" id="chart-unsw-smote"></div>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Model</th><th>Accuracy</th><th>Balanced Acc.</th><th>Precision</th><th>Recall</th><th>F1-Macro</th><th>G-Mean</th>
</tr>
</thead>
<tbody>
<tr><td>LSTM-CNN <span class="badge badge-smote">SMOTE</span></td><td class="worst">0.0112</td><td>0.1241</td><td>0.0918</td><td>0.1241</td><td class="worst">0.0077</td><td>0.0017</td></tr>
<tr><td>Random Forest <span class="badge badge-smote">SMOTE</span></td><td>0.9194</td><td class="best">0.1001</td><td class="best">0.1919</td><td class="best">0.1001</td><td class="best">0.0961</td><td class="worst">≈0</td></tr>
<tr><td>ANN <span class="badge badge-smote">SMOTE</span></td><td>0.9194</td><td>0.1000</td><td>0.0919</td><td>0.1000</td><td>0.0958</td><td class="worst">≈0</td></tr>
<tr><td>CNN <span class="badge badge-smote">SMOTE</span></td><td>0.9194</td><td>0.1000</td><td>0.0919</td><td>0.1000</td><td>0.0958</td><td class="worst">≈0</td></tr>
<tr><td>XGBoost <span class="badge badge-smote">SMOTE</span></td><td>0.1104</td><td>0.1108</td><td>0.1044</td><td>0.1108</td><td>0.0248</td><td class="worst">≈0</td></tr>
<tr><td>Decision Tree <span class="badge badge-smote">SMOTE</span></td><td>0.8633</td><td>0.0960</td><td>0.0930</td><td>0.0960</td><td>0.0937</td><td class="worst">≈0</td></tr>
<tr><td>LSTM <span class="badge badge-smote">SMOTE</span></td><td class="worst">0.0352</td><td class="worst">0.0683</td><td class="worst">0.0814</td><td class="worst">0.0683</td><td class="worst">0.0097</td><td class="worst">≈0</td></tr>
</tbody>
</table>
</div>
<div class="chart-wrap" style="margin-top:1.5rem; border-color: rgba(255,61,90,0.2)">
<div class="chart-title" style="color:var(--red)">// ⚠ SMOTE degraded ALL metrics on UNSW-NB15 — Not recommended for high-dimensional imbalanced data</div>
<p style="font-size:0.85rem; color:var(--muted); line-height:1.7">Applying SMOTE to the UNSW-NB15 dataset caused substantial deterioration across all models. Balanced accuracy, F1-macro, and G-Mean dropped significantly compared to raw data settings, indicating that sample-level oversampling is ineffective for high-dimensional complex datasets. Model robustness and algorithm-level imbalance handling are more critical.</p>
</div>
</div>
<!-- KDD RAW -->
<div id="kdd-raw" class="tab-content">
<div class="chart-wrap">
<div class="chart-title">// Balanced Accuracy — KDD Cup 99 (Raw)</div>
<div class="bar-chart" id="chart-kdd-raw"></div>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Model</th><th>Type</th><th>Accuracy</th><th>Balanced Acc.</th><th>Precision</th><th>Recall</th><th>F1-Macro</th><th>G-Mean</th>
</tr>
</thead>
<tbody>
<tr><td>Random Forest</td><td><span class="badge badge-ml">ML</span></td><td class="best">0.9999</td><td class="best">0.9940</td><td class="best">0.9969</td><td class="best">0.9940</td><td class="best">0.9955</td><td class="best">0.9939</td></tr>
<tr><td>XGBoost</td><td><span class="badge badge-ml">ML</span></td><td>0.9997</td><td>0.9909</td><td>0.9941</td><td>0.9909</td><td>0.9925</td><td>0.9908</td></tr>
<tr><td>LSTM-CNN</td><td><span class="badge badge-dl">DL</span></td><td>0.9992</td><td>0.9848</td><td>0.9687</td><td>0.9848</td><td>0.9758</td><td>0.9846</td></tr>
<tr><td>Decision Tree</td><td><span class="badge badge-ml">ML</span></td><td>0.9988</td><td>0.9614</td><td>0.9659</td><td>0.9614</td><td>0.9622</td><td>0.9586</td></tr>
<tr><td>LSTM</td><td><span class="badge badge-dl">DL</span></td><td>0.9985</td><td>0.9673</td><td>0.9401</td><td>0.9673</td><td>0.9517</td><td>0.9663</td></tr>
<tr><td>ANN</td><td><span class="badge badge-dl">DL</span></td><td>0.9987</td><td>0.9427</td><td>0.9622</td><td>0.9427</td><td>0.9519</td><td>0.9362</td></tr>
<tr><td>CNN</td><td><span class="badge badge-dl">DL</span></td><td>0.9899</td><td class="worst">0.6256</td><td>0.7080</td><td class="worst">0.6256</td><td>0.6446</td><td class="worst">0.0051</td></tr>
</tbody>
</table>
</div>
</div>
<!-- KDD SMOTE -->
<div id="kdd-smote" class="tab-content">
<div class="chart-wrap">
<div class="chart-title">// Balanced Accuracy — KDD Cup 99 (After SMOTE) — Selective improvements</div>
<div class="bar-chart" id="chart-kdd-smote"></div>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Model</th><th>Accuracy</th><th>Balanced Acc.</th><th>Precision</th><th>Recall</th><th>F1-Macro</th><th>G-Mean</th>
</tr>
</thead>
<tbody>
<tr><td>Random Forest <span class="badge badge-smote">SMOTE</span></td><td class="best">0.9999</td><td>0.9922</td><td class="best">0.9978</td><td>0.9922</td><td class="best">0.9949</td><td>0.9920</td></tr>
<tr><td>XGBoost <span class="badge badge-smote">SMOTE</span></td><td>0.9997</td><td class="best">0.9971</td><td>0.9864</td><td class="best">0.9971</td><td>0.9916</td><td class="best">0.9971</td></tr>
<tr><td>ANN <span class="badge badge-smote">SMOTE</span></td><td>0.9926</td><td>0.9953</td><td>0.7993</td><td>0.9954</td><td>0.8655</td><td>0.9953</td></tr>
<tr><td>LSTM-CNN <span class="badge badge-smote">SMOTE</span></td><td>0.9992</td><td>0.9907</td><td>0.9589</td><td>0.9908</td><td>0.9737</td><td>0.9906</td></tr>
<tr><td>Decision Tree <span class="badge badge-smote">SMOTE</span></td><td>0.9970</td><td>0.9931</td><td>0.9252</td><td>0.9931</td><td>0.9386</td><td>0.9930</td></tr>
<tr><td>LSTM <span class="badge badge-smote">SMOTE</span></td><td>0.9981</td><td>0.9980</td><td>0.9111</td><td>0.9912</td><td>0.9431</td><td>0.9910</td></tr>
<tr><td>CNN <span class="badge badge-smote">SMOTE</span></td><td>0.9494</td><td>0.9721</td><td class="worst">0.5231</td><td>0.9721</td><td class="worst">0.6199</td><td>0.9717</td></tr>
</tbody>
</table>
</div>
<div class="chart-wrap" style="margin-top:1.5rem; border-color: rgba(0,255,157,0.2)">
<div class="chart-title" style="color:var(--green)">// ✓ SMOTE on KDD Cup 99 — Improvements for DL models, marginal effect on tree-based</div>
<p style="font-size:0.85rem; color:var(--muted); line-height:1.7">SMOTE improved minority class recall for deep learning models notably (ANN: 0.94 → 0.99, CNN: 0.63 → 0.97). However, precision dropped, indicating more false positives. Tree-based models (RF, XGBoost) were largely unaffected — they inherently handle class imbalance well and do not benefit significantly from data-level oversampling.</p>
</div>
</div>
</div>
</section>
<hr class="divider">
<!-- COMPUTE COST -->
<section id="compute">
<div class="reveal">
<div class="section-label">// Section 03</div>
<h2>Computational Cost Analysis</h2>
<p class="section-desc">Inference time and memory footprint are critical factors for real-world NIDS deployment. Deep learning architectures show significantly higher latency and resource consumption.</p>
</div>
<div class="compute-grid reveal">
<div class="chart-wrap">
<div class="chart-title">// Inference Time (seconds) — UNSW-NB15</div>
<div class="bar-chart" id="chart-time-unsw"></div>
</div>
<div class="chart-wrap">
<div class="chart-title">// Inference Time (seconds) — KDD Cup 99</div>
<div class="bar-chart" id="chart-time-kdd"></div>
</div>
</div>
<div class="compute-grid reveal">
<div class="chart-wrap">
<div class="chart-title">// Memory Usage (MB) — UNSW-NB15 · Note: RF 22,424 MB</div>
<div class="bar-chart" id="chart-mem-unsw"></div>
</div>
<div class="chart-wrap">
<div class="chart-title">// Memory Usage (MB) — KDD Cup 99</div>
<div class="bar-chart" id="chart-mem-kdd"></div>
</div>
</div>
<div class="table-wrap reveal" style="margin-top:1.5rem">
<table>
<thead>
<tr><th>Model</th><th>Type</th><th>UNSW Infer. Time (s)</th><th>UNSW Memory (MB)</th><th>KDD Infer. Time (s)</th><th>KDD Memory (MB)</th></tr>
</thead>
<tbody>
<tr><td>Decision Tree</td><td><span class="badge badge-ml">ML</span></td><td class="best">0.025</td><td>1,579</td><td class="best">0.026</td><td>4,959</td></tr>
<tr><td>XGBoost</td><td><span class="badge badge-ml">ML</span></td><td>0.333</td><td class="best">1,571</td><td>0.226</td><td class="best">4,959</td></tr>
<tr><td>Random Forest</td><td><span class="badge badge-ml">ML</span></td><td>0.571</td><td class="worst">22,424</td><td>0.373</td><td>4,989</td></tr>
<tr><td>ANN</td><td><span class="badge badge-dl">DL</span></td><td>1.622</td><td>5,267</td><td>1.410</td><td>4,503</td></tr>
<tr><td>CNN</td><td><span class="badge badge-dl">DL</span></td><td>1.649</td><td>4,375</td><td>1.314</td><td>5,096</td></tr>
<tr><td>LSTM</td><td><span class="badge badge-dl">DL</span></td><td>1.902</td><td>4,710</td><td>1.475</td><td>5,104</td></tr>
<tr><td>LSTM-CNN</td><td><span class="badge badge-dl">DL</span></td><td class="worst">3.721</td><td>4,720</td><td class="worst">2.995</td><td>5,112</td></tr>
</tbody>
</table>
</div>
</section>
<hr class="divider">
<!-- KEY FINDINGS -->
<section id="findings">
<div class="reveal">
<div class="section-label">// Section 04</div>
<h2>Key Findings</h2>
<p class="section-desc">Six critical insights derived from unified experimental evaluation across models and datasets.</p>
</div>
<div class="findings-grid">
<div class="finding-card reveal">
<div class="finding-icon">🌲</div>
<h4>Tree Models Dominate on Structured Data</h4>
<p>Random Forest and XGBoost achieved near-perfect F1-macro (>0.99) on KDD Cup 99. Ensemble methods consistently outperformed all other approaches on structured, tabular datasets.</p>
</div>
<div class="finding-card reveal">
<div class="finding-icon">⚖️</div>
<h4>Accuracy is a Misleading Metric</h4>
<p>Multiple DL models reported >96% accuracy on UNSW-NB15, yet their balanced accuracy and G-Mean revealed near-zero minority class detection, exposing the danger of relying on a single metric.</p>
</div>
<div class="finding-card reveal">
<div class="finding-icon">🧠</div>
<h4>Deep Learning: High Cost, Mixed Returns</h4>
<p>CNN-LSTM hybrid achieved strong KDD performance (F1: 0.976) but requires 3.7s inference and >5GB memory. The computational cost limits real-time applicability significantly.</p>
</div>
<div class="finding-card reveal">
<div class="finding-icon">🚫</div>
<h4>SMOTE Harmful on High-Dimensional Data</h4>
<p>Applying SMOTE to UNSW-NB15 degraded all metrics across all models substantially. Simple sample-level balancing cannot compensate for feature complexity and distribution shifts.</p>
</div>
<div class="finding-card reveal">
<div class="finding-icon">✅</div>
<h4>SMOTE Helps DL on KDD Cup 99</h4>
<p>ANN balanced accuracy improved from 0.943 to 0.995, and CNN from 0.626 to 0.972 after SMOTE on KDD Cup 99. However, this came at the cost of precision degradation.</p>
</div>
<div class="finding-card reveal">
<div class="finding-icon">⚡</div>
<h4>Decision Tree Best for Real-Time</h4>
<p>With ~0.025s inference time and the smallest memory footprint, Decision Trees are optimal for latency-sensitive deployments where sub-second detection is a hard requirement.</p>
</div>
</div>
</section>
<hr class="divider">
<!-- GUIDELINES -->
<section id="guidelines">
<div class="reveal">
<div class="section-label">// Section 05</div>
<h2>Dataset–Model Selection Guidelines</h2>
<p class="section-desc">Practical decision framework for selecting the right model and strategy based on deployment requirements and dataset characteristics.</p>
</div>
<div class="guidelines-wrap reveal">
<div class="gl-row gl-header">
<div class="gl-cell">Deployment Scenario</div>
<div class="gl-cell">Recommended Model</div>
<div class="gl-cell">Dataset</div>
<div class="gl-cell">Key Evidence</div>
</div>
<div class="gl-row">
<div class="gl-cell">Structured, low-complexity traffic</div>
<div class="gl-cell"><span class="badge badge-ml">RF / XGBoost</span></div>
<div class="gl-cell" style="font-family:var(--mono); font-size:0.78rem; color:var(--cyan)">KDD Cup 99</div>
<div class="gl-cell" style="color:var(--muted)">F1-macro >0.99; near-perfect balanced accuracy</div>
</div>
<div class="gl-row">
<div class="gl-cell">High-dimensional, imbalanced traffic</div>
<div class="gl-cell"><span class="badge badge-ml">RF</span></div>
<div class="gl-cell" style="font-family:var(--mono); font-size:0.78rem; color:var(--cyan)">UNSW-NB15</div>
<div class="gl-cell" style="color:var(--muted)">Best balanced accuracy (0.57) and G-Mean (0.48) among all tested models</div>
</div>
<div class="gl-row">
<div class="gl-cell">Real-time / latency-sensitive deployment</div>
<div class="gl-cell"><span class="badge badge-ml">DT</span></div>
<div class="gl-cell" style="font-family:var(--mono); font-size:0.78rem; color:var(--cyan)">Both</div>
<div class="gl-cell" style="color:var(--muted)">Fastest inference (~0.02s); lowest memory footprint across all datasets</div>
</div>
<div class="gl-row">
<div class="gl-cell">Sequential / temporal attack patterns</div>
<div class="gl-cell"><span class="badge badge-dl">LSTM / CNN-LSTM</span></div>
<div class="gl-cell" style="font-family:var(--mono); font-size:0.78rem; color:var(--cyan)">KDD Cup 99</div>
<div class="gl-cell" style="color:var(--muted)">Strong recall on ordered flow attacks; temporal dependency modeling</div>
</div>
<div class="gl-row">
<div class="gl-cell">Imbalanced data + deep learning</div>
<div class="gl-cell"><span class="badge badge-smote">SMOTE + ANN/LSTM</span></div>
<div class="gl-cell" style="font-family:var(--mono); font-size:0.78rem; color:var(--cyan)">KDD Cup 99</div>
<div class="gl-cell" style="color:var(--muted)">Balanced accuracy improved from 0.94 to 0.99; recall gains outweigh precision drop</div>
</div>
<div class="gl-row">
<div class="gl-cell">High-dimensional data + imbalance</div>
<div class="gl-cell"><span class="badge badge-ml">RF (no SMOTE)</span></div>
<div class="gl-cell" style="font-family:var(--mono); font-size:0.78rem; color:var(--cyan)">UNSW-NB15</div>
<div class="gl-cell" style="color:var(--muted)">SMOTE degraded all metrics on high-dimensional data; avoid sample-level balancing</div>
</div>
</div>
<!-- Conclusion box -->
<div class="card reveal" style="margin-top:2rem; border-color:rgba(0,255,157,0.2)">
<div class="card-title" style="color:var(--green)">// Conclusion & Future Directions</div>
<h3 style="margin-bottom:1rem; font-size:1.2rem">Ensemble Methods Offer the Best Production Trade-off</h3>
<p>Decision Trees achieve inference times as low as 0.02s for real-time monitoring, while hybrid CNN-LSTM models exceed 3s latency with >5GB memory — suitable only for offline analysis. RF and XGBoost provide the optimal balance of strong detection performance with manageable inference costs, making them the most practical choice for production NIDS environments.</p>
<p style="margin-top:1rem">Future research should explore <strong style="color:var(--cyan)">transformer-based architectures</strong> for NIDS — leveraging self-attention for parallel processing and better capture of global traffic patterns, potentially overcoming the computational bottlenecks observed in LSTM and CNN-LSTM models.</p>
</div>
</section>
<footer>
<p>From Data to Defense · NIDS Survey · Evaluation of ML & DL for Network Intrusion Detection</p>
<p style="color:var(--cyan)">KDD Cup 99 · UNSW-NB15 · 7 Models · Unified Evaluation Framework</p>
</footer>
<script>
// ── BAR CHART RENDERER ──
function renderBar(containerId, data, colorFn) {
const el = document.getElementById(containerId);
if (!el) return;
const max = Math.max(...data.map(d => d.val));
el.innerHTML = '';
data.forEach((d, i) => {
const pct = (d.val / max * 100).toFixed(1);
const color = colorFn ? colorFn(d, i) : `hsl(${180 + i * 15}, 70%, 55%)`;
const row = document.createElement('div');
row.className = 'bar-row';
row.innerHTML = `
<div class="bar-label">${d.label}</div>
<div class="bar-track"><div class="bar-fill" data-width="${pct}" style="background:${color}; width:0%"></div></div>
<div class="bar-val">${d.val.toFixed ? d.val.toFixed(4) : d.val}</div>`;
el.appendChild(row);
});
requestAnimationFrame(() => {
el.querySelectorAll('.bar-fill').forEach(b => b.style.width = b.dataset.width + '%');
});
}
const ml_color = () => 'linear-gradient(90deg, #00d4ff, #00a8cc)';
const dl_color = () => 'linear-gradient(90deg, #8b5cf6, #6d28d9)';
const smote_color = () => 'linear-gradient(90deg, #ff6b35, #cc4400)';
function modelColor(d) {
if (['RF','DT','XGBoost'].includes(d.type)) return 'linear-gradient(90deg, #00d4ff, #00a8cc)';
return 'linear-gradient(90deg, #8b5cf6, #6d28d9)';
}
// UNSW RAW balanced acc
renderBar('chart-unsw-raw', [
{label:'Random Forest', val:0.5657, type:'RF'},
{label:'Decision Tree', val:0.4703, type:'DT'},
{label:'XGBoost', val:0.4247, type:'XGBoost'},
{label:'LSTM-CNN', val:0.3823, type:'dl'},
{label:'ANN', val:0.3744, type:'dl'},
{label:'LSTM', val:0.3287, type:'dl'},
{label:'CNN', val:0.2781, type:'dl'},
], modelColor);
// UNSW SMOTE balanced acc
renderBar('chart-unsw-smote', [
{label:'LSTM-CNN', val:0.1241, type:'dl'},
{label:'XGBoost', val:0.1108, type:'XGBoost'},
{label:'Random Forest', val:0.1001, type:'RF'},
{label:'ANN', val:0.1000, type:'dl'},
{label:'CNN', val:0.1000, type:'dl'},
{label:'DT', val:0.0960, type:'DT'},
{label:'LSTM', val:0.0683, type:'dl'},
], (d) => smote_color());
// KDD RAW balanced acc
renderBar('chart-kdd-raw', [
{label:'Random Forest', val:0.9940, type:'RF'},
{label:'XGBoost', val:0.9909, type:'XGBoost'},
{label:'LSTM-CNN', val:0.9848, type:'dl'},
{label:'LSTM', val:0.9673, type:'dl'},
{label:'Decision Tree', val:0.9614, type:'DT'},
{label:'ANN', val:0.9427, type:'dl'},
{label:'CNN', val:0.6256, type:'dl'},
], modelColor);
// KDD SMOTE balanced acc
renderBar('chart-kdd-smote', [
{label:'LSTM', val:0.9980, type:'dl'},
{label:'ANN', val:0.9953, type:'dl'},
{label:'XGBoost', val:0.9971, type:'XGBoost'},
{label:'DT', val:0.9931, type:'DT'},
{label:'Random Forest', val:0.9922, type:'RF'},
{label:'LSTM-CNN', val:0.9907, type:'dl'},
{label:'CNN', val:0.9721, type:'dl'},
], (d) => smote_color());
// INFERENCE TIME UNSW
renderBar('chart-time-unsw', [
{label:'DT', val:0.025, type:'DT'},
{label:'XGBoost', val:0.333, type:'XGBoost'},
{label:'RF', val:0.571, type:'RF'},
{label:'ANN', val:1.622, type:'dl'},
{label:'CNN', val:1.649, type:'dl'},
{label:'LSTM', val:1.902, type:'dl'},
{label:'LSTM-CNN', val:3.721, type:'dl'},
], (d) => d.type === 'dl' ? 'linear-gradient(90deg,#ff3d5a,#cc2a45)' : 'linear-gradient(90deg,#00d4ff,#00a8cc)');
// INFERENCE TIME KDD
renderBar('chart-time-kdd', [
{label:'DT', val:0.026, type:'DT'},
{label:'XGBoost', val:0.226, type:'XGBoost'},
{label:'RF', val:0.373, type:'RF'},
{label:'CNN', val:1.314, type:'dl'},
{label:'ANN', val:1.410, type:'dl'},
{label:'LSTM', val:1.475, type:'dl'},
{label:'LSTM-CNN', val:2.995, type:'dl'},
], (d) => d.type === 'dl' ? 'linear-gradient(90deg,#ff3d5a,#cc2a45)' : 'linear-gradient(90deg,#00d4ff,#00a8cc)');
// MEMORY UNSW (cap RF for display)
renderBar('chart-mem-unsw', [
{label:'XGBoost', val:1571, type:'XGBoost'},
{label:'DT', val:1580, type:'DT'},
{label:'CNN', val:4375, type:'dl'},
{label:'LSTM', val:4710, type:'dl'},
{label:'LSTM-CNN', val:4720, type:'dl'},
{label:'ANN', val:5267, type:'dl'},
{label:'RF ⚠', val:22424, type:'RF'},
], (d) => d.label.includes('RF') ? 'linear-gradient(90deg,#ff6b35,#cc4400)' : d.type === 'dl' ? 'linear-gradient(90deg,#8b5cf6,#6d28d9)' : 'linear-gradient(90deg,#00d4ff,#00a8cc)');
// MEMORY KDD
renderBar('chart-mem-kdd', [
{label:'ANN', val:4503, type:'dl'},
{label:'DT', val:4959, type:'DT'},
{label:'XGBoost', val:4959, type:'XGBoost'},
{label:'RF', val:4989, type:'RF'},
{label:'CNN', val:5096, type:'dl'},
{label:'LSTM', val:5104, type:'dl'},
{label:'LSTM-CNN', val:5112, type:'dl'},
], (d) => d.type === 'dl' ? 'linear-gradient(90deg,#8b5cf6,#6d28d9)' : 'linear-gradient(90deg,#00d4ff,#00a8cc)');
// ── TAB SWITCH ──
function switchTab(e, id) {
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
e.target.classList.add('active');
document.getElementById(id).classList.add('active');
// Re-trigger bar animations
setTimeout(() => {
document.querySelectorAll('#' + id + ' .bar-fill').forEach(b => {
const w = b.dataset.width;
b.style.width = '0%';
requestAnimationFrame(() => setTimeout(() => b.style.width = w + '%', 50));
});
}, 50);
}
// ── SCROLL REVEAL ──
const observer = new IntersectionObserver((entries) => {
entries.forEach(e => { if (e.isIntersecting) { e.target.classList.add('visible'); } });
}, { threshold: 0.1 });
document.querySelectorAll('.reveal').forEach(el => observer.observe(el));
// ── ANIMATE BARS ON LOAD ──
setTimeout(() => {
document.querySelectorAll('#unsw-raw .bar-fill').forEach(b => b.style.width = b.dataset.width + '%');
}, 300);
</script>
</body>
</html>
|