Cocktail AI: Evolutionary Recipe Generation with ML-Powered Flavor Prediction, deployed on AWS

Built an AI-assisted cocktail design system that predicts multi-label flavor profiles and uses evolutionary search to optimize recipes under real-world constraints. I trained taste classifiers on 4,500+ recipes, wired the models into a GA fitness loop, and deployed the pipeline on AWS for low-latency generation. The result is a production-style ML workflow that blends data science, backend orchestration, and DevOps to ship a user-facing product.

Average AUC
0.90
Best AUC
0.998
Average F1-Score
0.67
Taste Classifiers
9
DataSet
4,500+

Core Innovation

What makes this project different:

  • Multi-label flavor modeling instead of single “primary taste.”

  • Ingredient quantities as features, not just presence/absence.

  • Genetic Algorithm for constrained search, not brute force.

  • Fitness driven by trained ML models, not hand-crafted rules.

This turns cocktail creation into a structured optimization problem similar to real-world engineering systems. It runs on a serverless AWS stack so it stays reliable, cost-aware, and responsive for users.

  • S3: stores datasets and trained models.
  • SageMaker: trains and serves the taste models.
  • SQS + Lambda: processes recipe jobs in the background.
  • DynamoDB: tracks job status for the UI.
  • CloudWatch: monitors health and performance.

Performance highlights: average final fitness of 95.2%, average fitness of 90.6%, and recipe generation completing in about 45 seconds end-to-end.

The system scales smoothly by batching model evaluations per generation, cutting inference calls by 99.9% across a full run while keeping quality intact.

AWS Architecture Diagram
Event-driven ingestion, model training, and low-latency API delivery.

Sample Generated Recipes

Each recipe is evolved from mandatory ingredients and target flavor profiles using ML-powered genetic optimization.

spicy 90%sweet 10%

Mandatory

Sugar Syrup (2:1), Vodka

Generated Composition

Chocolate Caramel Liqueurs35.00%
Ginger Liqueur31.51%
Vodka15.00%
Sugar Syrup (2:1)15.00%
Total normalized: 96.51%
sweet 80%herbal 20%

Mandatory

Lime Juice, Vodka

Generated Composition

Chocolate Caramel Liqueurs32.28%
Bénédictine D.O.M.23.99%
Vodka15.08%
Lime Juice15.00%
Advocaat Liqueur13.62%
Total normalized: 99.97%
floral 50%fruity 50%

Mandatory

Vodka, Spiced Rum

Generated Composition

Crème de Cassis35.00%
Crème de Violette32.61%
Spiced Rum15.00%
Vodka15.00%
Total normalized: 97.61%
citrus 100%

Mandatory

None

Generated Composition

Lemon Juice35.00%
Lime Juice35.00%
Limoncello Liqueur29.00%
Total normalized: 99.00%
creamy 60%sweet 40%

Mandatory

Gin

Generated Composition

Whipping Cream35.00%
Cream of Coconut35.00%
Gin24.53%
Total normalized: 94.53%
bittersweet 70%fruity 30%

Mandatory

Malt Whisky

Generated Composition

Fresh Fruit34.97%
Gentian Liqueur34.96%
Malt Whisky24.29%
Total normalized: 94.22%

Model Performance

All taste classifiers were trained using Logistic Regression with tuned thresholds:

FlavorAUCPrecisionRecallF1-Score
Creamy0.9980.9171.0000.957
Floral0.9710.4580.6470.537
Bittersweet0.9600.8020.8530.827
Spicy0.9430.5710.6000.585
Sweet0.9010.7310.7310.731
Herbal0.8810.5310.6820.597
Fruity0.8630.7500.5960.664
Citrus0.8490.6600.8650.749
Savoury0.7500.3910.4290.409

Even with simple linear models, the system achieves strong AUC and usable F1 scores — validating the feature design and framing of flavor prediction.

These models directly power the GA fitness evaluation.