How gabrielchasukjin/conceptbottleneck-gui-experiment works
Main Components
A. Frontend Layer:
• React Application (src/App.js, src/index.js)
• User Interface Components
• Visualization Components (for concept activations)
B. Backend Layer:
• Flask Server (src/app.py)
• Model Training Components
• Concept Processing Pipeline
C. Machine Learning Components:
• CBL (Concept Bottleneck Layer) Module
• RoBERTa Model Integration
• Training Pipeline Components
D. Data Layer:
• Dataset Management (SetFit SST2)
• Model Weights Storage
• Configuration Storage
Component Relationships
[Frontend Layer]
• ↕ HTTP/API
[Backend Layer]
• ↕ Internal Communication
[ML Components]
• ↕ Data Flow
[Data Layer]
Specific Implementation Details
• Rectangles: Main components (Frontend, Backend, ML Pipeline)
• Hexagons: Processing units
• Blue: Frontend components
• Green: Backend services
• Purple: ML components
• Yellow: Data storage
• Red: Critical system paths
Component Breakdown
Frontend (Blue):
[React App]
• ↓
[Component Layer]
• Model Configuration UI
• Training Interface
• Visualization Dashboard
• Results Display
Backend (Green):
[Flask Server]
• ↓
[API Endpoints]
• ↓
[Service Layer]
• Training Orchestrator
• Concept Processor
• Model Manager
ML Pipeline (Purple):
[CBL Training Module]
• ↓
[RoBERTa Integration]
• ↓
[Concept Extraction]
• ↓
[Model Evaluation]
Data Layer (Yellow):
[Configuration Store]
[Model Weights]
[Training Data]
[Results Cache]
Key Flows to Highlight
A. Training Flow:
User Input → Frontend → Backend → ML Pipeline → Data Storage → Results → Frontend
B. Inference Flow:
Text Input → Frontend → Backend → Model → Concept Analysis → Visualization → Frontend
Additional Elements
• Version information for key components
• External service integrations (DSMPL UCSD server option)
• Scaling points and potential bottlenecks
• Security boundaries and data validation points
Implementation Notes
• Maintain consistent spacing and alignment
• Clear labels for all components
• Brief descriptions for complex interactions
• Both synchronous and asynchronous communication paths
This system design should effectively communicate the architecture while highlighting the unique aspects of the Concept Bottleneck Layer integration and the GUI's role in making it accessible to users.