{'fraction_non_alphanumeric': 0.03934987168520103, 'fraction_numerical': 0.014447295884421634, 'mean_word_length': 4.46004151530877, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Multimodal Representation Learning using Deep Multiset Canonical Correlation

We propose Deep Multiset Canonical Correlation Analysis (dMCCA) as an extension to representation learning using CCA when the underlying signal is observed across multiple (more than two) modalities. We use deep learning framework to learn non-linear transformations from different modalities to a shared subspace such that the representations maximize the ratio of between- and within-modality covariance of the observations. Unlike linear discriminant analysis, we do not need class information to learn these representations, and we show that this model can be trained for complex data using mini-batches. Using synthetic data experiments, we show that dMCCA can effectively recover the common signal across the different modalities corrupted by multiplicative and additive noise. We also analyze the sensitivity of our model to recover the correlated components with respect to mini-batch size and dimension of the embeddings. Performance evaluation on noisy handwritten datasets shows that our model outperforms other CCA-based approaches and is comparable to deep neural network models trained end-to-end on this dataset.


Introduction and Background
In many signal processing applications, we often observe the underlying phenomenon through different modes of signal measurement, or views or modalities. For example, the act of running can be measured by electrodermal activity, heart rate monitoring and respiratory rate. We refer to these measurements as modalities. These observations are often corrupted by sensor noise, as well as the variability of the signal across people, influenced by interactions with other physiological processes. The question then becomes: Given that these modalities are observing the same phenomenon, how do we learn to represent the information that is common to them. Multimodal representation learning often refers to this task of learning a subspace that captures the information shared among modalities.
Multimodal representations have been shown to capture the variability of the underlying signal better than a single modality [1], and generalize better to unseen data. Recently, deep neural network (DNN) methods in this domain have been successful for downstream tasks such as clustering or classification. Some examples of related work are multimodal autoencoders [2], RBM [3], and our work on autoencoder shared representations [4]. Most of these methods optimize some form of a reconstruction error. In this work we are interested in extending deep CCA to multiple modalities.
CCA [5,6] and kernel CCA [7] can find projections of two modalities to maximially correlate them. They have been applied for many applications-from unsupervised learning of fMRI data [8] to decreasing sample complexity for regression [9]. A drawback of CCA is that it can only learn a linear projection that maximizes the correlation between modalities. This can be somewhat alleviated by KCCA, which uses a kernel to learn nonlinear representations. But, the ability of KCCA to generalize is limited by the fixed kernel.
Deep CCA (DCCA [10]) addresses this limitation by learning non-linear transformations of the data that maximize the correlation between them. DCCA has been successfully applied to several applications for high dimensional data with complex relationships. Examples include unsupervised learning of acoustic features from articulatory data [11], matching images with caption [12] and multilingual word-embeddings [13] By definition, CCA and DCCA can only work with two modalitites and do not scale for multiple modalities.
One of the first works to extend CCA for several 'sets of variables' was proposed in [14]. Subsequently, the seminal work by Nielsen [15] examined different formulations of multiset CCA, and its applications. Another method for multiset CCA is generalized CCA (GCCA [16]). It has been successfully applied to multi-set problems such as multi-view latent space [17] and latent semantic analysis [18]. Deep GCCA [19] has been proposed to generalize GCCA. However, (D)GCCA only considers within-modality covariances, similar to principal component analysis (PCA), i.e, it captures components with maximum variance within a modality.
Complementary to GCCA, multiset CCA [20,14] considers both between-and within-modality variances. A formal characterization of MCCA was published in [21] to show that the MCCA solution is akin to maximizing the 'reliability' of repeated measurements. It is important to note that the ratio of covariances formulation here is similar to the ratio of scatter matrices used in linear discriminant analysis (LDA). However LDA and MCCA are conceptually different in that LDA needs class information but MCCA only needs congruent modalites. The relation between LDA and MCCA is detailed in [21]. However, MCCA is still limited to learning only linear projections. In this work, we propose deep MCCA (dMCCA) that enables us to learn non-linear transformations. We also show that dMCCA can be trained with stochastic methods, making it possible to scale the method for complex and large datasets.
CCA, GCCA and deep learning variants: Let (X 1 , X 2 ) be data matrices of two modalities, with covariances, (Σ 11 , Σ 22 ) and cross covariance Σ 12 . CCA finds linear projections in the direction that maximizes the correlation coefficient. In DCCA, the top-most layers of two DNNs are used instead of the data matrices, i.e., X l → H l to estimate the covariances,Σ. The loss function to optimize this network is the sum of the top k singular values of the matrix T =Σ . DCCA can be optimized full-batch [10], or with stochastic methods [12]. GCCA works with T × D × N tensor (notation consistent with [21]) where T is the number of data samples of dimension D for N > 2 modalities. Let X l ∈ R T ×D , l = 1, ..., N where the feature dimension d l can vary with modality. GCCA finds a low-dimensional, K < D orthonormal space such that its Frobenius norm to the input signal is minimized for all modalities. Its deep variant, DGCCA extends this formulation to DNN by maximizing the top K eigenvalues of the sum of projection matrices that whitens all H l , l ∈ [1, ..., N ] matrices. See [19] for more details.

Multiset CCA and dMCCA
In this section, we describe our formulation of dMCCA and give a sketch to derive gradients for backpropagation following [10,22]. Let X l ∈ R T ×D , l = 1, ....N be the data matrices of N modalities, the the inter-set correlation (ISC , [21]) is defined as: where R B and R W referred to as the between-set and within-set covariance matrices defined as: whereX = X − E(X) are the centered datasets. We omit the common scaling factor (T − 1) −1 N −1 here. MCCA finds the projection vectors v d , d = 1, ..., D to maximize the ratio of sums of between-set and within-set covariances by solving this generalized eigenvalue (GEV) problem: In summary, MCCA finds the projection of the data that maximizes ISC by finding the principal eigenvectors of between-set over within-set covariance. In simpler terms, MCCA examines the eigenvalue decomposition of In the dMCCA formulation, X · → H · . With increasing N, computing R B can be computationally expensive because all pairs of modalities need to be considered. Instead we estimate the total covariance R T , and then R B = R T − R W as: where H * = Σ N l=1 H l is the average of all modalities, and µ = 1 -the mean of all samples and all modalities.
The pseudo code of the our algorithm is given in Alg. 1.
We initialize the weights of the N d-layer networks to perform a forward pass of the input data and obtain the top-most layer activations, H l . We then estimate between-set and within-set covariances (eqn. 2-3) and solve the GEV problem (eqn. 4) using Cholesky decomposition of R W (line 6 Alg. 1) as described in [21]. Our objective is to maximize the average ISC (eqn 3) which is recomputed with the eigenvectors V (line 7 Alg. 1). Notice that the GEV solution V simultaneously diagnolizes R B and R W , hence the loss function is equivalent to the ratio of the diagonal elements. The key is to begin with the GEV problem (eqn 6): The partial derivative of the eigenvalue ρ d with respect to hidden layer representations H l can be written as follows [23]: WLOG, assume µ = 0 in eqn (5) and with simpler notation H * → H the partial derivative of R T in a mini-batch size of M is: To derive gradients of R W , we refer the reader to [10].

Synthetic data
In order to test if dMCCA is learning highly correlated components, we generate synthetic observations similar to that in [21] where the number of common signal components across the different modalities is known apriori. Because the source signal is given, we can build a supervised deep learning model to reconstruct the source signal. This provides an empirical upper-bound on performance. Data Generation: Consider T signal and noise components for N modalities s l t ∈ R K and n l t ∈ R D t = 1, ..., T , l = 1, ..., N , K < D, drawn from standard normal distribution. Because our objective is to obtain correlated components across the modalities, the signal component is same across all N modalitites, i.e, s l t ≈ s t , but corrupted with a modalityspecific noise η l . Thus, the signals were mapped to the measurement space as x l s,t = A l s s t + η l , x l n,t = A l n n l t . The multiplicative noise matrices were generated as A l s = O l s D l s ∈ R D×K and A l n = O l n D l n ∈ R D×D . The matrices O l s ∈ R D×K and O l n ∈ R D×D have random orthonormal columns. Unlike [21], we used different matrices A l s and A l n to simulate a case where the different views of the underlying signal are corrupted by different noise. As is the case with many real world datasets, the noise in the measurement signal is further spatially correlated. We simulated this by x l n,t ← αx l n,t + (1 − α)x l n,t−1 , α ∈ [0, 1]. Finally the SNR of the measurements was controlled by β to generate the observation data as y l t = βx l s,t + (1 − β)x l n,t , β ∈ [0, 1] resulting in a data matrix of size T × D × N . For all our experiments, we generated data with T = 100000, D = 1024, K = 10, N = 5, β = 0.7 and α = 0.5. Detailed analysis by varying these parameters is part of our future work.
Supervised learning baseline: We trained N neural networks to obtain an empirical upper-bound on the performance of estimating the signal components. The input to these networks was [X 1 , ..., X N ] and they were supervised to reconstruct the signal [s 1 , ..., s N ]. In our experiments, with N = 5 we used five identical networks, each with an input layer of 1024 nodes, followed by 512 nodes and 10 nodes (to match the number of correlated components). We refer to this DNN as Supervised-512-10. It was trained to minimize the mean squared error (MSE) between the outputs and the signal components. Additionally, we also varied the activation functions (linear, tanh) and mini-batch sizes. A dropout of 0.2 was included for the networks with tanh activation to prevent overfitting. All models were trained using SGD with Nesterov momentum of 0.9 (learning rate=1e-3) with with 20% of the data for validation (val) and 10% for testing.

dMCCA for synthetic data
The dMCCA network architecture is similar to the aforementioned model with two modifications: 1) There was no supervision, instead the mean ISC between the modalities was maximized (See Algo 1), and 2) number of dimensions of the output embedding, i.e., the number of correlated components was varied as K = [5,10,15,20,40,50,64,128]. We denote this model as dMCCA-512-K. The output layer dimension K was varied to examine its effect on the similarity of the DNN representations to the source signal. This is important, since in real world applications the number of correlated components is not known apriori. In our preliminary experiments we noted that RMSProp (learning rate = 1e-3, decay = 0.9) instead of SGD with momentum yielded stable results in terms of loss at each epoch for the train and val data. Early stopping criterion was employed for both the supervised and dMCCA models (i.e, stop training when validation loss is less than 1e-6 for at least 5 consecutive epochs). All experiments were repeated ten times with different train-val-test partitions of the synthetic data.

Noisy-MNIST (n-MNIST) experiments
We used the n-MNIST data [24] to demonstrate that dMCCA algorithm can be used to learn the correlated signal components using observations from different modalities. n-MNIST was created using the handwritten digits dataset, MNIST [25] by adding 1) additive white Gaussian noise (AWGN) 2) motion blur and, 3) reduced contrast + AWGN. The noise parameters are described in [24]. In all experiments, we used 50000 samples for training, 10000 for validation and 10000 for testing. The ten digit classes in the dataset were nearly balanced, hence we only report accuracy.
dMCCA for n-MNIST: The network architecture here was similar to the dMCCA model for synthetic data but with three branches. Each branch had an input layer of 784 nodes, followed by 1024 and K nodes , i.e, dMCCA-1024-K . We used the val set for early stopping. The trained model was then applied on the test partition. Representations from the three modalities were concatenated as input features for SVM. The SVM parameters were tuned on the val-set using grid-search and accuracy from a 10-fold cross-validation (CV) on the test set was reported. All experiments were repeated by varying mini-batch size and embedding dimension. We also used k-means clustering algorithm to assess linear separability of the ten classes.
Baseline experiments: We setup five baseline experiments to compare the performance of dMCCA for classification. For all experiments, we report the 10-fold CV accuracy on the test-set, after tuning the system (SVM or DNN) parameters on the val-set. We also varied the feature or embedding size, K and the mini-batch sizes (See Fig. 2 for ranges) where applicable. We used McNemar's χ 2 test to statistically compare performance.

Supervised baseline:
The architecture here was similar to Supervised-512-10, except with three branches: 784 dim input followed by 1024 and K nodes. The three K-dimensional top-most layers were concatenated and input to a softmax layer of 10 nodes for classifying the 10 digits. The concatenated layer ensures that the information across the three modalities is shared in this embedding. The model was optimized with categorical cross-entropy using early stopping criteria as described before. Because the model is supervised end-to-end, this is a very competitive baseline to compare with dMCCA. Arguably it may not be the best architecture for classifying n-MNIST dataset, but our objective here was to obtain an upper-bound in DNN performance using end-to-end training. 2. PCA: We compare with PCA because like CCA, it performs dimensionality reduction. We concatenated the 784-dim vectors of three modalities of n-MINST and perform PCA on test-set by estimating the covariance on the train set. K principal components are input as features to SVM. 3. DCCA: We chose two of the three modalities randomly and applied DCCA [10] to obtain embeddings that are then concatenated and input to SVM. 4. DGCCA: We used the publicly released DGCCA code [10] to learn embeddings using a network architecture same Figure 1: dMCCA-512-10 affinity measures for synthetic data as dMCCA-1024-K for different embedding dimensions, K. The embeddings were then concatented and input to SVM. 5. MCCA: The projection vector space V ∈ R D×K was estimated on the training set as described in eqn. (4). The correlated components were estimated by: Y l = X l V where the test set, X l ∈ R T ×D has T samples and D=784. The components are then concatenated and input to SVM.

Performance Evaluation
The benefit of using synthetic data is that we can examine what the network learns when the generative process is known. Because components with equal ISC can be produced by arbitrary linear combination of the vectors in the corresponding subspace, we examined the normalized affinity measure to compare dMCCA representation with the source signal. This was defined in [26] to estimate the angle between two subspaces. LetX l s ∈ R T ×K be the embedding for the source signal X l s ∈ R T ×K . The affinity betweenX and X can be estimated using the principal angles θ (·) as: where, a ∧ b ≡ min(a, b) and the cosine of the principal angles θ are the singular values of the matrix U V where U and V are the orthonormal bases for X andX respectively.
This measure of correlation between subspaces has been extensively used to compare distance between subspaces in the subspace clustering literature [26]. This measure is low when the principal angles are nearly orthogonal and has a maximum value equal to one when one of the subspaces is contained in the other. It can also compare subspaces of different dimensions.
We estimate two affinity measures: 1) reconstruction affinity, R a : average affinity between the reconstructed signal and the source signal across the N modalities and 2) inter-set affinity, R s : average affinity between the different modalities of the reconstructed signal:

Results
Synthetic data results: We first analyzed the performance of dMCCA algorithm by varying embedding dimension and mini-batch size. Fig. 1 shows the reconstruction affinity measure ( R a eqn. 11) and the inter-set affinity measure ( R s eqn. 12). Notice that the maximum R a is achieved for the embedding dimension of 10 (which is the number of correlated components used to generate the data) indicating that the dMCCA retains some notion of the ambient dimension for maximizing correlation between modalities. The R s measure consistently decreased with increasing embedding dimension. Because we estimate covariances in the loss function and use SGD with mini-batches for optimization, we also examined the performance with varying mini-batch size, M. As shown in Fig. 1, M > 400 gives consistent results. All our results were comparable for tanh activation.  Next, we compared the performance of our system with an empirical upper-bound obtained by training a DNN to reconstruct the ground-truth source signal. As shown in Table 1, and as expected -the R a measure for our system (0.73) is lower than the supervised system (0.85). However, the affinity between the modalities for the embeddings from dMCCA (0.82) is higher than that of the supervised system (0.60). This is perhaps the benefit of modelling the between-set covariance over just minimizing the reconstruction error that is common to many deep representation learning methods, as well as DGCCA.
n-MNIST results: We next evaluated our model to classify n-MNIST digits to assess dMCCA embeddings for classification task. Note that classifying noisy MNIST data is significantly difficult than the clean MNIST data [24]. We compared the performance of all models by varying the embedding dimensions. 10-fold CV accuracy averaged across mini-batch sizes and different partitions is shown in Fig. 2 (solid line). The standard deviation of accuracy is reflected by the error bars in Fig. 2. While a supervised DNN trained end-to-end performed slightly better than our method, the performance was not statisticall different for K > 40. PCA on the raw features yielded a best accuracy of about 87% (red in Fig. 2) which was significantly greater than that of DCCA which only looked at two modalities. CCA-based methods that used all three modalities outperformed DCCA method suggesting that multiple modalities can be leveraged more effectively to improve the performance.
Finally, our model outperformed the linear features from MCCA and other CCA methods suggesting the benefit of using deep learning to model the non-linear relationships. A key factor here is the embedding dimension K. In real-world data, this number is not known. But, in practice, it can be tuned on a validation set. Increasing the dimension size further did not improve classification performance. We also performed clustering on the dMCCA embeddings to assess linear separability (NMI=0.72, completeness=0.67). This suggests that dMCCA method can also be used for unsupervised learning.

Discussion and Conclusions
This ratio of variances used in our loss is also referred to as intraclass correlation coefficient [27] and is a widely-used measure of reliability in test-retest literature. Hence, multiple modalities can be viewed as analogous to repeated, albeit noisy measurements of the underlying signal. For classifying noisy MNIST data, we show that our model not only outperforms other CCA-based approaches but competes well with supervised learning models. For future work, we are working to include dMCCA within an autoencoder framework, and explore interpretability of features using MCCA. We have released the code and results on more real-world examples at https://github.com/usc-sail/mica-deep-mcca