Skip to content

Refactor gaze prediction pipeline and improve data normalization & evaluation #51

@midaa1

Description

@midaa1

Description

The current gaze prediction implementation needs refactoring to improve data leakage prevention, model evaluation consistency, and prediction stability.

Several parts of the pipeline mix training and testing logic, reuse scalers incorrectly, and couple model training logic tightly with prediction code, which makes the system harder to maintain and reason about.

Problems Identified

  • Potential data leakage due to incorrect scaler usage

  • Duplicated model training logic for X and Y predictions

  • Tight coupling between training, prediction, and evaluation logic

  • Accuracy computed per axis only, which does not reflect real spatial error

  • Lack of a single, intuitive metric for comparing model performance

Goals

  • Refactor the ML pipeline for clarity and correctness
  • Ensure proper train/test separation and scaling
  • Centralize and reuse model training logic
  • Improve evaluation by introducing Euclidean distance–based accuracy
  • Keep prediction outputs backward-compatible

Proposed Changes

  • Refactor model training into a shared helper function

  • Apply StandardScaler correctly (fit on train only)

  • Simplify prediction logic for X and Y axes

  • Add func_total_accuracy to compute pixel-level gaze error

  • Use total accuracy alongside existing precision metrics

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions