{"id":16725347,"url":"https://github.com/mastergalen/stop-bluffing","last_synced_at":"2026-05-22T14:15:11.751Z","repository":{"id":73170978,"uuid":"121399090","full_name":"Mastergalen/Stop-Bluffing","owner":"Mastergalen","description":"Machine Learning model for detecting bluffing in Poker","archived":false,"fork":false,"pushed_at":"2018-04-23T13:05:59.000Z","size":1625,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-22T05:24:49.526Z","etag":null,"topics":["affective-computing","deep-learning","facs","keras","ucl"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mastergalen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-13T15:26:49.000Z","updated_at":"2018-12-22T17:29:04.000Z","dependencies_parsed_at":"2023-07-02T19:46:16.852Z","dependency_job_id":null,"html_url":"https://github.com/Mastergalen/Stop-Bluffing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastergalen%2FStop-Bluffing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastergalen%2FStop-Bluffing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastergalen%2FStop-Bluffing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastergalen%2FStop-Bluffing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mastergalen","download_url":"https://codeload.github.com/Mastergalen/Stop-Bluffing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243746834,"owners_count":20341326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["affective-computing","deep-learning","facs","keras","ucl"],"created_at":"2024-10-12T22:48:53.359Z","updated_at":"2026-05-22T14:15:06.718Z","avatar_url":"https://github.com/Mastergalen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stop-Bluffing\n\nMachine Learning model for detecting bluffing in a Poker game.\n\nA mini project part of UCL's Affective Computing and Human Robot Interaction course. \n\n## Prepare Data\n\nPlace videos in `data/videos/{playerId}`. Video filenames should have the format `G{gameId}R{roundId}`.\n\nE.g. the video of player 2 in game 1 round 2 would be located at `data/videos/2/G1R2.mov`.\n\n## Facial Action Unit Model\n\nThe Facial Action Coding System (Ekman et al., 2002) breaks facial geometry into smaller parts and encodes how these change over time ('Action Units' (AUs)).\nAn AU is movement of a muscle or group of muscles. For example, AU10 is the raising of the upper lip.\nAUs are scored by intensity and can encode almost any anatomically possible facial expression.\n\nFull guide by Ekman et al.: https://bit.do/facs-full\n\nSummary: https://bit.do/facs-summary\n\n### Extracting action units\n\nExtraction is done using Openface (Baltrušaitis et al., 2016).\n\nWe recommend using Windows. We had success with MacOS and Ubuntu but configuring components is considerably more challenging.\nFor MacOS see https://bit.do/openface-mac and for other UNIX systems see https://bit.do/openface-unix.\n\n#### Instructions for Windows\n\n*Requires Visual Studio 2015 **without updates** (https://bit.do/openface-vs) and Visual C++ Redistributable 2015 (https://bit.do/openface-cpp).*\n\nDownload the required binaries here: http://bit.do/openface-bins\n\nClone OpenFace into your repository:\n```\ngit clone https://github.com/TadasBaltrusaitis/OpenFace.git\n```\n\nOpen OpenFace.sln with Visual Studio 2015 and run OpenFaceOffline.\nIn the menu, set recorded data to AUs only.\nOpen your selected files and run OpenFace.\n\nOutputs are saved as a CSV.\nIn the header, a suffix of *c* denotes classification data and a suffix of *r* denotes regression data.\n\n### Training\n\nTo train the SVM model:\n```\npython -m feature.svm\n```\n\nTo train the neural network models:\n```\npython -m feature.keras_models [model]\n```\n\nThe [model] argument can be 'mlp' or 'rnn', for example:\n```\npython -m feature.keras_models mlp\n```\n\n## Facial Geometry Model\n\nOur other model attempted to use only the coordinates of the subject's facial geometry.\n\n### Prerequisites\n\n* Nvidia Docker\n\n```\n# Build docker image\ndocker build -t face-alignment .\n\n# Launch Docker container\nsudo nvidia-docker run -it \\\n  -v ~/Stop-Bluffing:/stop-bluffing \\\n  --rm \\\n  face-alignment\n\npython test/test_face_alignment.py\n```\n\n### Trim and extract frames\n\nRun `python scripts/trim_and_extract_frames.py`. This will extract the 5s clips as an image sequence and place them in `data/frames`.\n\n### Extract facial geometry\n\nUse [face-alignment](https://github.com/1adrianb/face-alignment) library to extract 3D face landmarks.\n\nYou will need a GPU to run this. \n\n```\npython scripts/extract_face_landmarks.py\n```\n\n### Train model\n\nAfter all the necessary data pre-processing is completed, you can now train the model.\n\n```\npython train.py [model]\n```\n\nFor example, to train the MLP model:\n\n```\npython train.py mlp\n```\n\nIt will automatically evaluate on the test set and show a confusion matrix with Matplotlib.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastergalen%2Fstop-bluffing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmastergalen%2Fstop-bluffing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastergalen%2Fstop-bluffing/lists"}