Inspiration

Food waste isn't just an environmental problem — it's a lost economic opportunity. Every day, restaurants, bakeries, hotels, and supermarkets discard food that is still perfectly usable simply because it missed its selling window. At the same time, many people nearby are actively looking for affordable food options.

We saw this tension sharpen when we looked at what happens around mega-events like the FIFA World Cup 2026. Host cities will see a massive surge in visitors, venues, hotels, and restaurants operating at peak capacity — which means a massive surge in surplus and near-expiry food too. If even a fraction of that surplus could be redirected instead of thrown away, host cities could turn a logistics headache into a sustainability win. That's the gap EcoSort AI is built to close.

What it does

EcoSort AI is an AI-powered food recovery and affordability platform that connects surplus food with the people who can use it — before it becomes waste.

For host cities, venues, hotels, and restaurants during large events like the World Cup:

  • AI food & waste classification — identifies food items and waste types from a photo and provides disposal guidance.
  • Surplus food marketplace — businesses list unsold or near-expiry food; nearby consumers discover and claim it at a discount.
  • Smart discount recommendations — AI estimates urgency (shelf life, quantity, time remaining, demand) and suggests a fair discount that lets businesses recover value instead of losing it entirely.
  • Pantry & receipt scanning — helps consumers track what they already have.
  • Recipe intelligence & meal planning — semantic recipe matching and AI-generated recipes that make use of ingredients before they expire.
  • Location-based discovery — surfaces nearby surplus offers and restaurants using geographic filtering.

The core loop:

SURPLUS FOOD → AI URGENCY ANALYSIS → SMART DISCOUNT → CONSUMER PURCHASE → BUSINESS VALUE RECOVERED

Applied to host cities, this becomes a way to absorb the temporary spike in food surplus generated by visitors, matches, fan zones, and hospitality venues — reducing both waste and the strain on local food systems during the tournament.

How we built it

EcoSort AI follows a modular architecture with seven layers: presentation, API, core services, social services, data, AI/ML, and external services.

Frontend: HTML, CSS, and JavaScript. Backend: Python with FastAPI, served via Uvicorn. Database: MongoDB, storing users, pantry items, surplus offers, messages, notifications, and social data.

AI pipeline (with provider fallback):

Image Input → OpenAI GPT-4o → Google Gemini (fallback) → Hugging Face VLM (fallback) → Structured Output

This gives us resilience — if one vision provider is slow or unavailable, the system falls back to the next without failing the request.

Recipe intelligence pipeline:

Ingredients → Sentence Transformer Embeddings → Cosine Similarity → Recipe Matches

combined with a Hugging Face T5 model for generative recipe suggestions and external search for additional candidates, merged and filtered into a single ranked list.

Smart discount model: we designed a conceptual scoring function to guide discount recommendations, where remaining shelf-life score \(S\), quantity pressure \(Q\), urgency \(U\), local demand \(D\), and time remaining in the selling window \(T\) combine into a discount score:

$$ D_s = w_1 U + w_2 Q + w_3(1-S) + w_4(1-D) + w_5(1-T) $$

where the weights \(w_i\) would be calibrated against real historical business data. This score maps to a seller-approved discount range — businesses always retain final control over pricing and food-safety decisions.

Deployment: Railway/Vercel-compatible configuration, with the live demo and source available at the links below.

Challenges we ran into

  • Balancing AI cost and reliability — vision and language calls to multiple providers (OpenAI, Gemini, Hugging Face) needed a fallback chain so the app stays functional even if one provider is rate-limited or slow.
  • Normalizing messy real-world input — pantry photos and receipts produce inconsistent item names; we built a synonym-normalization step to map varied text into canonical ingredients.
  • Designing a discount model without production data — we had to keep the smart-discount scoring function transparent and adjustable rather than a black box, since real calibration requires historical transaction data we don't yet have.
  • Scoping a two-sided marketplace — matching business supply with consumer demand geographically, while keeping the interaction (claim → conversation → notification) simple enough to build in hackathon time.

Accomplishments that we're proud of

  • A working end-to-end pipeline from photo upload → AI classification → structured disposal guidance.
  • A functioning surplus marketplace loop: create offer → nearby discovery → claim → messaging → notification.
  • A multi-provider AI fallback system that keeps the app usable even under provider failure.
  • A semantic recipe-matching engine that combines a local catalog, generative AI, and external search into one ranked result set.

What we learned

  • Food waste is as much a coordination problem as a technical one — the AI is only half the solution; the marketplace mechanics (discovery, trust, claiming, communication) matter just as much.
  • Designing for graceful degradation (AI provider fallbacks) is essential for any system that depends on third-party APIs during a live demo or event.
  • A transparent, adjustable pricing model earns more trust from business stakeholders than an opaque "AI decides the price" black box.

What's next for EcoSort AI

  • Host-city pilot scope: adapt surplus discovery to cluster around World Cup venues, fan zones, and hotel districts, and add event-aware urgency signals (e.g., surges around match schedules).
  • Business dashboards for expiry monitoring, inventory insights, and waste-reduction analytics.
  • Dynamic pricing calibration using real transaction data to properly weight the smart-discount model.
  • Payments and logistics integration — in-app payment, pickup scheduling, and delivery partnerships.
  • Verification workflows for food safety and seller/buyer trust at scale.

Live Demo: https://ecosort-ai-production-fbf8.up.railway.app/ GitHub: https://github.com/hirabinteaftab-droid/ECOSORT-AI Team: Hira & Manahil Zulfiqar Aligned with: UN SDG 12 — Responsible Consumption and Production (Target 12.3)

Built With

Share this project:

Updates