This is a machine learning project aimed at learning Final Fantasy Trading Card Game.
Classifying card(s) images(s) based on their attributes -- such as card name, element, rarity, and abilities. The goal is to create a model that can accurately predict the card's unique identifier ("Code") given its features.
A collection of Final Fantasy Trading Card Game cards images can obtained from Square Enix's official website. The dataset includes card name, element, rarity, type, power, and abilities.
The approach used for this project is supervised learning, specifically classification. The dataset is split into training and testing sets. The model is trained on the training set and evaluated on the testing set. Once a model has finished being fit and saved, it is then tested against real-world hand-pick images from the internet that have unaccounted attributes such as, it is foil, in a different language, or has some border.
Using RAG LLM lang chains to help players (and agents) better understand how to play the game or interaction of rules
Various resources can be used. FFTCG's Offical FAQs is a great starting point.
Creating a well formed vectore store and langchain form a great contextual basis. One practical use case is to create a discord bot. From here would could expand its capabilities and further understand undocumented game lingo.
This project is implemented using Python 3.11.
All libraries used are included in the pyproject.toml
. You should copy or make a symlink from the _tensorflow
or _torch
directory to the base direction. (Currently torch is more supported.) You can execute the following to update your dependencies
poetry install
Moreover, the sequential model were originally created with the Nvidia GeForce GTX 980 GPU and Intel Core i7-5960X CPU. Therefore the complexity of the models is further constrained by allowable training time and gpu memory. Recently this constraint is laxed by using a RTX 4090.
To be rewritten to support LLM, docker, etc.
To run this project, simply execute the following commands:
python .\src\gatheredata.py
This will gather all the required training/testing images and created a .\data\cards.json
file with all relevent card data.
python .\src\generatemodels.py
This will train the model. You can modify the code to change the classification algorithm used, or to include additional features.
python .\src\testmodels.py
This will test the models against real-world hand-picked data and evaluate our accuracy. Images will be cached (downloaded) and converted to JPEG (removing any alpha channels) into .\data\test\
This project demonstrates the feasibility of using machine learning to classify Final Fantasy Trading Card Game cards based on their attributes. Future work could involve expanding the dataset to include more cards and features, exploring other classification algorithms, and (multi)object detection.