Table of Contents Author Guidelines Submit a Manuscript
Computational and Mathematical Methods in Medicine
Volume 2015 (2015), Article ID 343217, 8 pages
Research Article

Motion Estimation Using the Firefly Algorithm in Ultrasonic Image Sequence of Soft Tissue

Department of Computer Science and Information Engineering, National Pingtung University, No. 4-18, Minsheng Road, Pingtung 90003, Taiwan

Received 4 October 2014; Accepted 29 January 2015

Academic Editor: Chuangyin Dang

Copyright © 2015 Chih-Feng Chao et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.


Ultrasonic image sequence of the soft tissue is widely used in disease diagnosis; however, the speckle noises usually influenced the image quality. These images usually have a low signal-to-noise ratio presentation. The phenomenon gives rise to traditional motion estimation algorithms that are not suitable to measure the motion vectors. In this paper, a new motion estimation algorithm is developed for assessing the velocity field of soft tissue in a sequence of ultrasonic B-mode images. The proposed iterative firefly algorithm (IFA) searches for few candidate points to obtain the optimal motion vector, and then compares it to the traditional iterative full search algorithm (IFSA) via a series of experiments of in vivo ultrasonic image sequences. The experimental results show that the IFA can assess the vector with better efficiency and almost equal estimation quality compared to the traditional IFSA method.

1. Introduction

The motion estimation not only is an important component of the block-based video compression but also is often applied in disease diagnosis for the image sequences of the ultrasound or the magnetic resonance images. The ultrasonic examination is widely used to present the soft tissues such as heart or muscle; however it is usually influenced by speckle noises and the temporal decorrelation of the speckle patterns [1]. The popular optical flow algorithm [2] is based on the assumption that the intensity of material point of the tissue in a complete image sequence is always invariant. This assumption is generally called intensity invariant constraint; however, there exist the speckle noises and the tissue deformations usually destroy the intensity constraints and therefore cause the difficulty of motion estimation.

Another approach for motion estimation problem is the block-matching algorithm [35]; it measures the motion vector by evaluating the similarity criterion, such as the mean square error (MSE), mean absolute error (MAE), and sum of absolute differences (SAD) between the corresponding blocks of two consecutive images. The block-matching algorithm is to find a candidate block within a search region of the corresponding image that best matches the current block in the current image. The displacement between these two matching blocks is called a motion vector (MV). The full search algorithm (FSA) [6, 7] is the simplest block-matching algorithm that can search in burst-force for the optimal estimation solution with minimal matching error as it checks all candidate search points at a time. However, it is extremely computational expensive at the searching process, and, therefore, its usage is seriously limited in the medical image sequences. The effective reduction of the number of search points can accelerate the motion estimation, which is based on the assumption that block distortion is monotonically decreasing. These algorithms are proposed to alleviate the high computational complexity of full search, including the three- or four-step search [8, 9] and the gradient descent search [10]. However, the ultrasonic images are usually noisy and with low signal-to-noise ratio due to the speckle noises and the decorrelation of the speckle patterns; as a result the monotonically decreasing assumption does not hold such that the usage of these algorithms always traps into local optima. In order to tackle this problem, the traditional motion estimation algorithms are revised into an iterative algorithm together with a specific smoothness constraint; however, these changes need a great amount of computation to estimate optimal motion vectors when we use the iterative full search algorithm (IFSA).

Recently, the algorithms of bioinspired computing (BIO) such as the honey bee mating algorithm [11] and shuffled frog-leaping algorithm [12] have been used to efficiently search for the global optimum in the complex optimization problems. Up to the present, there are few of BIO methods that addressed the problems of motion estimation in the ultrasonic image sequence. Among them, the firefly algorithm is another algorithm that had been used in the image thresholding and vector quantitation [13, 14]. In this paper, we present an iterative algorithm that builds in the firefly algorithm for motion estimation. The proposed algorithm is introduced in Section 2. In Section 3, we demonstrate the experimental results. The conclusion and final remarks are given in Section 4.

2. Material and Methods

The problem of estimating motion field from image sequence has been studied extensively. The block-matching algorithm is the most popular because of its simplicity. Section 2.1 will briefly describe the block-matching algorithm. Section 2.2 introduces the firefly algorithm. In order to handle the problem of speckle noises, we designed an iterative firefly algorithm (IFA) together with a smooth constraint to estimate the motor vectors, described in Section 2.3.

2.1. The Block-Matching Algorithm

Because of its simplicity, the block-matching is a widely used algorithm in motion estimation. In matching procedures, the estimated image block of the processing frame will correspond to the best matching location within the predefined search window of the reference frame, as shown in Figure 1. In general, the size of estimated block, ispixels and the size of the corresponding search window is . These two windows are centered at the same pointin the two consecutive image frames (and). The full search searches for all possible locations within the search window by evaluating some matching criteria and selected one locationof the corresponding block. The relative displacement of the two locations of bothand is defined as the motion vector,,, .

Figure 1: Illustration of the block-matching algorithm [18].

The estimation of the motion vector is to find the optimal one such that its corresponding mean square error (MSE) is the smallest. Equation (1) defines the MSE measure: In other words the optimal motion vector satisfies the following equation:

2.2. Firefly Algorithm

The firefly algorithm is a new bioinspired computing approach for stochastic optimization, in which the search mechanism is simulated by social behavior of fireflies and the phenomenon of bioluminescent communication. There are two important issues in the firefly algorithm that are the variation of light intensity and formulation of attractiveness. Yang [15] simplifies that the attractiveness of a firefly is determined by its brightness which in turn is associated with the specific fitness function. The attractiveness is proportional to their brightness. Every member of the firefly swarm is characterized by its bright in which one can directly measure the corresponding fitness value.

Furthermore, there are three idealized rules.Regardless of their sex, any one firefly will be attracted to other fireflies.Attractiveness is proportional to their brightness, so for any two flashing fireflies, the less bright one will move to the brighter one. If there is brighter one than the particular firefly, it will move randomly.Brightness of a firefly is affected or determined by the landscape of the given fitness function; in other words, the brightnessof a firefly can be defined as .

More precisely, the attractiveness between firefliesandis defined as any monotonically decreasing function of their distance by the following equations:whereis the sum of initial assigned brightness of these two fireflies, is the light absorption coefficient, andindicates the index of the dimension of the candidate solution (i.e., firefly).

The movement of a fireflythat is attracted to another more attractive fireflyis determined by the following equations: If there is no brighter one than a particular firefly,, it will move randomly according to the following equation:where andare random numbers obtained from the uniform distribution.

2.3. The Proposed Motion Estimation Algorithm Using the Firefly Algorithm

The firefly algorithm usually defines a fitness function to compute the brightness of fireflies. Traditionally, the motion estimation algorithms use a similarity measure as their fitness function such as the mean square error (MSE) [3, 4]. However, the fact that speckle noises are exhibited in ultrasonic image sequence so that the traditional similarity criterion is not enough to accurately estimate motion vectors. To further decrease the sensitivity to speckle noises, a smoothness constraint is adopted to force continuity among neighbors motion vectors. Therefore, the used fitness function of the proposed algorithm consists of two terms of the similarity measure and the smoothness constraint. The widely used similarity measure is the mean square error (MSE), when the best motion vector is found; its corresponding MSE is the minima. The smoothness constraint is necessary to refer to its neighbors pixel’s motion vector to estimate current motion vector, and therefore it must be iterative. More practically, the calculation of motion vector at iterative number must consider the motion vectors of its neighbors at iterative number. The detail of the designed smoothness constraint is described as follows.

Suppose that the estimating motion vector of current blockwith center pixelat iterative number be the , and then the estimated motion vectors of block with the center of pixel at iterative number are . The is the eight neighbors of point . The smooth constraints (SC) at the iteration are described in the following equation:

The fitness function is defined as (7); it is used as search criteria for estimating motion vector in this paper: The proposed algorithm is described as follows.

Step 1 (setup the parameters of proposed system). This step assigns the parameter of the number fireflies, the maximum iteration numberand the light absorption coefficient, and the smooth parameter (In addition, according to (6), the estimation of the motion vector of block needs these initial motion vectors of neighbor. Therefore, all of the initial motion vectors of pixels of estimating block are randomly given ranging from to .

Step 2 (assign the initials of each firefly). For each estimating block , we assigned fireflies (in general, ) and each firefly is assigned an initial motion vector ranging from and ; that is, denotes the iterative number and is initially assigned to be 0 and the initial brightness of each firefly is assigned by its corresponding fitness.

Step 3 (update all candidate solutions). The mechanism of updating of candidate solution is generally stochastic; more practically, the IFA sequential picked up current th firefly solution and randomly selects its corresponding th firefly solution. The two motion vectors are denoted by and If the fitness value of is less than the fitness of , will update toward according to the following equations:where is the sum of initial assigned brightness (fitness value) of these two fireflies and γ is the light absorption coefficient: All of the candidate solutions are updated according to the procedures of (9) and (10), and then the best one is calculated for later process.
If theth firefly is the best one among all fireflies, this firefly will perform a random walk to renew its solution by using (11). If the new one has better fitness than the original one, it will replace it with the best solution; otherwise it is discarded. Finally, the best solution will be recorded by:

Step 4 (iterative execution and resulting vector output). The iteration number adds by 1: Ifreaches the maximum iteration number , the algorithm outputs the as the resulting motion vector; else go to Step 3.

3. Experimental Results

3.1. Execution Environment

All programs are programed by using Visual C++ programming language on a personal computer 2.4 GHz CPU, 1 G RAM running window XP system. All experiments were conducted in parameters of light absorption coefficient,. The size of initial firefly is assigned to be 5 and the maximum iteration number. The sizes of estimated image region, estimated block, and search window are, , and   (i.e., ).

Because of the substantial computational power of modern ultrasound systems, it is potential to evaluate muscle motion in real time [1]. The forearm extensors and extensor tendon are at the back of the forearm that typically cause pain at the outer aspect of the elbow. These muscles and tendon act to extend the wrist and fingers to bend the wrist backwards and straighten the fingers. In experiments, images were obtained by scanning the extensor tendon in longitudinal cross section. The images were taken from the tendon portions when the subject’s wrist moved extension to flexion. Figure 2 shows an ultrasonic extensor tendon image sequence, whose frame rate is 39 frames of one second.

Figure 2: An image of ultrasonic extensor tendon image sequence.
3.2. The Selection of Smooth Parameter λ

The setting of smoothness parameter may influence the estimation quality of motion estimation algorithm; we explored the different smoothness parameters in experiments. In general, the estimation quality is characterized by the peak signal-to-noise (PSNR) value; more practically, in PSNR the signal is the original data frames; meanwhile, the noise is the error introduced by the calculated motion vectors. The definition of PSNR is expressed as

The MSE is the mean square error between the original frames and those compensated by the estimated motion vectors. Figure 3 showed an illustration of results of PSNR versus the iteration number under different smoothness parameters. Form this figure, we found that the setting of the smoothness parameter was not significant to the final results of IFA and IFSA algorithms, and further the IFSA is in need of 20 iterations to converge but the iterative firefly algorithm requires 200 iterations. As a result, the smoothness parameter of all follow-up experiments was assigned to be 1.0.

Figure 3: The corresponding PSNR and the iteration number of different smoothness parameters.
3.3. Performance Evaluation

For comparisons with two different algorithms, two relevant performance indices were considered: the estimation quality and the search efficiency.

First the IFSA and IFA algorithms were compared in terms of estimation quality. The widely used index is the PSNR defined as (12); in addition to PSNR, an alternative index called PSNR degradation ratio () [5] is used in the experiments, which expresses the level of mismatch between the PSNRs of IFSA and IFA methods. The is defined as

Figure 4 shows the 10 selected regions of interest (ROI) with size ofpixels in an ultrasonic extensor tendon image sequence; those are used to estimate their motion vector by using the IFA and IFSA. Tables 1 and 2 show the PSNR values and computational times under running 200 iterations, considering the ten ROIs of Figure 4. Tables 3 and 4 are the results of PSNR versus computational time under 300 iterations. As it can be seen from these tables the quality results of both the IFA and IFSA have a limited difference. The corresponding PSNR degradation ratios are only 0.02105% (200 iterations) and 0.002% (300 iterations). The little differences imply that the usage of IFA is an alterative to calculate the accurate motion vectors. Figure 5 shows the resulting motion vectors of the first ROI using the IFSA and IFA ran with different iterations. In this figure, the interval time between current ROI and reference ROI is second.

Table 1: The PSNR and computational time of both IFSA and IFA which runs 200 iterations.
Table 2: The PSNR and of the usages of both IFA and IFSA, as it can be seen that the average of is only 0.02105% when IFA runs 200 iterations.
Table 3: The PSNR and computational time of both IFSA and IFA after running 300 iterations.
Table 4: The PSNR and of the usages of both IFA and IFSA, as it can be seen that the average of is only 0.002% after running 300 iterations.
Figure 4: The selected 10 regions of interest of the extensor tendon portion indicated by arrows.
Figure 5: The estimated motion vectors by using the IFSA and IFA with different iterations.

In addition, the computational times of the IFA and IFSA methods serve as an index for measuring the search efficiency. The index call computation saving ratio (CSR) [5] is defined for comparison in the experiments. It expresses the level of computation saving ratio between the computational times of the IFA and IFSA. The CSR is defined as

Tables 1 and 3 show the computational time of estimating of the 10 ROIs using both IFSA and IFA. From the two tables we found that the average computational time of IFA is 8.20 seconds (200 iterations) and 12.301 seconds (300 iterations), whereas the IFSA needs 30.785 seconds (20 iterations). Tables 5 and 6 show that the average CSRs of IFA are 73.4163% (200 iterations) and 60.1631% (300 iterations); in other words, IFA can save in excess of 60% computational cost.

Table 5: The computational time and the CSR of the usages of both IFA and IFSA, as it can be seen that the average of CSR is 73.416% under 200 iterations.
Table 6: The computational time and the CSR of the usages of both IFA and IFSA, as it can be seen that the average of CSR is 60.1631% under 300 iterations.

4. Conclusion

Based on the results of the present experiments of ultrasonic extensor tendon image sequence, the following conclusions can be emphasized.(1)In spite of the fact that the IFSA is a widely used algorithm to calculate the motion vector, it needs a great amount of computational time to calculate motion vectors, especially in the medical image sequences.(2)The IFA method is a stochastic algorithm that searches for optimal solution according to the swarm behavior of fireflies. This mechanism can effectively tackle the influences of speckle noises.(3)Experimental results revealed that the estimation qualities of the IFA and IFSA are nearly equal, and the IFA can save in excess of 60% computational cost. It implies that the proposed IFA is a more powerful algorithm in motion estimation of the application of ultrasonic image sequence.(4)The IFA pioneered in an application of bioinspired algorithm in estimating the motion field of ultrasonic image sequence. Maybe we can further investigate other bioinspired algorithms in the same application motion estimation. In addition, the IFA is a potential to be extensively applied in other motion researches such as motion vector composition [16, 17].

Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.


The work is supported by the Ministry of Science and Technology, Taiwan, under Grant nos. NSC 102-2221-E-251-001 and MOST 103-2221-E-153-011.


  1. C.-H. Lin, M. C.-J. Lin, and Y.-N. Sun, “Ultrasound motion estimation using a hierarchical feature weighting algorithm,” Computerized Medical Imaging and Graphics, vol. 31, no. 3, pp. 178–190, 2007. View at Publisher · View at Google Scholar · View at Scopus
  2. B. K. P. Horn and B. G. Schunck, “Determining optical flow,” Artificial Intelligence, vol. 17, no. 1–3, pp. 185–203, 1981. View at Publisher · View at Google Scholar · View at Scopus
  3. J. Cai and W. D. Pan, “On fast and accurate block-based motion estimation algorithms using particle swarm optimization,” Information Sciences, vol. 197, pp. 53–64, 2012. View at Publisher · View at Google Scholar · View at Scopus
  4. E. Cuevas, D. Zaldívar, M. Pérez-Cisneros, H. Sossa, and V. Osuna, “Block matching algorithm for motion estimation based on Artificial Bee Colony (ABC),” Applied Soft Computing Journal, vol. 13, no. 6, pp. 3047–3059, 2013. View at Publisher · View at Google Scholar · View at Scopus
  5. E. Cuevas, D. Zaldívar, M. Pérez-Cisneros, and D. Oliva, “Block-matching algorithm based on differential evolution for motion estimation,” Engineering Applications of Artificial Intelligence, vol. 26, no. 1, pp. 488–498, 2013. View at Publisher · View at Google Scholar · View at Scopus
  6. J. R. Jain and A. K. Jain, “Displacement measurements and its application in interframe image coding,” IEEE Transactions on Communications, vol. 29, no. 12, pp. 1799–1808, 1981. View at Publisher · View at Google Scholar · View at Scopus
  7. R. Yaakob, A. Aryanfar, A. A. Halin, and N. Sulaiman, “A comparison of different block algorithms for motion estimation,” Procedia Technology, vol. 11, pp. 199–205, 2013. View at Publisher · View at Google Scholar
  8. T. Koga, K. Iinuma, A. Hirano, Y. Lijima, and T. Ishiquro, “Motion compensated interframe coding for video conferencing,” in Proceedings of the National Telecommunications Conference, pp. C9.6.1–C9.6.5, 1981.
  9. L.-M. Po and W.-C. Ma, “A novel four-step search algorithm for fast block motion estimation,” IEEE Transactions on Circuits and Systems for Video Technology, vol. 6, no. 3, pp. 313–317, 1996. View at Publisher · View at Google Scholar · View at Scopus
  10. L.-K. Liu and E. Feig, “A block-based gradient descent search algorithm for block motion estimation in video coding,” IEEE Transactions on Circuits and Systems for Video Technology, vol. 6, no. 4, pp. 419–422, 1996. View at Publisher · View at Google Scholar · View at Scopus
  11. H. A. Abbasss, “Marriage in honey-bee optimization (HBO): a haplometrosis polygynous swarming approach,” in Proceedings of the Congress on Evolutionary Computation (CEC '01), pp. 207–214, 2001.
  12. M. M. Eusuff and K. E. Lansey, “Optimization of water distribution network design using the shuffled frog leaping algorithm,” Journal of Water Resources Planning and Management, vol. 129, no. 3, pp. 210–225, 2003. View at Publisher · View at Google Scholar · View at Scopus
  13. M. H. Horng and R. J. Liou, “Multilevel minimum cross entropy threshold selection based on the firefly algorithm,” Expert Systems with Applications, vol. 38, no. 12, pp. 14805–14811, 2011. View at Publisher · View at Google Scholar · View at Scopus
  14. M.-H. Horng, “Vector quantization using the firefly algorithm for image compression,” Expert Systems with Applications, vol. 39, no. 1, pp. 1078–1091, 2012. View at Publisher · View at Google Scholar · View at Scopus
  15. X.-S. Yang, “Firefly algorithms for multimodal optimization,” in Stochastic Algorithms: Foundations and Applications, vol. 5792 of Lecture Notes in Computer Science, pp. 169–178, Springer, Berlin, Germany, 2009. View at Publisher · View at Google Scholar · View at MathSciNet · View at Scopus
  16. T.-K. Lee, Y.-L. Chan, and W.-C. Siu, “Motion estimation in low-delay hierarchical p-frame coding using motion vector composition,” Journal of Visual Communication and Image Representation, vol. 24, no. 8, pp. 1243–1251, 2013. View at Publisher · View at Google Scholar · View at Scopus
  17. C.-H. Fu, T.-K. Lee, Y.-L. Chan, and W.-C. Siu, “An efficient motion vector composition algorithm for fast-forward playback in a video streaming system,” Journal of Visual Communication and Image Representation, vol. 21, no. 8, pp. 939–947, 2010. View at Publisher · View at Google Scholar · View at Scopus
  18. C. H. Lin, Model based motion estimation in medical image sequences [Ph.D. dissertation], National Cheng Kung University, Tainan, Taiwan, 2009.