Skip to content

Advanced Active Learning platform for engineering simulations. Reduces simulation costs by through intelligent surrogate modeling and physics-informed sampling.

License

Notifications You must be signed in to change notification settings

rdmurugan/SurrogateModel

πŸš€ Surrogate Model Platform

Advanced Active Learning & Adaptive Sampling for Engineering Simulations

Python FastAPI License PRs Welcome

scikit-learn PyTorch Docker PostgreSQL

Active Learning

A comprehensive cloud-based SaaS platform that reduces simulation costs by 70-80% through intelligent data collection and surrogate modeling. Features cutting-edge active learning algorithms, physics-informed sampling, and multi-fidelity modeling for engineering applications.

🎯 Key Features

  • 🧠 Intelligent Active Learning: Adaptive sampling strategies with physics-informed constraints
  • ⚑ Multi-Fidelity Modeling: Combines low and high-fidelity simulations efficiently
  • πŸ”„ Real-Time Adaptation: Dynamic strategy switching based on model performance
  • πŸ›‘οΈ Enterprise Security: JWT authentication with multi-tenant isolation
  • πŸ“Š Advanced Analytics: Uncertainty quantification and convergence monitoring
  • πŸš€ Scalable Architecture: Async processing with Docker containerization
  • 🎯 Smart Acquisition: Expected Improvement, UCB, Knowledge Gradient functions
  • βš™οΈ Physics Integration: Domain knowledge and conservation laws
  • πŸ“ˆ Budget Optimization: Cost-aware sampling with resource tracking

πŸ—οΈ Architecture

Backend

  • FastAPI: High-performance Python web framework
  • PostgreSQL: Primary database for metadata
  • Redis: Caching and session management
  • MinIO: S3-compatible object storage for datasets
  • SQLAlchemy: Database ORM with Alembic migrations
  • Celery: Background task processing

Frontend

  • React 18: Modern JavaScript framework
  • TypeScript: Type-safe development
  • Material-UI: Professional UI components
  • Plotly.js: Interactive data visualizations
  • Axios: HTTP client for API communication

Infrastructure

  • Docker: Containerization
  • Docker Compose: Local development orchestration
  • Nginx: Reverse proxy and static file serving

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose
  • Python 3.11+ (for local development)
  • Node.js 18+ (for frontend development)

Using Docker Compose (Recommended)

  1. Clone the repository

    git clone <repository-url>
    cd SurrogateModel
  2. Start all services

    docker-compose up -d
  3. Access the application

Local Development Setup

Backend Setup

cd backend

# Install dependencies
pip install -r requirements.txt

# Copy environment file
cp .env.example .env

# Run database migrations
alembic upgrade head

# Start the development server
uvicorn app.main:app --reload

Frontend Setup

cd frontend

# Install dependencies
npm install

# Start the development server
npm start

πŸ“ Usage

1. Upload Dataset

  • Navigate to the Datasets page
  • Click "Upload Dataset"
  • Provide CSV/Excel file with simulation results
  • Specify input and output columns

2. Train Surrogate Model

  • Go to Models page
  • Click "Create Model"
  • Select your dataset and algorithm
  • Wait for training to complete

3. Make Predictions

  • Visit Predictions page
  • Select your trained model
  • Enter input parameters
  • Get instant predictions with uncertainty quantification

4. API Integration

import requests

# Login
response = requests.post("http://localhost:8000/api/v1/auth/login", data={
    "username": "your_email",
    "password": "your_password"
})
token = response.json()["access_token"]

# Make prediction
headers = {"Authorization": f"Bearer {token}"}
prediction_data = {"length": 10, "width": 5, "thickness": 2}

response = requests.post(
    "http://localhost:8000/api/v1/predictions/1/predict",
    json=prediction_data,
    headers=headers
)
result = response.json()

πŸ”§ Development

Backend Commands

cd backend

# Run tests
make test

# Run tests with coverage
make test-cov

# Lint code
make lint

# Format code
make format

# Create database migration
make migrate-create name="add_new_table"

# Apply migrations
make migrate

Frontend Commands

cd frontend

# Run tests
npm test

# Build for production
npm run build

# Type checking
npm run type-check

πŸ—οΈ Project Structure

SurrogateModel/
β”œβ”€β”€ backend/                 # FastAPI backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/            # API endpoints
β”‚   β”‚   β”œβ”€β”€ core/           # Core functionality
β”‚   β”‚   β”œβ”€β”€ db/             # Database configuration
β”‚   β”‚   β”œβ”€β”€ models/         # SQLAlchemy models
β”‚   β”‚   └── services/       # Business logic
β”‚   β”œβ”€β”€ tests/              # Backend tests
β”‚   └── alembic/            # Database migrations
β”œβ”€β”€ frontend/               # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/          # Page components
β”‚   β”‚   β”œβ”€β”€ services/       # API services
β”‚   β”‚   └── types/          # TypeScript types
β”‚   └── public/             # Static assets
β”œβ”€β”€ infrastructure/         # Deployment configs
└── docs/                   # Documentation

πŸ” Security

  • JWT-based authentication
  • Role-based access control (RBAC)
  • Tenant isolation
  • Input validation and sanitization
  • SQL injection prevention
  • CORS configuration
  • Secure password hashing

πŸ“Š Monitoring

  • Health check endpoints
  • Structured logging
  • Performance metrics
  • Error tracking
  • API response time monitoring

πŸš€ Deployment

Production Deployment

  1. Configure environment variables
  2. Set up external databases (PostgreSQL, Redis)
  3. Configure object storage (S3/MinIO)
  4. Deploy with Kubernetes or Docker Swarm
  5. Set up monitoring and logging
  6. Configure SSL/TLS certificates

Environment Variables

See backend/.env.example for all available configuration options.

πŸ§ͺ Testing

Backend Tests

cd backend
pytest tests/ -v --cov=app

Frontend Tests

cd frontend
npm test

πŸ“ˆ Performance

  • Sub-100ms prediction response times
  • Horizontal scaling support
  • Efficient database queries
  • Caching for frequently accessed data
  • Optimized ML model serving

🀝 Contributing

We welcome contributions from the engineering and ML communities! See CONTRIBUTING.md for detailed guidelines.

Quick Start:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and add tests
  4. Run tests: pytest tests/ && python test_api.py
  5. Submit a pull request

Priority Areas:

  • 🧠 Advanced acquisition functions and sampling strategies
  • ⚑ Performance optimizations and parallelization
  • πŸ”§ Integration with commercial simulation tools (ANSYS, COMSOL, OpenFOAM)
  • πŸ“Š Advanced visualization and analysis tools
  • 🏭 Industry-specific examples and benchmarks

Research Contributions: We encourage academic contributions! Please reference original papers and include proper validation against benchmarks.

πŸ“„ License

This project is licensed under a Custom License for personal and research use:

  • βœ… Free for personal use and research
  • βœ… Open source contributions welcome
  • βœ… Academic and educational use permitted
  • 🏒 Commercial use requires separate license

For commercial licensing, enterprise support, or custom development: πŸ“§ Contact: durai@infinidatum.net

See the LICENSE file for complete terms and conditions.

πŸ†˜ Support & Contact

For any questions about licensing, commercial use, or custom implementations, please reach out to durai@infinidatum.net.

About

Advanced Active Learning platform for engineering simulations. Reduces simulation costs by through intelligent surrogate modeling and physics-informed sampling.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published