Spaces:
Runtime error
Runtime error
| title: Multimodal A/B Test Predictor | |
| emoji: π | |
| colorFrom: blue | |
| colorTo: purple | |
| sdk: gradio | |
| sdk_version: "4.44.0" | |
| app_file: app.py | |
| pinned: false | |
| # π Multimodal A/B Test Predictor | |
| ## Overview | |
| Advanced A/B testing outcome predictor using multimodal AI analysis combining: | |
| - πΌοΈ **Image Analysis**: Visual features from control & variant images | |
| - π **OCR Text Extraction**: Automatically extracts and analyzes text from images | |
| - π **Categorical Features**: Business context provided via API (industry, page type, etc.) | |
| - π― **Confidence Scores**: Based on training data statistics and historical accuracy | |
| ## π― Direct Input Architecture | |
| ### **Image + Categorical Data** | |
| - Accepts control and variant images directly via API | |
| - Requires categorical inputs: Business Model, Customer Type, Conversion Type, Industry, Page Type | |
| - Fast, efficient predictions without external API dependencies | |
| - All processing happens locally on GPU | |
| ## π― Features | |
| ### Direct Prediction with Categorical Data | |
| - Upload control & variant images | |
| - Provide categorical business context data | |
| - Fast prediction with comprehensive confidence analysis | |
| ### Enhanced Results | |
| - **Winner Prediction**: Variant vs Control with probability | |
| - **Model Confidence**: Accuracy percentage from training data | |
| - **Training Data Count**: Number of samples model trained on for this category | |
| - **Historical Win/Loss**: Real A/B test outcome statistics for this category | |
| - **Confidence Source**: Industry + Page Type combination used for scoring | |
| ## π§ Setup | |
| ### Model Files | |
| - `model/multimodal_gated_model_2.7_GGG.pth`: Enhanced multimodal model (789MB) | |
| - `model/multimodal_cat_mappings_GGG.json`: Category mappings | |
| ## π Technical Architecture | |
| ### Model: SupervisedSiameseMultimodal (GGG Enhanced) | |
| - **Vision**: ViT (Vision Transformer) for image features | |
| - **Text**: DistilBERT for OCR text processing | |
| - **Fusion**: Gated fusion with directional features | |
| - **Categories**: Embedding layers for categorical features | |
| - **Architecture**: BatchNorm + Fusion Block + Enhanced Prediction Head | |
| ### Confidence Scoring | |
| - Based on Industry + Page Type combinations | |
| - Uses holdout statistics with average 160 samples per combination | |
| - Much more reliable than full 5-feature combinations | |
| ## π Performance | |
| - **Multimodal Analysis**: Images + Text + Categories | |
| - **GPU Accelerated**: Fast predictions (2-4 seconds average) | |
| - **High Accuracy**: Enhanced GGG architecture with real training data | |
| - **No External Dependencies**: All processing done locally | |
| ## π― Use Cases | |
| - **A/B Test Prediction**: Predict winners before running tests with provided context | |
| - **Batch Processing**: Process multiple tests efficiently from CSV | |
| - **Confidence Assessment**: Understand prediction reliability based on historical data | |
| - **API Integration**: Easy integration with external systems | |
| ## π‘ API Usage | |
| ### Quick Start | |
| ```python | |
| from gradio_client import Client | |
| client = Client("SpiralyzeLLC/ABTestPredictor") | |
| result = client.predict( | |
| "control.jpg", "variant.jpg", | |
| "SaaS", "B2B", "High-Intent Lead Gen", | |
| "B2B Software & Tech", "Awareness & Discovery", | |
| api_name="/predict_with_categorical_data" | |
| ) | |
| ``` | |
| ### π Documentation | |
| - **[QUICK_START_GUIDE.md](QUICK_START_GUIDE.md)** - Get started in 3 steps | |
| - **[API_DOCUMENTATION.md](API_DOCUMENTATION.md)** - Complete API reference with examples in Python, JavaScript, and cURL | |
| - **[API_USAGE_UPDATED.md](API_USAGE_UPDATED.md)** - Technical details and migration notes | |
| ### π Web Interface | |
| Use the interactive interface: **https://huggingface.co/spaces/SpiralyzeLLC/ABTestPredictor** | |
| --- | |
| Built with β€οΈ using Gradio, PyTorch, Transformers, and Hugging Face. | |