Gaussian Mixture Probability Hypothesis Density Filter (GM-PHD)

Implementation of the Gaussian mixture probability hypothesis density filter GM-PHD.
Updated 7 Jan 2014

View License

This is an implementation of the Gaussian mixture probability hypothesis density filter (GM-PHD) described in:
B.-N. Vo, W.-K. Ma, "The Gaussian Mixture Probability Hypothesis Density Filter", IEEE Transactions on Signal Processing, Vol 54, No. 11, November 2006, pp4091-4104.

The submission includes a Matlab implementation of the linear Kalman filter GM-PHD filter and the extended Kalman filter GM-PHD filter algorithms described by Vo & Ma, as well as one of the simulated problems described in their paper. A few modifications were made from Vo & Ma's algorithm but they are for technical reasons and don't change the overall structure of the filter.

The GM-PHD filter is a means of estimating the number and positions of targets in measurement data. Its advantages include a representation of target position uncertainty (using a covariance matrix) as well as target existence uncertainty (using a weight) and the absence of data association in the update step. This implementation is quite heavily commented and will probably be helpful to people trying to learn about GM-PHD filtering, but the paper by Vo & Ma is essential to understand what is really going on.

The simulator creates noisy measurements of two moving targets in a cluttered environment, with a third target being created approximately halfway through the simulation. It's a fairly simple problem but it is effective in demonstrating filter performance. Vo & Ma use it to demonstrate the linear GM-PHD filter but I use it for the EKF version as well, rather than coding up the EKF simulator that they describe.

Ba-Ngu Vo has kindly allowed me to include his implementation of the Optimal Subpattern Assignment (OSPA) metric proposed by Schuhmacher et al in:
Schuhmacher, D.; Ba-Tuong Vo; Ba-Ngu Vo, "A Consistent Metric for Performance Evaluation of Multi-Object Filters," Signal Processing, IEEE Transactions on , vol.56, no.8, pp.3447,3457, Aug. 2008.
This isn't necessary for the GM-PHD filter to work but provides a nice way of visualising and quantifying performance. If people want to tweak this code, the metric is a nice way to see how well things are performing and it is fairly easy to modify this implementation to perform multiple test runs with the same data but different filter parameters and compare the metrics.

Read the README.txt, or just start with GM_PHD_Filter.m and work from there.

Cite As

Bryan Clarke (2024). Gaussian Mixture Probability Hypothesis Density Filter (GM-PHD) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on WSNs in Help Center and MATLAB Answers

Inspired by: error_ellipse

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Fixed a bug where, for some spawning settings, the weight of the existing target was not used to scale the weight of a target it spawned.

Removed CalculateOSPAMetric.m, added Ba-Ngu Vo's implementation ospa_dist.m which uses Alex Melin's Hungarian.m

Removed an error that was passing the OSPA metric the wrong data to calculate with. Fixed a bug that meant costs were not being calculated in the OSPA for measurements in Y unmatched in X. The results are much better now but still a bit buggy.

Modified GM_PHD_Create_Birth and GM_EKF_PHD_Create_Birth so that static targets are spawned from iteration 1 rather than waiting until iteration 2.

Fixed a small bug in a print statement.

I have included the extended Kalman filter algorithm described by Vo & Ma (the filter can be run as either linear KF or EKF). I also included a way of drawing velocity arrows on the main plot to demonstrate estimated target velocities.

A few bug fixes. A few new comments. Added a couple of features to better fit the Vo & Ma implementation. Added an implementation of the Optimal Subpattern Assignment (OSPA) metric proposed by Schuhmacher et al to quantify filter performance.

Fixed a bug in GM_PHD_Prune. Changed inv to \ in pruning and constructing update components.

Enhanced spawning for better compliance with Vo & Ma paper. Fixed error in spawn weight calculation. Minor plotting enhancements.

Added a few comments to hopefully make it clearer how to modify this code for different applications. Also did a bit of variable/renaming deleting but nothing major.

New targets can now be initialised with a 'spawned' weight rather than a 'birthed' weight. Whichever weight is higher is the one that is used. Previously all targets were birthed.
Extra output statements are now output when VERBOSE is set.

Fixed typos in the description.