--- title: FraudLens | Transaction Risk Intelligence Studio emoji: 🔍 colorFrom: indigo colorTo: blue sdk: static app_file: index.html pinned: false license: mit short_description: Explainable transaction risk simulator. tags: - cybersecurity - financial-crime - explainable-ai - risk-analysis - data-visualization - simulation --- # FraudLens | Transaction Risk Intelligence Studio **Hugdrigo portfolio · Project #90** FraudLens is a polished, **entirely offline**, browser-based educational workspace for explainable payment-transaction risk scoring, simulated case review, and alert-threshold calibration. It has no external dependencies, API keys, inference endpoints, data transmission, payment processing, or service costs. > **Important:** Every starting transaction, merchant, amount, and ground-truth label is fictional. The deterministic scoring rules are educational demonstrations, **not trained machine learning**, independently validated fraud detection, or calibrated estimates of actual fraud probability. Never use this prototype to evaluate genuine customers or make real financial decisions. ## Main features - **Executive overview:** synthetic transaction volume, alerts, demonstration precision/recall, risk-distribution histogram, signal frequency, and high-priority queue. - **Investigation queue:** search and filter by alert or case status; inspect transparent rule contributions; move cases through New, Investigating, and Closed states. - **Threshold laboratory:** adjust alert cutoff (0 to 100); vary transaction velocity, failed attempts, and amount; apply four illustrative scenario presets; view synthetic confusion matrices and threshold-response curves. - **Transaction workspace:** add, edit, archive, and restore synthetic records; automatically recalculate results; retain data in local browser storage. - **Portable data:** export spreadsheet-safe CSV, export a JSON backup, or import a validated FraudLens version 1 backup after explicit confirmation. - **Interface:** responsive desktop/mobile views, light/dark mode, semantic labels, no third-party scripts. ## Scoring methodology FraudLens sums transparent integer point contributions and caps the total at 100: | Feature | Rule contribution | | --- | --- | | Transaction amount | ≥ $250: +5, ≥ $500: +9, ≥ $1,000: +14 | | Transactions in last hour | ≥ 2: +5, ≥ 4: +12, ≥ 6: +20 | | Failed attempts | ≥ 1: +10, ≥ 3: +21 | | New device | +13 | | Unusual country | +12 | | Account age | < 90 days: +6, < 14 days: +13 | | Overnight transaction hour (00:00–05:59) | +6 | | Card-not-present | +5 | Each feature uses its highest applicable tier rather than summing tiers. The default alert cutoff is **60/100** and can be changed. An alert is emitted if `score >= threshold`. For the synthetic ground-truth examples, the confusion matrix counts true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN). **Precision = TP / (TP + FP)** and **recall = TP / (TP + FN)**; undefined ratios are displayed as N/A. These demonstrate the consequences of cutoff selection **on the same small fictional set**, not generalization performance. Case status never changes the truth label or risk score. Archiving removes a record from active statistics without deleting it. Scenario multipliers change effective amount and hourly velocity, and scenario failed attempts are added to the stored failure count. Stored transaction inputs and synthetic labels remain unchanged. Presets are reproducible and do not represent forecasts. ## Quick start 1. Create a new [Hugging Face Space](https://huggingface.co/new-space) with **SDK: Static**, **Visibility: Public**, and **License: MIT**. 2. Choose the repository name `fraudlens-transaction-risk-lab` under the owner `Hugdrigo`. 3. Upload the **three extracted files**, not the ZIP itself, to the repository root: `README.md`, `index.html`, `LICENSE`. 4. Open the Space and explore Overview, Investigation Queue, Threshold Laboratory, Transactions, and Methodology. For offline use, simply open `index.html` in a current browser. This is a single-file application and requires no build process. ## Data, privacy, and security - All sample entities are invented. Do **not** enter real cardholder, payment, personally identifiable, or other sensitive information. - Local storage can be read by someone with access to your browser profile; it is **not encrypted**. - User-supplied text is HTML-escaped before rendering; CSV text is escaped to reduce spreadsheet formula-injection risk. - JSON restore only accepts the documented version 1 record structure, strictly bounded numeric values, and up to 300 records / 1 MB file size. - Backup import or demo restoration overwrites the current local workspace only after confirmation. - This is not a security-certified system and no public/live payment integration is provided. ## Technology Vanilla HTML, CSS, JavaScript, and inline SVG. No cookies, remote services, paid APIs, model downloads, GPU, frameworks, or build dependencies. **Portfolio author:** Hugdrigo · **Project:** #90 · **License:** MIT