How gnueaj/machine-unlearning-comparator works
Main System Components
• Frontend: A React/TypeScript single-page application that provides rich visualization of experimental results, unlearning method comparisons, and interactive elements (e.g., charts, tables, and filters). It involves many components (Accuracy graphs, CKA line charts, experiments tables, etc.) and utility functions for API calls.
• Backend: A Python-based server (likely using frameworks such as FastAPI or Flask, judging by the “routers”, “services”, and “threads” directories) that exposes APIs to start training, execute different unlearning methods (Fine-Tuning, Gradient-Ascent, Random-Labeling, Custom, and Retraining), run privacy attacks, and serve static files (e.g., index.html).
• Data Handling: The backend includes a structured “data” folder with JSON files that likely represent pre-processed datasets or configurations for experiments.
• Concurrency & Task Management: Threads directories indicate that the backend offloads long-running tasks (training and unlearning procedures) into separate threads to improve responsiveness.
• Utility Modules: Modules for attack simulations, evaluation, data visualization, and helper functions support both the machine learning operations and result presentations.
Relationships and Interactions
• The Frontend communicates with the Backend via RESTful API calls (exemplified by endpoints in the routers directories such as train, unlearn, and data).
• Within the Backend, API routers receive requests and then trigger specific services that encapsulate the core machine unlearning logic.
• Each service (located in the “services” directory) might launch a corresponding task in the “threads” directory to execute the method asynchronously.
• Utility modules are integrated by services and routers to support tasks like data loading, attacking the model, evaluating performance metrics, and rendering visualization data.
• The project also includes configuration management (in the config directory) which defines settings required for both training and evaluation.
Architectural Patterns and Design Principles
• Separation of Concerns: The clear segregation between frontend and backend, as well as further modularization within the backend (routers for handling HTTP endpoints, services for business logic, threads for asynchronous execution, and utilities for common functionalities).
• Service-Oriented: Each unlearning method (FT, GA, RL, custom, retrain) is encapsulated as a distinct service, promoting modular testing and comparison.
• Asynchronous Processing: By using threads, the backend design accommodates potentially long-running training and unlearning tasks without blocking API responses.
• Extensibility: The custom method integration allows users to plug in their own unlearning techniques, which is vital for benchmarking new research ideas.