We compared the performance of deterministic and stochastic methods in maximizing the posterior distribution for the fish images under our prior model and likelihood formulation.
We used the simplex method rather than a method based on higher-order derivatives because the posterior is non-differentiable. Success with this approach has been reported by others [ 5 ], but here showed only partial success in locating and measuring fish in the images. On the few occasions when an object was correctly identified, its shape and size were well estimated. However, in most cases the search terminated at a model which was clearly a poor fit to the data. Moreover, the results were strongly dependent on a good starting position. These experiments suggest that the posterior density is highly convoluted with many highly-localised maxima, and that deterministic methods are inadequate.
The operation of a basic MCMC algorithm was compared with the simplex optimization on the same data. Whilst the simplex technique usually terminated in a wide variety of false maxima, the MCMC visited and left such locations easily. The proposed model was seen to move around easily during burn-in and showed a marked success in finding the true object, even when started far away. The algorithm spent more time in the neighbourhood of a fish than elsewhere and it appears that for an image containing a single fish the mode of the sampled posterior distribution coincides with the posterior maximum.
To illustrate these assertions, two sample images are shown in Fig. 2 . These images are of interest because they jointly contain three fish which are clearly visible by eye. The first fish (upper-middle in the top image) is outlined by well-defined edges; the second fish (lower-left in the top image) has an outline which is well-defined only in some regions; and the third fish (central in bottom image) has poorly-defined edges and considerable background clutter. In each case, an MCMC analysis was performed with a starting point in a large neighbourhood of the fish and consistent success was noted in approximate estimation of the fish. Each run began with a burn-in of 500 iterations followed by a main sequence of 500 iterations (this was a generous allocation: in practice, a length of 200 for each stage was sufficient).
For each example, the best template found has been overlaid together with samples from the posterior distribution chosen at random. These samples are illustrative of the variance of the random variables of the Markov chain, which provides an indication of the quality of fit. Results for these example are tabulated in Table 1 , giving estimates of the mode (defined here as the point of highest posterior probability found in the search), the mean of the posterior, and the standard error of the posterior. An estimate of the true parameters has been manually obtained.
The fit was judged to be of high quality for the first fish, lower quality for the second, and poor for the third. The relative size of the standard error estimate in each case is an indicator of quality. Note that, because the fish are generally aligned horizontally, the model is fairly well-constrained in the vertical direction with the largest errors and variability occuring in the horizontal location and length parameters. The difference in fit quality arises from the limitations of the model, and it is a strength of the methodology that such limitations can be identified.
In summary, the MCMC was less dependent on starting position, less prone to local maxima, and more consistent in estimation than the simplex analysis. Moreover, the computational expense was comparable with that for simplex. In this application, and under the model described above, it is clear that deterministic techiques like simplex are inferior to MCMC.
K De Souza