--- title: Submission Template emoji: 🔥 colorFrom: yellow colorTo: green sdk: docker pinned: false --- # Classification Model for Climate Disinformation Classification ## Global Informations The aim of this model is to detect illegal deforestation thanks to audio clips. Our objective is to make this AI system the most frugal possible. When you're new to AI for audio processing and you're looking for information on the Internet, the following methodology is often described: transform the audio signal into a spectrogram (2D image) and then have it analyzed by a CNN. It can be necessary when you're working on very precise task such as transcription, but it's too heavy for our task, which is simply to detect chainsaw noises. So, for our baseline, we used an mfcc transform to preprocess the data with, then we transformed the 2D output un a 1D by taking the mean for each feature and finally we applied a basic ml classification algorithm like Random Forest. Then, we tried to optimize the 2 different stages: the data preprocessing (to make it simple, quick and to create the smallest possible preprocessed dataset) and the ml model itself. At this point, we noticed than the preprocessing of our data (with the mfcc transformation) was consuming 12 times more than our model training and inference so we mostly worked on optimizing the data preprocessing part. Here are our main ideas : 1. The data preprocessing: * Compare different methods of audio feature extraction * Decrease the size of the data to analyse (i.e. by decreasing the sampling rate, take only a small sample of the initial audio of 3s, since we don’t really need several seconds to identify a sound, remove unnecessary data (as with plots we can see that the characteristic sounds of chainsraw are observed between 200Hz & 1000Hz)) * Decrease the number of features extracted 2. The ml model: * Use the most lightweighted model : Avoid neural networks and compare basic ml classification algorithms for example knn is 3 times less energy consuming than the Random Forest with a non-significant loss of accuracy ## Submitted models Model 1: * Data preprocessing: Resampling to 6000Hz and using librosa mfcc method to calculate 7 MFCC * Energy consumption for the processing of the training dataset : 0.005349 kWh * Model: KNN * Energy consumption for the training of the model : 0.000002 kWh Model 2: * Data preprocessing: Resampling to 6000Hz and using librosa mfcc method to calculate 10 MFCC * Energy consumption for the processing of the training dataset : 0.005648 kWh * Model: Random Forest * Energy consumption for the training of the model : 0.000326 kWh The 2nd model has better accuracy but is less energy efficient. ## Other avenues for optimization We learned a lot about all the possible optimizations but unfortunately, we didn't keep all of them for the final submission, as they led to an excessive loss of precision (~85% accuracy), they are described below : * Use a less complex method of audio feature extraction (example: spectral centroid is 5 times faster than mfcc) * Focus our analysis on the frequencies that really matter for chainsaws (from 0 to 20,000Hz) * Use less data (shortest audio), i.e. keep randomly only 0.2s of audio for each audio of the dataset before extracting features with mfcc and then also take only a small sample of each audio of the test dataset to predict the label