PyQt5: for Ad Analytics, Optimization, and Insights
The AI Ad Performance Optimizer is a comprehensive desktop application built with Python, PyQt5, scikit-learn, Stable-Baselines3 (RL), and Matplotlib. It helps digital marketers and advertisers analyze ad campaigns, predict CTR & conversions, optimize ad budgets, and generate actionable insights—all from a single CSV dataset.
This tool integrates ML prediction, RL-based budget optimization, NLP sentiment analysis, and interactive visualizations to make ad performance management smarter and faster.
- Load ad campaign data from CSV files.
- Automatically normalize and clean columns (Ad_ID, Budget, CTR, Conversions, etc.).
- Handle numeric coercion for financial and performance metrics.
- Predict CTR (Click Through Rate) and Conversions for ads using ML fallback.
- Generate automated insights highlighting low-performing ads.
- Compute feature importance using Random Forest models.
- Identify which ad metrics (e.g., Budget, Impressions, Clicks) influence performance most.
- Optimize ad budgets across campaigns using PPO (Proximal Policy Optimization).
- Users can select the metric to maximize: CTR, Conversions, or minimize Cost.
- View optimized budget allocation in interactive plots.
- Analyze ad text sentiment (Positive, Neutral, Negative).
- Provide ad copy suggestions to improve engagement.
- Simulate "what-if" scenarios like budget increases.
- Evaluate impact on predicted CTR and conversions.
- Visualize metrics like CTR per Product, Conversions per Region, Budget allocation.
- Includes zoom/pan toolbar and save plot functionality.
- Export processed data and insights to CSV or Excel.
- Includes predicted metrics, optimized budget, sentiment analysis, and suggestions.
- Clone the repository:
git clone https://github.com/Mohima6/AI-Ad-Performance-Optimizer.git
cd AI-Ad-Performance-Optimizer- Install required packages:
pip install -r requirements.txtRequirements: Python ≥3.10, PyQt5, pandas, numpy, matplotlib, scikit-learn, stable-baselines3, gym, shimmy
- Run the application:
python app/main.py- Load CSV: Click "Load CSV" and select your ad campaign dataset.
- Predict Performance: Click "Predict CTR/Conversions" to generate predictions.
- Optimize Budget: Click "Optimize Budget (RL)" and choose a metric to maximize.
- Text Analysis: Click "Analyze Ad Text" for sentiment and copy suggestions.
- Scenario Simulation: Click "Scenario Simulation" to test budget changes.
- XAI Feature Importance: Click "XAI Feature Importance" to see which features matter most.
- Export Report: Click "Export Report" to save your processed dataset.
- Python, PyQt5, pandas, numpy, matplotlib, scikit-learn, stable-baselines3, gym
- Inspired by the need for smarter ad budget optimization and campaign insights
-
Running effective digital advertising campaigns is challenging because:
-
Marketers often have hundreds of ads across multiple platforms, making manual analysis time-consuming.
-
Budgets are limited, and inefficient allocation can drastically reduce ROI.
-
Identifying high-performing ads and understanding what influences performance is difficult without proper analytics.
-
Ad copy and messaging often lack data-driven improvements, which can hurt engagement.
-
Automatically predicting CTR and conversions for all ads in a dataset.
-
Providing RL-based budget optimization to maximize returns from limited resources.
-
Offering explainable insights (XAI) on what metrics drive ad performance.
-
Suggesting improvements for ad copy based on sentiment analysis.
-
Allowing interactive visualization and scenario simulations for better decision-making.
In short: It helps marketers save time, improve ROI, and make data-driven decisions with ease.