Skip to content


Folders and files

Last commit message
Last commit date

Latest commit


Repository files navigation

Multimodal Learning with NMF

A set of tools and experimental scripts used to achieve multimodal learning with nonnegative matrix factorization (NMF).

This repository contains code to reproduce the experiments from the publications:


O. Mangin, D. Filliat, L. ten Bosch, P.Y. Oudeyer, MCA-NMF: Multimodal concept acquisition with non-negative matrix factorization PLOS ONE (October 21, 2015) (bibtex)


O. Mangin, P.Y. Oudeyer, Learning semantic components from sub symbolic multi modal perception Joint IEEE International Conference on Development and Learning and on Epigenetic Robotics (ICDL EpiRob), Osaka (Japan) (2013) (bibtex)

Please consider citing these papers when re-using the code in scientific publications.


This code is intended to work on its own. It however requires the dependencies mentioned below to be installed and available on the operating system. Please note the following elements.

  • Locations: The file is meant to hold local configuration of paths to data, features, etc. A template is provided in the repository. The paths defined in that file are only used when no path argument is provided to related functions (for examples the dataset loaders, or feature generators).
  • Data: The experimental scripts require data (see below). This data must be accessible from the script and eventually pre-processed. For the motion data, pre-processing can be achieved through multimodal/db/scripts/build_choreo2_features. Alternatively, all features and metadata for the databases can be downloaded by running multimodal/db/scripts/download_dbs. This removes the need to pre-process the choreo2 dataset.
  • Experiments: Just run the experimental script. Be sure to generate the required features. For the moment, the ACORNS Caregiver dataset is not available online, however feature files can be provided on request.

So for a quick hand on, just:

  1. Install dependencies:
pip install numpy scipy matplotlib librosa
  1. Download and install the sources:
git clone
cd multimodal
python develop --user
  1. Download databases features and metadata (run from where you downloaded the repository):
  1. Reproduce [Mangin2013]'s experiment:

Source files hierarchy:


  • db: helpers to load and pre-process data
  • features: helpers to build features
  • lib: general purpose helpers
  • experiments: experimental scripts
  • test: a few unit tests

Main files in multimodal

  • This file contains the main logic of the experimental setup. It defines classes to run multimodal experiments in a consistent and simplified manner. These include data preparation, training and evaluation.
  • Contains a class that abstracts the process of learning from multiple modalities. Contains the learning mechanism based on the NMF algorithm (itself included in lib/
  • Helpers to evaluate learning results.
  • Helpers to generate associations of samples from different modalities with same labels.
  • Plot functions to generate specific figures.

Experimental scripts (in samples)

  • Runs experiments and generate results corresponding to Mangin2013. Uses Acorns Caregiver database for speech sounds as well as the Choreo2 dataset.
  • Runs experiments similar to Mangin2013 with speech sounds from the Acorns Caregiver database and images from the image database.
  • Script to run many experiments with variations of parameters. Requires expjobs and some time or a cluster.
  • Script to run experiments with speech sound and images in which the learner is evaluated on its recognition sound from small time windows.
  • Interactive and static plots from the previous experiment.
  • Script to generate plot of the mutual information between sample labels and internal coefficients. The script re-uses a trained dictionary obtained from
  • and run an experiment from a configuration file. Mainly used by


  • Acorns Caregiver is available online. Please refer to the article by Bergmann et al. for permission. However, feature and metadata files can be downloaded through the code (see the download_meta_and_features function in db/ or use multimodal/db/scripts/download_dbs). See also DOI-Acorns.
  • Choreo1 can be found at
  • Choreo2 can be found at See also DOI-Choreo for features.
  • Object images (not publicly available yet). Pictures acquired by Natalia Lyubova and David Filliat as frames from interaction with an iCub robot, through an RGBD sensor (red, green, and blue camera coupled with a depth sensor). Feature and meta files can be downloaded (see the download_meta_and_features function in db/ or use multimodal/db/scripts/download_dbs). See also DOI-Images.


This code is distributed under the new BSD license. Please see LICENSE for more details.



  • python >2.7 or >3
  • numpy
  • scipy
  • librosa (for sound feature computation)


A set of tools and experimental scripts used to achieve multimodal learning with nonnegative matrix factorization (NMF).







No releases published


No packages published