• Studio
  • Talks
  • bio
Lynne Yun Design
  • Studio
  • Talks
  • bio

Tarot Card Generation with Machine Learning

Idea & Inspiration

There is a certain kind of magic in choosing through a process that seems seemingly random. Tarot cards are one example, where there is a series of cards and we try to divine meaning through cards that we choose at random. If the idea of Tarot Cards is to generate meaning through a randomized chaos, I figured that this would be a good idea to machine-generate a deck of tarot card images and their meanings. Another benefit of using Tarot Cards is the established rhythm of how the cards are drawn — they are usually portrait, a bit long in format, and the names are usually written at the bottom. They have a certain mystical atmosphere, and I was hoping that synthetic mediums would be able to make sense out of the card images that I would feed it.


Process

This project initially started out as an experiment related to my Electronic Rituals, Oracles and Fortune Telling class. However, I decided to explore further since I was starting to learn so much from this project.

For this project, I collected about 700 tarot card images from the internet (source links [1], [2], [3] and [4]) and used StyleGAN on RunwayML to train a tarot card model. Then, I compiled interpretations of readings and ran them through GPT-2 on RunwayML to generate new meanings. Finally, for the names, I settled on having a list of feelings that would pick 22 of them out of random. The number 22 comes from the major arcana of Tarot Cards. There were many pitfalls that I encountered throughout this process, I will list them below.

Attempt #1 at Training StyleGAN

giphy.gif
img000000002.jpg
img000000032.jpg
img000000038.jpg
img000000048.jpg
img000000052.jpg
giphy.gif img000000002.jpg img000000032.jpg img000000038.jpg img000000048.jpg img000000052.jpg

Attempt #2 at Training StyleGAN

latent_spacewalk.gif
img000000004.jpg
img000000022.jpg
img000000051.jpg
img000000080.jpg
img000000085.jpg
img000000086.jpg
latent_spacewalk.gif img000000004.jpg img000000022.jpg img000000051.jpg img000000080.jpg img000000085.jpg img000000086.jpg

Attempt #3 at Training StyleGAN

giphy.gif
img000000002.jpg
img000000005.jpg
img000000042.jpg
img000000059.jpg
img000000083.jpg
img000000095.jpg
giphy.gif img000000002.jpg img000000005.jpg img000000042.jpg img000000059.jpg img000000083.jpg img000000095.jpg

Attempt #4 at Training StyleGAN

giphy-1.gif
img000000004.jpg
img000000034.jpg
img000000060.jpg
img000000069.jpg
img000000073.jpg
img000000078.jpg
giphy-1.gif img000000004.jpg img000000034.jpg img000000060.jpg img000000069.jpg img000000073.jpg img000000078.jpg

Attempt to Train GPT-2

In an attempt to train GPT-2 on ‘fortune-telling’ sentences, I collected data from fortune cookie message archives (link [1], [2], [3]), proverb saying collections from the internet, and Tarot reading data (from Allison Parrish). Unfortunately, it ended up only being about 167KB’s worth of text (it takes a LOT of text to be over 1MB, I realized!), and the GPT–2 ended up only repeating the data that it already had.

So in the end, I just ended up using the same dataset but just selecting random samples of meanings (instead of generating them).

Generated Text

Final Outcome

After being disappointed with earlier attempts, I tried to debug the dataset — meaning that I tried to have a smaller quantity of samples that are more similar to each other in terms of artistic quality and resolution. I scraped this Japanese Blog that had four editions of the Rider-Waite-Smith tarot card deck, and added in one more set that I had. It wasn’t quite 500 images, but I hoped that it would be enough. Also, I found that the StyleGAN in Runway had a second, improved version. So I tried it out.

Here is a gist of the scraping Jupyter Notebook

To my pleasant surprise, the model turned out the most successfully than I expected! It produced much more variety than the previous models, and more predictable styles with less blobs. Still not varied enough, but a bit better than the previous attempts.


Name: The DisdainKeyword: ['Satisfaction', 'choice', 'option']Light: Experiencing transcendent joyShadow: Responding to constructive criticism with defensiveness

Name: The Disdain

Keyword: ['Satisfaction', 'choice', 'option']

Light: Experiencing transcendent joy

Shadow: Responding to constructive criticism with defensiveness

Name: The RestlessKeyword: ['stamina', 'conclusion', 'worry']Light: Searching for the truthShadow: Spending money carelessly

Name: The Restless

Keyword: ['stamina', 'conclusion', 'worry']

Light: Searching for the truth

Shadow: Spending money carelessly

Name: The Shut DownKeyword: ['collaboration', 'motivation', 'Enthusiasm']Light: Honoring limitsShadow: Obsessing on errors and overlooked details

Name: The Shut Down

Keyword: ['collaboration', 'motivation', 'Enthusiasm']

Light: Honoring limits

Shadow: Obsessing on errors and overlooked details

Name: The SafeKeyword: ['difference', 'skill', 'rejection']Light: Delivering exactly what others have asked forShadow: Using a barbed tongue to upset others

Name: The Safe

Keyword: ['difference', 'skill', 'rejection']

Light: Delivering exactly what others have asked for

Shadow: Using a barbed tongue to upset others

Name: The WoodenKeyword: ['nurturing', 'science', 'sneakiness']Light: Letting goShadow: Avoiding work that needs to be done

Name: The Wooden

Keyword: ['nurturing', 'science', 'sneakiness']

Light: Letting go

Shadow: Avoiding work that needs to be done

Name: The PresentKeyword: ['disaster', 'disruption', 'certainty']Light: Hoping for the bestShadow: Avoiding work that needs to be done

Name: The Present

Keyword: ['disaster', 'disruption', 'certainty']

Light: Hoping for the best

Shadow: Avoiding work that needs to be done

Name: The FrozenKeyword: ['acquisition', 'Wealth', 'attraction']Light: Exercising authorityShadow: Rejecting information that suggests your intuitions are misguided

Name: The Frozen

Keyword: ['acquisition', 'Wealth', 'attraction']

Light: Exercising authority

Shadow: Rejecting information that suggests your intuitions are misguided

Name: The HumiliatedKeyword: ['Advancement', 'reflection', 'initiation']Light: Investing time in learning or teaching a difficult taskShadow: Looking out for yourself while allowing harm to come to others

Name: The Humiliated

Keyword: ['Advancement', 'reflection', 'initiation']

Light: Investing time in learning or teaching a difficult task

Shadow: Looking out for yourself while allowing harm to come to others

Name: The CalmKeyword: ['Speed', 'cycles', 'completeness']Light: Starting your own businessShadow: Taking a fatalistic approach to life

Name: The Calm

Keyword: ['Speed', 'cycles', 'completeness']

Light: Starting your own business

Shadow: Taking a fatalistic approach to life

Name: The AgitatedKeyword: ['charm', 'Revival', 'withdrawal']Light: Allowing someone to use his or her own methods to get a job doneShadow: Debilitating passion

Name: The Agitated

Keyword: ['charm', 'Revival', 'withdrawal']

Light: Allowing someone to use his or her own methods to get a job done

Shadow: Debilitating passion

Name: The BraveKeyword: ['Variance', 'fantasy', 'learning']Light: Telling jokesShadow: Taking unnecessary risks as a means of proving your fearlessness

Name: The Brave

Keyword: ['Variance', 'fantasy', 'learning']

Light: Telling jokes

Shadow: Taking unnecessary risks as a means of proving your fearlessness

Name: The AggravatedKeyword: ['openness', 'illumination', 'revolution']Light: Being cheered on by the crowdShadow: Refusing to handle stress in healthy ways

Name: The Aggravated

Keyword: ['openness', 'illumination', 'revolution']

Light: Being cheered on by the crowd

Shadow: Refusing to handle stress in healthy ways

Name: The IrritatedKeyword: ['prosperity', 'Assessment', 'grace']Light: Starting a savings planShadow: Obsessing on death and dying

Name: The Irritated

Keyword: ['prosperity', 'Assessment', 'grace']

Light: Starting a savings plan

Shadow: Obsessing on death and dying

Name: The InvigoratedKeyword: ['wit', 'oppression', 'reversals']Light: Receiving the perfect gift at the perfect timeShadow: Seizing every new idea that comes your way without question

Name: The Invigorated

Keyword: ['wit', 'oppression', 'reversals']

Light: Receiving the perfect gift at the perfect time

Shadow: Seizing every new idea that comes your way without question

Name: The ClenchedKeyword: ['dreams', 'purity', 'destruction']Light: Blazing your own trailShadow: Habitually discounting input or feedback from others

Name: The Clenched

Keyword: ['dreams', 'purity', 'destruction']

Light: Blazing your own trail

Shadow: Habitually discounting input or feedback from others

Name: The ReleasingKeyword: ['discipline', 'Union', 'cooperation']Light: Experiencing intense joyShadow: Adopting a point of view and refusing to reconsider your conclusions, even when presented with refuting evidence

Name: The Releasing

Keyword: ['discipline', 'Union', 'cooperation']

Light: Experiencing intense joy

Shadow: Adopting a point of view and refusing to reconsider your conclusions, even when presented with refuting evidence

Name: The WearyKeyword: ['attention', 'irrationality', 'health']Light: Making sacrificesShadow: Using cheap illusions to dazzle others

Name: The Weary

Keyword: ['attention', 'irrationality', 'health']

Light: Making sacrifices

Shadow: Using cheap illusions to dazzle others

Name: The CompassionKeyword: ['assumptions', 'investigation', 'combination']Light: Taking care of the small detailsShadow: Employing sarcasm

Name: The Compassion

Keyword: ['assumptions', 'investigation', 'combination']

Light: Taking care of the small details

Shadow: Employing sarcasm

Name: The ItchyKeyword: ['dissatisfaction', 'illumination', 'diplomacy']Light: Understanding the meaning of lifeShadow: Using clever insults to undermine the confidence of others

Name: The Itchy

Keyword: ['dissatisfaction', 'illumination', 'diplomacy']

Light: Understanding the meaning of life

Shadow: Using clever insults to undermine the confidence of others

Name: The TightKeyword: ['fervor', 'training', 'fulfillment']Light: Bearing fruitShadow: Putting excessive emphasis on appearances

Name: The Tight

Keyword: ['fervor', 'training', 'fulfillment']

Light: Bearing fruit

Shadow: Putting excessive emphasis on appearances

Name: The BurningKeyword: ['overwhelming emotion', 'community', 'rejection']Light: Picking yourself up by your own bootstrapsShadow: Ignoring healthy approaches to life

Name: The Burning

Keyword: ['overwhelming emotion', 'community', 'rejection']

Light: Picking yourself up by your own bootstraps

Shadow: Ignoring healthy approaches to life

Name: The RelaxedKeyword: ['Authority', 'Enlightenment', 'Fertility']Light: Winning a competitionShadow: Torturing yourself with regrets

Name: The Relaxed

Keyword: ['Authority', 'Enlightenment', 'Fertility']

Light: Winning a competition

Shadow: Torturing yourself with regrets


Final Thoughts

I’m happy with where it ended up, although I can’t get over my frustration of wanting the images to be more different and varied. It seems the data is running into the problem of overfitting, when it trains for more than 4,000 steps. If only I had more tarot cards and data!

The latent space for the last model

The latent space for the last model

Wednesday 03.11.20
Posted by Lynne Yun
Newer / Older

© 2022 Lynne Yun