Code to run closed-loop experiment on the Dropfactory platform
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

This repository is associated to the paper "A soft matter discovery robot driven by child-like curiosity" by Jonathan Grizou, Laurie J. Points, Abhishek Sharma and Leroy Cronin. A draft version of the paper is available on Chemarxiv and a brief overview of the scientific approach can be found at

Dropfactory Exploration

Code used to run closed-loop droplet experiments using the curiosity (and other) algorithms.



The principles are described in details in the Supportng Information of the paper section 2.1.3 starting p83. The guiding principles are as follow:

Each experimental run requires three distinct steps, each feeding data to the next one in an iterative way:

  1. Perform experiments on the droplet system. This task is given to the Dropfactory platform. Dropfactory has only one role, it looks for experiments (in the form of a params.json file) to run in a specific folder and executes them. It then saves a video of the experiment as a video.avi file and an information file in the form of a run_info.json file with time, temperature and humidity information. This process is operated by the realworld_experiments/ script in this repository.

  2. Analyse the results of the experiments. This task is given to a specific, standalone and independent software running in its own thread. This process looks for droplet videos (in the form of video.avi files) in a specific folder (typically generated by the platform once an experiment is finalized) and process the file in three steps. It first extract frame by frame the contour of each droplets, then attempt to stitch together the droplet in each frame as time sequences and finally computes a bunch of metrics about the droplet motion in the form of a features.json file. See section 2.1.5 title “Droplet Tracking” of the SI and This process is operated by the realworld_experiments/ script in this repository.

  3. Decide on what experiment to do next. This task is given to a specific, standalone and independent software running in its own thread. This process looks for droplet features files (typically generated by the video droplet tracking in the form of a features.jsonfile) and an experimental parameter files in a specific folder. It gathers all this information and, depending on the algorithm selected, output a new experimental file (params.jsonfile) for the platform to execute. This process is operated by the script in this repository.

Repository Organization

Top-level scripts used to start experiments on the platform:

  • is the script used to create a folder with a configuration file representing an exeprimental run. This configuration file will contains the random seed, the algorithm type and parameters, as well as the number and configuration of droplet experiments.
  • realworld_experiments/ is the script that watch a folder for new droplet experiments (from the algorithm) and send them to the Dropfactory platform, which will output a video of the experiments.
  • realworld_experiments/ is the script that watch a folder for new droplet videos (from the Dropfacotry platform) and send them to the droplet tracking software, which will ouput metrics about the droplet motion.
  • is the script that watch a folder for new experimental observation (from the droplet tracking) and send them to the algorithm as new data, which will output a new droplet experiment parameters to be run on the Dropfactory platform.

An early practical guide to launch and monitor experiments is also available in the protocol release. It might be slighlty out of date but will point in the right direction with guiding principles.

Folders usage:

  • datasets folder contains data from previous work used to develop the code architecture and for debugging. When developping or debugging, the datasets are used to train a model that is used instead of running experiments on the Dropfacotry platform.
  • explauto_tools folder holds the code interfacing our work with the explauto library, for examples to define an environment, setup an experiment and run the selected algortihm to generate the next experiments.
  • models folder holds the regression methods used to generate a model from the data stored in the datasets folder. The model is used to speed up developping and debugging by bypassing the robotic platform.
  • realworld_experiments folder is where real droplet experiments performed on the platform are geenrated and stored.
  • simulated_experiments folder is where experiments are simulated using the model for developing and debugging, it is a simple way to test the code without having access to the robot.
  • tune_explauto_parameters folder was used to select the best parameters for the various algorithms by running experiments against our model.
  • utils contains a set of python tools useful for this work. Among them is utils/ that monitor folder to check for new data (e.g. a new droplet video) and the utils/ that contains tools to generate, monitor and extract experimental results in the correct location.

Associated repositories


This code has been tested under Python 2.7.6 on Ubuntu 14.04 LTS. Despite all our efforts, we cannot guarantee everything will be executable on other OS or Python version.

Aside from the standard libraries, we are using the following libraries. You do not have to install them all, it depends on the task you are performing.

  • opencv: Image analysis with python binding. Version: cv2.version is '2.4.8'

  • numpy: Scientific computing in Python. Version: numpy.version is '1.10.4'

  • scipy: More scientific computing in Python. Version: scipy.version is '0.16.1'

  • sklearn: Machine Learning in Python. Version: sklearn.version is '0.19.1'

  • explauto is the modified version of the explauto library from the Flowers Team ( for the prupose of this research.

  • filetools is a simple file management library

  • dropfactory should be installed and placed at the same level as the repository


Jonathan Grizou while working in the CroninGroup.