# A Multi-Site Anti-Interference Neural Network for ASD Classification
## 2 Materials and Methods
### Site Feature Learning  
We use autoencoder (AE) and site average pools to extract site image features from functional connections. The low-dimensional vectors reflecting the individual characteristics of the subject are obtained by using the autoencoder, and the average vectors of all individual feature vectors in the site are calculated by using the site average pool. From this, we can obtain low-dimensional feature vectors that can reflect site information. Autoencoder is a kind of feedforward neural network, which is composed of encoder and decoder, where the encoder encodes the input data \(x\) into a low-dimensional representation, as shown in Formula (1). \[h_{enc}=\phi_{enc}(x)=f(W_{enc}x+b_{enc}) \tag{1}\]  
\(f\) is the activation function, \(W_{enc}\) and \(b_{enc}\) are the weight and bias of the encoder, respectively. The decoder reconstructs the output of the encoder back to the original input data, as shown in Formula (2), where \(W_{dec}\) and \(b_{dec}\) are the weight and bias of the decoder, respectively. \[x^{\prime}=\phi_{dec}(h_{enc})=W_{dec}h_{enc}+b_{dec} \tag{2}\]  
The autoencoder completes the model training by minimizing the reconstruction Error. The loss function is the Mean Squared Error (MSE) between the input data \(x\) and the reconstruction result \(x^{\prime}\). After the encoder completes the training, the output of the encoder can be regarded as a low-dimensional feature of the input data \(x\). Using the characteristics of unsupervised training and nonlinear dimensionality reduction of the autoencoder, the low-dimensional individual feature vector of the subject is extracted first. Because the functional connection matrix is symmetric, the upper triangle part of the matrix is repeated with the lower triangle part. In order to reduce the parameter number of the autoencoder and speed up the training efficiency, the lower triangle part containing the main diagonal is deleted, and the upper triangle part is planar as a one-dimensional vector as the input of the autoencoder. The autoencoder adopts a single hidden-layer structure, and the encoder part and the decoder part are a single-layer fully connected layer. The autoencoder weights are 19,900 \(\times\) N and N \(\times\) 19,900, respectively, where N is the embedded dimension of the hidden layer, which is determined by hyperparameter optimization. The data of all site subjects are used as input to train the model, and the optimal model is saved in the position with the least loss value. Then, the output vector of the encoder is obtained by feeding the one-dimensional function connection vector into the autoencoder, which is a low-dimensional vector reflecting the individual characteristics of the subject. In order to further obtain the feature vector that can reflect the difference information of the sites, the mean vector of the individual feature vector of all subjects in each site is calculated by site average pooling. The reason is that we use the mean of individual characteristics of the subjects in the site to reflect the characteristics of a site as a whole. The process is shown in Figure 3.  
In addition to site heterogeneity in functional connections, site heterogeneity was also included in subjects' phenotypic information. However, the amount of phenotypic information, such as age and gender, is much smaller than the number of site features extracted from functional connections. The dimension of the vector composed of phenotypic information may be single digits while the dimension of the feature vector extracted from functional connections is in the hundreds. Directly connecting the two vectors together may make it difficult to reflect the site heterogeneity contained in the phenotypic information. Therefore, we select features based on the cosine similarity between the site feature vector extracted from the functional connection and the phenotype information, so that the final site features contain the phenotype information indirectly.