Learning Causal Mechanisms through Orthogonal Neural Networks
A fundamental feature of human intelligence is the ability to infer
high-level abstractions from low-level sensory data. An essential component of
such inference is the ability to discover modularized generative mechanisms.
Despite many efforts to use statistical learning and pattern recognition for
finding disentangled factors, arguably human intelligence remains unmatched in
this area.
  In this paper, we investigate a problem of learning, in a fully unsupervised
manner, the inverse of a set of independent mechanisms from distorted data
points. We postulate, and justify this claim with experimental results, that an
important weakness of existing machine learning solutions lies in the
insufficiency of cross-module diversification. Addressing this crucial
discrepancy between human and machine intelligence is an important challenge
for pattern recognition systems.
  To this end, our work proposes an unsupervised method that discovers and
disentangles a set of independent mechanisms from unlabeled data, and learns
how to invert them. A number of experts compete against each other for
individual data points in an adversarial setting: one that best inverses the
(unknown) generative mechanism is the winner. We demonstrate that introducing
an orthogonalization layer into the expert architectures enforces additional
diversity in the outputs, leading to significantly better separability.
Moreover, we propose a procedure for relocating data points between experts to
further prevent any one from claiming multiple mechanisms. We experimentally
illustrate that these techniques allow discovery and modularization of much
less pronounced transformations, in addition to considerably faster
convergence.
Peyman Sheikholharam Mashhadi, Slawomir Nowaczyk
# Learning Causal Mechanisms through Orthogonal Neural Networks

###### Abstract

A fundamental feature of human intelligence is the ability to infer high-level abstractions from low-level sensory data. An essential component of such inference is the ability to discover modularized generative mechanisms. Despite many efforts to use statistical learning and pattern recognition for finding disentangled factors, arguably human intelligence remains unmatched in this area. In this paper, we investigate a problem of learning, in a fully unsupervised manner, the inverse of a set of independent mechanisms from distorted data points. We postulate, and justify this claim with experimental results, that an important weakness of existing machine learning solutions lies in the insufficiency of cross-module diversification. Addressing this crucial discrepancy between human and machine intelligence is an important challenge for pattern recognition systems. To this end, our work proposes an unsupervised method that discovers and disentangles a set of independent mechanisms from unlabeled data, and learns how to invert them. A number of experts compete against each other for individual data points in an adversarial setting: one that best inverses the (unknown) generative mechanism is the winner. We demonstrate that introducing an orthogonalization layer into the expert architectures enforces additional diversity in the outputs, leading to significantly better separability. Moreover, we propose a procedure for relocating data points between experts to further prevent any one from claiming multiple mechanisms. We experimentally illustrate that these techniques allow discovery and modularization of much less pronounced transformations, in addition to considerably faster convergence.
**Keywords:** Causal Mechanism, Orthogonalization, Diversity, Unsupervised Learning, Ensemble learning

## 1 Introduction

Understanding cause-effect relations and the mechanisms by which they are related is a primary element of human intelligence. A key aspect related to such mechanisms is modularity (Scholkopf, 2019). Intuitively, the generating processes of different abstract concepts can be analyzed and modeled separately, or with minimal interactions.

Equipped with ways of discovering such mechanisms, humans are able to use them as building blocks in countless combinations (Vankov and Bowers, 2020). As a narrow manifestation of this concept, Humboldt referred to a language as a system that "makes infinite use of finite means," later quoted by Noam Chomsky many times. Since an infinite combinations of sentences can be generated from a finite number of grammatical rules, arguably the understanding of core mechanisms is the key component towards broader generalization.

As stated by (Chollet, 2019), the ability to generalize is a spectrum, with symbolic AI offering no generalization, rising up towards local generalization provided by machine learning (specialist AI), and with the ultimate goal of Artificial General Intelligence. Stepping into the new era of deep learning with hierarchical knowledge representations has the potential to offer the ability to adapt to new situations far from the learned manifold of seen data. We believe that robust and fast methods for identifying independent generative mechanisms, or transformations, directly from the data is an important next step for the AI field, especially as we move towards "knowledge creation" Nowaczyk et al. (2020).

As a special case, finding invariant features has been one of the prime concerns of pattern recognition systems (Goodfellow et al., 2009). Needless to say, the promise is to recognize patterns of interest under different transformations. For instance, a Convolutional Neural Network (CNN), presented with enough relevant samples during the training, can learn characteristics of classes of interest through a set of functions mapping original features into a manifold where the effects of different mechanisms manifest in similar ways (Dhillon and Verma, 2020).

We argue that despite the tremendous success of the deep learning field, they lack the true generalization perspective (Jakubovitz et al., 2019; Baldock et al., 2021). The first issue is that the transformations learned within a trained model are entangled (Xie et al., 2020). This lack of modularity, as we discussed earlier, makes it impossible to come up with new, "creative" combinations of learned concepts (Battaglia et al., 2018). Finding disentangled factors is substantially different from building mechanisms that bring back data points of a given category to a common region of space. More concretely, consider
an image dataset containing faces that are either rotated or stretched. A new image, on which both rotation and stretching are applied, will lie far from the manifold learned of such data. Nevertheless, models that captured rotation and stretching mechanisms separately, can bring this data point back to the manifold, and subsequently recognize.

Our research extends the study of Parascandolo et al. (2018), which proposed several experts to adversarially compete against each other for transforming data points. The goal for each expert is to find the inverse of a particular mechanism, and thus fool a discriminator.

We follow the same setting, providing two substantial contributions over the previous work: the ability to invert less pronounced transformation, and greatly reduced convergence time. We achieve these by proposing, first, to augment experts with an orthogonalization layer, thus forcing their respective outputs to be orthogonal to each other. This leads to higher diversity among experts, which causes the discriminator to provide a more informative signal. Secondly, we introduce data point relocation between experts, discouraging any one of them from claiming multiple transformations. The key finding in this work is the discovery of a previously unknown bottleneck in terms of separability power, namely, that the discriminator part of the adversarial architecture is an insufficient diversification factor. By adapting a recently-proposed orthogonality layer (originally intended for ensemble learning), our model gains the ability to invert less pronounced transformations. This is a fundamental difference that could not be replicated in the existing method simply by using more computations, neither in terms of time nor amount of data.

The remainder of the paper organized as follows. Section 2 describes related work; Section 3 presents problem formulation; Section 4 explains the proposed method, and discusses key differences from state of the art; Section 5 contains results of our experiments. Finally, Section 6 concludes the paper.

## 2 Related work

The most relevant research that we draw from is Parascandolo et al. (2018). We share the same goal, i.e., to find inverse of a set of mechanisms in an unsupervised fashion. Examples are available of both untouched data and distorted data; however, there is no information about mechanism, or transformation, was applied to a particular data point. The key idea is for a set of experts to compete against each other for data points, where the one best capable of reversing the mechanism wins and gets trained further.

Along similar lines, von Kugelgen et al. (2020) proposed decomposition of complex visual scenes using ensemble of experts competing for different parts of a visual scene. An important assumption in their study is that a scene is layered composition of depth-ordered objects. In order for each expert to become specialized on a different part, firstly, they are equipped with an attention network. Then, the attended region is mapped into a latent space and, through a decoder, reconstructs the unoccluded object shape.
Locatello et al. (2018) proposed a clustering procedure adopting generative models. Each data point is supposed to be generated by one causal mechanism. Generators (chosen to be VAEs) compete against each other with the purpose of generating realistic data points. The method is the generative counterpart of k-means, since an assignment function assigns data points to different partitions (equal to the number of generators). The generators compete to win over the distribution formed by each partition.

Fox and Wiens (2019) proposed a method called "advocacy learning" for a supervised setting, where a set of advocates (decoders) generate class-conditional representations to encourage a judge (classification model) that an input data point belongs to their class. The output of each advocate forms an attention map that, after modulation with the input, will be fed to the judge. The idea is that each advocate learns an attention map which eases the judge's classification task.

Clearly, the performance of all these methods greatly depends on the discriminator providing the right signal, i.e., assigning distorted data points to the "correct" expert. This can only be done reliably given enough diversity among the experts. In an extreme case, if all the experts generate equivalent output, the discriminator could not reliably differentiate between the mechanisms. We claim that existing competitive learning approaches are not sufficient, and thus our key contribution is adapting an enforced diversity module that Mashhadi et al. (2021) proposed for ensemble learning into the learning causal mechanisms setting. Once the diversity is enhanced by making the outputs of all experts orthogonalized to each other, the crucial pressure on the discriminator is lowered significantly.

## 3 Problem Setting

Let \(\mathcal{P}\) be the empirical distribution of original images (before transformation) defined on pixel space \(\mathbb{R}^{d}\). Also, let's assume that there are \(N\) different transformations (mechanisms) denoted by \(M_{1},M_{2},...,M_{N}\) that can be applied on the original images. Let's denote the resultant empirical distribution of applying the mechanisms by \(Q_{1},Q_{2},...,Q_{N}\) where \(Q_{i}=M_{i}(\mathcal{P})\).

For training, the model is provided with two separate datasets: \(D_{P}\), with data points from the original distribution \(\mathcal{P}\), and \(D_{Q}\) with data points sampled i.i.d from transformed distributions \(Q_{1},Q_{2},...,Q_{N}\). It is important to notice that nothing is indicating which transformed data point in \(D_{Q}\) corresponds to which original data point in \(D_{\mathcal{P}}\). If that was the case, one could feed a model with original data points as input and the transformed data points from the same transformation class as output. Alas, in real world, the supervised scenario is rare compared to the unsupervised ones.

For simplicity and interpretability of results, let us assume that the number of experts is equal to the number of mechanisms, denoted by \(E_{1},E_{2},...,E_{N}\). The desired outcome is that each expert becomes specialized in inverting a
single transformation. The original paper Parascandolo et al. (2018) showcases natural relaxations of this scenario, which we omit due to space constraints.

## 4 Methodology

In this section, we first explain the overall adversarial process of learning mechanisms, followed by the proposed model architecture and its motivation.

### Learning mechanisms via competing experts

As proposed by (Parascandolo et al., 2018), the adversarial process of learning mechanisms is based on making experts compete over data points. For every transformed data point \(x^{\prime}\) from \(D_{Q}\) in \(\mathbb{R}^{d}\), each expert generates a new data point in \(\mathbb{R}^{d}\), trying to trick the discriminator into recognizing their generated images as coming from \(\mathcal{P}\). In other words, each expert \(E_{i}\) tries to maximize the output of the discriminator denoted by \(c_{i}\), where \((c_{i}:\mathbb{R}^{d}\rightarrow\mathbb{R})\).

In the training process, the corresponding discriminator's outputs for all the experts \(c_{i}=c(E_{i}(x^{\prime}))\) are compared to each other. Then, the parameters \(\theta^{*}\) of only the winning expert \(E^{*}\), the one with the highest \(c_{i}\), are updated. This means that the one best able to inverse a specific mechanism (manifested in \(x^{\prime}\)), will be reinforced to improve even further.

Along with updating the winning expert, the discriminator is also updated, however, it is taking into account the outputs of all the experts. Quite similar to the standard GAN's discriminator loss function (Goodfellow et al., 2020), the following is used to update the discriminator.

\[\max_{\theta_{D}}\quad\mathbb{E}_{x\sim\mathcal{P}}\ \log\Big{(}D_{\theta_{D}}(x) \Big{)}+\frac{1}{N^{\prime}}\,\sum_{i=1}^{N^{\prime}}\,\mathbb{E}_{x^{\prime} \sim Q}\Big{(}\log(1-D_{\theta_{Q_{D}}}(\mathbb{E}_{\theta_{i}})(x^{\prime}) \Big{)} \tag{1}\]

The difference between Eq. 1 and the default GAN's discriminator loss function is that in our case the second term is the summation over all the experts (generators). The winning expert loss function is exactly the standard GAN's generator loss:

\[\min\theta_{E^{*}}\quad\mathbb{E}_{x^{\prime}\sim Q}\ 1-\log\Big{(}D_{\theta_{D}} (E^{*}(x^{\prime}))\Big{)} \tag{2}\]

### Proposed architecture

We propose the following architecture to learn the inverse of mechanisms. As seen from Figure 1, first a number of parallel experts are created. The main novelty of our architecture is adding the "Orthogonalization Layer." Following Mashhadi et al. (2021), the role of this layer is restricting the output of experts at a specific location to become orthogonal to each other. The motivation is to enforce diversity, and we demonstrate in the next section that this increased diversity translates into higher effectiveness of the discriminator.
The most crucial challenge in this competitive learning schema is providing effective discriminating signal to correctly assign experts to mechanisms. The better signal the discriminator provides, the more effective and faster the training of the experts - every mistake leads to confusing an expert by training it on an inappropriate mechanism. Without the orthogonalization layer, the only way to diversify the experts is through discriminator-provided training signal, as described in Section 4.1. Although this process is very promising, we argue that the learning becomes significantly more efficient if an explicit diversity technique is incorporated.

In the proposed architecture, we enforce expert diversity using the orthogonalization layer. The output of the first expert at layer \(P\), \(\mathbf{u}_{1}^{P}\), is untouched (\(\mathbf{v}_{1}^{P}\)); then, the output of the second expert, \(\mathbf{u}_{2}^{P}\), is orthogonalized to the \(\mathbf{v}_{1}^{P}\) using the Gram-Schmidt orthogonalization, see Equation 3. The result of this orthogonalization is denoted by \(\mathbf{v}_{2}^{P}\) in Fig. 1. Then, the output of the third expert, \(\mathbf{u}_{3}^{P}\), is orthogonalized to the previous two experts, resulting in \(\mathbf{v}_{3}^{P}\). This process continues to the last expert. More detailed description of the details on diversity and error backpropagation through the orthogonalization layer is included in (Mashhadi et al., 2021).

\[\mathbf{v}_{k}=\mathbf{u}_{k}-\sum_{i=1}^{k-1}\frac{(\mathbf{v}_{i},\mathbf{ u}_{k})}{(\mathbf{v}_{i},\mathbf{v}_{i})}\mathbf{v}_{i} \tag{3}\]

An important distinction between our work and the earlier study by Paras-candolo et al. (2018) is that in the latter, the discussion is made around

Figure 1: Parallel Orthogonal Deep Neural Network (PODNN)
learning independent mechanisms. Both mechanisms and experts are independent in the sense that they do not inform or influence each other. However, in our architecture, the experts do interact and exchange information, throughout the orthogonalization layer. Besserve et al. (2018) introduced the need for going beyond statistical independence to disentangle latent factors. They argued that many interesting transformations to latent factors are actually statistically dependent and proposed a non-statistical framework based on counterfactual manipulation to find modular structures. We take this transition to yet another level, arguing that there are advantages for modular mechanisms to influence and inform each other. Thinking Bayesian, if the new evidence alters the posterior of what a mechanism is, the updated mechanism should resonate with other mechanisms, and if it does not, it should influence the other mechanisms. For example, if one's concept of what "right translation" means changes, the "left translation" (and other translations) might need to be adjusted accordingly.

### Data points relocation mechanism

While the orthogonalization layer leads to higher diversity of experts and better separability of mechanisms among them, still, in some cases the confusion between experts persists. To further discourage an expert from claiming multiple transformations, we propose the data points relocation mechanism.

The main idea behind the relocation mechanism is to separate a percentage of low-confidence data points from an expert and assign them to expert which has not won any data point. The level of confidence, or proficiency, of an expert on any given data point is measured by the discriminator score. The lower be the discriminator score, the smaller the confidence. However, selecting which expert should "give up" a data point is challenging, since there is no way to know that an expert has won more than one transformation (due to the unsupervised nature). We propose to use the standard deviation of the euclidean distances of discriminator's last hidden layer on the data points claimed by an expert as a proxy of "ambition level" of the expert. We argue that experts with higher standard deviation are most likely the experts that are trying to claim more than one transformation. The motivation behind this idea is that it would be difficult for an expert to find a hidden space in which data points from different transforms lie very close to each other; in comparison, for an expert winning only one transformation, this task is significantly easier, and the resulting space is more compact.

Finally, since the above modifications lead to significantly faster convergence of experts compared to previous work, we argue that the competitive learning approach is only needed in the beginning. After all the experts converge, there is no need anymore to continue the training through the discriminator. Therefore, from that point forward, we only use the discriminator to assign the data points to the specialized experts, while training then standalone. This saves computation, since the error does not need to get propagated from the discriminator to all experts. The pseudocode of the proposed
method is depicted in Algorithm 1 and the data points relocation mechanism is depicted in Algorithm 21.

Footnote 1: source code available at: [https://github.com/causalPODNN/causalpodnn](https://github.com/causalPODNN/causalpodnn)

```
1:\(t=1\)
2:while TRUE do
3:\(\triangleright\) Sample mini-batches
4:\(x_{\mathcal{P}},x_{Q}\gets sample(X_{\mathcal{P}}),sample(X_{Q})\).
5:\(\triangleright\) Score all the experts' output using \(D\) and calculate output of the discriminator's last hidden layer on all data point in
6:for\(i=1\) to \(N^{\prime}\)do
7:\(c_{i}\gets D(E_{i}(x_{Q}))\)
8:\(h_{i}\gets D[\text{last hidden layer}](E_{i}(x_{Q}))\)
9:endfor
10:\(\triangleright\) Update discriminator
11:\(\theta_{D}^{t+1}\leftarrow\max\limits_{\theta_{D}^{t}}\left(\nabla\mathbb{E }_{x_{\mathcal{P}}}\log D(x_{\mathcal{P}})+\nabla\left(\frac{1}{N^{\prime}} \right)\sum_{i=1}^{N^{\prime}}\log(1-\mathbb{E}(c_{i}))\right)\)
12:\(dp_{1},dp_{2},...dp_{N^{\prime}}\leftarrow\) assign data points to each expert according to \(c\}_{i=1}^{N^{\prime}}\) values
13:\(\triangleright\) Relocation mechanism
14:if exists at least one expert without any claimed data point then
15:\(idx_{L}\leftarrow\) select a ramdon expert among expert without any claim
16:\(dp_{1},dp_{2},...,dp_{N^{\prime}}\leftarrow\)
17:\(\triangleright\)
18:endif
19:\(\triangleright\) Update all experts
20:for\(i=1\) to \(N^{\prime}\)do
21:\(\theta_{E_{i}}^{t+1}\leftarrow\max\limits_{\theta_{E_{i}}^{t}}\left(\nabla \mathbb{E}_{dp_{i}}\log D(c_{i})\right)\)
22:endfor
23:if convergence then
24:break
25:endif
26:\(t\gets t+1\)
27:endwhile
28:\(\triangleright\) Stop training discriminator and utilize it only for scoring the experts
29: Continue training experts on the data points they are claiming
```

**Algorithm 1** Learning causal mechanisms through PODNN

```
1:\(\triangleright\) Relocation mechanism
2:if exists at least one expert without any claimed data point then
3:\(idx_{L}\leftarrow\) select a ramdon expert among expert without any claim
4:\(dp_{1},dp_{2},...,dp_{N^{\prime}}\leftarrow\)
5:\(\triangleright\) Relocation_algorithm \(\left(h\right)_{i=1}^{N^{\prime}},c\}_{i=1}^{N^{\prime}},dp\}_{i=1}^{N^{ \prime}},idx_{L}\)
6:endif
7:\(\triangleright\) Update all experts
8:for\(i=1\) to \(N^{\prime}\)do
9:\(\theta_{E_{i}}^{t+1}\leftarrow\max\limits_{\theta_{E_{i}}^{t}}\left(\nabla \mathbb{E}_{dp_{i}}\log D(c_{i})\right)\)
10:endfor
11:if convergence then
12:break
13:endif
14:\(t\gets t+1\)
15:endwhile
16:\(\triangleright\) Stop training discriminator and utilize it only for scoring the experts
17: Continue training experts on the data points they are claiming
```

**Algorithm 21**.
```
0:\(h_{1},h_{2},...,h_{N^{\prime}}\): outputs of the discriminator's last hidden layer for data points claimed by each expert \(c_{1},c_{2},...,c_{N^{\prime}}\): score of all each experts' output using D on all data point in \(x_{Q}\)\(dp_{1},dp_{2},...,dp_{N^{\prime}}\): data points assigned to each expert \(idx_{L}\): index of an expert without any claim Parameter: \(rp\): relocation percentage, percentage of low-confidence data points to be relocated
1:for\(i=1\) to \(N^{\prime}\)do
2:\(dist_{i}\leftarrow\) pairwise euclidean distance within \(h_{i}\)
3:\(std_{i}\leftarrow\) standard deviation of \(dist_{i}\)
4:endfor
5:\(\triangleright\) Find the expert with highest std
6:\(idx_{W}\leftarrow\) argmax(\(std_{1},std_{2},...,std_{N^{\prime}}\))
7:\(\triangleright\) Select low-confidence data points claimed by expert
8:\(idx_{W}\)
9:\(low\_confidence\_dp\leftarrow\) select \(rp\%\) of data points sorted
10: in ascending order of \(c_{idx_{W}}\)
11: remove \(low\_confidence\_dp\) from \(dp_{idx_{W}}\) and to \(dp_{idx_{L}}\)
12:return\(dp_{1},dp_{2},...,dp_{N^{\prime}}\)
```

**Algorithm 2** Data point relocation algorithm

## 5 Experiments

We run several experiments using MNIST and Fashion-MNIST datasets. Three different categories of transformations are used: translation, adding noise, and contrast inversion. For the translation, in different experiments, depending on the desired number of mechanisms, multiple directions of translation are used: right, left, up, down, right-up, right-down, left-up, and left-down. The goal of the model is identifying, or separating, these transformations (mechanisms), and then learning how to reverse each one.

We conduct three sets of experiments, each with a specific purposes. The first experiment demonstrates the fast convergence of the proposed architecture, in comparison to the architecture without orthogonalization. The second experiment focuses on the different roles of the experts and the discriminator, and shows that it is the discriminator that benefits the most from the orthogonalization. Moreover, it highlights the drawback of over-reliance on the discriminator, especially for less pronounced transformations - where our method, due to enforced diversity, solves problems than the original counterpart could not handle. The third experiment justifies the relocation technique, by showcasing how it prevents an expert from claiming multiple mechanisms.

### Faster convergence

Figures 2 and 5 compare the convergence speed of the proposed method with its counterpart, on MNIST and Fashion-MNIST datasets, respectively. The left
column is without orthogonalization layer and data point relocation, while the right column is the proposed method with orthogonalization and data point relocation mechanism. The last row in the figure shows the number of "correct" data points claimed by each expert, i.e., coming from the transformation they are most specialized in. For the first 10 rows, the vertical axis shows the discriminator score of experts. For the left column, after more than 100 iterations, there is still confusion among experts, while for the right column, after iteration 40, each experts is on the right track - claiming only the points from a single transformation, different from all the others. Figures 3 and 4 illustrate the result of trained experts on random subsets of transformed images.

In order to showcase the consistency of the convergence, we define "convergence iteration" as the iteration after which every expert wins the majority of their data points from exactly one transformation. This definition is equivalent, and more intuitively understood, as the last swap in visualization such as the graphs of Figure 2 (MNIST) and 5 (Fashion-MNIST).

In Figure 2 the right column, the last swap occurred around iteration 40 (in the seventh row), while in the left column, convergence has not happened yet. Comparison of the convergence iteration of the proposed method with its counterpart across five different runs is shown in Figure 6. The experiment was limited to 200 iterations, so in the third and fifth runs the experts did not converge at all. It can be seen that the orthogonalization leads to drastic

Figure 2: MNIST- Comparison of experts’ performance without orthogonalization (and relocation) and with orthogonalization (and relocation). Each line color represents one expert, and each row corresponds to one transformation. Experts’ performance is measured by discriminator scores.
improvement. Moreover, the variance of the convergence iteration is also much lower for the proposed method. In Figure 5, the improvement is even more notable as in the right column, the last swap occurred at iteration 85. In contrast, for the left column, even after 180 iterations, the orange expert prevailed three tasks. It is observed that for Fashion-MNIST, without organization and data point relocation, for different runs convergence never happened. Figure 4 illustrates the result of trained experts with orthogonalization and data point relocation on a random subset of transformed images.

The rest of the experiments are reported only for MNIST dataset as our proposed method's improvement is not as strong as it is in the case of Fashion-MNIST. In other words, we chose the one that is less favorable to our method, as a more fair comparison.

### Time complexity

The computation time associated with the addition of the orthogonalization layer is noticeable, but way lower than the gains provided. In general, the proposed architecture takes on average 10% more time to train than

Figure 4: Fasion-MNIST- In each group of rows, the top row shows the input to the experts, and the button row shows the output of an expert with the highest discriminator score

Figure 3: MNIST- In each group of rows, the top row shows the input to the experts, and the button row shows the output of an expert with the highest discriminator score
the one without orthogonalization. However, since our convergence iteration is as shown in Figure 6 is on average 3.5 times faster than its counterpart, the orthogonalization cost is negligible. In addition, since after experts' convergence we stop training them through the discriminator and continue training them standalone, we save additional computations by removing the discriminator from the backpropagation.

Figure 5: Fasion-MNIST- Comparison of experts’ performance without orthogonalization (and relocation) and with orthogonalization (and relocation). Each line color represents one expert, and each row corresponds to one transformation. Experts’ performance is measured by discriminator scores.

Figure 6: Convergence speed comparison between “without orthogonalization” (and relocation) and “with orthogonalization” (and relocation) on 5 separate runs
### Diversity helps the discriminator

Given that orthogonalization promotes diversity among experts, we argue that the emerged diversity is particularly helpful for the discriminator, allowing it to provide more effective discriminating signal. Looking at the system (experts and discriminator) as a whole, it is not straightforward to understand which part benefits most from the embedded diversity component. In other words, we need to disentangle the discriminator from the experts to analyze the effect of diversity on them.

We intend to do it by varying the severity of transformations. First, we replace the discriminator with an oracle, meaning that the discriminator knows in advance what transformation is applied on any image \(x^{\prime}\). We then consider different severity of the transformations, for example, the translation distance. We demonstrate that the experts are mostly invariant to that. For instance, translating four pixels to the right would not make it much more difficult for the experts than translating one pixel to the right.

To evaluate the experts' performance in undoing the transformations, their outputs are fed to a CNN trained on MNIST. For this experiment, the transformations are chosen to be various translations, with different severity, measured in pixels. Moreover, the relocation mechanism is factored out for this experiment to focus on the orthogonalization aspect as our main driving force of diversification. Table 1 reports the results, in terms of accuracy, without and with orthogonalization. First, it can be seen that as we increase the severity from 1px to 5px, the accuracy of experts remains essentially the same - there is no difference in difficulty. Moreover, regardless of the transformation severity, the difference in accuracy of experts with and without orthogonalization is negligible.

This indicates that the key to improved performance in Section 5.1 lies in the benefits that the diversity brings to the discriminator. It is intuitively understandable why the discriminator would be very susceptible to the severity of transformations. When they are very minor, such as translation by one pixel, it is difficult to provide an effective discriminating signal. The outputs from all the experts look as "reasonable" candidates belonging to \(\mathcal{P}\). Identifying the "winning" expert is much easier for more pronounced transformations, since the outputs of different experts are more diverse.

Therefore, we repeat the previous experiment with transformations of difference severity using a "real" discriminator. Our goal is to investigate whether orthogonalization leads to a better discriminating signal to the competing

\begin{table}
\begin{tabular}{|l|c|c|c|c|c|} \hline Method Severity & 1px & 2px & 3px & 4px & 5px \\ \hline \hline Without Orth & 0.9720 & 0.9720 & 0.9718 & 0.9706 & 0.9687 \\ \hline With Orth & 0.9704 & 0.9702 & 0.9682 & 0.9652 & 0.9633 \\ \hline \end{tabular}
\end{table}
Table 1: Effect of transformation severity on experts’ performance (in terms of accuracy of MNIST-trained CNN.
experts. We perform this experiment on two different severities of transformations: 2px and 5px. We expect that in the latter case the discriminator would not have much difficulty providing an effective discriminating signal to the experts, both in the setting with and without orthogonalization. On the other hand, when the transformations are less pronounced, the discriminator will work much better in case of the experts with orthogonalization than without it.

Figures 7 and 8 illustrate the results on severity of 5px, without and with orthogonalization, respectively. Furthermore, Figures 9 and 10 illustrate corresponding results on severity of 2px. For the more pronounced case, 5px, it can be seen that despite convergence speed being lower without orthogonalization, both methods converge nonetheless. On the other hand, in the case of 2px, the difference between the state of the art and the proposed method is no longer only terms of convergence time. Without orthogonalization, the experts are not able to converge at all, even given much higher number of iterations. It is clear that once the discriminator is unable to reliably identify the output of "incorrect" expert as such, a stronger diversity-promoting solution is necessary - and orthogonalization can be just that.
data points (for different experts) and the number of transformations won by each expert. As an alternative that could be used instead, we also show the standard deviation of the discriminator score. Note that, for the sake of readability, only three transformations, instead of all of them, are shown in the figure.

It is noticeable from Figure 11 that experts that win multiple transformations tend to have higher standard deviations. For instance, the expert associated with the blue curve, which starts by winning 4 or 5 transformations, shows very high standard deviation; while the expert shown in green, winning

Figure 8: With orthogonalization, transform severity 5px

Figure 9: Without orthogonalization, transform severity 2px
zero or one transformation, exhibits very low standard deviation. As the training progresses and experts converge towards winning one transformation each, their standard deviations get closer to each other.

In this experiment, the number of data points for each transformation within each batch of training is uniformly distributed. One might argue that once an expert starts winning more transformations, it will simply claim more data points; it could be the case that due to the sample prevalence of some

Figure 11: relation between number of transformations won by each expert and \(std\) of last discriminator’s hidden layer output (also \(std\) of discriminator score) – balanced sample

Figure 10: With orthogonalization, transform severity 2px
transformations, the standard deviation becomes higher for experts winning those transformations, even if an expert wins one transformation. To show the robustness of the relocation mechanism against sample prevalence of transformations, in the next experiment for each training batch, the number of data points for one transformation is three times higher than the others. Figure 13 depicts three transformations one of which, left translation, has the largest number of data points. It can be seen that simply winning a larger number data points does not lead to increase in the standard deviation. Instead, as we hoped, the number of transformation won by the corresponding expert is the key factor affecting the standard deviation.

### 5.5 Relocation percentage

Figure 12 depicts the sensitivity of the method on the percentage of data points relocated among experts (\(rp\) in Algorithm 2), in terms of convergence speed. Every bar is the average of five separate runs. It is noticeable that very high or very low relocation percentages deteriorate the convergence speed, however, selecting a reasonable value for this hyperparameter is not difficult. For the experiments in Section 5, \(rp\) is selected to be 30%.

### 5.6 Relocation mechanism robustness

To show the robustness of the relocation mechanism against sample prevalence of transformations, in the next experiment for each training batch, the number of data points for one transformation is three times higher than the others. Figure 13 depicts three transformations one of which, left translation, has the largest number of data points. It can be seen that simply winning a larger number data points does not lead to increase in the standard deviation. Instead, as we hoped, the number of transformation won by the corresponding expert is the key factor affecting the standard deviation.

In this experiment, the number of data points for each transformation within each batch of training is uniformly distributed. One might argue that

Figure 12: Effect of percentage of data points to relocate on convergence speed
once an expert starts winning more transformations, it will simply claim more data points; it could be the case that due to the sample prevalence of some transformations, the standard deviation becomes higher for experts winning those transformations, even if an expert wins one transformation.

## 6 Conclusions

In this study, we have proposed a novel method for finding modular causal mechanisms. We have demonstrated that it converges significantly faster and has more power in identifying the modular mechanisms, compared to state of the art. We believe finding modular causal mechanisms is a key towards allowing AI systems to take the next step in generalization performance - the kind of generalization that can go beyond the manifold of a single data set.

The primary constituent of our methodology is enforcing diversity between experts. Our key contribution is the observation that the performance bottleneck in this case lies at the insufficient power of the discriminator. A new method for reducing the similarity between experts was needed. This diversity is created by adopting an orthogonalization layer requiring the experts' outputs to be orthogonal to each other. To further reinforce modularization, we propose data points relocation, giving "lost" experts the opportunity to stay in the competition.

As a future work, our research naturally lends itself to be applied on more challenging data sets and in real-world scenarios. More importantly, the generalizability of the learned mechanism to new situations should be analyzed

Figure 13: relation between number of transformations won by each expert and \(std\) of last discriminator’s hidden layer output (also \(std\) of discriminator score) – imbalanced sample
further. As a more technical future work direction, relaxing the orthogonalization constraint can also be considered. In other words, the level to which the experts' outputs needs to be de-correlated should possibly be adaptive, depending on the properties of the data and the transformations to be learned.

## Appendix A Detailed architectures and experts and discriminator

Experts and discriminator architectures are shown in Tables 1 and 2, respectively. The same architectures are used for both the model without orthogonalization and with orthogonalization. The difference is that with orthogonalization, as shown in Figure 1, an orthogonalization layer is embedded after the fourth layer, to make experts outputs orthogonal to each other.

It is worth mentioning that we have also examined larger models for discriminator and/or for the experts, however, since the results (including the improvement of the proposed method over the baseline) is consistent across other architectures, we do not report this study in the paper in detail.
## Appendix B Transformations details

We used the following transformations for the experiments.

* Contrast inversion: The original value of each pixel, which is in the \([0,1]\) range, is transformed as (\(1-\)original value).
* Noise addition: Gaussian noise with mean 0 and standard deviation of 0.1 is added.
* Translations: eight directions (namely right, left, up, down, and their diagonals) are used. In Figure 2, 4px translation is used. In Figures 11 and 13, 2px is used.
