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

Intelligent Systems for Pattern Recognition (6 CFU) - Old course - Deprecated page

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

Midterm 2 (2021)

Completion requirements
Due: Monday, 3 May 2021, 12:00 PM

Assignment Rules and Execution

The second midterm covers the generative models introduced up to Lecture 11. To pass the midterm you should

  1. perform one (only one) of the assignments described in the following;
  2. prepare the short presentation describing your results and upload it here by the (strict) deadline;
  3. give your short presentation in front of the class on the midterm date (May the 03rd, 2021, h. 13.30).

You can use library functions to perform the analysis (e.g. implementations of HMMs, LDA, etc., as well as helper functions, e.g. to extract visual patches, etc.) unless explicitly indicated (e.g. Assignment 3 and 4). You can use whatever programming language you like, but I strongly suggest to use either Python or Matlab for which you have coding examples.

The midterm presentation MUST take a maximum of 3 minutes and should include a maximum of 5 slides, whose content should cover:

  1. A title slide with the assignment number and your name
  2. (only needed for assignement 3 and 4) A slide with code snippets highlighting the key aspects of your code
  3. Slides showing the results of the analysis
  4. A final slide with your personal considerations (fun things, weak aspects, possible ways to enhance the analysis, etc.).

Don’t waste slides and time to describe the dataset or the assignment you are solving as we will all be already informed on it.

Assignments are based on the following two datasets already used in Midterm 1: refer to Midterm 1 page for details on the content.

DSET1 (Signal processing): https://archive.ics.uci.edu/ml/datasets/Appliances+energy+prediction#

DSET2 (Image processing): http://download.microsoft.com/download/A/1/1/A116CD80-5B79-407E-B5CE-3D5C6ED8B0D5/msrc_objcategimagedatabase_v1.zip

In addition to these datasets from Midterm 1, Assignment 3 is based on the well-known MNIST dataset:

DSET3 (Image processing): http://yann.lecun.com/exdb/mnist/

List of Midterm Assignments

Assignment 1

Fit an Hidden Markov Model with Gaussian emissions to the data in DSET1: it is sufficient to focus on the “Appliances” and “Lights” columns of the dataset which measure the energy consumption of appliances and lights, respectively, across a period of 4.5 months. Consider the two columnsin isolation, i.e. train two separate HMM, one for appliances and one for light.  Experiment with HMMs with a varying number of hidden states (e.g. at least 2, 3 and 4). Once trained the HMMs, perform Viterbi on a reasonably sized subsequence (e.g. 1 month of data) and plot the timeseries data highlighting (e.g. with different colours) the hidden state assigned to each timepoint by the Viterbi algorithm.  Then, try sampling a sequence of at least 100 points from the trained HMMs and show it on a plot discussing similarities and differences w.r.t. the ground truth data.

Assignment 2

Implement a simple image understanding application for DSET2 using the LDA model and the bag of visual terms approach described in Lecture 9. For details on how to implement the approach see the BOW demo and paper [10] referenced on the Moodle site.  Keep one picture for each image subset (identified by the initial digit in the filename) out of training for testing. In short:

1.     For each image (train and test) extract the SIFT descriptors for the interest points identified by the SIFT detector (you are free to use a different detector if you wish; even grid sampling).

2.     Learn a 500-dimensional codebook (i.e. run k-means with k=500 clusters) from  the SIFT descriptors of the training images (you can choose a subsample of them if k-means takes too long).

3.     Generate the bag of visual terms for each image (train and test): use the bag of terms for the training images to train an LDA model (use one of the available implementations). Choose the number of topics as you wish (but reasonably).

4.     Test the trained LDA model on test images: plot (a selection of) them with overlaid visual patches coloured with different colours depending on the most likely topic predicted by LDA.

Assignment 3

Implement from scratch an RBM and apply it to DSET3. The RBM should be implemented fully by you (both CD-1 training and inference steps) but you are free to use library functions for the rest (e.g. image loading and management, etc.).

1.     Train an RBM with 100 hidden neurons (single layer) on the MNIST data (use the training set split provided by the website).

2.     Use the trained RBM to encode all the images using the corresponding activation of the hidden neurons.

3.     Train a simple classifier (e.g. any simple classifier in scikit) to recognize the MNIST digits using as inputs their encoding obtained at step 2. Use the standard training/test split. Show the resulting confusion matrices (training and test) in your presentation.

(Alternative to step 3, optional) Step 3 can as well be realized by placing a softmax layer after the RBM: if you are up for it, feel free to solve the assignment this way.

Assignment 4

Disclaimer: this assignment is only for those strongly motivated to play with Bayesian Network and sampling

Implement a Bayesian Network (BN) comprising at least 10 nodes, all with binomial or multinomial distribution. Represent the BN with the data structures that you deem appropriate and in the programming language that you prefer. The BN should model some problem/process of your choice, so you are also free to define the topology according to your prior knowledge (just be ready to justify your choices). For instance, you can define a BN to represent a COVID diagnosis through a certain number of events/exams/symptoms: e.g. Cough, Cold, Fever, Breathing problems, Swab Exam, etc. Or you can model your daily routine: Wakeup, Coffee, Toilet, Study, Lunch, etc.

Once you have modelled the BN, also plug in the necessary local conditional probability tables. You can set the values of the probabilities following your own intuition on the problem (ie no need to learn them from data). Then run some episoded of Ancestral Sampling on the BN and discuss the results.

The assignment needs to be fully implemented by you, without using BN libraries.

◄ Midterm 1 (2021)
Midterm 3 (2021) ►

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-6CFU (Until 2021)

          • News

          • Course Information

          • Lectures and Calendar

          • Course Grading and Exams

          • Midterms and Projects

            • AssignmentMidterm 1 (2021)

            • AssignmentMidterm 2 (2021)

            • AssignmentMidterm 3 (2021)

            • AssignmentFinal Projects (2020/2021)

            • AssignmentMidterm 4 (2021)

            • AssignmentISPR Midterm 4 & Final Project Delivery - Sess...

            • AssignmentISPR Midterm 4 & Final Project Delivery - Sess...

            • AssignmentISPR Midterm 4 & Final Project Delivery - Sess...

            • AssignmentISPR Midterm 4 & Final Project Delivery - Sess...

            • AssignmentISPR Midterm 4 & Final Project Delivery - Sess...

            • AssignmentISPR Midterm 4 & Final Project Delivery - Sess...

            • AssignmentFinal Project Delivery - Session 9 (Spring 2022)

          • Past Editions

          • References

      • 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-6CFU (Until 2021)
Data retention summary
Get the mobile app