Additive autoencoder for dimension estimation
Full text
This is a self-archived version of an original article. This version may differ from the original in pagination and typographic details. Author(s): Title: Year: Version: Copyright: Rights: Rights url: Please cite the original version: CC BY 4.0 https://creativecommons.org/licenses/by/4.0/ Additive autoencoder for dimension estimation © 2023 The Author(s). Published by Elsevier B.V. Published version Kärkkäinen, Tommi; Hänninen, Jan Kärkkäinen, T., & Hänninen, J. (2023). Additive autoencoder for dimension estimation. Neurocomputing, 551, Article 126520. https://doi.org/10.1016/j.neucom.2023.126520 2023
Additive autoencoder for dimension estimation Tommi Kärkkäinen ⇑ , Jan Hänninen Faculty of Information Technology, University of Jyväskylä, Finland article info Article history: Received 10 February 2023 Revised 15 May 2023 Accepted 30 June 2023 Available online 6 July 2023 Communicated by Zidong Wang Keywords: Autoencoder Dimension reduction Intrinsic dimension Deep learning abstract Dimension reduction is one of the key data transformation techniques in machine learning and knowledge discovery. It can be realized by using linear and nonlinear transformation techniques. An additive autoencoder for dimension reduction, which is composed of a serially performed bias estimation, linear trend estimation, and nonlinear residual estimation, is proposed and analyzed. Compared to the classical model, adding an explicit linear operator to the overall transformation and considering the nonlinear residual estimation in the original data dimension significantly improves the data reproduction capabilities of the proposed model. The computational experiments confirm that an autoencoder of this form, with only a shallow network to encapsulate the nonlinear behavior, is able to identify an intrinsic dimension of a dataset with low autoencoding error. This observation leads to an investigation in which shallow and deep network structures, and how they are trained, are compared. We conclude that the deeper network structures obtain lower autoencoding errors during the identification of the intrinsic dimension. However, the detected dimension does not change compared to a shallow network. As far as we know, this is the first experimental result concluding no benefit from a deep architecture compared to its shallow counterpart. Ó2023 The Author(s). Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/). 1. Introduction Dimension reduction is one of the main tasks in unsupervised learning [1]. Both linear and nonlinear techniques can be used to transform a set of features into a smaller dimension [2]. A specific and highly popular set of nonlinear methods are provided with autoencoders, AE [3], which by using the original inputs as targets integrate unsupervised and supervised learning for dimension reduction. The main purpose of this paper is to propose and thoroughly test a new autoencoding model, which comprises an additive combination of linear and nonlinear dimension reduction techniques through serially performed bias estimation, linear trend estimation, and nonlinear residual estimation. Preliminary, limited investigations of such a model structure have been reported in [4,5]. With the proposed autoencoding model, we consider its ability to estimate the intrinsic dimensionality of data [6–8]. According to [9], the intrinsic dimension can be defined as the size of the lowerdimension manifold where data lies without information loss. For the most popular linear dimension reduction technique, the principal component analysis (PCA), the information loss can be measured with the explained variance which is provided by the eigenvalues of the covariance matrix [10]. Indeed, the use of an autoencoder to estimate the intrinsic dimension can be considered a nonlinear extension of the projection method based on PCA [11]. However, in the nonlinear case measures for characterizing the essential information and how this is used to reduce the dimensionality vary [12,13]. With the intrinsic dimension, for instance the data reduction step in the KDD process [14,15] would not loose information. In [16] it was concluded that a shallow autoencoder shows the best performance when the size of the squeezing dimension is approximately around the intrinsic dimension. In this direction, techniques that are closely related to our work were proposed in [17], where the intrinsic dimension was estimated using an autoencoder with sparsity-favoring l 1 penalty and singular value proxies of the squeezing layer’s encoding. In the experiments, the superiority of the autoencoder compared to PCA was concluded. This and the preliminary work by [18] applied a priori fixed architectures of the autoencoder and different autoencoding error measure compared to our work. Here, multiple feedforward models are used and compared, with a simple thresholding technique to detect the intrinsic dimension based on the data reconstruction error. https://doi.org/10.1016/j.neucom.2023.126520 0925-2312/Ó2023 The Author(s). Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/). ⇑ Corresponding author. E-mail address: [email protected] (T. Kärkkäinen). Neurocomputing 551 (2023) 126520 Contents lists available at ScienceDirect Neurocomputing journal homepage: www.elsevier.com/locate/neucom
1.1. Motivation of the autoencoding model The proposed model is formally derived in Section 3.1, but the basic idea to apply sequentially linear and nonlinear transformation models for dimension reduction and estimation could be realized in many ways. However, in order to reduce the reconstruction error efficiently– and to reveal the instrinsic dimension– there is one pivotal selection which is illustrated in Fig. 1:After the linear transformation, residual for the nonlinear model’s encoding should be treated in the original dimension!. Interestingly, our experiments reveal that the intrinsic dimension can be identified by using only a shallow feedforward network as the nonlinear residual operator in the additive autoencoding model. This results exactly from the two essential choices: iÞ to include the linear operator in the overall transformation and iiÞto consider the unexplained residual in the original data dimension. This does not happen with the classical autoencoder (without the linear term) or if the nonlinear autoencoding would be applied in the reduced dimension after the linear transformation. These phenomena, with the models and techniques fully specified in the subsequent sections, are illustrated in Fig. 1. Therefore, in addition to exploring the capabilities of revealing the intrinsic dimension we assess the advantages of applying deeper networks as nonlinear operators. 1.2. Contributions and contents The main contribution of the paper is the derivation and evaluation of the additive autoencoding model. We provide an experimental confirmation of the new autoencoder’s ability to reveal the intrinsic dimension and study the effect of model depth. With minor role, mostly covered in the Supplementary Material (SM), we also discuss and provide an experimental illustration of the difficulties of currently popular deep learning techniques in realizing the potential of deep network models. Apparently, our results diversify views on the general superiority of deeper network architectures. They suggest that current and upcoming applications in deep learning and in the use of autoencoders could be improved by using an explicit separation of the linear and nonlinear aspects of the data-driven model. The remainder of the paper is organized in the following manner: In Section 2, we provide a brief summary of the forms and applications of autoencoders and provide a preliminary discussions on certain aspects of deep learning. In Section 3, we discuss the formalization of the proposed method as a whole. In Section 4,we describe the computational experiments and summarize the main findings. In Section 5, we provide the overall conclusions and discussion. In the SI, we provide more background and preliminary material and, especially, report the computational experiments as Fig. 1. Top row: Residual errors with Wine dataset for the usual autoencoders with different number of hidden layers (left) and for the proposed, additive autoencoders (right). Bottom row: Comparison of classical and proposed autoencoder with five-hidden-layers for the MNIST dataset. Here x-axis contains the squeezing dimension and yaxis the autoencoding (reconstruction) error. Deeper models provide lower autoencoding errors on the top left, but, only with the additional linear operator as proposed here, the intrinsic dimension is revealed on the top right and bottom figures. Improvement due to the depth of the model is significant on the top left but only moderate on the top right, where all models are stricly better than the linear PCA alone. On the bottom, better capability of the proposed autoencoder to encapsulate the variability of MNIST compared to the classical approach is clearly visible. T. Kärkkäinen and J. Hänninen Neurocomputing 551 (2023) 126520 2
a whole. Main findings solely covered on SI confirm the quality of the implementation of the methods and especially indicate that different autoencoder models, as depicted in the previous section, could be used for the nonlinear residual estimation. 2. Related work and preliminaries In this section, we introduce the different variants of autoencoders, summarize their wide range of applications, and provide some preliminaries on deep learning techniques. 2.1. On Autoencoders Feedforward autoencoders have a versatile history, beginning from [19,20]. Their development as part of the evolution from shallow network models into deep learning techniques with various network architectures has been depicted in numerous large and comprehensive reviews [3,21,22]. Therefore, we will not go into details in what follows. Deep feedforward autoencoding was highly influenced by the seminal work of Hinton and Salakhutdinov [23]. In what follows, we refer this approach, where the encoder was composed of multiple feedforward layers until the squeezing dimension and estimation of the network weights was based on the least-squares fidelity, possibly with a Tykhonov type of squared regularization (penalization) term [24],asthe classical autoencoder. The work in [23] emphasized the importance of pretraining and the usability of stacking (i.e., layer-by-layer construction of the deeper architecture). Such techniques, by directing the determination of weights to a potential region of the search space, particularly alleviate the vanishing gradient problem (see Section 5.9 [3] and references therein). As summarized– for example, by [25], many architectures and training variants for deep autoencoders (AE) have been proposed over the years. Summary of the main AE approaches is given in Table 1, where ‘Architecture’ refers to the AE’s model structure, ‘Learning principle’ summarizes the essential basis of learning, ‘Evaluation’ contains the given information on the assessment of quality, efficiency and complexity, and ‘Applications’ points to the basic use cases within the cited papers. In addition to the approaches given in Table 1, many other combinations and hybrid forms of AEs exist. Special AEs typically integrate concepts and techniques from relevant areas, for instance, autoencoder bottlenecks (AE-BN) that are based on Deep Belief Networks [26] and rough autoencoders where the rough set based neurons are used in the layers [27].InMethodological combinations with AEs, the base case is to use AE for dimension reduction before supervised learning. Interesting unsupervised hybrids are provided by clustering techniques that incorporate AEs for feature transformation [28,29] and unsupervised AE-based hashing methods that can be used for large-scale information retrieval [30]. More involved combinations include use of AE with unsupervised clustering and generative models [31,32] and for representation learning of various learning tasks, e.g., low-dimensional visualization, semantic compression, and data generation [33]. A wide variety of tasks and domains has been and can be addressed with autoencoders. AEs are typically used in numerous application domains in scenarios where transfer learning can be utilized– for example, in speech processing [55], time series prediction [56], fault diagnostics in condition monitoring [57–59], and machine vision and imaging tasks [60,61,33,62,63,44,64–68]. Further, AEs have been used for the estimation of data distribution [69]. Use of a variational AE for joint estimation of a normal latent data distribution and the corresponding contributing dimensions has been addressed in [70]. Yet another use case of autoencoders is outlier or anomaly detection [71,33,72–74]. Also data imputation has been realized using a shallow autoencoder in [75], with deeper models in [76–78], and especially for spatio-temporal data in [79,76,80–83]. More exotic use cases include (but are not limited to) use of AE to transfer domain knowledge in recommendation systems [84] and to construct efficient surrogates in astronomy [85]. 2.2. Preliminaries on deep learning Deep learning has been an extremely active field of research and development in the twenty-first century [86]. These techniques reveal repeatedly promising results in new application areas [87]. On the other hand, deep networks might be overly complex and equal performance could be reestablished after significant pruning [88]. Deep neural networks are sensitive to small variations in training and architectural design parameters, thereby requiring careful calibration [89] and meticulousness in analyzing and comparing different models [90]. These factors have caused, e.g., the emergence of automated neural architecture search techniques [91]. Therefore, it is important to improve our basic understanding of both the empirical and theoretical bases of deep learning [92]. Systematic methods and studies to analyze the behavior of deep neural networks are needed [93]. Indeed, there exist some fundamental aspects of deep learning in which theory and practice are not fully aligned. The first issue is the universal approximation capability, whose main shallow results are reviewed, for example, by Pinkus [94] and whose general importance was excellently summarized in [95, p. 363]: ‘‘We have thus established that such [feedforward] ‘mapping’ networks are universal approximators. This implies that any lack of success in applications must arise from inadequate learning, insufficient numbers of hidden units or the lack of a deterministic relationship between input and target.” To put it succinctly, a sufficiently large width of one or at most two hidden layers is, according to the approximation theory, enough for an accurate approximation of a nonlinear function, which is implicitly represented by a discrete set of examples in the training data. Another aspect is the dominant approach to training a deep network structure– that is, estimating unknown weights in different layers. This is realized by applying a certain form of the steepest gradient descent method with a rough approximation of the true gradient, using one observation (online or stochastic gradient descent) or a small subset of observations (minibatch). In classical optimization, even the batch gradient descent using the complete data is considered a slow algorithm but still a convergent one provided that the gradient of the minimized function is Lipschitz continuous and the line search– that is, the determination of the step size (the learning rate in neural networks terminology) when moving to the search direction– satisfies specific decrease conditions as given in Theorems 6.3.2 and 6.3.3 in [96] and Theorem 3.2 in [97]. In deep learning, step size may be fixed to a small positive constant [98] or be based on monitoring the first- and second-order moments of the gradient during the search with direct updates [99]. Often restricted to a fixed number of iterations and not assuring stopping criteria measuring fulfillment of the optimality conditions (see Section 7.2 in [96]), this implies that the actual optimization problem for determining the weights of a DNN might be solved inaccurately [100]. In a genuine supervised learning for a regression model or a classifier, inexact optimization can be tolerated when seeking the best generalizing network. Then, the search of weights that provide better minimizers for the cost/loss function is stopped prematurely when the test or validation error of the model begins increasing as an indication of overlearning. In such a case, we are not seeking the most accurately optimized network but the best generalizing T. Kärkkäinen and J. Hänninen Neurocomputing 551 (2023) 126520 3
Table 1 Summary of main forms of autoencoders. Technique Architecture Learning principle Evaluation Applications Denoising AE (DAE) [34–39] Classical Add noise to inputs [34] or pretraining [34] or weight updates [35] Linear complexity for Marginalized Stacked Linear DAE [36]; Higher imputation accuracy [38] Better higher-order representations [34]; Time series classification [37]; Generative models for genetic operators [39]; Data imputation [38] Sparse AE (SAE) [40] (see also Section 5.6.4 [3]) Classical Introduce sparsity favoring regularization and special solvers Reduced models with less active weights High-dimensional regression and classification problems, e.g., in Chemometrics Separable AE (SAE) [41] (cf. Siamese neural networks that do opposite and use shared weights) Classical Pretrain multilayer AE for speech and onthe-fly multi-layer AE for residual noise from Spectrogram with nonnegativity constraint Quality of enhanced speech, analysis of noise distribution Separate speech and noise Graph AE (GAE) [42–47] Variational GAE [48] (see VAE next) Schrinking and enlarging forward– backward transformation of data graph (GNN); Use AE to encode-decode Graph layer Convolution Network [43]; Masked GAE [46]; Encode-decode both topology and node attributes [47]; GNN encoder + separate feature&label decoders [48] Reconstruction of adjacency matrix in least-squares sense [42] or cross-entropy sense [43]; Apply weight-least-squares and graph Laplacian regularization [44,48]; Regularize both topology and node attribute proximity [47] Use latent representation to test preservation of topological features or node or graph structure; Classification and clustering quality; Linear training scalability [48] Suppressed graph encapsulation of linked data representing citations, emails, flights, species, social networks, blockchains, collaborations, functional magnetic resonance imaging (fMRI); Estimation of missing feature information on nodes for link prediction [48] Variational AE (VAE) [49–52] Structurally classical, input and/or latent distributions, generative use emphasized [49,50] Stochastic fitting to samples and regularization of latent space, e.g., with Kulback-Leibler divergence, non-convex optimization problems [49,50] Recovery of generated latent space [49], size of latent space [49], quality of generated topics [50]; imbalanced classification quality [51,52]; Quality of density estimation and number of active units [52] Generation of topics [50], Generation of samples for minority class [51] Regularized AE (RAE) [53] Any Combination of classical reconstruction error and contractive regularizer (encoder-decoder derivative with respect to input) Function approximation, recovery of manifolds Recovery of data-generation density Multi-modal AE [54] Set autoencoder to process different data modalities, recurrent units Input–output order matching using sum of reconstruction error and cross-entropy loss between set memberships Quality of set assignments and matching, quality of kernel density estimation Genes-to-proteins mapping T. Kärkkäinen and J. Hänninen Neurocomputing 551 (2023) 126520 4
model based on another error criterion at the meta-optimization level. Theoretically, however, generalization and optimality can be linked in certain respects: An outer-layer locally optimal network, independently on the level of optimality of the hidden layers, provides an unbiased estimate of the prediction error over the training data in the sense of mean, median, or spatial median [101]. In a typical use case, the goal of a dimension reduction through autoencoding is to obtain a reduced, compact representation that encapsulates variation of data. Similar to linear dimension reduction techniques, when attempting to represent the given data accurately in lower dimensions, we aim for the best possible reconstruction accuracy. Then, the cost function that measures the autoencoding error (such as the least-squares error function) must be solved with sufficiently high optimization accuracy because of the direct correlation: The smaller the cost function, the better the autoencoder. 3. Methods In this section, we describe the methods used here as part of the autoencoding approach. In the following account, we assume that a training set of Nobservations X¼x i fg N i¼1 , where x i 2R n , is given. 3.1. The autoencoding model In mathematical modelling, linear and nonlinear models are typically treated separately [102]. Following [5], according to Taylor’s formula, in the neighborhood of a point x 0 2R n , the value of a sufficiently smooth real-valued function fxðÞcan be approximated as fxðÞ¼fx 0 ðÞþ r fx 0 ðÞ T xx 0 ðÞþ 1 2xx 0 ðÞ T r 2 fx 0 ðÞxx 0 ðÞþ...; where rfx 0 ðÞdenotes the gradient vector and r 2 fx 0 ðÞthe Hessian matrix at x 0 . According to Lemma 4.1.5 [96], there exists z2ls x;x 0 ðÞ;z2R n , where ls refers to the line segment connecting the two points xand x 0 , such that fxðÞ¼fx 0 ðÞþ r fx 0 ðÞ T xx 0 ðÞþ 1 2xx 0 ðÞ T r 2 fzðÞxx 0 ðÞ:ð1Þ This formula yields the sufficient condition of x2R n to be the local minimizer of a convex f(whose Hessian is positive semidefinite) Theorem 2.2 [97]:rfxðÞ¼0. However, another interpretation of the formula above is that we can locally approximate the value of a smooth function as a sum of its bias (i.e., constant level), a linear term, and a nonlinear higher-order residual operator. This observation is the starting point for proposing an autoencoder that has exactly such an additive structure. The bias estimation simply involves the elimination of its effect through normalization by subtracting the data mean and scaling each feature separately into the same range 1;1½with the scaling factor 2 max xðÞmin xðÞ . Thus, we combine the mean component from zscoring and the scaling component from min–max scaling. The reason for this is that the unit value of the standard deviation in zscoring does not guarantee equal ranges, and min–max scaling into 1;1½does not preserve the zero mean. In the second phase, we estimate the linear behavior of the normalized data by using the classical principal component transformation [103]. For a zero-mean vector x2R n , the transformation to a smaller-dimensional space m<nspanned by mprincipal components (PCs) is given by y¼U T x, where U2R nm consists of the mmost significant (as measured by the sizes of the corresponding eigenvalues) eigenvectors of the covariance matrix. Thus, because of the orthonormality of U, the unexplained residual variance of the PC coordinates (i.e., the linear trend in R m )in the original space (see SI, Section 7) can be estimated in the following manner: ~ x¼xUy ¼xUU T x¼IUU T x:ð2Þ This transformation is referred to as PCA. With erroneous data or data with missing values, mean and classical PCA can be replaced with their statistically robust counterparts [104]. In the third, nonlinear phase, we apply the classical fully connected feedforward autoencoder to the residual vectors in (2). We note that structurally, in comparison with the classical autoencoding model [23] (see Section 2.1), the difference according to (2) is the inclusion of the linear dimension reduction operator acting on the original dimension. To use the same data dimension in the linear approximation is suggested by the Taylorian analogy according to Eq. (1). Furthermore, one needs to return to the original dimension in the linear approximation, because otherwise (i.e., if we would consider the residual in the reduced dimension m) the overall reconstruction error would be constrained by the accuracy of the linear part. Here, instead, when the residual data is represented in the original dimension, both the linear and nonlinear parts of the additive autoencoder contribute to the reduction of the autoencoding error in the original data dimension. As anticipated by the scaling, the tanh activation function fxðÞ¼ 2 1þexp 2xðÞ 1 is used. This ensures the smoothness of the entire transformation and the optimization problem of determining the weights. The currently popular rectified linear units are nondifferentiable [101] and, therefore, are not theoretically compatible with the gradient-based methods Section 6.3.1 [98]. The importance of differentiability was also noted in [105]. The formalism introduced by [24] is used for the compact derivation of the optimality conditions. By representing the layerwise activation using diagonal function-matrix F¼FðÞ¼Diag f i ðÞ fg m i¼1 , where f i f, the output of a feedforward network with Llayers and linear activation on the final layer reads as o¼o L ¼N ~ xðÞ¼W L o L1ðÞ ;ð3Þ where o 0 ¼~ xfor an input vector ~ x2R n 0 , and o l ¼F W l o l1ðÞ forl¼1;...;L1. To allow the formal adjoint transformation to be used as the decoder, we assume that Lis even and that the bias nodes are not included in (3). The dimensions of the weight matrices are then given by dim W l ¼n l n l1 ;l¼1;...;L. In the autoencoding context, n L ¼n 0 and n l ;0<l<L, define the sizes (the number of neurons) of the hidden layers with the squeezing dimension n L=2 <n 0 . To determine the weights in (3), we minimize the regularized mean least-squares cost function of the form JW l no L l¼1 ¼1 2NX N i¼1 W L o L1ðÞ i ~ x i 2 þ a 2ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi X L l¼1 #W l 1 v u u tX L l¼1 W l W l 0 2 ;ð4Þ where kkdenotes the Frobenius norm and #W l 1 the number of rows of W l . Let abe fixed to 1e-6 throughout; to simplify the notations, we define b¼a=ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi P L l¼1 jW l 1 j q. The underlying idea in (4) is to average in both terms: in the first, the data fidelity (least-squares error, LSE) term, and in the second, the regularization term. Averaging the first term with 1 N implies that the term scales automatically T. Kärkkäinen and J. Hänninen Neurocomputing 551 (2023) 126520 5
by the size of the data subset, for instance, in minibatching, thereby providing an approximation of the entire LSE on a comparable scale. In the second term, because ais fixed, the inverse scaling constant 1=ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi P L l¼1 jW l 1 j qbalances the effect of the regularization compared to the data fidelity for networks with a different number of layers of different sizes. Because (4) will be minimized with local optimizers, we simply use the initial guesses W l 0 no of the weight values in the second term to improve the local coercivity of (4) and to restrict the magnitude of the weights, thereby attempting to improve generalization [106]. Because of the residual approximation, the random initialization of the weight matrices is generated from the uniform distribution U0:1;0:1½ðÞ.s The gradient matrices r W l JW l no L l¼1 ;l¼L;...;1, for (4) are of the following form (see [24]): r W l JW l no ¼1 NX N i¼1 d l i o l1ðÞ i T þbW l W l 0 ;ð5Þ where the layerwise error backpropagation reads as d L i ¼e i ¼W L o L1ðÞ i ~ x i ;ð6Þ d l i ¼Diag FðÞ 0 W l o l1ðÞ i no W lþ1ðÞ T d lþ1ðÞ i :ð7Þ The use of different weights in the encoding– that is, in the transformation until layer L=2– and decoding, from layer L=2toL, implies more flexibility in the residual autoencoder but also rougly doubles the amount of weights to be determined. Therefore, it is common to use the tight weights, which means that the formal adjoint W 1 T FW 2 T F... W L=2 T of the encoder is used as the decoder. Then, it is easy to see that the layerwise optimality conditions for l¼1;...;L=2 read as r W l J¼1 NX N i¼1 d l i o l1ðÞ i T þo ~ l1 ðÞ i d ~ l i T ÞþbW l W l 0 ;ð8Þ where ~ l¼Ll1ðÞ. For convenience, we define e L¼L=2– that is, the number of layers to be optimized with the symmetric models. We note that when the layerwise formulae above are used with vector-based optimizers, we always need to reshape operations to toggle between the weight matrices and a column vector of all weights. Remark 1. Let us briefly summarize the use of the additive autoencoder for an unseen dataset after it has been estimated (and the corresponding data structures have been stored) for the training data through the three phases. First, data is normalized through mean subtraction and feature scaling into the same range 1;1½. Then, residuals according to formula (2) are computed and this residual data is fed to the feedforward autoencoder. Again due to (2), the reduced, m-dimensional representation of new data is obtained as a sum of its PC projection and the output of the autoencoder’s squeezing layer. Formula (2) shows that the explicit formation of the residual data between linear and nonlinear representations can be replaced by setting f W 1 ¼W 1 IUU T and using this as the first transformation layer of the autoencoder for the normalized, unseen data. 3.2. Layerwise pretraining We apply the classical stacking procedure depicted, e.g., in Section 6.2 [107]. A similar idea appears with the deep residual networks (ResNets) in [108], where consecutive residuals are stacked together using layer skips– for example, over two or three layers with batch normalization. However, in ResNets, the layer skips can introduce additional weight matrices whereas the layer-by-layer pretraining follows the originally chosen network architecture. The stacking procedure is illustrated in Fig. 2. For three hidden layers with two unknown weight matrices, W 1 and W 2 , we first estimate W 1 with the given data ~ x i fg . Then, the output data of the estimated layer W 1 ~ x i no are used as the training data (the input and the desired output) for the second layer W 2 . Thereafter, the entire network is fine-tuned by optimizing over both weight matrices. The process from the heads to the inner layers is naturally enlarged for a larger number of hidden layers. We could then also apply partial fine-tuning– for example, to fine-tune the three hidden layers during the process of constructing a five-hidden-layer network. However, according to our tests and similar to [23], the layerwise pretraining suffices before fine-tuning the entire network. A special case of utilizing a simpler structure is the onehidden-layer case: The symmetric model 1S YM with one weight matrix is first optimizer to obtain W 1 and then used in the form W 1 T ;W 1 as the initial guess for optimizing the nonsymmetric model 1H ID with two weight matrices. Again such an approach could be generalized to multiple hidden-layer case for the nonsymmetric, deep autoencoding model. Remark 2. As stated in Section 2.1, stacking attempts to mitigate the vanishing gradient problem, which may prevent the adaptation of the weights in deeper layers. We assessed the possibility of such a phenomenon by studying the relative changes in the weight matrix norms jkW l 0 kkW l kj=kW l 0 k while fine-tuning the symmetric autoencoders with 3–7 layers (3S YM ,5S YM , and 7S YM ; see Section 4). The subscripts ‘0’ and ‘’ refer to the initial and final weight matrix values, respectively. This study revealed that the relative changes in the weights in the deeper layers were not on a smaller numerical scale compared to the other layers. Apparently, the double role of the layers in the symmetric models as part of the encoder and the decoder, with the corresponding effect on the gradient as seen in formula (8), is also helpful in avoiding a vanishing gradient. 3.3. Determination of intrinsic dimension The basic procedure to determine the intrinsic dimension is to gradually increase the size of the squeezing layer and to seek a small value of the reconstruction error measuring autoencoding error, with a knee point [109] indicating that the level of nondeter- Fig. 2. Layerwise pretraining from heads to inner layers. The most outer layer is trained first and its residual is then fed as training data for the next hidden layer until all layers have been sequentially pretrained. T. Kärkkäinen and J. Hänninen Neurocomputing 551 (2023) 126520 6
ministic residual noise has been reached in autoencoding. We apply the mean root squared error (MRSE) to compute the autoencoding error: e¼1 Nffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi X N i¼1 jx i N x i ðÞj 2 v u u t;ð9Þ where x i fg is assumed to be normalized and Ndenotes the application of the autoencoder. This choice was made because in [110], MRSE correlated better with the independent validation error than the usual root mean squared error RMSE, In practice, the difference between the RMSE and the MRSE is only the scaling factor, 1=ffiffiffiffi N pvs. 1=N. After the linear PC trend estimation, the MRSE is obtained by using (9) for the residual data defined in formula (2). Note that the reconstruction error is a strict error measure and its use requires higher accuracy from autoencoding compared to other measures: with the Wine dataset in Fig. 1, the linear PCA needs all dimensions of the rotated coordinate axis for the reconstruction whereas already 10 principal components out of 13 would explain over 96% of the data variance. An example of determining the intrinsic dimension of the Glass dataset (see the next section) is presented in Fig. 3. In the figure, the x-axis ‘‘SqDim” presents the squeezing dimension and the yaxis on the left the ‘‘MRSE” and on the right its change ‘‘ D (MRSE)” (i.e., backward difference) for the symmetric model with one hidden dimension (1S YM ) and the corresponding nonsymmetric model 1H ID . The intrinsic dimension of data is detected by first locating a sufficiently small change in the autoencoding error (the right plot). For this purpose, a user-defined threshold s = 4e-3 is applied. The detected dimension 5 on the left, marked with a circle, is the dimension below the threshold on the right minus one. The intrinsic dimension 5 is also characterized by a clear knee point in the MRSE behavior. 4. Results The main focus of the computational experiments, which are fully reported in the Supplementary Material (SM), was to investigate the ability of the proposed additive autoencoder model to represent a dataset in a lower-dimensional space. Therefore, we confined ourselves to the use of Matlab as the platform (mimicking the experiments in [23]) to have full control over the realization of the methods in order to study the effects of different parameters and configurations. Reference implementation of the proposed method and its basic testing is available in GitHub 1 . We apply and compare the following set of techniques to approximate the nonlinear residual of the autoencoder, after normalization and identification of the linear trend: 1H ID (model with one hidden layer and separate weight matrices for the encoder and the decoder), 1S YM (symmetric model with one hidden layer and a shared weight matrix), 3S YM (three-hidden-layer symmetric model with two shared weight matrices), 5S YM , and 7S YM . To systematically increase the flexibility and the approximation capability of the deeper models, the sizes of the layers for l¼e L;...;1 are given below, where ne L is the size of the squeezing layer: 3S YM :ne L –2ne L –n, 5S YM :ne L –2ne L –4ne L –n, 7S YM :ne L –2ne L –3ne L –4ne L –n. Note that for ne L >n=2 the size of the second layer and, therefore, the dimension of the first intermediate representation, is larger than the input dimension for all these models. 4.1. Identification of the intrinsic dimension The first purpose of the experiments was to search for the intrinsic dimension of a dataset via autoencoding. This was done using the shallow models 1S YM and 1H ID . The optimization settings and visualization of all results are given in the online SM. The experiments were carried out for two groups of datasets, one with small-dimension data (less than 100 features) and the other with large-dimension data (up to 1024 features). The datasets were obtained from the UCI repository [111], except the FashMNIST, which was downloaded from GitHub 2 . For most of the datasets, only the training data was used; however, with Madelon, the given training, testing, and validation datasets were combined. The datasets do not contain missing values. The constant features were identified and eliminated according to whether the difference between the maximum and minimum values of a feature was less than ffiffiffiffiffiffiffiffiffiffiffiffi MEps p, where MEps denotes machine epsilon (this is classically used numerical proxy of zero, see [96, p. 12]). Because of this preprocessing, the number of features nin Tables 2 and 3 is not necessarily the same as that in the UCI repository. During the search, the squeezing dimension for the smalldimension datasets began from one and was incremented one by one up to n1. For the large-dimension cases, we began from 10 and used increments of 10 until the maximum squeezing dimension b0:6ncwas reached (cf. the ‘‘Red” values in Tables 2 and 3). The experiments were run with Matlab on a Laptop with 2.3 GHz Intel i7 processor and 64 GB RAM and on a server with a Xeon E5-2690 v4 CPU and 384 GB of memory. Fig. 3. Identification of the intrinsic dimension for the Glass dataset. The hidden dimension (plus one) on the left is captured by the sufficiently small error improvement on the right. 1 https://github.com/TommiKark/AdditiveAutoencoder 2 https://github.com/zalandoresearch/fashion-mnist T. Kärkkäinen and J. Hänninen Neurocomputing 551 (2023) 126520 7
In Tables 2 and 3, we present the name of the dataset, the number of observations N, the number of features n, and the detected intrinsic dimension ID. The autoencoding error trajectories and thresholdings are illustrated for all datasets in the online SM. The detection threshold for small-dimension datasets was fixed to s = 4e-3. The reduction rate ID=nfor the intrinsic data dimension is Table 2 Results of the identification of the intrinsic dimension for small-dimension datasets. The intrinsic dimensions were identified with the reduction rates varying between 0.41–0.54. The SteelPlates and COIL2000 (with the most discrete feature profile) have the best reduction rate. The residual errors are between 1.1e-2–4.3e-4. Dataset NnID Red MRSE FeatProf (%) Glass 214 10 5 0.50 1.3e-3 10–40-50–0 Wine 178 13 7 0.54 1.2e-3 0–46-54–0 Letter 20 000 16 8 0.50 9.4e-4 0–100-0–0 SML2010 2 763 17 9 0.53 5.4e-4 0–12-18–71 FrogMFCC 7 195 22 11 0.50 1.1e-3 0–0-5–95 SteelPlates 1 941 27 11 0.41 4.3e-3 11–11-56–22 BreastCancerW 569 30 14 0.47 6.9e-3 0-0–100-0 Ionosphere 351 33 17 0.52 1.9e-3 3–0-97–0 SatImage 6 435 36 18 0.50 4.3e-4 0–75-25–0 SuperCond 21 263 82 37 0.45 1.1e-2 2–1-12–84 COIL2000 5 822 85 35 0.41 2.8e-2 99–1-0–0 Table 3 Results of the identification of the intrinsic dimension for large-dimension datasets. The intrinsic dimensions were identified with the reduction rates varying between 0.39–0.55. The HumActRec dataset with a continuous feature profile has the best reduction rate. The residual errors are between 8.0e-2–2.9e-3. Dataset NnID Red MRSE FeatProf (%) USPS 9 298 256 130 0.51 2.9e-3 0–0-0–100 BlogPosts 52 397 277 130 0.47 3.9e-3 79–8-12–1 CTSlices 53 500 379 180 0.47 6.3e-2 8–4-10–78 UJIIndoor 19 937 473 200 0.42 7.0e-2 26–73-1–0 Madelon 4 400 500 250 0.50 7.9e-2 2–31-67–0 HumActRec 7 351 561 220 0.39 8.0e-2 0–2-0–98 Isolet 7 797 617 310 0.50 9.4e-3 1–6-14–80 MNIST 60 000 717 350 0.49 9.3e-3 9–14-77–0 FashMNIST 60 000 784 380 0.48 5.0e-2 0–2-98–0 COIL100 7 200 1 024 560 0.55 6.4e-3 0–11-89–0 Fig. 4. Identification of the intrinsic dimension for the Letter dataset and SuperCond dataset. Left: Clearly identified knee-point in ID = 8 for Letter. Right: Gradual decrease of MRSE with ID = 37 for SuperCond. Fig. 5. Identification of the intrinsic dimension for the MNIST dataset. The hidden dimension (plus one) on the left is captured by the sufficiently small error improvement on the right. Left: Gradual decrease of MRSE with ID = 350 for MNIST. Right: Zoom of MRSE improvement with the threshold s = 3e-3 confirms the detection. T. Kärkkäinen and J. Hänninen Neurocomputing 551 (2023) 126520 8
[54] N. Janakarajan, J. Born, M. Manica, A fully differentiable set autoencoder, in: Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2022, pp. 3061–3071. [55] J. Deng, S. Frühholz, Z. Zhang, B. Schuller, Recognizing emotions from whispered speech based on acoustic feature transfer learning, IEEE Access 5 (2017) 5235–5246. [56] C. Sun, M. Ma, Z. Zhao, S. Tian, R. Yan, X. Chen, Deep transfer learning based on sparse autoencoder for remaining useful life prediction of tool in manufacturing, IEEE transactions on industrial informatics 15 (4) (2018) 2416–2425. [57] M. Sun, H. Wang, P. Liu, S. Huang, P. Fan, A sparse stacked denoising autoencoder with optimized transfer learning applied to the fault diagnosis of rolling bearings, Measurement 146 (2019) 305–314. [58] M.A. Chao, B.T. Adey, O. Fink, Implicit supervision for fault detection and segmentation of emerging fault types with deep variational autoencoders, Neurocomputing 454 (2021) 324–338. [59] N. Amini, Q. Zhu, Fault detection and diagnosis with a novel source-aware autoencoder and deep residual neural network, Neurocomputing 488 (2022) 618–633. [60] S. Kim, Y.-K. Noh, F.C. Park, Efficient neural network compression via transfer learning for machine vision inspection, Neurocomputing 413 (2020) 294– 304. [61] W. Sheng, X. Li, Siamese denoising autoencoders for joints trajectories reconstruction and robust gait recognition, Neurocomputing 395 (2020) 86– 94. [62] Z. Cao, X. Li, Y. Feng, S. Chen, C. Xia, L. Zhao, Contrastnet: Unsupervised feature learning by autoencoder and prototypical contrastive learning for hyperspectral imagery classification, Neurocomputing 460 (2021) 71–83. [63] G. Lin, C. Fan, W. Chen, Y. Chen, F. Zhao, Class label autoencoder with structure refinement for zero-shot learning, Neurocomputing 428 (2021) 54– 64. [64] J. Song, G. Shi, X. Xie, Q. Wu, M. Zhang, Domain-aware stacked autoencoders for zero-shot learning, Neurocomputing 429 (2021) 118–131. [65] D. Sun, W. Xie, Z. Ding, J. Tang, Silp-autoencoder for face de-occlusion, Neurocomputing 485 (2022) 47–56. [66] X. Yue, J. Li, J. Wu, J. Chang, J. Wan, J. Ma, Multi-task adversarial autoencoder network for face alignment in the wild, Neurocomputing 437 (2021) 261– 273. [67] W. Yin, L. Li, F.-X. Wu, A semi-supervised autoencoder for autism disease diagnosis, Neurocomputing 483 (2022) 140–147. [68] Q. Zhou, B. Li, P. Tao, Z. Xu, C. Zhou, Y. Wu, H. Hu, Residual-recursive autoencoder for accelerated evolution in savonius wind turbines optimization, Neurocomputing 500 (2022) 909–920. [69] A. Khajenezhad, H. Madani, H. Beigy, Masked autoencoder for distribution estimation on small structured data sets, IEEE Transactions on Neural Networks and Learning SystemsEarly Access, to appear. [70] Y. Ikeda, K. Tajiri, Y. Nakano, K. Watanabe, K. Ishibashi, Estimation of dimensions contributing to detected anomalies with variational autoencoders, arXiv preprint arXiv:1811.04576. [71] Y. Gao, B. Shi, B. Dong, Y. Chen, L. Mi, Z. Huang, Y. Shi, RVAE-ABFA: robust anomaly detection for highdimensional data using variational autoencoder, in: 2020 IEEE 44th Annual Computers, Software, and Applications Conference (COMPSAC), IEEE, 2020, pp. 334–339. [72] Y. Liu, Y. Lin, Q. Xiao, G. Hu, J. Wang, Self-adversarial variational autoencoder with spectral residual for time series anomaly detection, Neurocomputing 458 (2021) 349–363. [73] Q. Yu, M. Kavitha, T. Kurita, Autoencoder framework based on orthogonal projection constraints improves anomalies detection, Neurocomputing 450 (2021) 372–388. [74] N. Li, F. Chang, C. Liu, Human-related anomalous event detection via spatialtemporal graph convolutional autoencoder with embedded long short-term memory network, Neurocomputing 490 (2022) 482–494. [75] S. Narayanan, R. Marks, J.L. Vian, J. Choi, M. El-Sharkawi, B.B. Thompson, Set constraint discovery: missing sensor data restoration using autoassociative regression machines, in: Proceedings of the 2002 International Joint Conference on Neural Networks. IJCNN’02, Vol. 3, IEEE, 2002, pp. 2872–2877. [76] N. Abiri, B. Linse, P. Edén, M. Ohlsson, Establishing strong imputation performance of a denoising autoencoder in a wide range of missing data problems, Neurocomputing 365 (2019) 137–146. [77] X. Lai, X. Wu, L. Zhang, W. Lu, C. Zhong, Imputations of missing values using a tracking-removed autoencoder trained with incomplete data, Neurocomputing 366 (2019) 54–65. [78] Y. Zhou, Z. Ding, X. Liu, C. Shen, L. Tong, X. Guan, Infer-avae: An attribute inference model based on adversarial variational autoencoder, Neurocomputing 483 (2022) 105–115. [79] L. Tran, X. Liu, J. Zhou, R. Jin, Missing modalities imputation via cascaded residual autoencoder, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017, pp. 1405–1414. [80] J. Zhao, Y. Nie, S. Ni, X. Sun, Traffic data imputation and prediction: An efficient realization of deep learning, IEEE Access 8 (2020) 46713–46722. [81] L. Li, M. Franklin, M. Girguis, F. Lurmann, J. Wu, N. Pavlovic, C. Breton, F. Gilliland, R. Habre, Spatiotemporal imputation of MAIAC AOD using deep learning with downscaling, Remote sensing of environment 237 (2020). [82] M. Sangeetha, M.S. Kumaran, Deep learning-based data imputation on timevariant data using recurrent neural network, Soft Computing 24 (17) (2020) 13369–13380. [83] S. Ryu, M. Kim, H. Kim, Denoising autoencoder-based missing value imputation for smart meters, IEEE Access 8 (2020) 40656–40666. [84] A. Ahmed, K. Saleem, O. Khalid, J. Gao, U. Rashid, Trust-aware denoising autoencoder with spatial-temporal activity for cross-domain personalized recommendations, Neurocomputing 511 (2022) 477–494. [85] P. Nousi, S.-C. Fragkouli, N. Passalis, P. Iosif, T. Apostolatos, G. Pappas, N. Stergioulas, A. Tefas, Autoencoder-driven spiral representation learning for gravitational wave surrogate modelling, Neurocomputing 491 (2022) 67–77. [86] L. Alzubaidi, J. Zhang, A.J. Humaidi, A. Al-Dujaili, Y. Duan, O. Al-Shamma, J. Santamaría, M.A. Fadhel, M. Al-Amidie, L. Farhan, Review of deep learning: concepts, CNN architectures, challenges, applications, future directions, Journal of big Data 8 (1) (2021) 1–74. [87] V. Carletti, A. Greco, G. Percannella, M. Vento, Age from faces in the deep learning revolution, IEEE transactions on pattern analysis and machine intelligence 42 (9) (2020) 2113–2132. [88] S. Chen, Q. Zhao, Shallowing deep networks: Layer-wise pruning based on feature representations, IEEE transactions on pattern analysis and machine intelligence 41 (12) (2018) 3048–3056. [89] C. Guo, G. Pleiss, Y. Sun, K.Q. Weinberger, On calibration of modern neural networks, arXiv preprint arXiv:1706.04599 (2017). [90] S. Lathuilière, P. Mesejo, X. Alameda-Pineda, R. Horaud, A comprehensive analysis of deep regression, IEEE transactions on pattern analysis and machine intelligence 42 (9) (2020) 2065–2081. [91] T. Elsken, J.H. Metzen, F. Hutter, Neural architecture search: A survey, The, Journal of Machine Learning Research 20 (1) (2019) 1997–2017. [92] T.J. Sejnowski, The unreasonable effectiveness of deep learning in artificial intelligence, Proceedings of the National Academy of SciencesWww.pnas.org/ cgi/doi/10.1073/pnas.1907373117. [93] S. Yu, J.C. Principe, Understanding autoencoders with information theoretic concepts, Neural Networks 117 (2019) 104–123. [94] A. Pinkus, Approximation theory of the mlp model in neural networks, Acta Numerica 8 (1999) 143–195. [95] K. Hornik, M. Stinchcombe, H. White, Multilayer feedforward networks are universal approximators, Neural Networks 2 (5) (1989) 359–366. [96] J.E. Dennis Jr., R.B. Schnabel, Numerical Methods for Unconstrained Optimization and Nonlinear Equations, Vol. 16, Siam, 1996. [97] J. Nocedal, S. Wright, Numerical Optimization, Springer Science & Business Media, 2006. [98] I. Goodfellow, Y. Bengio, A. Courville, Deep Learning, MIT Press, 2016. [99] D.P. Kingma, J. Ba, Adam: A method for stochastic optimization, in: Proceedings of International Conference on Learning Representations, 2015, arXiv: 1412.6980. [100] G. Taylor, R. Burmeister, Z. Xu, B. Singh, A. Patel, T. Goldstein, Training neural networks without gradients: A scalable ADMM approach, in: International Conference on Machine Learning (ICML), PMLR, 2016, pp. 2722–2731. [101] T. Kärkkäinen, E. Heikkola, Robust formulations for training multilayer perceptrons, Neural Computation 16 (4) (2004) 837–862. [102] N. Bellomo, L. Preziosi, Modelling mathematical methods and scientific computation, Vol. 1, CRC Press, 1994. [103] C.M. Bishop, Neural Networks for Pattern Recognition, Oxford University Press, 1995. [104] T. Kärkkäinen, M. Saarela, Robust principal component analysis of data with missing values, in: International Workshop on Machine Learning and Data Mining in Pattern Recognition, Springer, 2015, pp. 140–154. [105] A. Ghods, D.J. Cook, A survey of deep network techniques all classifiers can adopt, Data mining and knowledge discovery 35 (1) (2021) 46–87. [106] H. Gouk, E. Frank, B. Pfahringer, M.J. Cree, Regularisation of neural networks by enforcing lipschitz continuity, Machine Learning 110 (2) (2021) 393–416. [107] Y.O. Bengio, Learning deep architectures for ai, Foundations and trends, Machine Learning 2 (1) (2009) 1–127. [108] K. He, X. Zhang, S. Ren, J. Sun, Deep residual learning for image recognition, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 770–778. [109] R.L. Thorndike, Who belongs in the family?, Psychometrika 18 (4) (1953) 267–276 [110] T. Kärkkäinen, On cross-validation for MLP model evaluation, in: Joint IAPR International Workshops on Statistical Techniques in Pattern Recognition (SPR) and Structural and Syntactic Pattern Recognition (SSPR), Springer, 2014, pp. 291–300. [111] D. Dua, C. Graff, UCI Machine Learning Repository (2017). URL: http://archive. ics.uci.edu/ml. [112] Y. LeCun, B.E. Boser, J.S. Denker, D. Henderson, R.E. Howard, W.E. Hubbard, L. D. Jackel, Handwritten digit recognition with a back-propagation network, in: Advances in Neural Information Processing Systems, 1990, pp. 396–404. [113] L. Song, H. Ma, M. Wu, Z. Zhou, M. Fu, A brief survey of dimension reduction, in: International Conference on Intelligent Science and Big Data Engineering, Springer, 2018, pp. 189–200. [114] J.T. Vogelstein, E.W. Bridgeford, M. Tang, D. Zheng, C. Douville, R. Burns, M. Maggioni, Supervised dimensionality reduction for big data, Nature communications 12 (1) (2021) 1–9. T. Kärkkäinen and J. Hänninen Neurocomputing 551 (2023) 126520 15
Tommi Kärkkäinen (TK) received the Ph.D. degree in Mathematical Information Technology from the University of Jyväskylä (JYU), in 1995. Since 2002 he has been serving as a full professor of Mathematical Information Technology at the Faculty of Information Technology (FIT), JYU. TK has led 50 different R&D projects and has been supervising 60 PhD students. He has published over 200 peer-reviewed articles. TK received the Innovation Prize of JYU in 2010. He has served in many administrative positions at FIT and JYU, leading currently a Research Division and a Research Group on Human and Machine based Intelligence in Learning. The main research interests include data mining, machine learning, learning analytics, and nanotechnology. He is a senior member of the IEEE. Jan Hänninen received the BSc and MSc degrees in Mathematical Information Technology from the University of Jyväskylä, Department of Mathematical Information Technology. He is working towards the PhD degree in Mathematical Information Technology at the Faculty of Information Technology, University of Jyväskylä. His research interests include neural networks, nonlinear optimization, and computational efficiency. T. Kärkkäinen and J. Hänninen Neurocomputing 551 (2023) 126520 16