Skip to main content
INF - e-learning - Dipartimento di Informatica
You are currently using guest access (Log in)

Intelligent Systems for Pattern Recognition - 9 CFU

  1. Home
  2. Courses
  3. Corso di Laurea Magistrale in Informatica (LM-18)
  4. ISPR (9 CFU)
  5. Midterms and Projects
  6. Midterm 1 (2025)

Midterm 1 (2025)

Completion requirements
Due: Friday, 21 March 2025, 6:00 PM

Assignment Rules and Execution

The first midterm covers the basic pattern recognition techniques introduced up to Lecture 4. To pass the midterm you should

  1. perform one (only one) of the assignments described in the following;
  2. report your results as a Colab notebook or a 10 slide presentation (both versions are equally fine) and upload it here by the (strict) deadline;
In case you are delivering a Colabo notebook, please upload a txt file with the link to your Colab notebook (already ran). 
 

You can use library functions to perform the analysis (e.g. to do the DFT, to perform ncut clustering, etc.) unless explicitly indicated. You can use whatever programming language you like, but I strongly suggest to use either Python or Matlab for which you have coding examples. Python will further allow you to deliver your midterm as a Colab notebook, but this is not a requirement (you can deliver a presentation instead). 

Your report (irrespectively of whether it is a notebook or a presentation) needs to cover at least the following aspects (different assignments might have different additional requirements):

  1. A title with the assignment number and your name
  2. The full code to run your analysis (for Colabs) or a few slides (for presentations) with code snippets highlighting the key aspects of your code
  3. A section reporting results of the analysis and your brief comments on it
  4. A final section with your personal considerations (fun things, weak aspects, possible ways to enhance the analysis, etc.).

Do not waste time and space to describe the dataset or the assignment you are solving as we will all be already informed on it.

I do not espect state of the art performance: I am more interested in seeing that you have applied the technique correctly and that you can interpret the results, so do not invest heavy time in superoptimizing your results.

List of Midterm Assignments

Signal processing assignments

Assignment 1

Consider the following dataset: https://archive.ics.uci.edu/ml/datasets/Appliances+energy+prediction#

As you know, auto-regressive models assume weak stationarity. What happens if this assumption does not hold? To study the effect of non-stationarity, we will add a linear trend to the “Appliances” column of the dataset, which measures the energy consumption of appliances across a period of 4.5 months.
- First, preprocess the dataset to remove any trend (if necessary)
- Perform an autoregressive analysis on the clean time series
- Define a linear trend (i.e. a linear increase in time of the timeseries observations) and add it to the time series
- Perform the autoregressive analysis on the new time series

Show the results of the analysis with and without the linear trend, discussing your design choices and the results.
To perform the autoregressive analysis, fit an autoregressive model on the first 3 months of data and estimate performance on the remaining 1.5 months. Remember to update the autoregressive model as you progress through the 1.5 testing months. For instance, if you have trained the model until time T, use it to predict at time T+1. Then to predict at time T+2 retrain the model using data until time T+1. And so on. You might also try and experimenting with less "computationally heavy" retraining schedule (e.g. retrain only "when necessary").   You can use the autoregressive model of your choice (AR, ARMA, ...).

Hint: in Python, use the ARIMA class of the statsmodels library (set order=(3,0,0) for an AR of order 3); in Matlab you can use the ar function to fit the model and the forecast function to test.

Assignment 2

Consider the following dataset: https://www.kaggle.com/datasets/imsparsh/single-chestmounted-accelerometer

It contains accellerometer timeseries for 15 participants performing 7 different physical activities.

For this assignement focus on a single participant (of your choice) and study its 7 different activities using the Continous Wavelet Decomposition (CWD) approach discussed during the lectures. It suffices to compare the CWD visually and report you considerations on similarities and differences between the activities.

Note: you need to run the CDW separately for each accelerator channel. You can choose the wavelet family you prefer more (at random is also ok). In Python you may want to use Pywavelets or in Matlab the bundled Wavelet Toolbox (or you can use any other language and library that makes sense to you, but for this assignment I strongly advise Matlab).

Assignment 3

The musical pitch of a note is determined by its fundamental frequency. The pitch played by different instruments sounds different due to harmonics, i.e. other frequencies that are superimposed and determine the timbre of the instrument. This dataset contains samples from several instruments playing different notes. Plot the spectrogram for some of them (4 instruments are sufficient) and check if it is possible to recognize the different instruments by only looking at the spectrogram. In your presentation, discuss which samples you chose to compare, how you computed the spectrogram and whether the resulting features are sufficient to recognize the instrument.
 
In Python you can import WAVs (and acces several other music-related functions), using the LibROSA library.

Image processing assignments

All the image processing assignments require to use the following dataset:

www.kaggle.com/datasets/ztaihong/weizmann-horse-database/data

The dataset contains in the horse directory 327 pictures of horses and in the mask directory where each image correspond to one image in the horse directory, and reports the corresponding manual segmentation of the horse.

Assignment 4

Implement the convolution of a set of edge detection filters with an image and apply it to at three images of your choice from the dataset. Implement Roberts, Prewitt and Sobel filters (see here, Section 5.2, for a reference) and compare the results (it is sufficient to do it visually).  You should not use the library functions for performing the convolution or to generate the Sobel filter. Implement your own and show the code!

Assignment 5

Extract the SIFT descriptors using the visual feature detector embedded in SIFT from the horse pictures to identify the points of interest. Aggregate all the identified descriptors in a dataset and run k-means (or any clustering algorithm of your choice) on such data to partition the descriptors in clusters. Then analyze the obtained clusters by confronting the descriptors assigned to each cluster with the area of the semantic segmentation they end-up (in other words, compute a confusion matrix between the clusters and the 2 segmentation classes, horse and background). Discuss your findings. Choice of the number of clusters and of the clustering algorithm is on you (and should be discussed in the report).

Assignment 6

Implement the convolution of a Laplacian of a Gaussian blob (LoG) detector with an image and apply it to 3-4 images of your choice from the dataset. Do not use library functions for implementing the convolution or to generate the LoG filter. Implement your own and show the code (the interesting bits at least)! The function you implement should be able to run the LoG for different choices of the scale parameter, which is passed as an input argument. Show the results of your code on the 3-4 example images, for different choices of the scale parameter (sigma).

◄ Lecture 37 slides
Midterm 2 (2025) ►

Blocks

Skip Navigation

Navigation

  • Home

    • Site pages

      • My courses

      • Tags

      • ForumSite news

    • My courses

    • Courses

      • Corso di Laurea Magistrale in Informatica (LM-18)

        • CNS 2025

        • CMCS 2025

        • P2P2425

        • IQC(24-25)

        • ADB 24/25

        • CL 24/25

        • ICT-RA

        • AIF24-25

        • ML 2024

        • CM24

        • SDC 24/25

        • ISPR (9 CFU)

          • Intelligent Systems for Pattern Recognition - 9 CFU

          • Course Information

          • Introduction (2h)

          • Fundamentals of Pattern Recognition (6h)

          • Probabilistic (Generative) Learning (30h)

          • Deep Learning (18h)

          • Generative Deep Learning (10h)

          • Advanced Topics and Applications (8h)

          • Course Grading and Exams

          • Midterms and Projects

            • AssignmentMidterm 1 (2025)

            • AssignmentMidterm 2 (2025)

            • AssignmentMidterm 3 (2025)

            • AssignmentMidterm 4 (2025)

            • AssignmentFinal Projects (2025)

            • AssignmentFinal Project Delivery - Session 3 (Summer 2025)

            • AssignmentFinal Project Delivery - Session 4 (Summer 2025)

            • AssignmentFinal Project Delivery - Session 5 (Summer 2025)

            • AssignmentFinal Project Delivery - Session 10 (Spring 2025, ...

          • Bibliography

      • Corso di Laurea in Informatica (L-31)

      • Corso di Laurea Magistrale in Informatica e Networ...

      • Corso di Laurea Magistrale in Data Science and Bus...

      • Corso di Laurea Magistrale in Informatics for Digi...

      • Corsi erogati dal Dipartimento di Matematica

      • Master di II livello in "Professione formatore in ...

      • Corsi CLIL

      • Altri Corsi

      • Anno Accademico 2013-14

Blocks

You are currently using guest access (Log in)
ISPR (9 CFU)
Data retention summary
Get the mobile app