Understanding Genuine vs. Fake Data: Key Concepts and a Scoring Framework - Part 2




 

🧠 Build a Fake Data Detector Using the Genuine Data Score (GDS) Formula

In today’s digital age, where misinformation and synthetic content are spreading faster than ever, it’s crucial to have tools that assess the authenticity and integrity of data. That’s where the Genuine Data Score (GDS) comes in — a smart scoring system that helps classify whether content is Genuine, Suspicious, or Fake.

Let’s dive into what GDS is and how you can create a simple JavaScript app to detect fake data or posts using this scoring model.


✅ What Is the Genuine Data Score (GDS)?

The GDS is a calculated metric that assesses the overall quality of a dataset or content based on eight key factors:

Metric Description
A Accuracy – How correct is the data?
Au Authenticity – Is the source verified?
I Integrity – Has the data been altered?
R Reproducibility – Can it be repeated or verified?
C Completeness – Is anything missing?
T Timeliness – Is the data up to date?
Co Consistency – Are there contradictions?
V Validity – Does it follow expected logic?

Each of these dimensions is scored from 0 to 1 and assigned a weight based on importance. The final GDS is computed using the following formula:

GDS = w1*A + w2*Au + w3*I + w4*R + w5*C + w6*T + w7*Co + w8*V

🎯 Classification Thresholds

Once the GDS is calculated, we classify the data/post into three categories:

  • Genuine – GDS ≥ 0.80
  • Suspicious – 0.60 ≤ GDS < 0.80
  • Fake – GDS < 0.60


🧑‍💻 Build the GDS App in JavaScript

Let’s create a simple web app using HTML + JavaScript to calculate the GDS and flag fake data in real time.

✨ Features

  • Input fields for all 8 quality scores
  • Adjustable weights
  • Instant classification
  • Mobile-friendly design

🧩 Code Snippet

Here's the complete code:

<!-- Save this as gds-detector.html and open in your browser -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>Fake Data Detector - GDS</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background: #f0f2f5;
      padding: 30px;
      max-width: 700px;
      margin: auto;
    }
    h2 { color: #333; }
    .input-group { margin-bottom: 10px; }
    label { display: inline-block; width: 180px; }
    input { padding: 6px; width: 80px; }
    #result { margin-top: 25px; font-size: 18px; font-weight: bold; }
    .status {
      font-size: 20px; padding: 10px; margin-top: 10px;
      border-radius: 6px; width: fit-content;
    }
    .genuine { color: #1e7e34; background-color: #d4edda; }
    .suspicious { color: #856404; background-color: #fff3cd; }
    .fake { color: #721c24; background-color: #f8d7da; }
  </style>
</head>
<body>

  <h2>🔍 Fake Data Detector - Genuine Data Score (GDS)</h2>
  <form id="gdsForm">
    <!-- Scores -->
    <div class="input-group"><label>Accuracy (A):</label><input type="number" step="0.01" id="A"></div>
    <div class="input-group"><label>Authenticity (Au):</label><input type="number" step="0.01" id="Au"></div>
    <div class="input-group"><label>Integrity (I):</label><input type="number" step="0.01" id="I"></div>
    <div class="input-group"><label>Reproducibility (R):</label><input type="number" step="0.01" id="R"></div>
    <div class="input-group"><label>Completeness (C):</label><input type="number" step="0.01" id="C"></div>
    <div class="input-group"><label>Timeliness (T):</label><input type="number" step="0.01" id="T"></div>
    <div class="input-group"><label>Consistency (Co):</label><input type="number" step="0.01" id="Co"></div>
    <div class="input-group"><label>Validity (V):</label><input type="number" step="0.01" id="V"></div>

    <!-- Weights -->
    <div class="input-group"><label>Weight A:</label><input type="number" step="0.01" id="w1" value="0.125"></div>
    <div class="input-group"><label>Weight Au:</label><input type="number" step="0.01" id="w2" value="0.125"></div>
    <div class="input-group"><label>Weight I:</label><input type="number" step="0.01" id="w3" value="0.125"></div>
    <div class="input-group"><label>Weight R:</label><input type="number" step="0.01" id="w4" value="0.125"></div>
    <div class="input-group"><label>Weight C:</label><input type="number" step="0.01" id="w5" value="0.125"></div>
    <div class="input-group"><label>Weight T:</label><input type="number" step="0.01" id="w6" value="0.125"></div>
    <div class="input-group"><label>Weight Co:</label><input type="number" step="0.01" id="w7" value="0.125"></div>
    <div class="input-group"><label>Weight V:</label><input type="number" step="0.01" id="w8" value="0.125"></div>

    <button type="button" onclick="calculateGDS()">🧮 Classify Data</button>
  </form>

  <div id="result"></div>

  <script>
    function calculateGDS() {
      const A = parseFloat(document.getElementById("A").value) || 0;
      const Au = parseFloat(document.getElementById("Au").value) || 0;
      const I = parseFloat(document.getElementById("I").value) || 0;
      const R = parseFloat(document.getElementById("R").value) || 0;
      const C = parseFloat(document.getElementById("C").value) || 0;
      const T = parseFloat(document.getElementById("T").value) || 0;
      const Co = parseFloat(document.getElementById("Co").value) || 0;
      const V = parseFloat(document.getElementById("V").value) || 0;

      const w1 = parseFloat(document.getElementById("w1").value) || 0;
      const w2 = parseFloat(document.getElementById("w2").value) || 0;
      const w3 = parseFloat(document.getElementById("w3").value) || 0;
      const w4 = parseFloat(document.getElementById("w4").value) || 0;
      const w5 = parseFloat(document.getElementById("w5").value) || 0;
      const w6 = parseFloat(document.getElementById("w6").value) || 0;
      const w7 = parseFloat(document.getElementById("w7").value) || 0;
      const w8 = parseFloat(document.getElementById("w8").value) || 0;

      const GDS = (
        w1*A + w2*Au + w3*I + w4*R +
        w5*C + w6*T + w7*Co + w8*V
      ).toFixed(3);

      let status = "Fake";
      let className = "fake";
      if (GDS >= 0.8) {
        status = "Genuine";
        className = "genuine";
      } else if (GDS >= 0.6) {
        status = "Suspicious";
        className = "suspicious";
      }

      document.getElementById("result").innerHTML =
        `<div class="status ${className}">
           GDS: ${GDS} → ${status}
         </div>`;
    }
  </script>

</body>
</html>

🔒 Final Thoughts

This app is a great starting point to detect fake content in datasets, social posts, or even AI-generated outputs. You can expand it by:

  • Integrating AI to auto-fill the scores
  • Adding a backend for storage and auditing
  • Using browser plugins to score live content



Post a Comment

0 Comments