Be the first to rate this file! 7 Downloads (last 30 days) File Size: 12.2 KB File ID: #33573

Windowed Gaussian Surprise and Running Windowed Mean / Variance

by Boris Schauerte

 

01 Nov 2011 (Updated 05 Feb 2012)

Compute the windowed Gaussian surprise/saliency of the data as well as the windowed mean/variance

| Watch this File

File Information
Description

This code calculates the (windowed!) running mean and variance as well as
the windowed Gaussian surprise for each newly added element.

A simple (and useless) usage example:

  data=rand(1,100); % randomly generate 100 1-D samples
  history_length=10; % use a window size of 10 samples
  [s1,m1,v1]=gaussian_windowed_surprise_ring_buffer(data,history_length);

where m1 is the running window mean, v1 is the variance in the window,
and s1 is the windowed Gaussian surprise (novelty, saliency,
interestingness, wow, ...).

Here is another example on how we can (very simply) calculate the
auditory surprise / acoustic surprise similar to the approach presented
in [1] (also see/run example_surprise.m):

  T = 0:0.001:2;
  X = [chirp(T,100,1,200,'q') chirp(T,100,1,200,'q')];
  Y=spectrogram(X,128,120,128,1E3);
  Z=abs(Y);
  surprise=mean(gaussian_windowed_surprise_ring_buffer(Z,10));
  figure('name','Demo: Surprise of the double chirp signal');
  plot(surprise);

However, in real applications you need to choose, e.g., a meaningful
frequency range and window length. Furthermore, please consider that the
values for the first elements (i.e., the first history_size-1 elements)
are wrong/broken and should be treated accordingly.

Please see [1] for details and an application of the Gaussian windowed
surprise and be so kind to cite [1], if you use the provided code.

[1] B. Schauerte, B. Kuehn, K. Kroschel, R. Stiefelhagen, "Multimodal
    Saliency-based Attention for Object-based Scene Analysis," in Proc.
    Int. Conf. Intelligent Robots and Systems (IROS), 2011.

(Please note that this is NOT the [reference/original] implementation
 that was applied in [1] and there ARE differences in the results due to
 different calculations/algorithms.)

MATLAB release MATLAB 7.12 (2011a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
20 Dec 2011 Adam

Hi, I can get the example scripts to run fine, but when I apply this to a data set of mine, I get all Nan for the surprise variable, even though the windowed mean and variance some out ok. Any idea why this is?

20 Dec 2011 Boris Schauerte

Hi Adam, if you send me the data (you will find my e-mail address on my web page), I will take a closer look at the issue (I tested the code on data from audio, some image processing, ... - so my experience does not cover all kinds of data). However, some first ideas: you could/should try both estimation methods and also have a closer look at the min_variance_value. Bests, Boris

Please login to add a comment or rating.
Updates
02 Nov 2011

- set the numerically more stable variance estimation as default
- minor interface adaptation of the C/C++ code

16 Nov 2011

- added a help
- minor C/C++ interface changes

05 Feb 2012

improved the documentation and added an example script

Tag Activity for this File
Tag Applied By Date/Time
saliency Boris Schauerte 01 Nov 2011 14:55:06
surprise Boris Schauerte 01 Nov 2011 14:55:06
interestingness Boris Schauerte 01 Nov 2011 14:55:06
novelty Boris Schauerte 01 Nov 2011 14:55:06
windowed mean Boris Schauerte 01 Nov 2011 14:55:06
running mean Boris Schauerte 01 Nov 2011 14:55:06
windowed variance Boris Schauerte 01 Nov 2011 14:55:07
running variance Boris Schauerte 01 Nov 2011 14:55:07
gaussian surprise Boris Schauerte 01 Nov 2011 14:55:07
windowed surprise Boris Schauerte 01 Nov 2011 14:55:07
bayesian surprise Boris Schauerte 02 Nov 2011 15:04:27

Contact us at files@mathworks.com