# MFCC Selection by LASSO for Honey Bee Classification
## 2 Materials and Methods
### Classification by Autoencoder Neural Networks  
An autoencoder neural network [43; 44; 45] in a classification task operates in two stages: the encoding phase and the decoding phase (see Figure 5). In the encoding phase, the neural network is tasked with transforming the input information, such as an image or text, into an efficient representation in the form of a lower-dimensional encoded vector. The network consists of an input layer, a hidden layer, and an output layer. The input layer receives the input data and then transforms them using internal weights and activation functions. The hidden layers, which are usually smaller in size than the input layer, encode the information by reducing its dimensionality. In the decoding phase, the neural network reconstructs the input data based on the code in one of the hidden layers. At this point, the quality of the reconstruction can be evaluated based on the calculated difference between the input and output data. In a classification task, an autoencoder neural network can be used as a method to determine the vector representation of input data. After the encoding phase, a condensed vector (a code) is obtained that represents the data. Then, such a vector can be passed to another classifier, such as the output layer, which performs classification based on the received representation. As a result, an autoencoder neural network can serve as a feature reducer in a classification task, which can increase the efficiency of the classifier. In audio signal recognition, autoencoder neural networks can be used to learn compact representations of audio signals that capture their essential features [44; 45]. This can be useful for tasks such as pattern recognition, classification, identification, anomaly detection, or noise reduction. By training an autoencoder on a large data set of audio signals, the network can learn to extract features that are relevant to the task at hand, while also discarding noise and irrelevant information. One common approach to using autoencoders in audio signal recognition is to train the network on a reconstruction task, where the input is an audio signal and the output is the reconstructed audio signal [43; 44]. The loss function used during training is typically a measure of the difference between input and output signals, such as the mean squared error (MSE) or the mean absolute error. Once the network is trained, the compressed representation learned by the encoder can be used as a feature vector for identifying or classifying different types of audio signals. The scheme of such a network is shown in Figure 5.  
For the classification of honey bees, an autoencoder neural network had the following structure, shown in Figure 5, with 4 fully connected hidden layers in total: 2 hidden layers for the encoder and 2 hidden layers for the decoder. In the encoder, all hidden layers had ReLu activation functions. In the decoder, one hidden layer used ReLu (the layer called code), and the second one, the sigmoid activation function. The size of the input layer depends on the size of the feature vector, and the exact number of features are presented in Section 3 regarding the results. The code layer in our autoencoder structure was a vector of size 8. The general approach to applying the autoencoder to the drone bee detection task was as follows: the autoencoder neural network was trained on the feature vectors obtained from the worker bee audio recordings only, minimizing the reconstruction mean square error for the coefficient vectors reconstructed by the decoder. A feature vector representing a drone bee audio recording, which has been input to the autoencoder (already trained on worker bees recordings) is then considered an anomaly, and produces a much higher reconstruction MSE than for an average worker bee recording.