AI-powered Demand Side Platform (DSP) engine for optimizing Real-Time Bidding under budget constraints using machine learning and expected value optimization.
BidWise is a machine learning–driven Real-Time Bidding (RTB) engine designed to maximize:
Score = Clicks + N × Conversions
under strict constraints:
- 💰 Fixed advertiser budget
- ⚖ Second-price auction mechanism
- ⏱ Low-latency inference
- 🧠 Sequential decision making (no future request knowledge)
- 📦 Memory-efficient implementation
This project simulates a real-world ad-tech bidding system used in programmatic advertising platforms.
Predicts probability that a user clicks an ad.
Predicts probability that a user converts after clicking.
EV = P(click) + N × P(conversion)
Bid = EV × BaseBid × BudgetFactor
Where:
BudgetFactor = RemainingBudget / InitialBudget
If:
Bid ≥ Market Price
- Win auction
- Pay second-highest price (market price)
- Deduct budget
- Update score
- Python 3.9
- Pandas
- NumPy
- Scikit-learn (Logistic Regression)
- Joblib
- CTR Logistic Regression Model
- CVR Logistic Regression Model
- ROC-AUC Validation
- Vectorized Inference Optimization
- Next.js
- Tailwind CSS
- Recharts / Chart.js
- Light/Dark Theme Toggle
BIDWISE_RTB/
│
├── backend/
│ ├── data/
│ │ └── train.csv
│ │
│ ├── models/
│ │ ├── ctr_model.pkl
│ │ └── cvr_model.pkl
│ │
│ ├── rtb_engine/
│ │ ├── predictor.py
│ │ ├── budget_manager.py
│ │ ├── strategy.py
│ │ ├── simulator.py
│ │ └── dataset_generator.py
│ │
│ ├── train_models.py
│ └── main.py
│
├── frontend/
└── README.md
Synthetic RTB dataset (50,000 rows) with realistic patterns:
- Evening hours → Higher CTR
- Campaign 2 & 3 → Better performance
- Mobile → Higher conversion rate
- Conversion depends on click probability
Columns:
- impression_id
- campaign_id
- hour
- device_type
- floor_price
- market_price
- click
- conversion
- Vectorized CTR & CVR prediction
- Reduced per-row ML inference
- Budget-aware early stopping
- Lightweight Logistic Regression models
- Optimized simulation loop
The system compares:
Fixed bid for every impression.
Expected Value–based dynamic bidding with budget scaling.
This demonstrates measurable improvement in score under budget constraints.
pip install -r backend/requirements.txtpython backend/rtb_engine/dataset_generator.pycd backend
python train_models.pypython main.pyThis project demonstrates:
- Real-world ad-tech optimization logic
- Budget-constrained decision systems
- Applied machine learning in auction environments
- Performance-aware algorithm design
- Sequential online optimization
- Advanced budget pacing algorithm
- Multi-armed bandit strategy
- Reinforcement learning optimization
- FastAPI backend integration
- Modern analytics dashboard (Next.js)
- Deployment to cloud
Developed as part of a Hackathon RTB Optimization Challenge.