← Back to archive
Data Forecasting

How to Teach Computers to Learn Zhou Yi Image-Association — Plus Some Thoughts on AI Research

For many people, teaching a computer to perform image-association (quxiang) sounds rather mystical; in fact, it is not difficult at all — once the principle is clear, it becomes simple.

Image-classification in Yi studies, from an abstract angle, is really just a way of categorizing all things. Because the sages observed the opening and closing of yin and yang in order to name things, when humans name the objects they perceive in the objective world, they always follow some intuitive regularity.

And this regularity transcends language. In recent studies of language translation models, one can find similar interesting phenomena: a model for translation between two languages can be transferred to another pair of languages, adjusted a bit, and then put to use.

This means that, although human languages appear to differ greatly in grammar and structure, the intuition behind and beyond the symbols is consistent; therefore the ways symbols are organized all secretly accord with some unified regularity.

Also, when using models like GPT for human-language text generation, one discovers further that imitating a writer's style is quite easy. The so-called different styles really amount to which words a sentence prefers for organizing its expression, and how many dimensions of description are applied to things — these also conform to a certain distribution. Once this is captured, language can be imitated with ease.

This even includes the speech models shaped by people's worldviews, values, and outlooks on life; from a mathematical point of view they are merely a form of probability distribution.

A typical example is that someone trained a model on the dialogue of characters in Dream of the Red Chamber, and the model could infer which character said a given line, with extremely high accuracy.

Correspondingly, people very familiar with Dream of the Red Chamber, even if they cannot recite it, can guess by feel who is speaking when they see certain lines.

So conversely, for humans, language style is a kind of "feeling," and this feeling allows people to share a "sensation" in both writing and reading. This human feeling is essentially a perception of a specific probability distribution.

This is a very remarkable situation. It means that humans, when reading only a sentence or two, often quickly capture this distribution intuitively and make judgments. This process is very likely not carried out through physical computation but through biochemical mechanisms.

Sometimes people say a newborn infant is a blank slate — that statement is not quite correct. From a model-based perspective, the infant is more like someone who already possesses a huge adjustable model; training of this model enables rapid learning.

But the more one learns this way, the more fixed the model becomes. Hence people develop all kinds of mental sets and are confined in invisible shackles. This is why Daoism requires that cultivating the Way must be done like an infant learning — striving to shake off the influence of acquired transfer, return to the innate model, and thereby possess stronger learning ability.

Whether it is the image-associations of the eight trigrams, those of the ten heavenly stems, or the image-associations of the unique symbol names in various arts of divination, all can be understood as a method of classification.

What is most miraculous in Yi studies is that these classification methods have strong interconnectivity. For example, anything named by the ten heavenly stems keeps the same image-associations no matter how it is organized and computed in what Yi-studies model. This means the partitions of image-association remain consistent across different divination models, showing very strong generality.

Since human language has a unified regularity behind it, the partitioning of image-associations can certainly correspond to that regularity as well.

There is also another issue: the classification of image-associations must account for how words may change under different contexts. For instance, many new internet terms have emerged in the modern web era — such as "time-management master," a jab at certain social phenomena, which carries multiple meanings. There are other cases too: homophones can sometimes be used for image-association. Although this is widely applied, whether it is sufficiently reasonable still needs verification.

So what follows is only a preliminary test, kept simple for convenience. We directly loaded BERT's word-vector model and then performed text classification, with image-association descriptions such as these:


    Son, QianFather, QianGreat man, QianOld man, QianElder, QianCelebrity, QianOfficial, QianGold and jade, QianPrecious pearl, QianRound object, QianWood fruit, QianHard object, QianCap, QianMirror, QianCourt hall, QianTower terrace, QianLofty hall, QianMansion, Qian

    Put simply, we treat trigram names as the class labels of the image-associations. Using the curated training set and training 6000 times, by the 1500th iteration the training-set accuracy had already reached nearly 75%.

    Image

    Regarding whether overfitting will occur: it becomes a problem only when the training data contains incorrect data or when the provided keywords are inaccurate. If you have a good enough base dataset for training, you need not worry too much about overfitting.

    Image

    The error rate is only 0.046, meaning roughly 94.4% accuracy. Not high enough yet, but usable.

    Image

    Testing with a set of phrases, we can see it really does group things — for example, it correctly identifies "Yellow River" and "Yangtze River" as belonging to Water.

    A few more casual tests:

    Image

    The classification results are still satisfying.

    What is this good for? For example, when you do not know which trigram a real-world thing belongs to, you can use such a system to help infer it. With a text generator on top and a well-designed sentence template, it might even produce a judgment — though that would be more complex and is not easy to implement currently.

    Worth mentioning is that when this project was proposed, someone suggested using the images from Jiao Shi Yi Lin. After testing, however, the results were extremely poor: the model could at best converge to just over sixty percent.

    Later I tracked down the source of this image-association table, and looking through Shang Binghe's Commentary on Jiao Shi Yi Lin, I found that this table has serious problems.

    First, when Shang Binghe extracted images in his Commentary on Jiao Shi Yi Lin, he did not do so for single hexagrams one by one. Each group in Jiao Shi Yi Lin consists of two sets of sixty-four hexagrams, and when deconstructing it, one does not simply adopt the interpretive relations of a single hexagram. The two sixty-four hexagrams, besides being splittable into four trigrams, can also be split into mutual hexagrams and opposite hexagrams, forming relations among at least eight hexagrams for mutual computation. So the image-association is done as an integral relationship.

    If one naively treats it as a single hexagram for interpretation, it inevitably becomes difficult to dig out. The person who originally extracted this image-association table merely scanned the words in the Commentary on Jiao Shi Yi Lin with computer code and then did word segmentation and extraction, so the resulting classified hexagram images contain numerous conflicts — and therefore, when placed in the model, the results do not converge well.

    This also provides a reverse validation, which is more reliable: not all word groups can be arbitrarily thrown together for casual classification. There are still principles behind them; one can say the traditional basic classification method is indeed effective.

    Next I experimented with the image-associations of the ten heavenly stems; the results were still good. I will not paste every image here, and later I will consider making a relatively richer set of earthly-branch image-associations.

    This is research done on a whim. If anyone has ideas, please point them out in the comments.

    Written by Master Sanfu on July 11, 2022. Please credit the source if you share.

    Translation Notice: This English version was translated with AI assistance. Specialized, historical, religious, or culturally sensitive terms may contain nuances, inaccuracies, or debatable wording. In case of ambiguity or discrepancy, the original Chinese text shall prevail.