Pattern Recognition Project Report

Team: Deepthika Sivaram & Derek Lu

Group: Group 6 — University at Buffalo

Phase 1: Data Collection

Phase 2: Computer Vision

Objective: To quantitatively assess the quality, balance, and separability of our collected fruit images by training two transfer-learning based CNN classifiers.

Produce Classifier

Variation Classifier

Methodology

Dataset Directory Structure

Removed batch subfolders. Dataset organized flat: 4 produce folders, each containing 3 variant subfolders (≈12 000 images total).

Pre-training Analysis

ResNet-50 (Produce)

EfficientNet-B0 (Variation)

Apple Variants
Grapes Variants
Peach Variants
Raspberry Variants

Fine Tuning 1

Fine Tuning 1 Analysis

ResNet-50 (Produce)

EfficientNet-B0 (Variation)

Apple
Grapes
Peach & Raspberry

Phase 3: Semantic Recipe Retrieval (NLP)

Objective: The goal of the NLP phase was to design a BERT-based semantic search engine capable of recommending recipes based on ingredient and descriptor tags. The system needed to handle nuanced, multi-tag user queries and return ranked recipe suggestions from the RAW_recipes.csv and RAW_Interactions.csv dataset.

Methodology

Evaluation

Test Query Set Design

To assess the model's robustness, we constructed a test set containing:

  1. Ingredient-based queries (e.g., "chicken, rice")
  2. Conceptual and subjective terms (e.g., "healthy dinner", "quick snacks", "seasonal recipes")
  3. Combined queries (e.g., "vegan soup quick", "low-carb dinner healthy")

These were selected to probe both surface-level retrieval and semantic understanding.

Recommendation Output Review

1. Simple Ingredient Queries
2. Abstract/Conceptual Queries

Success and Failure Patterns

Query TypeSuccess CaseFailure CaseNotes
Ingredient Matching"chicken rice" → Chicken & Rice Casserole"peach thyme" → Dessert without thymeStrong for simple matches
Healthy Concepts"low calorie lunch" → Grilled Fish Salad"heart healthy" → Pasta AlfredoSubjective term inference limited
Time Constraints"quick snacks" → Peanut Butter Banana Bites"10 minute meal" → Took 30+ minsNo prep time filter
Seasonal Reasoning"fall desserts" → Pumpkin Pie"spring stew" → Winter recipesLacks season metadata

Limitations

Conclusion

The model performs well for ingredient queries and somewhat for conceptual inputs. Future improvements should include structured metadata and post-filtering based on user goals to boost relevance and trust.

Phase 4: Web Application Deployment

Objective: The goal of this phase was to create a polished, static web application that integrates both our Computer Vision (CV) and Natural Language Processing (NLP) models into a seamless, interactive platform. This web app serves as the unified demonstration and delivery mechanism for our project, hosted publicly on Render.com.

Live Deployment: https://patternrec-project-group6.onrender.com/

GitHub Repository: PatternRec_Project_Group6

Team Responsibilities

Role Member Responsibilities
CV Engineer Derek Lu Developed the front-end interface for image upload and fruit/variant classification
NLP Engineer Deepthika Sivaram Built the interface for tag-based recipe recommendations using a BERT model
Joint Tasks Both Co-designed layout, styling, and integrated the written scientific report

System Overview

Architecture Diagram

[User] → [Upload Image / Input Tags]
      ↘                           ↙
   [CV Frontend]          [NLP Frontend]
      ↓                           ↓
[CV ONNX Model]       [NLP BERT Model]
      ↓                           ↓
  [Fruit/Variant]        [Top-K Recipes]
          ↘               ↙
     [Unified Display & Report Integration]

Highlights

Limitations & Future Work

Conclusion

This deployment phase successfully unified the two core machine learning components of our project into a single, user-accessible interface. The web application not only demonstrates technical proficiency in React and ONNX deployment but also enhances transparency and reproducibility through embedded scientific reporting. The Render-hosted solution provides an easily shareable and scalable showcase of our work.

Conclusion

This project successfully integrated Computer Vision and NLP systems into a unified, end-user application. High model performance and seamless web deployment reflect the robustness of both dataset design and implementation strategy.