Giter VIP home page Giter VIP logo

flavorgraph's Introduction

FlavorGraph

This repository provides a Pytorch implementation of FlavorGraph2Vec, trained on FlavorGraph, a large-scale food ingredient/chemical compound network of 8K nodes and 147K edges. As it is trained on not only food-food but also compound-compound relationships, our FlavorGraph2Vec is able to provide plausible food ingredient pairing recommendations based on chemical context.

FlavorGraph: Building and embedding a large-scale food graph to suggest better food pairing
Donghyeon Park*, Keonwoo Kim, Seoyoon Kim, Michael Spranger and Jaewoo Kang
Accepted and to be appear in [a publication or conference]

Our paper is available at:
[the link to the paper]

You can try our demo version of FlavorGraph:
[the link to the demo]

For more details to find out what we do, please visit https://dmis.korea.ac.kr/

Pipeline & Abstract

FlavorGraph

FlavorGraph

FlavorGraph2Vec

FlavorGraph2Vec Architecture

Embeddings

FlavorGraph2Vec Node Embeddings

Abstract
Food pairing is an area that has not yet been fully pioneered, despite our everyday experience and the large amount of data onfood. Such sophisticated and meticulous work so far has been determined by the intuition of the talented chefs. We introduceFlavorGraph that represents a large-scale food graph built on more than one million food recipes and information of 1,500flavor molecules. We analyze and extract sophisticated and meticulous relations of food both statistically and chemically so thatwe can give out a better hint of food pairing. Our graph embedding method based on deep learning surpasses other baselinemethods on food clustering. Food pairing suggestions from our model not only did it show better results, but it also showed thatseveral recommendations were possible depending on the situation. Our research offers a new reflection towards not only foodpairing techniques but also food science in general.

Prerequisites & Development Environment

  • Python 3.5.2

  • PyTorch 1.0.0

  • Maybe there are more. If you get an error, please try pip install "package_name".

  • CUDA 9.0

  • Tested on NVIDIA GeForce Titan X Pascal 12GB

Dataset

  • Generated pairing paths for training FlavorGraph2Vec (209MB)
    To train the model with pre-generated pairing paths, download the above file containing user-specified paths and place it in input/paths folder

  • node2fp_revised_1120.pickle (11MB)
    To train the model with Chemical Structure Prediction Layer, download the above file containing food&drug-like compound fingerprints and place it in input folder

Training & Test

Train the model with default settings. If you haven't download the above pairing paths file and placed it in the input/paths folder, the code will generate the pairing paths before running the model. The pairing paths are generated based on default settings.

python3 src/main.py --CSP_train --CSP_save

(You may remove the --CSP_train --CSP_save argument to train the model without Chemical Structure Prediction.)

If you want try another variation of metapaths before training the model, you can specify the arguments for the MetapathWalker as follows,

python3 src/main.py --number_of_walks 100 \ 
                    --walk_length 50 \ 
                    --idx_metapath 'M11' \
                    --which_metapath 'CHC+CHNHC+NHCHN' \
                    --num_walks 100 \
                    --len_metapath 50 \
                    --CSP_train --CSP_save

Embeddings

After the model is trained, a pickle file containing node embeddings from FlavorGraph2Vec and their corresponding tSNE projections will be created in output folder.

Contributors

Donghyeon Park, Keonwoo Kim
DMIS Labatory, Korea University, Seoul, South Korea
Please, report bugs and missing info to Donghyeon parkdh (at) sejong.ac.kr.

Citation

@article{park2021flavorgraph,
  title={FlavorGraph: a large-scale food-chemical graph for generating food representations and recommending food pairings},
  author={Park, Donghyeon and Kim, Keonwoo and Kim, Seoyoon and Spranger, Michael and Kang, Jaewoo},
  journal={Scientific reports},
  volume={11},
  number={1},
  pages={1--13},
  year={2021},
  publisher={Nature Publishing Group}
}

License

Apache License 2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.