New model explanations
Browse files147 unmodified lines148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206147 unmodified lines}`}style={{ visibility: howVisible ? "visible" : "hidden" }}><div className="max-w-3xl"><h2 className="text-xl md:text-2xl font-semibold">How it works</h2></div><div className="mt-8 space-y-4 text-xs md:text-sm font-mono">{[{title: "1 路 Upload",heading: "Add your video",body: "Choose an MP4 file. It is only used while this page is open.",},{title: "2 路 Pick frames",heading: "Sample about 20 moments",body: "Spread evenly from the start to the end of the clip.",},{title: "3 路 Find faces",heading: "Run a face detector",body: "Detect faces in each chosen frame and crop them out.",},{title: "4 路 Score faces",heading: "Rate each face",body: "A small neural network scores every face as real or fake.",},{title: "5 路 Show frames",heading: "Display the evidence",body: "You get a grid of cropped faces with their labels.",},{title: "6 路 Final result",heading: "Summarise the video",body: "We combine the face scores into one simple REAL or FAKE verdict.",},].map((step, idx) => (<divkey={step.title}className={`rounded-lg border bg-slate-950/80 p-3 flex flex-col gap-1 transition-all duration-500 ${idx % 3 === 0? "border-emerald-700/60": idx % 3 === 1? "border-cyan-600/60": "border-fuchsia-600/60"} ${howVisible ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"}`}style={{ transitionDelay: howVisible ? `${idx * 80}ms` : "0ms" }}><div className="text-[10px] uppercase tracking-wide text-emerald-400/90">{step.title}</div><div className="font-semibold">{step.heading}</div><p className="text-emerald-100/75">{step.body}</p></div>))}</div></section></main>147 unmodified lines148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253147 unmodified lines}`}style={{ visibility: howVisible ? "visible" : "hidden" }}><div className="grid gap-8 lg:grid-cols-[1.1fr,0.9fr]"><div><div className="max-w-3xl"><h2 className="text-xl md:text-2xl font-semibold">How it works</h2></div><div className="mt-8 space-y-4 text-xs md:text-sm font-mono">{[{title: "1 路 Upload",heading: "Add your video",body: "Choose an MP4 file. It is only used while this page is open.",},{title: "2 路 Pick frames",heading: "Sample about 20 moments",body: "Spread evenly from the start to the end of the clip.",},{title: "3 路 Find faces",heading: "Run a face detector",body: "Detect faces in each chosen frame and crop them out.",},{title: "4 路 Score faces",heading: "Rate each face",body: "A small neural network scores every face as real or fake.",},{title: "5 路 Show frames",heading: "Display the evidence",body: "You get a grid of cropped faces with their labels.",},{title: "6 路 Final result",heading: "Summarise the video",body: "We combine the face scores into one simple REAL or FAKE verdict.",},].map((step, idx) => (<divkey={step.title}className={`rounded-lg border bg-slate-950/80 p-3 flex flex-col gap-1 transition-all duration-500 ${idx % 3 === 0? "border-emerald-700/60": idx % 3 === 1? "border-cyan-600/60": "border-fuchsia-600/60"} ${howVisible ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"}`}style={{ transitionDelay: howVisible ? `${idx * 80}ms` : "0ms" }}><div className="text-[10px] uppercase tracking-wide text-emerald-400/90">{step.title}</div><div className="font-semibold">{step.heading}</div><p className="text-emerald-100/75">{step.body}</p></div>))}</div></div><div className="space-y-6"><div className="rounded-2xl border border-emerald-900 bg-slate-950/80 p-6 shadow-lg shadow-emerald-900/30 space-y-4"><div className="text-xs font-mono uppercase tracking-[0.25em] text-emerald-400/80">Under the hood</div><ol className="space-y-4 text-sm md:text-base text-emerald-100/80"><li><span className="font-semibold text-emerald-300">Face Extraction (YOLOv8):</span> We discard thebackground and auto-crop each detected face with a 1.3脳 safety margin so micro-forensic cues stay in frame.</li><li><span className="font-semibold text-emerald-300">Smart Preprocessing:</span> A light Gaussian blur acts as alow-pass filter, suppressing compression noise and forcing the model to focus on geometric artifacts.</li><li><span className="font-semibold text-emerald-300">Efficient Backbone:</span> ResNet18 transfer learning retainsroughly 97.5% of heavier baselines while using about half the parameters (11.7M vs 23M), so inference stays fast.</li><li><span className="font-semibold text-emerald-300">Imbalance Correction:</span> Focal Loss with 纬=2.0 compels themodel to learn from hard real faces, sharply reducing false positives.</li></ol></div><div className="rounded-2xl border border-cyan-900/60 bg-slate-950/80 p-6 space-y-4 shadow-lg shadow-cyan-900/20"><div className="text-xs font-mono uppercase tracking-[0.25em] text-cyan-300/80">Performance</div><p className="text-sm md:text-base text-emerald-100/80">Evaluated on the FaceForensics++ (c23) high-quality benchmark.</p><dl className="grid gap-4 sm:grid-cols-2 text-center">{[{ label: "Test Accuracy", value: "93.31%" },{ label: "Recall (Fake)", value: "95.41%" },{ label: "Recall (Real)", value: "80.68%" },].map((metric) => (<div key={metric.label} className="rounded-lg border border-emerald-900/60 px-3 py-4 bg-slate-950/60"><dt className="text-[10px] uppercase tracking-[0.25em] text-emerald-300/70">{metric.label}</dt><dd className="text-2xl font-semibold text-emerald-200">{metric.value}</dd></div>))}</dl></div></div></div></section></main>
frontend/pages/index.jsx+98-51