CZ4042 Neural Networks and Deep Learning

AY21/22, AY22/23, AY23/24

TA for CZ4042/SC4001, taught via TensorFlow/Keras (AY21/22, AY22/23) and PyTorch (AY23/24)


When designing the assignment questions, we utilised datasets unique to Singapore: speech recordings from the National Speech Corpus and a localised version of the quintessential ML dataset: HDB resale prices.

For the NSC dataset, we performed a polarity prediction task on a subset of the dataset (Part 5) that were recorded via mobile phones. These datasets contain audio recordings as well as orthographic transcripts (saved in TextGrid format). Part 5 contains, amongst several tasks, speech recordings of positive and negative emotions. 750 data samples, each containing about 20 minutes of speech, were available. These were divided into finer segments of ~10 seconds.

Features were engineered from the audio recordings via the librosa library, producing a range of features (including tempo, mel spectrograms / MFCC, harmonics, etc.) . These were then used as inputs to vanilla neural networks that the students were tasked to implement and tune. This part of the assignment concludes with an activity for students to preprocess and classify their own recordings.

For the HDB dataset, the dataset of housing prices was augmented with additional features such as distances from the flats to the nearest MRT and the city center. Since the original dataset only provided addresses, other databases were used to map them to coordinates (lat/long) so as to compute distances. Centrality measures were also computed based on the connectivity of the nearest MRT station.

This dataset was particularly interesting as this period of time (2021-2023) coincided with several rounds of government intervention to cool the housing market. Thus, beyond fundamental questions on implementing the model, other interesting questions we could set included:

  • How to use neural networks on categorical variables (e.g. encoding, embedding, etc)
  • Identifying the most important features via recursive feature elimination
  • Identifying the most important features via explainable AI algorithms in Captum such as (integrated) gradients, SHAP, etc.
  • Detecting data distributions drifts (e.g. via Alibi Detect) and dealing with model degradation
  • An interesting question on a quirk of Adam when working on regression problems (due to the way it is initialised) :)

Last updated: 23 August 2023