# Unsupervised learning architecture based on
neural Darwinism and Hopfield networks
recognizes symbols with high accuracy

Mario Stepanik

(Department of Mathematics, ETH Zürich
<EMAIL_ADDRESS>
###### Abstract

This paper introduces a novel unsupervised learning paradigm inspired by
Gerald Edelman’s theory of neuronal group selection (“Neural Darwinism”). The
presented automaton learns to recognize arbitrary symbols (e.g., letters of an
alphabet) when they are presented repeatedly, as they are when children learn
to read. On a second hierarchical level, the model creates abstract categories
representing the learnt symbols. The fundamental computational unit are simple
McCulloch-Pitts neurons arranged into fully-connected groups (Hopfield
networks with randomly initialized weights), which are “selected”, in an
evolutionary sense, through symbol presentation. The learning process is fully
tractable and easily interpretable for humans, in contrast to most neural
network architectures. Computational properties of Hopfield networks enabling
pattern recognition are discussed. In simulations, the model achieves high
accuracy in learning the letters of the Latin alphabet, presented as binary
patterns on a grid. This paper is a proof of concept with no claims to state-
of-the-art performance in letter recognition, but hopefully inspires new
thinking in bio-inspired machine learning.

##  1 Introduction

The late Gerald Edelman, widely recognized for his Nobel-prize-winning
research on the chemical structure of antibodies, was known to marvel at the
unfathomable individuality and variation of neural structures in human brains
([2]). How could it be that no two brains were alike, in terms of their
synaptic circuitry, while they evidently solved similar tasks? Convinced that
the Darwinian notions of mutation and selection are fundamental functional
principles organizing a variety of biological systems, Edelman introduced a
theory of neuronal group selection, later popularized as neural Darwinism, as
the unifying algorithm underlying higher brain function ([4]; [3]). The core
of the theory is simple: the fundamental computational unit of the brain is a
neural group capable of performing some function. A large number of neuronal
groups, strongly coupled internally but weakly among each other, are present
initially (e.g., at birth) and are capable of performing a variety of
functions. Throughout ontogeny, these groups are selected according to their
suitability to solve problems the organism faces. Edelman’s previous research
had solidified the claim that such a Darwinian process acted as the functional
principle underlying our immune system ([13]). Until his death in 2014, his
neuroscientific work was dedicated to exploring the idea of a similar
selection acting on neuronal groups which are characterized by differences in
their connectivity patterns.

While Edelman and colleagues developed a series of automata to formalize the
intuition behind neural Darwinism ([5]; [11]), no model constructed from
building blocks as simple as individual neurons has been proposed, to the best
of my knowledge. Instead, previous models have relied on a possible later
discovery of a recognition mechanism which explains the functioning of
neuronal groups. In this paper, I propose that Hopfield networks, generally
appreciated as computational models of associative memory ([9]), can provide
the missing link by exploiting an intuitive, but little discussed, property of
their convergence algorithm. In particular, it is demonstrated that the speed
of convergence, defined below, can act as a natural and interpretable
indicator of “recognition”. Simulations demonstrate that an automaton
combining Hopfield networks, my recognition criterion, and the previous
architecture proposed by [5] can learn to recognize and abstract an arbitrary
alphabet solely by repeated presentation of the individual letters with high
accuracy. This model may be unique in its ability to integrate the neuronal
and functional levels of analysis while retaining complete interpretability,
which is of particular interest in machine learning research ([8]).

The remainder of this paper is structured as follows: Section 2 introduces the
architecture and the theoretical formulation of the proposed automaton.
Section 3 presents the results of the simulation studies. These findings and
the computational and neurobiological properties of the automaton are
discussed in Section 4. Section 5 concludes.

##  2 Theoretical model

The automaton presented here consists of three main building blocks: (i)
neuronal groups (Hopfield networks), (ii) a recognition repertoire, and (iii)
an abstraction repertoire. In this architecture, neuronal groups are the
fundamental units responsible for the recognition of inputs. Each neuronal
group is randomly initialized (in a sense to be made precise) and a large
number of such groups is organized in the loosely coupled recognition
repertoire. Intuitively, this repertoire corresponds to the natural diversity
(achieved through mutation) among which selection takes place in a Darwinian
manner. Upon presentation of a stimulus to all groups, the best-performing one
is identified and propagates its recognition ability to nearby groups. On a
second hierarchical level, another set of neuronal groups of the same kind
(termed the abstraction repertoire) is initialized randomly. These groups do
not receive input from external sources (i.e., stimuli), but only from the
recognition repertoire to which they are sparsely connected. Over time, these
abstraction groups learn to become abstract representations of the presented
stimuli. The formal description of these computational properties is presented
in the following subsections. The architecture is inspired by previous work by
[11].

### Neuronal groups

The fundamental computational unit of which groups are composed is a classical
McCulloch-Pitts neuron. For such a neuron $k$, let there be $m$ inputs with
signals $x_{1}$ to $x_{m}$ as well as associated weights $w_{k1}$ to $w_{km}$.
The signal (“activity”) of neuron $k$ is obtained by:

$s_{k}=\varphi\left(\sum_{j=0}^{m}w_{kj}x_{j}\right)$ (1)

where $\varphi$ is usually a threshold function. We assume this function to be
an indicator function such that $s_{k}=1$ when the sum of weighted inputs is
at least $0$ and $s_{k}=0$ otherwise. These units are arranged in a fully-
connected group $i$ with $n$ neurons (a Hopfield network) which is fully
characterized by the symmetric $n\times n$ weight matrix $W_{i}$. The elements
$w_{kj}$ of the weight matrix $W_{i}$ hence correspond to the edge weights in
an undirected graph. We constrain self-weights (the diagonal elements of
$W_{i}$) to be $0$ and all other connections, initially, to be either $+1$
(excitatory) or $-1$ (inhibitory). If a neuron is chosen to be updated (as
described below), the activity rule in Equation 1 is invoked.

It is well known that such a fully-connected network will always converge to a
stable state if neurons are updated asynchronously ([9]; [1]). That is, if we
pick a neuron $k$ at random, sum the weights of all other activated neurons
and activate neuron $k$ (i.e., set $s_{k}=1$) if the sum is greater than zero
and deactivate it ($s_{k}=0$) otherwise, then the network will always converge
to a stable $n$-dimensional activity pattern after a finite number of updates.
From the study of Ising models in statistical physics, it is known that the
set of stable states of a Hopfield network corresponds exactly to the set of
local minima in the network’s energy function (which is the Hamiltonian of the
system111No external magnetic field/individual thresholds are included in this
formulation of the model.):

$E=-\frac{1}{2}\sum_{k,j}w_{kj}s_{k}s_{j}$ (2)

It is possible that a given network has multiple local minima, in which case
the initial activation pattern determines to which stable pattern the system
will converge (“basins of attraction”). In the present model I assume, for
simplicity, that neurons are not updated randomly but in an ordered, cyclical
manner. This implies that we know precisely when convergence has been reached,
namely after a full cycle of $n$ non-updates.

Crucially for this model, the weights in the matrix $W_{i}$ for each group $i$
are initialized randomly and thus, the stable states of each group are random
_a priori_.222In the software implementation, this corresponds to randomly
sampling either +1 or -1 for every connection between neurons (see function
create_rand_weights in the accompanying code). Note, however, that the number
of update steps to convergence depends heavily on the congruence of the
initial activation pattern and the stable activation pattern of the network:
if the initial pattern is already a stable state, no updates are required, but
the number of updates grows loosely in proportion to the Hamming distance
between initial and stable patterns. Hence, the number of updates required for
convergence, which we denote $q$, may be interpreted as a measure of
“recognition”: if no updates are required, the network fared well in
“recognizing” the input pattern. In neurobiological terms, this could
correspond to convergence speed, which can be usefully interpreted in the
context of the recognition repertoire, presented next.

To build intuition for the connection between a pattern of interest and the
initial activation pattern of a neuronal group, consider Figure 1a which
depict how a simple $5\times 5$ input symbol can be converted to a binary
string representing the input activation pattern.

### Recognition repertoire

Observe that each such neuronal group is intrinsically tuned to “recognize” a
specific set of symbols, namely those which correspond to binary activation
patterns (see Figure 1a) which are local minima of the neuronal group’s
Hamiltonian. If a pattern identical to a stable state of the network is
“presented” (that is, the neuronal group is initialized to the binary
activation pattern corresponding to this pattern), no updates are required,
which we view a “fast convergence” in a biological sense.333Note that this
requires the number of neurons in a group, $n$, to be equal to the dimension
of the input pattern, which we assume throughout (I return to limitations of
this assumption in the discussion section). We shall now express this idea
rigorously and see how it can be exploited in learning.

Let us assume the model evolves in discrete time steps $t$. Between $t$ and
$t+1$, an input pattern (stimulus) is presented to a neuronal group $i$,
convergence is reached, and the number of updates required for convergence,
$q_{i}$, is recorded. We equip each group with an time-dependent excitation
state $S_{i}(t)$ which inversely depends on $q_{i}$:

$S_{i}(t)=\Phi[q_{i}(t)]+\omega S_{i}(t-1)+\varepsilon(t)$ (3)

Here, $\Phi[q_{i}(t)]$ represents a function relating the number of
convergence steps at time $t$ to an excitation state. In this case, we take it
to be $\frac{1}{q_{i}}$ if a stimulus is presented at time $t$ and $0$
otherwise. $\omega\in[0,1[$ is an attenuation factor which determines the
degree to which previous activation persists across time. $\varepsilon(t)$ is
Gaussian noise. Equation 3 essentially translates the performance of a group
in recognizing a presented pattern into a scalar value which can be compared
to the performance of other groups.

Figure 1: _Top:_ A simple $5\times 5$ input symbol can be converted to a
binary string representing the input activity pattern. _Bottom:_ Upon
presentation of a symbol (left), a neuronal group $i$ converges in $q_{i}$
steps, which is translated into an excitation state.

With this formal definition of a neuronal group in hand, we can now define the
starting condition of the first hierarchical level, called the recognition
repertoire. This repertoire is a collection of $r$ neuronal groups of the kind
described above, sparsely connected to each other to allow weight propagation.
The intuitive idea behind this setup is illustrated in Figure 1b: suppose we
have a large number $r$ of neuronal groups, each initialized randomly to
recognize some stimulus in the sense defined above. If a certain set of
stimuli is presented repeatedly (e.g., an alphabet), some groups, naturally
tuned to recognize the presented symbols, will react by exhibiting an
increased excitation state $S$. For example, if the letter “H” is presented
(as in Figure 1b), a group $i$ which intrinsically possesses an identical
convergence pattern will be excited most strongly (illustrated by the neuronal
group in the bottom center). If the repertoire of neuronal groups is large
enough, there will likely be a group which recognizes any given stimulus.

We can implement a notion of learning by defining a mechanism by which the
most excited groups propagate their weight matrix $W$ to a set of nearby
groups. This is desirable because a high excitation state indicates the
salience of the stimulus which caused the excitation. If a consistent, not too
large set of stimuli is presented over time, more neuronal groups will learn
to recognize these stimuli over time as their weight matrices become more
similar to the weight matrix of the group which initially (through random
initialization) recognized the stimulus. Formally, we can describe the weight
propagation mechanism as follows:

$W_{i}(t)=\frac{1}{\max|w_{i}(t)|}\left[W_{i}(t-1)+\alpha\sum_{l}[S_{l}(t-1)-\theta]_{+}W_{l}(t-1)\right]$
(4)

where $\alpha$ denotes the learning rate, $\theta$ is a threshold value, the
index $l$ enumerates all groups directly connected to $i$ (described in more
detail below), and $\max|w_{i}(t)|$ describes the absolute value of the
maximum entry in the new weight matrix, so dividing by it normalizes the
resulting matrix to a maximum absolute value of 1 again. The subscript +
indicates that the preceding term in brackets is set to 0 if it evaluates to a
negative number (to avoid “negative weight propagation”). Intuitively, each
weight matrix $W_{i}$ is updated by adding a fraction (determined by $\alpha$)
of the weight matrices of sufficiently excited (determined by $\theta$)
surrounding groups. If a group $j$ is consistently excited (because it
recognizes a frequently presented, i.e., salient, stimulus) while group $i$ is
not, $j$’s weight matrix will be transferred to group $i$ over time. In the
software implementation, I further included a high threshold level of
excitation which, if surpassed, prevents a group’s weights from being updated
to ensure stability.

Following the original concept presented by [4], the neuronal groups are
“topographically” arranged and connected in the recognition repertoire. This
means that during initialization, groups which are determined to be directly
connected to each other (and are thus able to receive weight updates) resemble
each other in the sense that their weight matrices differ only in a small
number of entries. This implies that connected groups recognize similar
stimuli. Inspired by the topographical organization in parts of the cortex,
[4] argued this would facilitate learning. Note that this does not make the
initialization less random, as we are simply rearranging the groups to meet
this topography criterion: no information about potential stimuli is reflected
in the weights in this process. I have adopted this assumption.

In summary, the first hierarchical level of the model operates according to
the following steps: first, a recognition repertoire containing $r$
topographically arranged groups of $n$ neurons is created (using the function
create_rec_rep). Second, an input pattern is presented at each time point $t$,
i.e., all activation patterns of the groups in the recognition repertoire are
set to the input pattern. All groups converge to an intrinsic stable state and
the number of steps to convergence is recorded for each group (function
present_pattern_cum). Third, at the same time step $t$, groups which converged
after a low number of updates are highly excited (Equation 3) and propagate
their weight matrix to less excited groups (Equation 4). Over time, more
groups will recognize those stimuli which are presented repeatedly and hence,
the recognition repertoire is tuned to the specific set of symbols presented
to it without any explicit assumptions about which symbols it might encounter.

### Abstraction repertoire

The model is completed by a second hierarchical level termed the abstraction
repertoire. This repertoire consists of $a\ll r$ groups of the same kind as
those in the recognition repertoire. Each group $s$ in the abstraction
repertoire is connected to a small number of (topographically connected)
groups in the recognition repertoire (function create_abs_rep). These groups
do not receive external stimuli directly but only inputs from the recognition
repertoire. Each weight matrix of an abstraction group $s$, denoted
$W^{A}_{s}$, is initialized randomly, as in the recognition repertoire, but is
only subject to weight propagation from the groups in the recognition
repertoire it is connected to. In contrast, however, an abstraction group is
only updated if the cumulative excitation of these connected groups is
sufficiently strong (function abs_weight_updating_cum). A schematic
representation of the hierarchical structure of the model is depicted in
Figure 2.

Figure 2: Representation of the network’s hierarchical structure. Stimuli are
presented to all groups in the recognition repertoire. Sufficient excitation
in parts of the recognition repertoire triggers weight propagation to the
abstraction repertoire. The connections between an abstraction group $s$
(yellow) and a set of recognition groups, indexed $v$ (red), are shown. The
learned patterns that groups are tuned to recognize are schematically depicted
near each group.

Intuitively, these groups learn an “abstract” category representation of the
presented symbols. These are imagined to be our abstract idea of, for example,
the letter “H”. As there are only a small number of abstraction groups, it is
unlikely that they are intrinsically tuned to recognize patterns of interest
(see simulation results below). Formally, the weight update equation for
abstraction groups is given by:

$W^{A}_{s}(t)=\frac{1}{\max|w^{A}_{s}(t)|}\left(W^{A}_{s}(t-1)+\beta\left[\sum_{v}[s_{v}(t-1)W_{v}(t-1)-\theta]_{+}-\theta_{A}\right]_{+}\right)$
(5)

Here, $\beta$ denotes the second-level learning rate, the index $v$ runs over
recognition groups connected to the abstraction group $s$, $\theta_{A}$ is the
threshold excitation for weight propagation for the abstraction group, and
$\max|w^{A}_{s}(t)|$ is again a normalization factor. The subscript + is
defined as in Equation 4. This equation expresses the idea that, if the sum of
excitations in the connected recognition groups exceeds the threshold
$\theta_{A}$, a fraction (determined by $\beta$) of their weight matrices is
added to the abstraction group’s weight matrix. If the threshold is not
exceeded, no change in $W_{s}^{A}$ occurs.

Ideally, these groups are tuned, over time, to the set of symbols presented
repeatedly to the recognition repertoire. In the following simulation studies,
the accuracy is measured by the number of patterns for which there exists an
abstraction groups which learned this pattern, in the sense that the pattern
is a stable state of the abstraction group network. This concludes the formal
description of the model. In the next section, I will present simulation
results.

##  3 Simulations

The model was implemented using only standard packages in Python. The
accompanying code is available here.

###  3.1 Implementation

For computational reasons, the simulations were run using patterns of
dimension $n=4\times 4=16$ (in contrast to the $5\times 5$ patterns depicted
in the figures). This size allows for $2^{16}=65,536$ possible patterns.
Binary $n$-dimensional vectors for each of the 26 letters of the Latin
alphabet were defined (as in Figure 1a).

A topologically organized recognition repertoire is created with a simple
stepwise procedure: first, an initial group is created. Then, a number of
similar groups (i.e., with a small number of resampled weights) are created
and connected to the initial group. A few groups of the newly created ones are
sampled as the starting point for the next expansion of the same kind. Some
backward connections between two sets of expansions are added. The details of
this procedure can be studied in the function create_rec_rep and the
appropriate auxiliary functions. In the results presented here, a total of
49,961 neuronal groups were created.

The abstraction repertoire was set to consist of 250 neuronal groups. To
specify their connections, 250 recognition groups were randomly sampled and
each group, its connected groups, and the connected groups of these groups
were determined to be the connected groups of a given abstraction group. On
average, each abstraction group turned out to be connected to 23 recognition
groups. Details can be found in the function create_abs_rep and the
appropriate auxiliary functions.

The learning procedure is as follows: one of the 26 letters is randomly
selected and presented to all neuronal groups in the recognition repertoire.
The excitation state of each group is determined using Equation 3 and
appropriate weight updates are performed using Equations 4 and 5. For each
letter, this process was repeated 10 times to emulate the process of focusing
on one letter to learn it (rather than switching swiftly and randomly between
them). This procedure is repeated an arbitrary number of times. After each 100
iterations, the number of recognition and abstraction groups which converged
to one of the desired letter patterns were recorded to track how many letters
were correctly learned. Table 1 lists the parameter values, identified through
trial and error, which yielded good performance. The thresholds specified as
“see code” are dynamically generated to identify sensible values: for example,
the abstraction threshold depends on the number of recognition groups
connected to a given abstraction group, as those with more connected groups
would be more easily excitable otherwise. For simplicity, no Gaussian noise is
simulated for the excitation state.

Parameter | Description | Value
---|---|---
$\omega$ | Attenuation factor | 0.97
$\alpha$ | Learning rate (recognition) | 0.05
$\theta$ | Propagation threshold (recognition) | see code
$\beta$ | Learning rate (abstraction repertoire) | 0.3
$\theta_{A}$ | Propagation threshold (abstraction) | see code
Table 1: Parameters values and descriptions.

###  3.2 Results

The simulations clearly demonstrate that the model is capable of recognizing,
learning, and abstracting symbols in the sense described above. The weight
matrices of the neuronal groups in the recognition repertoire adapt over time,
leading to a majority of groups converging to a stable state which represents
a letter pattern. Furthermore, the groups in the abstraction repertoire were
able to learn almost all letters presented.

The left panel of Figure 3 depicts the evolution of the number of neuronal
groups in the recognition repertoire which have one of the letter patterns as
their stable state. The lines represent all 26 letters. At time point 0,
around 15 $\%$ of letters of the alphabet were not a stable state of any
neuronal group and 50 $\%$ of letters were a stable state of a maximum of
three groups. Over time, the weight matrices (and thus, the patterns which are
stable states of groups) propagate as expected. Note that a small number of
letter patterns (here, “H”, “Y”, “Z”) are captured by very few neuronal groups
after 10,000 iterations.

The right panel of Figure 3 depicts the evolution of the number of abstraction
groups which have one of the letter patterns as their stable state. For
clarity, only the first six letters are presented. At time point 0, only 2
letter patterns are (by chance) stable states of at least one of the 250
abstraction groups (one of them is “E”, as depicted). After 10,000 iterations,
24 out of 26 letter patterns were stable states of at least one neuronal group
in the abstraction repertoire, as depicted in Figure 4.

Figure 3: _Left:_ Number of neuronal groups in the recognition repertoire
whose stable states are a pattern of interest (letters, as depicted in the
legend), out of a total of 49,961. _Right:_ Number of abstraction groups whose
stable states are a pattern of interest, out of a total of 250. (only first
six depicted for visibility). _Note:_ The x-axis represents sets of 10
iterations, so the maximum is in fact 10,000.

Figure 4: Number of letter patterns which are stable states of at least one
neuronal group in the abstraction repertoire.

##  4 Discussion

This paper introduced a novel unsupervised learning paradigm inspired by
neural Darwinism. The presented automaton learns to recognize arbitrary
symbols when they are presented repeatedly and creates abstract category
representations for them. I proposed Hopfield networks as the fundamental
computational unit implementing the concept by [4].

The model captures a number of key properties of Edelman’s original proposal.
First, it is a selectionist model: it achieves the task of letter recognition
and abstraction by starting from a large variety of randomly initialized
fundamental units, among which the stimuli presented to the model “select” the
most useful ones. No assumptions about the precise patterns to be recognized
are made, other than the requirement that they can be represented in binary
form in the given dimension. Second, it represents Edelman’s observation that
selective recognition requires a degenerate (i.e., overlapping) but not
redundant repertoire ([4]). That is, the recognition units need to strike a
balance between functional diversity and similarity, which is achieved with a
sufficiently large recognition repertoire.

A major appeal of this model is the intuitive interpretation of learning it
allows. The system infers which patterns are sufficiently salient that they
deserve to be remembered (and abstracted) solely from the frequency in which
they are presented. Had we used, for example, letters of the Cyrillic script,
these could have similarly been learned. Essentially, it is the regularity
with which patterns are presented which matters. Furthermore, we can observe
that the reliable recognition of a given pattern comes hand in hand with a
loss of flexibility in recognizing new patterns. This is due to the fact that
the repeated activation of one group overwrites the recognition ability of
another due to weight propagation. This could provide an explanation for the
observation that we tend to lose our ability to flexibly acquire new concepts
as we age: in a selectionist paradigm, we suffer from a lack of mutation.
Finally, the components of the model are easily interpretable for an external
observer: the stored patterns of each group can be probed at any time, so the
learning mechanism is entirely transparent. This is a major advantage over
most machine learning methods, which are frequently seen as black boxes
([12]).

Heuristic considerations also reveal similarities to other theoretical
frameworks in neuroscience. Note that this model essentially solves a large
number of energy minimization problems as convergence in Hopfield networks is
equivalent to the identification of a local minimum in the system’s energy
landscape. This is reminiscent of the free energy principle, which suggests
that agents seek to minimize the free energy (or surprise) through the
construction of more accurate models of the environment or actions to modify
it ([6]). In this case, the correct recognition of patterns which occur
frequently in the agent’s environment serves the purpose of minimizing energy
in a concrete manner. Furthermore, the principle of active inference, which
states that agents may actively seek out new stimuli in the pursuit of
surprise minimization ([7]), chimes in well with the proposed interpretation
of learning: while not simulated explicitly, it is imaginable that accuracy
increases even further if we seek out stimuli with the goal of actively
learning them when we are struggling to do so. For example, it could be
attempted to present those letters which were not yet learned for longer
periods of time.

Finally, two properties of neurobiological appeal deserve to be mentioned.
First, note that no central coordination of the neuronal groups (e.g., time
keeping via a clock) is required: the notion of a “winning group,” determined
by fastest convergence, is natural and neurobiological implementations are
imaginable (although see limitations below). Second, a system as the one
presented here is capable of generating reliable output despite relying on
(potentially) unreliable computational units. The convergence properties of
Hopfield networks hinge primarily on the valence of edge weights (determining
whether the connection is excitatory or inhibitory), but not their precise
magnitude ([9]). In contrast to major learning mechanisms prevalent in
classical machine learning (e.g., backpropagation), which rely on strong
architectural and numerical constraints ([10]), the present mechanism lowers
the requirements for individual neurons and connections.

Of course, this simple implementation suffers from a number of limitations,
both as a computational model and as a theory of brain function. From a
computational standpoint, one first has to note that a large number of neurons
($49,961\cdot 16=799,376$) are required to fulfil a relatively simple task.
Second, the model is currently not robust to alterations of the inputs, such
as rotation or distortion. One could argue that a lower hierarchical level
could be capable of transforming sensory inputs such that they arrive at the
recognition repertoire in the appropriate format. However, this possibility
has not been modeled here. From a neurobiological perspective, several
questions remain to be answered. First, the precise neural circuits
implementing these neuronal groups need to be described. Evidently, axonal
projections allow only for unidirectional information flow in real nervous
systems, whereas connections in classical Hopfield networks are symmetric.
Second, biological systems do not operate in discrete time steps as has been
assumed here for modeling purposes. It would be interesting to explore a
setting in which updating and weight propagation occur in a dynamical fashion
instead. Third, the present account lacks a neurobiological explanation of how
convergence speed of a network is translated into a group excitation state,
which then allows for the transfer of connection weights to other groups.
These questions need to be explored in future work.

##  5 Conclusion

This paper presented an unusual approach to pattern recognition in machine
learning. It achieves high accuracy in recognizing and categorizing symbols
within a selectionist paradigm, introduced in [4]. It represents a proof of
concept which can be refined and extended in future work and hopefully
inspires researchers to tread new paths in the search for biologically
plausible computational models.

## Accompanying code

The accompanying code is available here.

## Acknowledgments

I am grateful for the conversations with Kasper Rasmussen, Markus Limbeck, and
Anton Schäfer, which improved the quality of this manuscript.

## References

  * [1] Jehoshua Bruck  “On the convergence properties of the Hopfield model”  In _Proceedings of the IEEE_ 78.10 IEEE, 1990, pp. 1579–1585
  * [2] Gerald Edelman  “Interview with Gerald Edelman”  In _Web of Stories (36)_ (https://www.webofstories.com/play/gerald.edelman/36), 1998
  * [3] Gerald M Edelman  “Neural Darwinism: The theory of neuronal group selection.”  Basic books, 1987
  * [4] Gerald M Edelman and Vernon B Mountcastle  “The mindful brain: Cortical organization and the group-selective theory of higher brain function”  MIT press, 1982
  * [5] Gerald M Edelman and George N Reeke Jr  “Selective networks capable of representative transformations, limited generalizations, and associative memory.”  In _Proceedings of the National Academy of Sciences_ 79.6 National Acad Sciences, 1982, pp. 2091–2095
  * [6] Karl Friston  “The free-energy principle: a unified brain theory?”  In _Nature reviews neuroscience_ 11.2 Nature Publishing Group UK London, 2010, pp. 127–138
  * [7] Karl Friston, Thomas FitzGerald, Francesco Rigoli, Philipp Schwartenbeck and Giovanni Pezzulo  “Active inference and learning”  In _Neuroscience & Biobehavioral Reviews_ 68 Elsevier, 2016, pp. 862–879
  * [8] Leilani H Gilpin, David Bau, Ben Z Yuan, Ayesha Bajwa, Michael Specter and Lalana Kagal  “Explaining explanations: An overview of interpretability of machine learning”  In _2018 IEEE 5th International Conference on data science and advanced analytics (DSAA)_ , 2018, pp. 80–89  IEEE
  * [9] John J Hopfield  “Neural networks and physical systems with emergent collective computational abilities.”  In _Proceedings of the national academy of sciences_ 79.8 National Acad Sciences, 1982, pp. 2554–2558
  * [10] Timothy P Lillicrap, Adam Santoro, Luke Marris, Colin J Akerman and Geoffrey Hinton  “Backpropagation and the brain”  In _Nature Reviews Neuroscience_ 21.6 Nature Publishing Group UK London, 2020, pp. 335–346
  * [11] George N Reeke, Olaf Sporns and Gerald M Edelman  “Synthetic neural modeling: the’Darwin’series of recognition automata”  In _Proceedings of the IEEE_ 78.9 IEEE, 1990, pp. 1498–1530
  * [12] Cynthia Rudin  “Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead”  In _Nature machine intelligence_ 1.5 Nature Publishing Group UK London, 2019, pp. 206–215
  * [13] Urs Rutishauser  “Gerald Edelman (1929–2014)”  In _Nature_ 510.7506 Nature Publishing Group UK London, 2014, pp. 474–474


where the dashed grey, blue, light grey and cyan petals presenting order three blocks $K_1 \equiv C_5 {L^{\sf T}} C_5^\dagger$, $P_1 \equiv C_7 {L^{\sf T}} C_7^\dagger$, $R_1 \equiv C_5 {L^{\sf T}} C_7^\dagger$ and $S_1 \equiv C_7 {L^{\sf T}} C_5^\dagger$, respectively.

* Order-5:
J^+_l^1c_5^2    :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=darkgreen,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=darkgreen,style=ultra thick,style=dashed]

=(L |C_5|^4),
J^+_l^1c_7^2 := -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=green,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=green,style=ultra thick,style=dashed]

=(L |C_7|^4),

J^+_l^1c^2    :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=darkgreen,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=green,style=ultra thick,style=dashed]

=(L |C_5|^2 |C_7|^2)+(L |C_7|^2 |C_5|^2),

J^+_l^1lk_1^1   :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=gray,style=ultra thick,style=dashed]

= (L^2 C_5 L^T C_5^†),
J^+_l^1lp_1^1 := -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=blue,style=ultra thick,style=dashed]

= (L^2 C_7 L^T C_7^†),

J^+_l^1lr_1^1   :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=lightgray,style=ultra thick,style=dashed]

= (L^2 (C_5 L^T C_7^†+ C_7 L^T C_5^†)),

J^+_l^1ls_1^1   :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=cyan,style=ultra thick,style=dashed]

= (L^2 (C_5 L^T C_7^†-C_7 L^T C_5^†)),

J^+_c_5^2c_1^1    :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=darkgreen,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=yellow,style=ultra thick,style=dashed]

=(L |C_5|^2(C_5 C_7^†+ C_7 C_5^†))+(|C_5|^2 L (C_5 C_7^†+ C_7 C_5^†)),

J^-_l^1c_5^2c_2^1    :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=darkgreen,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=orange,style=ultra thick,style=dashed]

=(L |C_5|^2(C_5 C_7^†- C_7 C_5^†))+(|C_5|^2 L (C_5 C_7^†- C_7 C_5^†)),

J^+_l^1c_7^2c_1^1    :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=green,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=yellow,style=ultra thick,style=dashed]

=(L |C_7|^2(C_5 C_7^†+ C_7 C_5^†))+(|C_7|^2 L (C_5 C_7^†+ C_7 C_5^†)),

J^-_l^1c_7^2c_2^1    :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=green,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=orange,style=ultra thick,style=dashed]

=(L |C_7|^2(C_5 C_7^†- C_7 C_5^†))-(|C_7|^2 L (C_5 C_7^†- C_7 C_5^†)),

J^+_l^1c_1^2 + J^-_l^1c_2^2    :=    -1.5em
[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=yellow,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=yellow,style=ultra thick,style=dashed]

+ -1.5
[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=orange,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=orange,style=ultra thick,style=dashed]

(L(C_5 C_7^†)^2 + L(C_7 C_5^†)^2),

J^-_l^1c_1^1c_2^1    :=    -1.5em
[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=orange,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=yellow,style=ultra thick,style=dashed]

= (L(C_5 C_7^†)^2 - L(C_7 C_5^†)^2).

* Order-6:
J^+_l^2 c_5^2    :=    -1.5em
[grid=none, axis lines=none]
+[mark=none,domain=0:90, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=90:180, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=180:270, samples=30,color=darkgreen,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=270:360, samples=30,color=darkgreen,style=ultra thick,style=dashed]

=(L^2 |C_5|^4),
J^+_l^2 c_7^2 := -1.5em
[grid=none, axis lines=none]
+[mark=none,domain=0:90, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=90:180, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=180:270, samples=30,color=green,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=270:360, samples=30,color=green,style=ultra thick,style=dashed]

=(L^2 |C_7|^4),

J^+_ c_5^1 c_7^2    :=    -1.5em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=darkgreen,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=green,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=green,style=ultra thick,style=dashed]

=(|C_5|^4 |C_7|^2),
J^+_c_5^2 c_7^1 := -1.5em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=darkgreen,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=green,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=darkgreen,style=ultra thick,style=dashed]

=(|C_5|^2 |C_7|^4),

J^+_c_5^3   :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=darkgreen,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=darkgreen,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=darkgreen,style=ultra thick,style=dashed]

= (|C_5|^6),
J^+_c_7^3 := -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=green,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=green,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=green,style=ultra thick,style=dashed]

= (|C_7|^6),

J^+_l^1lk_2^1    :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=purple,style=ultra thick,style=dashed]

=(L^2 C_5 L^T^2 C_5^†),
J^+_l^1lp_2^1 := -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=magenta,style=ultra thick,style=dashed]

=(L^2 C_7 L^T^2 C_7^†),

J^+_l^1lk_2^1    :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=brown,style=ultra thick,style=dashed]

=(L^2 C_5 L^T^2 C_7^†),
J^+_l^1lk_2^1 := -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=olive,style=ultra thick,style=dashed]

=(L^2 C_7 L^T^2 C_5^†),

J^+_lk_1^1c_5^1    :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=darkgreen,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=gray,style=ultra thick,style=dashed]

= (L C_5 L^TC_5^†|C_5|^2) + ( C_5 L^TC_5^†  L |C_5|^2),

J^+_lp_1^1c_7^1    :=    -1.1em
[grid=none, axis lines=none]
+[mark=none,domain=0:60, samples=30,color=green,style=ultra thick,style=dashed]

[grid=none, axis lines=none]
+[mark=none,domain=60:120, samples=30,color=pink,style=ultra thick]

[grid=none, axis lines=none]
+[mark=none,domain=120:180, samples=30,color=blue,style=ultra thick,style=dashed]

= (L C_7 L^TC_7^†|C_7|^2) + ( C_7 L^TC_7^†  L |C_7|^2),

⋯   ,

where the dashed petals in grey, purple, brown and olive present order four $K_2 \equiv C_5 {L^{\sf T}}^2 C_5^\dagger$, $H_2 \equiv C_5 {L^{\sf T}}^2 C_5^\dagger$, $R_2^+ \equiv C_5 {L^{\sf T}}^2 C_7^\dagger +C_7 {L^{\sf T}}^2 C_5^\dagger$ and $R_2^- \equiv C_5 {L^{\sf T}}^2 C_7^\dagger - C_7 {L^{\sf T}}^2 C_5^\dagger$ in the ring diagram.

In the above list, there are already CP-odd invariants $J^-$, where their non-zero values account for CP violation.

Taking the character functions of ${\bf 3}$ and ${\bf 3}^*$ to be $z_1 +z_2 +z_3 $ and $z_1^{-1}+z_2^{-1}+z_3^{-1}$ respectively, one can calculate the character functions of the flavor invariants

\begin{eqnarray}
\chi_l \left(z_1,z_2,z_3 \right)&=&\left(z_1 +z_2 +z_3 \right)\left(z_1^{-1}+z_2^{-1}+z_3^{-1}\right)\;,\nonumber\\
\chi_5 \left(z_1,z_2,z_3 \right)&=&z_1^2+z_2^2+z_3^2+z_1 z_2 +z_1 z_3 +z_2 z_3 \\
\chi_7 \left(z_1,z_2,z_3 \right)&=&z_1^2+z_2^2+z_3^2+z_1 z_2 +z_1 z_3 +z_2 z_3 \\
\end{eqnarray}

Then the PE function can be written as

\begin{eqnarray}\small
\label{eq:PE eff 3g}
{\rm PE}\left(z_1,z_2,z_3 ;q\right)&=& {\rm exp}(\sum_{k=1}^\infty\frac{\chi_l(z_1^k,z_2^k,z_3^k)q^k+\chi_5(z_1^k,z_2^k,z_3^k)q^k+\chi_7(z_1^k,z_2^k,z_3^k)q^k}{k})\nonumber\\
&=&\Big[\left(1-q\right)^3\left(1-q z_1 z_2^{-1}\right) \left(1-q z_2 z_1^{-1}\right) \left(1-q z_1 z_3^{-1}\right) \left(1-q z_3 z_1^{-1}\right) \nonumber\\
& & \left(1-q z_2 z_3^{-1}\right) \left(1-q z_3 z_2^{-1}\right) \left(1-q z_1^2\right)^2\left(1-q z_2^2\right)^2\left(1-q z_3^2\right)^2\nonumber\\
& &\left(1-q z_1 z_2 \right)^2 \left(1-q z_1 z_3 \right)^2\left(1-q z_2 z_3 \right)^2
\left(1-q z_1^{-2}\right)^2\left(1-q z_2^{-2}\right)^2\nonumber\\
& & \left(1-q z_3^{-2}\right)^2 \left(1-q z_1^{-1}z_2^{-1}\right)^2\left(1-q z_1^{-1}z_3^{-1}\right)^2\left(1-q z_2^{-1}z_3^{-1}\right)^2\Big]^{-1}\;.
\end{eqnarray}

Thus, one obtains the HS in the dim-7 $\nu$SMEFT where the Haar measure of ${U}(3)$ group has been inserted and thus one may obtain

\begin{eqnarray}
\label{eq:HS-3g}
{ \cal H}_7 (q)=\frac{{ \cal N}_7 (q)}{{ \cal D}_7 (q)}\;,
\end{eqnarray}

\begin{eqnarray}
\label{eq:numerator2}
{ \cal N}_7 (q)&=&1 + q^2 + 2 q^3 + 11 q^4 + 18 q^5 + 73 q^6 + 120 q^7 + 335 q^8 +
633 q^9
\nonumber\\
&&+ 1454 q^{10}+ 2690 q^{11} + 5456 q^{12} + 9501 q^{13} +
17145 q^{14} + 28182 q^{15}
\nonumber\\
&&+ 46469 q^{16} + 71634 q^{17} + 109578 q^{18} +
158647 q^{19} + 226102 q^{20}
\nonumber\\
&&+ 308209 q^{21} + 411372 q^{22} +
528477 q^{23} + 663734 q^{24} + 805058 q^{25} \nonumber\\
&&+ 953211 q^{26} +
1093469 q^{27} + 1222533 q^{28} + 1326782 q^{29} + 1402711 q^{30}
\nonumber\\
1441224 q^{31} + 1441224 q^{32} + 1402711 q^{33} + 1326782 q^{34} +
1222533 q^{35}
\nonumber\\
&& + 1093469 q^{36}+ 953211 q^{37} + 805058 q^{38} +
663734 q^{39} + 528477 q^{40}
\nonumber\\
&& + 411372 q^{41} + 308209 q^{42} +
226102 q^{43} + 158647 q^{44}+ 109578 q^{45}
\nonumber\\
&&+ 71634 q^{46} + 46469 q^{47} +
28182 q^{48} + 17145 q^{49} + 9501 q^{50} + 5456 q^{51}
\nonumber\\
&&+ 2690 q^{52}+
1454 q^{53} + 633 q^{54} + 335 q^{55} + 120 q^{56} + 73 q^{57} + 18 q^{58} \nonumber\\
11 q^{59} + 2 q^{60} + q^{61} + q^{63},
\end{eqnarray}

\begin{eqnarray}\small
\label{eq:denominator}
{ \cal D}_7 (q) = (1 - q )^1 (1 - q^2 )^4 (1 - q^3 )^3 (1 - q^4)^7 (1 - q^5 )^4 (1 - q^6 )^5\;.
\end{eqnarray}

Hence, the PL takes on the form

\begin{eqnarray}\small
\label{eq:PL7}
{\rm PL}\left[{\cal H}(q)\right]&=&q + 5 q^2 + 5 q^3 + 17 q^4 + 20 q^5 + 64 q^6 + 82 q^7 + 175 q^8 +
231 q^9 \nonumber\\
&&+ 199 q^{10}-{\cal O}\left(q^{11}\right)\;,
\end{eqnarray}

that aligns with the results obtained earlier in this section using petals of building blocks.

Our procedure, suggests an automated way to find explicitly the structure of invariants other than providing only the number of invariants. These classifications of invariants play a crucial role in analysing theories which explain flavor by a dynamical mechanism.

§ SUMMARY AND DISCUSSIONS

This paper extends our earlier work <cit.>, enhancing the Ring-Diagram framework's capability to classify CP invariants. We enrich this methodology with detailed examples and extend its application across a wider range of theoretical physics.

The traditional Hilbert-Poincaré series (HS) and its Plethystic Logarithm (PL), while crucial for counting invariants in theoretical physics, often do not reveal the detailed structures and connections among these invariants. This is especially true in complex theories that involve higher-dimensional operators. Their main limitation is in merely counting invariants without distinguishing their physical significance or differentiating between redundant and essential invariants. This often results in an overestimated number of independent invariants. Recognizing these limitations highlights the need for alternative approaches that offer a clearer and more intuitive understanding of invariants. The ring diagram technique answers this call, providing a visual and topological way to illustrate the structure of invariants that algebraic methods miss.

By integrating the ring-diagram approach with the Cayley-Hamilton theorem, we have automated the classification of basis invariants. This has led to significant progress in systematically identifying basic and joint invariants, showing that the summation of joint invariants can always be represented in terms of basic invariants in a specific order. This formalism allows us to:

* Apply the Cayley-Hamilton theorem in practice,

* Offer a generic method for the classification of invariants,

* Automatically distinguish between CP-even and CP-odd invariants right from their most basic levels.

Through this approach, we have revisited the SM invariants and demonstrated the technique's application in identifying invariants across SMEFT up to dim-$2n$ and low energy $\nu$SMEFT including operators of dimension-5,6 and -7. This method not only offers a new perspective on invariant identification but also provides new explanations for details in the classical HS and its PL, particularly in terms of classifying basis invariants, joint invariants, syzygies, and the negative leading numbers in PL.

In Table <ref>, we present a summary of the lowest order of CP-odd invariants due to matrix properties (excluding their complex nature), the highest order of basic invariants, and the lowest order of joint invariants for the SM, SMEFT and $\nu$SMEFT. The final column indicates the orders greater than or equal to the sum of the lowest order of CP-odd invariants and the lowest order of joint invariants for each framework, except when the number of the lowest order of joint invariants is smaller than that of the highest order basic invariants. In such scenarios, it lists orders greater than the sum of the lowest order of CP-odd and the highest order of basic invariants. This column clarifies in which order the invariants cease, which aligns with the appearance of negative leading numbers in the PL.

Model     LO CP-odd     HO Basic     LO Joint     Termination
SM     6     4     6     $\geq$ 12
SMEFT-dim$2n$     3     4     4     $\geq$ 7
$\nu$-SMEFT dim-5     6     6     7     $\geq$ 13
$\nu$-SMEFT dim-5,6     4     6     5     $>$ 10
$\nu$-SMEFT dim-5,7     5     6     6     $\geq$ 11

Summary of the lowest order of CP-odd invariants due to matrix properties (excluding complex nature) across different models. The second column outlines the lowest order of CP-odd invariants, while the third and fourth columns detail the highest order of basic invariants and the lowest order of joint invariants, respectively. The final column delineates the order of invariant termination.

This method can be applied in the construction of invariants from high-rank tensors and complex structures as well as the frameworks of multi-Higgs doublet models ($n$HDMs) and $n$HDM-Effective Field Theory ($n$HDM-EFT) <cit.> that we plan to report in our upcoming publications. This integrated approach aims to fill existing gaps in the literature and provides a more complete picture of the intricate relationship between CPV and EDMs.

§ ACKNOWLEDGMENTS

This work is supported by the National Science Foundation of China under Grants No. 12347105, No. 12375099 and No. 12047503, and National Key Research and Development Program of China Grant No. 2020YFC2201501, No. 2021YFA0718304. The work of ND is supported by STFC under the grant number ST/T006749/1.