Skip to content

mnothman/image_recommendation

Repository files navigation

A machine learning-driven image recommendation system designed to predict and personalize image suggestions based on user interactions, leveraging advanced embeddings and logistic regression models.

Testing algorithm for user interactions
Including interactions such as likes, comments, watch time per image and showing more content geared toward the user preference


folder: image rec final testsqlflask

steps:

  1. remove existing dataset and folder (if existing already)
    rm -rf data/validation/data
    (may need to elevate permissions to delete)

  1. python ./app.py

build:
make build

run:
make run

  1. Stop/Remove/Clean: make stop

make remove

make clean

home page displays a wide range of content and the users interactions are recorded
these recorded interactions are weighted upon their strengths to show content geared toward the user on the image recommendations page

updatedpict1

updatedpict2

Using resnet50 for image classification
Machine learning implementation:

  1. Build and run project, and interact with images by liking and commenting

  2. Train model
    http://localhost:5000/train_model
    This triggers training process inside docker container at "/app/data/recommender_model.pkl"

  3. View recommendations tab which should better reflect interactions consistent with images liked and commented

  4. Inspect / debug model:
    Check trained model using check_model.py script

First option:
i. Enter container shell (docker must be running: make build / make run/ docker ps -a (for logs: docker logs image_recommendation_container))

docker exec -it image_recommendation_container /bin/bash

ii. python check_model.py

debugterminal


Second option:
Or go to route: http://localhost:5000/debug_model

debuggoogle



In this example the user mainly interacted with labels such as cars and vehicles on the general page, therefore they are displayed images based upon these in their recommended tab:
recommend1

recommend2



About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published