# Patent

## Title
Variational mode seeking

## Abstract

A mode-seeking clustering mechanism identifies clusters within a data set based on the location of individual data point according to modes in a kernel density estimate. For large-scale applications the clustering mechanism may utilize rough hierarchical kernel and data partitions in a computationally efficient manner. A variational approach to the clustering mechanism may take into account variational probabilities, which are restricted in certain ways according to hierarchical kernel and data partition trees, and the mechanism may store certain statistics within these trees in order to compute the variational probabilities in a computational efficient way. The clustering mechanism may use a two-step variational expectation and maximization algorithm and generalizations hereof, where the maximization step may be performed in different ways in order to accommodate different mode-seeking algorithms, such as the mean shift, mediod shift, and quick shift algorithms.

## Background
BACKGROUND
Clustering is a component of machine learning, data mining, pattern recognition, image analysis, and bioinformatics. Clustering is sometimes known as automatic classification, botryology, topological analysis, cluster analysis, and other terms.
SUMMARY
A mode-seeking clustering mechanism identifies clusters within a data set based on the location of individual data points according to modes in a kernel density estimate. For large-scale applications the clustering mechanism may utilize rough hierarchical kernel and data partitions in a computationally efficient manner. A variational approach to the clustering mechanism may take into account variational probabilities, which may be restricted in certain ways according to hierarchical kernel and data partition trees, and the mechanism may store certain statistics within these trees in order to compute the variational probabilities in a computational efficient way. Some embodiments may employ a marked partition tree that may incorporate information from both a kernel tree and a data partition tree. The clustering mechanism may use a two-step variational expectation and maximization algorithm and generalizations hereof, where the maximization step may be performed in different ways in order to accommodate different mode-seeking algorithms, such as the mean shift, mediod shift, and quick shift algorithms.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.



BRIEF DESCRIPTION OF THE DRAWINGS
In the drawings,
FIG. 1 is a diagram illustration of an embodiment showing a system with a clustering mechanism.
FIG. 2 is a diagram illustration of an example embodiment showing a fixed kernel partition, dynamic data partition, and block partition.
FIG. 3 is an illustration of an embodiment showing a first property definition.
FIG. 4 is an illustration of an embodiment showing a second property definition.
FIG. 5 is a diagram illustration of an example embodiment showing a marked partition tree.
FIG. 6 is an illustration of an embodiment showing a recursive block definition method.
FIG. 7 is an illustration of an example embodiment showing an algorithmic description of an E-step.
FIG. 8 is a flowchart illustration of an embodiment showing a method for mode seeking.



DETAILED DESCRIPTION
A variational mode seeking mechanism may move data points together into groups of data points that define clusters. Data points in different clusters may be considered different and the clustering can therefore be used to reason about the data in different ways for many different applications.
An efficient mechanism for mode seeking may use a variational Expectation-Maximization algorithm or a variational generalized Expectation-Maximization algorithm, and may use two types of approximation hierarchies: a hierarchy of dynamic data points that may be moved towards the modes or clusters, and a hierarchy of kernels in an underlying fixed kernel density function. In the hierarchies, statistics may be stored for portions of the data and the kernels so that a learning algorithm may reason from the portions of data rather than the individual data points.
The mechanism may allow for homoscedastic and heteroscedastic data models, and may further enable mean-shifting, mediod-shifting, and quick-shifting techniques to be applied to the data.
Throughout this specification, like reference numbers signify the same elements throughout the description of the figures.
When elements are referred to as being “connected” or “coupled,” the elements can be directly connected or coupled together or one or more intervening elements may also be present. In contrast, when elements are referred to as being “directly connected” or “directly coupled,” there are no intervening elements present.
The subject matter may be embodied as devices, systems, methods, and/or computer program products. Accordingly, some or all of the subject matter may be embodied in hardware and/or in software (including firmware, resident software, micro-code, state machines, gate arrays, etc.) Furthermore, the subject matter may take the form of a computer program product on a computer-usable or computer-readable storage medium having computer-usable or computer-readable program code embodied in the medium for use by or in connection with an instruction execution system. In the context of this document, a computer-usable or computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The computer-usable or computer-readable medium may be for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. By way of example, and not limitation, computer-readable media may comprise computer storage media and communication media.
Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and may be accessed by an instruction execution system. Note that the computer-usable or computer-readable medium can be paper or other suitable medium upon which the program is printed, as the program can be electronically captured via, for instance, optical scanning of the paper or other suitable medium, then compiled, interpreted, of otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
Communication media typically embodies computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” can be defined as a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. Combinations of any of the above-mentioned should also be included within the scope of computer-readable media.
When the subject matter is embodied in the general context of computer-executable instructions, the embodiment may comprise program modules, executed by one or more systems, computers, or other devices. Generally, program modules include routines, programs, objects, components, data structures, and the like, that perform particular tasks or implement particular abstract data types. Typically, the functionality of the program modules may be combined or distributed as desired in various embodiments.
FIG. 1 is a diagram of an embodiment 100, showing a system that may identify clusters within a data set. Embodiment 100 is a simplified example of a computer system that may process a data set using a variational mode seeking analysis mechanism and produce clusters from the data set.
The diagram of FIG. 1 illustrates functional components of a system. In some cases, the component may be a hardware component, a software component, or a combination of hardware and software. Some of the components may be application level software, while other components may be operating system level components. In some cases, the connection of one component to another may be a close connection where two or more components are operating on a single hardware platform. In other cases, the connections may be made over network connections spanning long distances. Each embodiment may use different hardware, software, and interconnection architectures to achieve the described functions.
Embodiment 100 illustrates a device 102 that may be used to perform clustering. The device 102 may be a conventional computer device that may operate software components that may perform clustering operations. In other embodiments, the operations of the software components may be embodied in a gate array, programmable logic array, or other hardware component. The architecture of embodiment 100 is merely one example of a mechanism that may implement the mode seeking mechanism described below.
Device 102 may have a hardware platform 104 and various software components 106. The hardware platform 104 may comprise a processor 108, random access memory 110, and nonvolatile storage 112. The device 102 may also have a user interface 114 and a network interface 116.
In many embodiments, the device 102 may be a personal computer or code development workstation. The device 102 may also be a server computer, desktop computer, or comparable device. In some embodiments, the device 102 may still also be a laptop computer, netbook computer, tablet or slate computer, wireless handset, cellular telephone, game console, or any other type of computing device.
The hardware components 104 may include a processor 108, random access memory 110, and nonvolatile storage 112. The hardware components 104 may also include a user interface 114 and network interface 116. The processor 108 may be made up of several processors or processor cores in some embodiments. The random access memory 110 may be memory that may be readily accessible to and addressable by the processor 108. The nonvolatile storage 112 may be storage that persists after the device 102 is shut down. The nonvolatile storage 112 may be any type of storage device, including hard disk, solid state memory devices, magnetic tape, optical storage, or other type of storage. The nonvolatile storage 112 may be read only or read/write capable.
The user interface 114 may be any type of hardware capable of displaying output and receiving input from a user. In many cases, the output display may be a graphical display monitor, although output devices may include lights and other visual output, audio output, kinetic actuator output, as well as other output devices. Conventional input devices may include keyboards and pointing devices such as a mouse, stylus, trackball, or other pointing device. Other input devices may include various sensors, including biometric input devices, audio and video input devices, and other sensors.
The network interface 116 may be any type of connection to another computer. In many embodiments, the network interface 116 may be a wired Ethernet connection. Other embodiments may include wired or wireless connections over various communication protocols.
The software components 106 may include an operating system 118 on which various applications and services may operate. An operating system may provide an abstraction layer between executing routines and the hardware components 104, and may include various routines and functions that communicate directly with various hardware components.
The software components 106 may include a clustering mechanism 120 which may process a data set 122 to create cluster definitions 124. The clustering mechanism 120 may further utilize a fixed kernel partition 126 and a dynamic data partition 128 in order to perform the clustering in a computational efficient way.
The clustering mechanism 120 may execute an algorithm that may find clusters within a data set 122. The clustering mechanism may use a mode seeking algorithm, examples of which are defined below. The clustering mechanism 120 may use an expectation-maximization (EM) algorithm view on the mode-seeking clustering, where the Expectation step may generalize or approximate the Expectation step by breaking the product space of data and kernels into chunks, and processing these chunks as a whole. Such a mechanism may lower computational time while sacrificing a minimum of accuracy.
Mode Seeking
Let μ=(μ1, . . . , μM) denote a set of fixed data points for which the values cannot change, and let x=(x1, . . . , xN) denote a set of dynamic data points that are allowed to change (or shift) their values (or positions).
Mode-seeking clustering algorithms form a class of non-parametric clustering (or segmentation) algorithms that conceptually work as follows:
(1) Given the fixed μ1, . . . , μM, create a copy to be used as the dynamic x1, . . . , xN. (Hence, M=N.)
(2) For each dynamic data point xn iteratively move this data points uphill towards a mode in the underlying kernel density function, defined as the finite mixture




  
    
      
        
          
            p
            ⁡
            
              (
              
                x
                n
              
              )
            
          
          =
          
            
              ∑
              
                m
                =
                1
              
              M
            
            ⁢
            
              
                p
                ⁡
                
                  (
                  m
                  )
                
              
              ⁢
              
                p
                ⁡
                
                  (
                  
                    
                      
                        x
                        n
                      
                      |
                      
                        μ
                        m
                      
                    
                    ,
                    
                      Σ
                      m
                    
                  
                  )
                
              
            
          
        
        ,
      
    
    
      
        (
        1
        )
      
    
  




where p(m) is the weight (or mixing proportion) for kernel m, and





  
    p
    (
    
      
        
          x
          n
        
        |
        
          μ
          m
        
      
      ,
      
        ∑
        m
      
    
    )
  
  =
  
    
      1
      
        Z
        m
      
    
    ⁢
    
      K
      ⁡
      
        (
        
          
            D
            
              ∑
              m
            
          
          ⁡
          
            (
            
              
                x
                n
              
              ,
              
                μ
                m
              
            
            )
          
        
        )
      
    
  




is a normalized Gaussian kernel function with profile





  
    
      K
      ⁡
      
        (
        z
        )
      
    
    =
    
      e
      
        
          -
          
            1
            2
          
        
        ⁢
        z
      
    
  
  ,




location μm, bandwidth Σm, normalization Zm, and





  
    
      D
      
        ∑
        m
      
    
    ⁡
    
      (
      
        
          x
          n
        
        ,
        
          μ
          m
        
      
      )
    
  
  =
  
    
      
        (
        
          
            x
            n
          
          -
          
            μ
            m
          
        
        )
      
      T
    
    ⁢
    
      
        
          ∑
          
            -
            1
          
        
        m
      
      ⁢
      
        (
        
          
            x
            n
          
          -
          
            μ
            m
          
        
        )
      
    
  




is the Mahalanobis distance. For mode seeking algorithms it is standard that





  
    p
    ⁡
    
      (
      m
      )
    
  
  =
  
    
      1
      M
    
    .
  




(3) Assign μi and μj to the same cluster if their associated dynamic points xi and xj have moved to the same mode for the kernel density function.
Mean-Shift & its EM Interpretation
Mean-shift is one version of a mode-seeking algorithm. The mean shift version of the mode seeking clustering algorithm may operate within the framework of the Expectation-Maximization (EM) algorithm. Conceptually, in this view, instead of maximizing the log-likelihood with respect to the parameters in the mixture model defined by the kernel density estimate, a log-likelihood is maximized with respect to each of the dynamic data points. That is, the EM view iteratively maximizes the log-likelihood




  
    
      
        
          l
          ⁡
          
            (
            
              x
              n
            
            )
          
        
        =
        
          
            log
            ⁢
            
              
            
            ⁢
            
              p
              ⁡
              
                (
                
                  x
                  n
                
                )
              
            
          
          =
          
            log
            ⁢
            
              
                ∑
                
                  m
                  =
                  1
                
                M
              
              ⁢
              
                
                  p
                  ⁡
                  
                    (
                    m
                    )
                  
                
                ⁢
                
                  p
                  ⁡
                  
                    (
                    
                      
                        
                          x
                          n
                        
                        |
                        
                          μ
                          m
                        
                      
                      ,
                      
                        Σ
                        m
                      
                    
                    )
                  
                
              
            
          
        
      
    
    
      
        (
        2
        )
      
    
  




independently for each dynamic point xn, n=1, . . . , N, where each iteration consists of the following two steps:

E-step: Compute the posterior mixture-component membership probabilities p(m|xn) for m=1, . . . , M.
M-step: Maximize Ep(m|xn)[log(p(m)p(x|μm,Σm))] with respect to x; where Ep(m|xn)[•] denotes the expectation with respect to the distribution p(m|xn), m=1, . . . , M. The maximization leads to the following update for the individual d-dimensional data points




  
    
      
        
          
            
              
                
                  x
                  n
                
                ←
                
                ⁢
                
                  
                    arg
                    ⁢
                    
                      
                    
                    ⁢
                    
                      
                        max
                        
                          x
                          ∈
                          
                            R
                            d
                          
                        
                      
                      ⁢
                      
                        
                          ∑
                          
                            m
                            =
                            1
                          
                          M
                        
                        ⁢
                        
                          
                            p
                            ⁡
                            
                              (
                              
                                m
                                |
                                
                                  x
                                  n
                                
                              
                              )
                            
                          
                          ⁢
                          log
                          ⁢
                          
                            
                          
                          ⁢
                          
                            p
                            ⁡
                            
                              (
                              
                                x
                                |
                                m
                              
                              )
                            
                          
                        
                      
                    
                  
                  +
                  C
                
              
            
          
          
            
              
                =
                
                ⁢
                
                  arg
                  ⁢
                  
                    
                  
                  ⁢
                  
                    
                      min
                      
                        x
                        ∈
                        
                          R
                          d
                        
                      
                    
                    ⁢
                    
                      
                        ∑
                        
                          m
                          =
                          1
                        
                        M
                      
                      ⁢
                      
                        
                          p
                          ⁡
                          
                            (
                            
                              m
                              |
                              
                                x
                                n
                              
                            
                            )
                          
                        
                        ⁢
                        
                          
                            D
                            
                              ∑
                              m
                            
                          
                          ⁡
                          
                            (
                            
                              x
                              ,
                              
                                μ
                                m
                              
                            
                            )
                          
                        
                      
                    
                  
                
              
            
          
          
            
              
                =
                
                ⁢
                
                  
                    
                      (
                      
                        
                          ∑
                          
                            m
                            =
                            1
                          
                          M
                        
                        ⁢
                        
                          
                            p
                            ⁡
                            
                              (
                              
                                m
                                |
                                
                                  x
                                  n
                                
                              
                              )
                            
                          
                          ⁢
                          
                            ∑
                            m
                            
                              -
                              1
                            
                          
                        
                      
                      )
                    
                    
                      -
                      1
                    
                  
                  ⁢
                  
                    
                      ∑
                      
                        m
                        =
                        1
                      
                      M
                    
                    ⁢
                    
                      
                        p
                        ⁡
                        
                          (
                          
                            m
                            |
                            
                              x
                              n
                            
                          
                          )
                        
                      
                      ⁢
                      
                        
                          ∑
                          m
                          
                            -
                            1
                          
                        
                        ⁢
                        
                          μ
                          m
                        
                      
                    
                  
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        where
        ⁢
        
          

        
        ⁢
        
          
            
              
                
                  C
                  =
                  
                  ⁢
                  
                    
                      ∑
                      
                        m
                        =
                        1
                      
                      M
                    
                    ⁢
                    
                      
                        p
                        ⁡
                        
                          (
                          
                            m
                            |
                            
                              x
                              n
                            
                          
                          )
                        
                      
                      ⁢
                      log
                      ⁢
                      
                        
                      
                      ⁢
                      
                        p
                        ⁡
                        
                          (
                          m
                          )
                        
                      
                      ⁢
                      
                        
                      
                      ⁢
                      is
                      ⁢
                      
                        
                      
                      ⁢
                      independent
                      ⁢
                      
                        
                      
                      ⁢
                      of
                      ⁢
                      
                        
                      
                      ⁢
                      x
                    
                  
                
                ,
                
                  and
                  ⁢
                  
                    
                  
                  ⁢
                  
                    p
                    ⁡
                    
                      (
                      
                        m
                        |
                        
                          x
                          n
                        
                      
                      )
                    
                  
                
              
            
          
          
            
              
                =
                
                ⁢
                
                  
                    
                      p
                      ⁡
                      
                        (
                        
                          
                            x
                            n
                          
                          |
                          m
                        
                        )
                      
                    
                    
                      Mp
                      ⁡
                      
                        (
                        
                          x
                          n
                        
                        )
                      
                    
                  
                  ⁢
                  for
                  ⁢
                  
                    
                  
                  ⁢
                  
                    p
                    ⁡
                    
                      (
                      m
                      )
                    
                  
                
              
            
          
          
            
              
                =
                
                ⁢
                
                  
                    1
                    M
                  
                  .
                
              
            
          
        
      
    
    
      
        (
        3
        )
      
    
  




The updated xn is now used for the next iteration of EM, and this process continues until convergence.
Medoid-Shift & its (Generalized) EM Interpretation
The EM interpretation for mean-shift opens up for many mode-seeking variations, because the partitioning of each iteration into two steps (the E- and M-steps) offers a flexibility that is conceptually easy to understand. The medoid-shift algorithm may be a variation of the mean-shift algorithm, where the M-step in the above EM interpretation may be modified by computing the new position of xn as the weighted




  
    
      
        
          
            
              
                x
                n
              
              ←
              
              ⁢
              
                
                  arg
                  ⁢
                  
                    
                  
                  ⁢
                  
                    
                      max
                      
                        
                          x
                          =
                          
                            μ
                            m
                          
                        
                        ,
                        
                          m
                          =
                          1
                        
                        ,
                        
                          
                        
                        ⁢
                        ...
                        ⁢
                        
                          
                        
                        ,
                        M
                      
                    
                    ⁢
                    
                      
                        ∑
                        
                          m
                          =
                          1
                        
                        M
                      
                      ⁢
                      
                        
                          p
                          ⁡
                          
                            (
                            
                              m
                              |
                              
                                x
                                n
                              
                            
                            )
                          
                        
                        ⁢
                        log
                        ⁢
                        
                          
                        
                        ⁢
                        
                          p
                          ⁡
                          
                            (
                            
                              x
                              |
                              m
                            
                            )
                          
                        
                      
                    
                  
                
                +
                C
              
            
          
        
        
          
            
              =
              
              ⁢
              
                arg
                ⁢
                
                  
                
                ⁢
                
                  
                    max
                    
                      
                        x
                        =
                        
                          μ
                          m
                        
                      
                      ,
                      
                        m
                        =
                        1
                      
                      ,
                      
                        
                      
                      ⁢
                      ...
                      ⁢
                      
                        
                      
                      ,
                      M
                    
                  
                  ⁢
                  
                    
                      ∑
                      
                        m
                        =
                        1
                      
                      M
                    
                    ⁢
                    
                      
                        p
                        ⁡
                        
                          (
                          
                            m
                            |
                            
                              x
                              n
                            
                          
                          )
                        
                      
                      ⁢
                      
                        
                          
                            D
                            
                              ∑
                              m
                            
                          
                          ⁡
                          
                            (
                            
                              x
                              ,
                              
                                μ
                                m
                              
                            
                            )
                          
                        
                        .
                      
                    
                  
                
              
            
          
        
      
    
    
      
        (
        4
        )
      
    
  




By restricting the optimization to only allow the update for xn to assign values from the fixed data points μ, the M-step will increase the unrestricted log-likelihood but not necessarily maximize it, and therefore this interpretation of the medoid-shift is a generalized EM interpretation.

Quick-Shift & its (Generalized) EM Interpretation
By realizing that it is not necessary to minimize (4) in the M-step of the medoid-shift algorithm in order to obtain a convergent (generalized) EM algorithm, we can define a quick-shift algorithm, which in spirit is similar to other quick-shift algorithms. This quick-shift algorithm will simply assign the nearest neighbor that decreases (and not necessarily minimizes) the value in (4) to the updated value for xn.
Variational Mode Seeking
The variational mode seeking algorithm may use any of the mode-seeking algorithms that can be explained in the (generalized) EM view with different M-step variations. A variational distribution may be introduced as:

q(m|n), m=1, . . . , M and n=1, . . . , N  (5)

The posterior mixture-component membership probabilities p(m|xn) may be approximated as q(m|n) in the E-step as described below. Using this approximation, the algorithm is still convergent, but will converge to a lower bound of the log-likelihood, where the tightness of this bound is determined by the quality of the approximation.
In the variational mode-seeking approach, each dynamic data point may not be considered individually, but instead the joint log-likelihood of the independent data points will be considered:




  
    
      
        
          
            
              
                l
                ⁡
                
                  (
                  x
                  )
                
              
              =
              
                l
                ⁡
                
                  (
                  
                    
                      x
                      1
                    
                    ,
                    ...
                    ⁢
                    
                      
                    
                    ,
                    
                      x
                      n
                    
                  
                  )
                
              
            
          
        
        
          
            
              =
              
                
                  ∑
                  
                    n
                    =
                    1
                  
                  N
                
                ⁢
                
                  log
                  ⁢
                  
                    
                  
                  ⁢
                  
                    p
                    ⁡
                    
                      (
                      
                        x
                        n
                      
                      )
                    
                  
                
              
            
          
        
        
          
            
              
                =
                
                  
                    ∑
                    
                      n
                      =
                      1
                    
                    N
                  
                  ⁢
                  
                    log
                    ⁢
                    
                      
                    
                    ⁢
                    
                      
                        ∑
                        
                          m
                          =
                          1
                        
                        M
                      
                      ⁢
                      
                        
                          p
                          ⁡
                          
                            (
                            m
                            )
                          
                        
                        ⁢
                        
                          p
                          ⁡
                          
                            (
                            
                              
                                
                                  x
                                  n
                                
                                |
                                
                                  μ
                                  m
                                
                              
                              ,
                              
                                Σ
                                m
                              
                            
                            )
                          
                        
                      
                    
                  
                
              
              ⁢
              
                
              
            
          
        
      
    
    
      
        (
        6
        )
      
    
  




Introducing the variational distribution q(m|n) and using Jensen's inequality




  
    
      
        
          
            
              
                
                  l
                  ⁡
                  
                    (
                    x
                    )
                  
                
                =
                
                ⁢
                
                  
                    ∑
                    
                      n
                      =
                      1
                    
                    N
                  
                  ⁢
                  
                    log
                    ⁢
                    
                      
                    
                    ⁢
                    
                      
                        ∑
                        
                          m
                          =
                          1
                        
                        M
                      
                      ⁢
                      
                        
                          q
                          ⁡
                          
                            (
                            
                              m
                              |
                              n
                            
                            )
                          
                        
                        ⁢
                        
                          
                            
                              p
                              ⁡
                              
                                (
                                m
                                )
                              
                            
                            ⁢
                            
                              p
                              ⁡
                              
                                (
                                
                                  
                                    
                                      x
                                      n
                                    
                                    |
                                    
                                      μ
                                      m
                                    
                                  
                                  ,
                                  
                                    Σ
                                    m
                                  
                                
                                )
                              
                            
                          
                          
                            q
                            ⁡
                            
                              (
                              
                                m
                                |
                                n
                              
                              )
                            
                          
                        
                      
                    
                  
                
              
            
          
          
            
              
                ≥
                
                ⁢
                
                  
                    ∑
                    
                      n
                      =
                      1
                    
                    N
                  
                  ⁢
                  
                    
                      ∑
                      
                        m
                        =
                        1
                      
                      M
                    
                    ⁢
                    
                      
                        q
                        ⁡
                        
                          (
                          
                            m
                            |
                            n
                          
                          )
                        
                      
                      ⁢
                      log
                      ⁢
                      
                        
                          
                            p
                            ⁡
                            
                              (
                              m
                              )
                            
                          
                          ⁢
                          
                            p
                            ⁡
                            
                              (
                              
                                
                                  
                                    x
                                    n
                                  
                                  |
                                  
                                    μ
                                    m
                                  
                                
                                ,
                                
                                  Σ
                                  m
                                
                              
                              )
                            
                          
                        
                        
                          q
                          ⁡
                          
                            (
                            
                              m
                              |
                              n
                            
                            )
                          
                        
                      
                    
                  
                
              
            
          
          
            
              
                =
                
                ⁢
                
                  
                    F
                    ⁡
                    
                      (
                      
                        q
                        ,
                        x
                      
                      )
                    
                  
                  .
                  
                    (
                    8
                    )
                  
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        And
      
    
    
      
        (
        7
        )
      
    
  
  
    
      
        
          
            
              l
              ⁡
              
                (
                x
                )
              
            
            -
            
              F
              ⁡
              
                (
                
                  q
                  ,
                  x
                
                )
              
            
          
          =
          
            KL
            ⁡
            
              [
              
                
                  q
                  (
                  
                    ·
                    
                      
                      n
                      )
                    
                  
                  
                
                ⁢
                
                  
                  
                    
                      p
                      (
                      ·
                      
                    
                    ⁢
                    
                      x
                      n
                    
                  
                  )
                
              
              ]
            
          
        
        ,
      
    
    
      
        (
        9
        )
      
    
  




where KL[•∥•] denotes the Kullback-Leibler divergence between the two distributions in the arguments.
Equation (9) can also be realized from the following derivation




  
    
      
        
          
            
              
                
                  l
                  ⁡
                  
                    (
                    x
                    )
                  
                
                -
                
                  F
                  ⁡
                  
                    (
                    
                      q
                      ,
                      x
                    
                    )
                  
                
              
              =
              
              ⁢
              
                
                  
                    ∑
                    
                      n
                      =
                      1
                    
                    N
                  
                  ⁢
                  
                    log
                    ⁢
                    
                      
                    
                    ⁢
                    
                      
                        ∑
                        
                          m
                          =
                          1
                        
                        M
                      
                      ⁢
                      
                        
                          q
                          ⁡
                          
                            (
                            
                              m
                              |
                              n
                            
                            )
                          
                        
                        ⁢
                        
                          
                            
                              p
                              ⁡
                              
                                (
                                m
                                )
                              
                            
                            ⁢
                            
                              p
                              ⁡
                              
                                (
                                
                                  
                                    
                                      x
                                      n
                                    
                                    |
                                    
                                      μ
                                      m
                                    
                                  
                                  ,
                                  
                                    Σ
                                    m
                                  
                                
                                )
                              
                            
                          
                          
                            q
                            ⁡
                            
                              (
                              
                                m
                                |
                                n
                              
                              )
                            
                          
                        
                      
                    
                  
                
                -
              
            
          
        
        
          
            
              
              ⁢
              
                
                  ∑
                  
                    n
                    =
                    1
                  
                  N
                
                ⁢
                
                  
                    ∑
                    
                      m
                      =
                      1
                    
                    M
                  
                  ⁢
                  
                    
                      q
                      ⁡
                      
                        (
                        
                          m
                          |
                          n
                        
                        )
                      
                    
                    ⁢
                    log
                    ⁢
                    
                      
                        
                          p
                          ⁡
                          
                            (
                            m
                            )
                          
                        
                        ⁢
                        
                          p
                          ⁡
                          
                            (
                            
                              
                                
                                  x
                                  n
                                
                                |
                                
                                  μ
                                  m
                                
                              
                              ,
                              
                                Σ
                                m
                              
                            
                            )
                          
                        
                      
                      
                        q
                        ⁡
                        
                          (
                          
                            m
                            |
                            n
                          
                          )
                        
                      
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                
                  
                    ∑
                    
                      n
                      =
                      1
                    
                    N
                  
                  ⁢
                  
                    
                      ∑
                      
                        m
                        =
                        1
                      
                      M
                    
                    ⁢
                    
                      
                        q
                        ⁡
                        
                          (
                          
                            m
                            |
                            n
                          
                          )
                        
                      
                      ⁢
                      log
                      ⁢
                      
                        
                          ∑
                          
                            m
                            =
                            1
                          
                          M
                        
                        ⁢
                        
                          
                            p
                            ⁡
                            
                              (
                              m
                              )
                            
                          
                          ⁢
                          
                            p
                            ⁡
                            
                              (
                              
                                
                                  
                                    x
                                    n
                                  
                                  |
                                  
                                    μ
                                    m
                                  
                                
                                ,
                                
                                  Σ
                                  m
                                
                              
                              )
                            
                          
                        
                      
                    
                  
                
                -
              
            
          
        
        
          
            
              
              ⁢
              
                
                  ∑
                  
                    n
                    =
                    1
                  
                  N
                
                ⁢
                
                  
                    ∑
                    
                      m
                      =
                      1
                    
                    M
                  
                  ⁢
                  
                    
                      q
                      ⁡
                      
                        (
                        
                          m
                          |
                          n
                        
                        )
                      
                    
                    ⁢
                    log
                    ⁢
                    
                      
                        
                          p
                          ⁡
                          
                            (
                            m
                            )
                          
                        
                        ⁢
                        
                          p
                          ⁡
                          
                            (
                            
                              
                                
                                  x
                                  n
                                
                                |
                                
                                  μ
                                  m
                                
                              
                              ,
                              
                                Σ
                                m
                              
                            
                            )
                          
                        
                      
                      
                        q
                        ⁡
                        
                          (
                          
                            m
                            |
                            n
                          
                          )
                        
                      
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                
                  ∑
                  
                    n
                    =
                    1
                  
                  N
                
                ⁢
                
                  
                    ∑
                    
                      m
                      =
                      1
                    
                    M
                  
                  ⁢
                  
                    
                      q
                      ⁡
                      
                        (
                        
                          m
                          |
                          n
                        
                        )
                      
                    
                    ⁢
                    
                      (
                      
                        
                          
                            
                              
                                log
                                ⁢
                                
                                  
                                    ∑
                                    
                                      m
                                      =
                                      1
                                    
                                    M
                                  
                                  ⁢
                                  
                                    
                                      p
                                      ⁡
                                      
                                        (
                                        m
                                        )
                                      
                                    
                                    ⁢
                                    
                                      p
                                      ⁡
                                      
                                        (
                                        
                                          
                                            
                                              x
                                              n
                                            
                                            |
                                            
                                              μ
                                              m
                                            
                                          
                                          ,
                                          
                                            Σ
                                            m
                                          
                                        
                                        )
                                      
                                    
                                  
                                
                              
                              -
                            
                          
                        
                        
                          
                            
                              log
                              ⁢
                              
                                
                                  
                                    p
                                    ⁡
                                    
                                      (
                                      m
                                      )
                                    
                                  
                                  ⁢
                                  
                                    p
                                    ⁡
                                    
                                      (
                                      
                                        
                                          
                                            x
                                            n
                                          
                                          |
                                          
                                            μ
                                            m
                                          
                                        
                                        ,
                                        
                                          Σ
                                          m
                                        
                                      
                                      )
                                    
                                  
                                
                                
                                  q
                                  ⁡
                                  
                                    (
                                    
                                      m
                                      |
                                      n
                                    
                                    )
                                  
                                
                              
                            
                          
                        
                      
                      )
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                
                  ∑
                  
                    n
                    =
                    1
                  
                  N
                
                ⁢
                
                  
                    ∑
                    
                      m
                      =
                      1
                    
                    M
                  
                  ⁢
                  
                    
                      q
                      ⁡
                      
                        (
                        
                          m
                          |
                          n
                        
                        )
                      
                    
                    ⁢
                    log
                    ⁢
                    
                      
                        q
                        ⁡
                        
                          (
                          
                            m
                            |
                            n
                          
                          )
                        
                      
                      
                        
                          
                            p
                            ⁡
                            
                              (
                              m
                              )
                            
                          
                          ⁢
                          
                            p
                            ⁡
                            
                              (
                              
                                
                                  
                                    x
                                    n
                                  
                                  |
                                  
                                    μ
                                    m
                                  
                                
                                ,
                                
                                  Σ
                                  m
                                
                              
                              )
                            
                          
                        
                        
                          
                            ∑
                            
                              m
                              =
                              1
                            
                            M
                          
                          ⁢
                          
                            
                              p
                              ⁡
                              
                                (
                                m
                                )
                              
                            
                            ⁢
                            
                              p
                              ⁡
                              
                                (
                                
                                  
                                    
                                      x
                                      n
                                    
                                    |
                                    
                                      μ
                                      m
                                    
                                  
                                  ,
                                  
                                    Σ
                                    m
                                  
                                
                                )
                              
                            
                          
                        
                      
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                
                  KL
                  ⁡
                  
                    [
                    
                      
                        q
                        (
                        
                          m
                          ⁢
                          
                            
                            n
                            )
                          
                        
                        
                      
                      ⁢
                      
                        
                        
                          
                            p
                            (
                            m
                            
                          
                          ⁢
                          
                            x
                            n
                          
                        
                        )
                      
                    
                    ]
                  
                
                .
              
            
          
        
      
    
    
      
        (
        10
        )
      
    
  




An iteration in the variational EM view on mode-seeking algorithms performs coordinate ascent on F(q, x) by the following two steps
E-step: qt+1=arg maxq F (q, xt)=arg minqKL[q(m|n)∥p(m|xnt)]
M-Step:
For Mean-shift:




  
    
      
        
          x
          
            t
            +
            1
          
        
        =
        
          arg
          ⁢
          
            
          
          ⁢
          
            
              max
              
                
                  x
                  ⁢
                  
                    :
                  
                  ⁢
                  
                    x
                    n
                  
                
                ∈
                
                  
                    R
                    d
                  
                  ⁢
                  
                    ∀
                    n
                  
                
              
            
            ⁢
            
              F
              ⁡
              
                (
                
                  
                    q
                    
                      t
                      +
                      1
                    
                  
                  ,
                  x
                
                )
              
            
          
        
      
    
    
      
        (
        11
        )
      
    
  




leading to the following update for individual data points




  
    x
    n
    
      t
      +
      1
    
  
  =
  
    
      
        (
        
          
            ∑
            
              m
              =
              1
            
            M
          
          ⁢
          
            
              
                q
                
                  t
                  +
                  1
                
              
              ⁡
              
                (
                
                  m
                  |
                  n
                
                )
              
            
            ⁢
            
              ∑
              m
              
                -
                1
              
            
          
        
        )
      
      
        -
        1
      
    
    ⁢
    
      
        ∑
        
          m
          =
          1
        
        M
      
      ⁢
      
        
          
            q
            
              t
              +
              1
            
          
          ⁡
          
            (
            
              m
              |
              n
            
            )
          
        
        ⁢
        
          
            ∑
            m
            
              -
              1
            
          
          ⁢
          
            μ
            m
          
        
      
    
  




For Medoid-Shift:




  
    
      
        
          x
          
            t
            +
            1
          
        
        =
        
          arg
          ⁢
          
            
          
          ⁢
          
            
              max
              
                
                  x
                  ⁢
                  
                    :
                  
                  ⁢
                  
                    x
                    n
                  
                
                ∈
                
                  μ
                  ⁢
                  
                    
                  
                  ⁢
                  
                    ∀
                    n
                  
                
              
            
            ⁢
            
              F
              ⁡
              
                (
                
                  
                    q
                    
                      t
                      +
                      1
                    
                  
                  ,
                  x
                
                )
              
            
          
        
      
    
    
      
        (
        12
        )
      
    
  




leading to the following update for individual data points




  
    
      
        
          x
          n
          
            t
            +
            1
          
        
        =
        
          arg
          ⁢
          
            
          
          ⁢
          
            
              min
              
                x
                ∈
                μ
              
            
            ⁢
            
              
                ∑
                
                  m
                  =
                  1
                
                M
              
              ⁢
              
                
                  q
                  ⁡
                  
                    (
                    
                      m
                      |
                      n
                    
                    )
                  
                
                ⁢
                
                  
                    D
                    
                      Σ
                      m
                    
                  
                  ⁡
                  
                    (
                    
                      x
                      ,
                      
                        μ
                        m
                      
                    
                    )
                  
                
              
            
          
        
      
    
    
      
        (
        13
        )
      
    
  




For Quick-shift: Similar to Medoid-shift, where the update for each individual data points is the nearest neighbor that decreases (and not necessarily minimizes) the value in (13).
Since the Kullback-Leibler divergence is always positive, q(m|n)=p(m|xn) maximizes the E-step, and, in this case, the variational (generalized) EM algorithm is equivalent to the standard (generalized) EM algorithm.
In some embodiments, q(m|n) may be restricted to attain significant speedup in computational complexity over the standard mode-seeking algorithms, implying that KL[q(•|n)∥p(•|xn)] may not be zero, because p(•|xn) is not in the allovable class of distributions for q(•|n). However, the E-step will minimize this KL divergence.
Data and Kernel Partition
Let us define a hierarchical partition for the fixed data points μ=μ1, . . . , μM and similar for the dynamic data points x=x1, . . . , xN. Note that a kernel may be associated with each fixed data point, as indicated in Equation (1). The terms fixed data point and kernel are used interchangeably.
FIG. 2 illustrates an embodiment 200 showing a fixed kernel partition tree 202 and a dynamic data partition tree 204. We assume a partition of x×μ into blocks {(A1, B1), . . . , (AP, BP)}, where Ap⊂x and Bp⊂μ for p=1, . . . , P.
In FIG. 2, Ap and Bp correspond to nodes in, respectively, the dynamic data and the fixed kernel partition trees, and (Ap, Bp) corresponds to a block (a square) in the partition table 206.
Computational efficiency may be increased by maintaining two partition trees: one for the data points that are shifted towards the modes and one for the kernels in the underlying fixed kernel density function. The two trees may be known respectively as a data partition tree and a kernel partition tree. A node in one of these trees may represent the union of the elements, either data points or kernels, for the elements represented by the node's children. Individual elements may not actually be stored in each node, but rather, the sufficient statistics for the estimation operations may be pre-computed and stored in a tree.
Any tree may be suitable for constructing a partition tree so long as there may be some degree of similarity between the data or kernels in a block.
The trees may represent computationally cheap, but rough, hierarchical clusterings of data and kernels. The clusterings may allow groups of data and kernels represented by a blocks in the partition table to be reasoned about in subsequent analyses.
An anchor tree construction may assume that all distance computations during the construction are performed according to the same isotropic distance metric. Such an assumption may be appropriate for constructing a data partition tree, because data simply specify a location in a given data space. Such a tree may be known as a homoscedastic anchor tree. In contrast to data, each kernel may additionally impose an individual distance metric, which may be included in the kernel partition tree. For homoscedastic kernels, all distance metrics may be the same.
The anchor tree construction algorithm may start with an anchor growing phase that for N elements gradually grows a set of √{square root over (N)} anchors A, which will become the leafs in an anchor sub-tree. Each anchor aεA has a pivot element ap and may maintain a list of individual member elements am={aMi}i, which may be data points or kernels sorted by decreasing order of distance to the pivot D(aMi,ap), aMiεaM. The list of elements in an anchor may have a characteristic that all elements in the anchor are closer to the pivot of that anchor than the pivot of any other anchor.
During the anchor growing phase, a new anchor anew may be added to the current set of anchors and its pivot element may be chosen as the element with largest distance to the pivot of the anchor that currently owns it. That is,




  
    
      
        
          a
          new
        
        =
        
          
            
              arg
              ⁢
              
                
              
              ⁢
              max
            
            
              
                
                  a
                  M
                  i
                
                ∈
                
                  a
                  M
                
              
              ,
              
                a
                ∈
                M
              
            
          
          ⁢
          
            D
            ⁡
            
              (
              
                
                  a
                  M
                  i
                
                ,
                
                  a
                  p
                
              
              )
            
          
        
      
    
    
      
        (
        14
        )
      
    
  




The new anchor may now iterate through the member elements of current anchors and may “steal” elements with D(aMi,apnew)<D(aMi,ap). Because the list of elements in an anchor may already be sorted with respect to D (aMi,ap) computational efficiency may be achieved by not evaluating the remaing elements in the list once we discover that D(aMi,ap)<D(apnew,ap)/2, which guarantees that these elements cannot be stolen. Once a new anchor is done stealing elements from older anchors, its list of elements is sorted and no further sorting is needed for this anchor.
The anchor sub-tree construction now contains a phase that recursively merges the pair of anchors that results in the smallest distance from the pivot for the element farthest away. The leafs or anchors in the tree now contains √{square root over (N)} elements on average and we can subdivide further by recursively calling the sub-tree construction algorithm on the data in each leaf.
The Heteroscedastic Anchor Tree
Recall the normalized kernel function for data point x




  
    
      
        
          
            K
            
              μ
              ,
              Σ
            
          
          ⁡
          
            (
            x
            )
          
        
        =
        
          
            1
            
              Z
              Σ
            
          
          ⁢
          
            K
            ⁡
            
              (
              
                
                  D
                  Σ
                
                ⁡
                
                  (
                  
                    x
                    ,
                    μ
                  
                  )
                
              
              )
            
          
        
      
    
    
      
        (
        15
        )
      
    
  




where μ and Σ are the kernel location and bandwidth matrix, respectively, ZΣ is a normalization constant only depending on Σ, and K may be the profile depending on the Mahalanobis distance

DΣ(x,μ)=(x−μ)TΣ−1(x−μ)  (16)

When constructing the kernel tree, information about data are not be available. In order to group kernels in a way to reason about the groups, kernels may be grouped according to distance in location. For the distance computations between two kernels ai=Kμi,Σi and aj=Kμj,Σj use the bandwidth that will imply the most variability on data far away. That is,

D(ai,aj)=min {DΣj(μi,μj),DΣi(μj,μi)}  (17)

We will assume that that kernel heteroscedacity stems from differently scaled bandwidths. For an arbitrary kernel with bandwidth Σ, the scaled bandwidths in the different kernels can now be represented as Σi=αiΣ. Hence,




  
    D
    ⁡
    
      (
      
        
          a
          i
        
        ,
        
          a
          j
        
      
      )
    
  
  =
  
    
      1
      
        α
        ⁡
        
          (
          
            
              a
              i
            
            ,
            
              a
              j
            
          
          )
        
      
    
    ⁢
    
      
        D
        Σ
      
      ⁡
      
        (
        
          
            a
            i
          
          ,
          
            a
            j
          
        
        )
      
    
  




where α(ai,aj)=max {αi,αj} and DΣ(•,•) is the distance computed with respect to Σ.
The heteroscedastic anchor tree construction may proceed as for the homoscedastic case with this new distance measure and a modification to the criterion for when to stop traversing the sorted list of elements in an anchor. The property of FIG. 3 may be used to derive this criterion.
Notice that in the case of homoscedastic kernels, the conditioning statement in the property of FIG. 3 reduces to the criterion D(aMi,ap)<D(apnew,ap)/2 that guarantees that the remaining elements in aM cannot be stolen once the condition is satisfied for aMi. This guarantee follows directly by recalling that aM may be sorted with respect to distance from ap (high to low), and therefore D(ap,aMi+k)≦D(ap,aMi) for k>0.
However, for heteroscedastic kernels, the dependence on aMi (and aMi+k for following elements) in the conditioning statement of the property in FIG. 3 has the consequence that we cannot assume that this condition is satisfied for aMi+k once it is satisfied for aMi. The problem is that for some aMi+k, the scaling factor α(apnew,aMi+k) may be greater than the factor for aMi. We can fix this problem by a slight modification to the criterion, as follows. Let α denote the largest α used for scaling the kernels in aM∪{apnew}. It is now guaranteed that the remaining elements in aM cannot be stolen once we observe that




  
    
      
        
          D
          ⁡
          
            (
            
              
                a
                p
              
              ,
              
                a
                M
                i
              
            
            )
          
        
        <
        
          
            1
            
              2
              ⁢
              
                
              
              ⁢
              
                α
                _
              
            
          
          ⁢
          
            
              D
              Σ
            
            ⁡
            
              (
              
                
                  a
                  p
                
                ,
                
                  a
                  p
                  new
                
              
              )
            
          
        
      
    
    
      
        (
        18
        )
      
    
  




The heteroscedastic criterion is slightly less efficient than the homoscedastic criterion, because α≦1 (with equality in the homoscedastic case). Fortunately, α decreases as the number of anchors increases, and, the savings by not having to evaluate all elements in an anchor may be significant when there are many anchors, because most of the old anchors discover immediately that none or only few of their elements can be stolen by a new anchor under construction.
Another reason for the slightly less efficient heteroscedastic criterion is the answer to how we efficiently keep track of α. We will in addition to maintaining the sorted list of elements aM also be maintaining a sorted (from high to low) list of scaling factors αM. Each element aMiεaM may be linked to its corresponding aMjεaM, so when an element aMi is stolen from aM, the linked αMj is stolen from aM as well. Hence, α may be efficiently found as the greater of the scaling factors for the pivot in the new anchor under construction and the first element in αM for the old anchor currently being investigated.
The agglomeration of anchors into the anchor sub-tree may now be considered. The tree is constructed bottom-up by letting each anchor represent a leaf or node in the tree and then recursively merging the pair of most compatible nodes into a parent node until only one root node is left.
The compatibility of two nodes may be defined as follows. Notice that by construction, all element in an anchor are within a guaranteed distance of DΣ(ap,aM1)=α(ap,aM1)D(ap,aM1). In other words, in the metric space with a Mahalanobis distance metric, all elements in an anchor are enclosed in a ball that is centered at ap and has Mahalanobis radius DΣ(ap,aM1). The compatability of two nodes is now measured by the radius of the smallest ball that completely contains the balls for the two nodes, and the most compatible nodes are those resulting in the smallest radius. By observing Mahalanobis distances along this line, it is a simple geometric argument that a line between the furthest apart points on two balls passes through the center of the balls. It therefore follows that the enclosing ball will have characteristics as defined by the property defined in FIG. 4.
The Block Constrained Variational Distribution
Given the data and kernel partition trees, and a mutually exclusive and exhaustive partition for the product space of data and kernels into blocks {(A1, B1), . . . , (AP, BP)}, where AP is a part of the data and BP is a part of the kernels, corresponding to nodes in the two Respective trees—as previously defined in FIG. 2. This partition may group data and kernels together for which kernels are unable to differentiate between the data in any significant way. Our variational distribution q will then for all the data in a block assign the same variational membership for all the mixture components defined by the kernels in the block. That is,

q(m|n)=q(Bp|Ap) for all (n,m)ε(Ap,Bp)  (18)

where (n, m)ε(Ap, Bp) is a notational convenient representation for (xn, Kμm,Σm)ε(Ap, Bp). FIG. 2 illustrates a block partition where, for example, q(1|4)=q(1|5)=q(2|4)=q(2|5).
The variational distributions q(•|n) are standard probability distributions and must therefore satisfy the sum-to-one constraint Σmq(m|n)=1. The positivity constraints q(m|n)>0 are automatically satisfied during estimation of q and are therefore not treated as explicit constraints. By integrating the block constraints in (18) into these standard sum-to-one constraints, we obtain the following N constraints

Σp;nεAp|Bp|q(Bp|Ap)=1 for all nε{1, . . . , N}  (19)

The constraint associated with data point n involves exactly the q(Bp|Ap) for which nεAp in the block partition. In FIG. 2, the variational probabilities involved in a constraint are therefore those q(Bp|Ap) encountered on the column under a data partition leaf in the block partition table. For example, for the data partition leaf corresponding to data point n=1, the corresponding constraint is

q(1|1)+q(2|1)+q(3|1)+3q(4−6|1−2)+3q(7−9|1−3)=1  (19)

where q(m1−m2|n1−n2) is the probability assigned to the block with kernels m1 through m2 and data points n1 through n2.
The constraints in (19) complicates the optimization of q in the E-step, because they are intertwined in the sense that some variational probabilities involved in one constraint may also appear as a part of another constraint. Fortunately, this complication can be alleviated, because it turns out that it is possible to represent the block constraints in the form of a so-called marked partition tree or MPT.
FIG. 5 illustrates an example embodiment 500 showing a marked partition tree (MPT). A MPT is similar to the data partition tree, but with an additional encoding of data partitions that relates to specific components in a mixture model, as follows. If Ap is a data block in the partition for mixture component m, then the corresponding node in the tree is marked by an identifier for that component. Now, recall that the kernels in the kernel density estimate for each data point correspond to the components in a mixture model. We, accordingly, create a MPT from a block partition by simply marking the node in the data partition tree corresponding to Ap with the mark Bp for each block (Ap, Bp) in the partition. For example, for the block partition in FIG. 2 the MPT will appear as in FIG. 5. The MPT of FIG. 5 has a group of kernels in a block to be marked together instead of insisting on individual marks for each mixture component defined by the kernels in the block. For example, the marks Bpε{1−2,7−9} may be used instead of the marks Bpε{1,2,7,8,9} for Ap=4−5 in FIG. 5. This difference may add to computational efficiency, as we will see later.
By construction, each path from a leaf n to the root in the MPT has the property that it marks all Bp for which nεAp and (Ap,Bp) is in the block partition. The MPT therefore also defines the constraints in (19). However, the MPT representation may have an additional benefit of representing the constraints in an explicit tree structure that is exploited during the efficient estimation of q in the E-step.
As a final caveat, it is in fact possible that the lowest marked nodes in the tree are not leaf nodes. If Ap is such a node, all constraints in (19) for nεAp will be redundant. In this case the MPT construction process proceeds by pruning all unmarked nodes without marked descendants from the tree, which in effect reduces the number of constraints in (19) to the lower number of non-redundant constraints associated with paths from leaves to the root in the reduced tree.
Block Selection
The (Ap,Bp) blocks in FIG. 2 may be constructed by a recursive traversal of the data and kernel partition trees. Let a denote a node in the data partition tree and b denote a node in the kernel partition tree. Starting from a and b being the roots of their respective trees, the blocks may be constructed by a call to the recursive function of FIG. 6.
Here Block (a, b) creates one of the (Ap, Bp) blocks in FIG. 2.
The CanBlock(a, b, γ) is a criterion which determines if a and b are far enough apart that the group of kernels in b is unable to differentiate between a group of data in a to a certain degree determined by a user-specified parameter γ.
Letting α and α denote the smallest and largest factor used to scale the reference bandwidth Σ for the kernels in node b. The distance from any kernel in b to any data point in a (from the view point of b) cannot be smaller than




  
    
      
        
          
            D
            min
          
          ⁡
          
            (
            
              a
              ,
              b
            
            )
          
        
        =
        
          max
          ⁢
          
            {
            
              0
              ,
              
                
                  
                    1
                    
                      α
                      _
                    
                  
                  ⁢
                  
                    
                      D
                      Σ
                    
                    ⁡
                    
                      (
                      
                        
                          a
                          p
                        
                        ,
                        
                          b
                          p
                        
                      
                      )
                    
                  
                
                -
                
                  
                    1
                    
                      α
                      _
                    
                  
                  ⁢
                  
                    
                      D
                      Σ
                    
                    ⁡
                    
                      (
                      
                        
                          a
                          p
                        
                        ,
                        
                          a
                          M
                          1
                        
                      
                      )
                    
                  
                
                -
                
                  D
                  ⁡
                  
                    (
                    
                      
                        b
                        p
                      
                      ,
                      
                        b
                        M
                        1
                      
                    
                    )
                  
                
              
            
            }
          
        
      
    
    
      
        (
        20
        )
      
    
  




and the distance cannot be larger than




  
    
      
        
          
            D
            max
          
          ⁡
          
            (
            
              a
              ,
              b
            
            )
          
        
        =
        
          
            
              1
              
                α
                _
              
            
            ⁢
            
              
                D
                Σ
              
              ⁡
              
                (
                
                  
                    a
                    p
                  
                  ,
                  
                    b
                    p
                  
                
                )
              
            
          
          +
          
            
              1
              
                α
                _
              
            
            ⁢
            
              
                D
                Σ
              
              ⁡
              
                (
                
                  
                    a
                    p
                  
                  ,
                  
                    a
                    M
                    1
                  
                
                )
              
            
          
          +
          
            D
            ⁡
            
              (
              
                
                  b
                  p
                
                ,
                
                  b
                  M
                  1
                
              
              )
            
          
        
      
    
    
      
        (
        21
        )
      
    
  




A CanBlock criterion can now be defined as a threshold for the relative distance between kernel evaluations based on the smallest and largest possible distances from b to a




  
    
      
        
          
            
              
                1
                
                  Z
                  
                    Σ
                    min
                  
                
              
              ⁢
              K
              ⁢
              
                (
                
                  D
                  min
                
                )
              
            
            -
            
              
                1
                
                  Z
                  
                    Σ
                    max
                  
                
              
              ⁢
              
                K
                ⁡
                
                  (
                  
                    D
                    max
                  
                  )
                
              
            
          
          
            
              1
              
                Z
                
                  Σ
                  max
                
              
            
            ⁢
            
              K
              ⁡
              
                (
                
                  D
                  max
                
                )
              
            
          
        
        <
        γ
      
    
    
      
        (
        22
        )
      
    
  




where Σmin and Σmax denote the unknown bandwidths leading to the smallest and largest distances. For the heteroscedastic Gaussian kernels the criterion becomes




  
    
      
        
          
            
              
                
                  (
                  
                    
                      
                      
                        Σ
                        max
                      
                      
                    
                    
                      
                      
                        Σ
                        min
                      
                      
                    
                  
                  )
                
                
                  
                    -
                    1
                  
                  /
                  2
                
              
              ⁢
              
                K
                ⁡
                
                  (
                  
                    D
                    min
                  
                  )
                
              
            
            -
            
              K
              ⁡
              
                (
                
                  D
                  max
                
                )
              
            
          
          
            K
            ⁡
            
              (
              
                D
                max
              
              )
            
          
        
        <
        γ
      
    
    
      
        (
        23
        )
      
    
  




By the restriction of heteroscedasity to scaled bandwidths, Σmin=αminΣ and Σmax=αmaxΣ. The unknown factor in (23) can therefore be bounded as follows




  
    
      
        
          
            (
            
              
                
                
                  Σ
                  max
                
                
              
              
                
                
                  Σ
                  min
                
                
              
            
            )
          
          
            
              -
              1
            
            /
            2
          
        
        =
        
          
            
              
                (
                
                  
                    α
                    max
                  
                  
                    α
                    min
                  
                
                )
              
              
                
                  -
                  d
                
                /
                2
              
            
            ⁢
            
              
                
                Σ
                
              
              
                
                  -
                  1
                
                /
                2
              
            
          
          ≤
          
            
              
                (
                
                  
                    α
                    _
                  
                  /
                  
                    α
                    _
                  
                
                )
              
              
                -
                
                  d
                  2
                
              
            
            ⁢
            
              
                
                Σ
                
              
              
                -
                
                  1
                  2
                
              
            
          
        
      
    
    
      
        (
        24
        )
      
    
  




Using this bound instead of the unknown factor in (23) guarantees that the threshold γ for the CanBlock criterion will not be violated.
For homoscedastic kernels α= α=1, and the criterion in this case simplifies to




  
    
      
        
          
            
              K
              ⁡
              
                (
                
                  D
                  min
                
                )
              
            
            -
            
              K
              ⁡
              
                (
                
                  D
                  max
                
                )
              
            
          
          
            K
            ⁡
            
              (
              
                D
                max
              
              )
            
          
        
        <
        γ
      
    
    
      
        (
        25
        )
      
    
  




Efficient Variational E-Step
With the block constraints in (18) on the variational distribution, the decomposition of F(x, q) in (7) reduces to




  
    
      
        
          
            F
            ⁡
            
              (
              
                x
                ,
                q
              
              )
            
          
          =
          
            
              ∑
              
                p
                =
                1
              
              P
            
            ⁢
            
              
                
                
                  A
                  p
                
                
              
              ⁢
              
                
                
                  B
                  p
                
                
              
              ⁢
              
                
                  q
                  ⁡
                  
                    (
                    
                      
                        B
                        p
                      
                      ⁢
                      
                        |
                      
                      ⁢
                      
                        A
                        p
                      
                    
                    )
                  
                
                ⁡
                
                  [
                  
                    
                      
                        -
                        log
                      
                      ⁢
                      
                        
                      
                      ⁢
                      
                        q
                        ⁡
                        
                          (
                          
                            
                              B
                              p
                            
                            ⁢
                            
                              |
                            
                            ⁢
                            
                              A
                              p
                            
                          
                          )
                        
                      
                    
                    +
                    
                      H
                      ⁡
                      
                        (
                        
                          B
                          p
                        
                        )
                      
                    
                    +
                    
                      G
                      ⁡
                      
                        (
                        
                          
                            B
                            p
                          
                          ⁢
                          
                            |
                          
                          ⁢
                          
                            A
                            p
                          
                        
                        )
                      
                    
                  
                  ]
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        
          
        
        ⁢
        
          where
          ,
          
            
              for
              ⁢
              
                
              
              ⁢
              
                p
                ⁡
                
                  (
                  m
                  )
                
              
            
            =
            
              1
              /
              M
            
          
          ,
        
      
    
    
      
        (
        26
        )
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            
              H
              ⁡
              
                (
                
                  B
                  p
                
                )
              
            
            =
            
              
                
                  1
                  
                    
                    
                      B
                      p
                    
                    
                  
                
                ⁢
                
                  
                    ∑
                    
                      m
                      ∈
                      
                        B
                        p
                      
                    
                  
                  ⁢
                  
                    log
                    ⁢
                    
                      
                    
                    ⁢
                    
                      p
                      ⁡
                      
                        (
                        m
                        )
                      
                    
                  
                
              
              =
              
                -
                
                  log
                  ⁡
                  
                    (
                    M
                    )
                  
                
              
            
          
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          and
        
        ⁢
        
          

        
      
    
    
      
        (
        27
        )
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            G
            ⁡
            
              (
              
                
                  B
                  p
                
                |
                
                  A
                  p
                
              
              )
            
          
          =
          
            
              1
              
                
                  
                  
                    A
                    p
                  
                  
                
                ⁢
                
                  
                  
                    B
                    p
                  
                  
                
              
            
            ⁢
            
              
                ∑
                
                  n
                  ∈
                  
                    B
                    p
                  
                
              
              ⁢
              
                
                  ∑
                  
                    m
                    ∈
                    
                      B
                      p
                    
                  
                
                ⁢
                
                  log
                  ⁢
                  
                    
                  
                  ⁢
                  
                    p
                    (
                    
                      
                        
                          x
                          n
                        
                        ⁢
                        
                          |
                        
                        ⁢
                        
                          μ
                          m
                        
                      
                      ,
                      
                        ∑
                        m
                      
                    
                    )
                  
                
              
            
          
        
      
    
    
      
        (
        28
        )
      
    
  




Notice that the block-specific geometric mean G(A|B) is the only part of F(x,q) that depends on specific data and kernel parameters.
The constraints in (19) may then be integrated into the maximization of F(x,q) with respect to q by use of the Lagrange multiplier method. Introducing the Lagrange multipliers λ=(λ1, . . . , λN) for the constraints, we construct the Lagrangian




  
    
      
        
          F
          ⁡
          
            (
            
              x
              ,
              q
              ,
              λ
            
            )
          
        
        =
        
          
            F
            ⁡
            
              (
              
                x
                ,
                q
              
              )
            
          
          +
          
            
              ∑
              
                n
                =
                1
              
              N
            
            ⁢
            
              
                λ
                n
              
              (
              
                
                  
                    ∑
                    
                      p
                      :
                      
                        n
                        ∈
                        
                          A
                          p
                        
                      
                    
                  
                  ⁢
                  
                    
                      
                      
                        B
                        p
                      
                      
                    
                    ⁢
                    
                      q
                      ⁡
                      
                        (
                        
                          
                            B
                            p
                          
                          |
                          
                            A
                            p
                          
                        
                        )
                      
                    
                  
                
                -
                1
              
              )
            
          
        
      
    
    
      
        (
        29
        )
      
    
  




By setting




  
    
      
        
          
            ∂
            
              F
              ⁡
              
                (
                
                  x
                  ,
                  q
                  ,
                  λ
                
                )
              
            
          
          
            ∂
            
              (
              
                
                  B
                  p
                
                |
                
                  A
                  p
                
              
              )
            
          
        
        =
        0
      
    
    
      
        
      
    
  




and solving all for q (Bp|Ap) we obtain the solution





  
    
      
        
          
            q
            λ
          
          ⁡
          
            (
            
              
                B
                p
              
              ⁢
              
                |
              
              ⁢
              
                A
                p
              
            
            )
          
        
        =
        
          
            exp
            (
            
              
                
                  1
                  
                    
                    
                      A
                      p
                    
                    
                  
                
                ⁢
                
                  
                    ∑
                    
                      p
                      :
                      
                        n
                        ∈
                        
                          A
                          p
                        
                      
                    
                  
                  ⁢
                  
                    λ
                    n
                  
                
              
              -
              1
            
            )
          
          ⁢
          
            exp
            ⁡
            
              (
              
                H
                ⁡
                
                  (
                  
                    B
                    p
                  
                  )
                
              
              )
            
          
          ⁢
          
            exp
            ⁡
            
              (
              
                G
                ⁡
                
                  (
                  
                    
                      B
                      p
                    
                    ⁢
                    
                      |
                    
                    ⁢
                    
                      A
                      p
                    
                  
                  )
                
              
              )
            
          
        
      
    
    
      
        (
        30
        )
      
    
  




where the λ subscript in qλ(Bp|Ap) indicates that this solution is still a function of λ.
A closed-form solution to the constrained optimization problem can now be found by inserting qλ(Bp|Ap) into the constraints in (19) and then exploit the tree structure of these constraints, as represented by the MPT, to gradually solve for λ. Following, by inserting this λ into (30), we finally obtain the optimal value for the variational probabilities qλ(Bp|Ap), p=1, . . . , .
An algorithmic description of the E-step may be found in FIG. 7.
Sufficient Statistics
It is key to the computational efficiency of the variational E-step that sufficient statistics for G (Bp|Ap) factorizes into data-specific statistics and kernel-specific statistics in this way avoiding computation of statistics on the product space of data and kernels. These statistics can therefore be pre-computed separately and stored at the nodes in the respective partition trees prior to the actual mode-seeking process. For heteroscedastic Gaussian kernels with profile defined on the Mahalanobis distance




  
    
      
        
          
            
              
                G
                ⁡
                
                  (
                  
                    
                      B
                      p
                    
                    ⁢
                    
                      |
                    
                    ⁢
                    
                      A
                      p
                    
                  
                  )
                
              
              =
              
              ⁢
              
                
                  1
                  
                    
                      
                      
                        A
                        p
                      
                      
                    
                    ⁢
                    
                      
                      
                        B
                        p
                      
                      
                    
                  
                
                ⁢
                
                  
                    ∑
                    
                      n
                      ∈
                      
                        A
                        p
                      
                    
                  
                  ⁢
                  
                    
                      ∑
                      
                        m
                        ∈
                        
                          B
                          p
                        
                      
                    
                    ⁢
                    
                      log
                      ⁢
                      
                        
                      
                      ⁢
                      
                        p
                        (
                        
                          
                            
                              x
                              n
                            
                            ⁢
                            
                              |
                            
                            ⁢
                            
                              μ
                              m
                            
                          
                          ,
                          
                            ∑
                            m
                          
                        
                        )
                      
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                c
                -
                
                  
                    1
                    2
                  
                  ⁡
                  
                    [
                    
                      
                        
                          
                            
                              
                                1
                                
                                  
                                  
                                    B
                                    p
                                  
                                  
                                
                              
                              ⁢
                              
                                
                                  ∑
                                  
                                    m
                                    ∈
                                    
                                      B
                                      p
                                    
                                  
                                
                                ⁢
                                
                                  log
                                  ⁢
                                  
                                    
                                    
                                      ∑
                                      m
                                    
                                    
                                  
                                
                              
                            
                            +
                          
                        
                      
                      
                        
                          
                            
                              1
                              
                                
                                  
                                  
                                    A
                                    p
                                  
                                  
                                
                                ⁢
                                
                                  
                                  
                                    B
                                    p
                                  
                                  
                                
                              
                            
                            ⁢
                            
                              
                                ∑
                                
                                  n
                                  ∈
                                  
                                    A
                                    p
                                  
                                
                              
                              ⁢
                              
                                
                                  ∑
                                  
                                    m
                                    ∈
                                    
                                      B
                                      p
                                    
                                  
                                
                                ⁢
                                
                                  
                                    
                                      (
                                      
                                        
                                          x
                                          n
                                        
                                        -
                                        
                                          μ
                                          m
                                        
                                      
                                      )
                                    
                                    T
                                  
                                  ⁢
                                  
                                    
                                      ∑
                                      m
                                      
                                        -
                                        1
                                      
                                    
                                    ⁢
                                    
                                      (
                                      
                                        
                                          x
                                          n
                                        
                                        -
                                        
                                          μ
                                          m
                                        
                                      
                                      )
                                    
                                  
                                
                              
                            
                          
                        
                      
                    
                    ]
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                c
                -
                
                  
                    1
                    2
                  
                  ⁡
                  
                    [
                    
                      
                        
                          〈
                          
                            log
                            ⁢
                            
                              
                              
                                ∑
                                m
                              
                              
                            
                          
                          〉
                        
                        
                          B
                          p
                        
                      
                      +
                      
                        
                          1
                          
                            
                            
                              B
                              p
                            
                            
                          
                        
                        ⁢
                        
                          
                            ∑
                            
                              m
                              ∈
                              
                                B
                                p
                              
                            
                          
                          ⁢
                          
                            (
                            
                              
                                
                                  
                                    
                                      
                                        μ
                                        m
                                        T
                                      
                                      ⁢
                                      
                                        
                                          
                                            ∑
                                            m
                                          
                                          
                                            -
                                            1
                                          
                                        
                                        ⁢
                                        
                                          μ
                                          m
                                        
                                      
                                    
                                    +
                                  
                                
                              
                              
                                
                                  
                                    
                                      
                                        〈
                                        
                                          
                                            x
                                            n
                                            T
                                          
                                          ⁢
                                          
                                            
                                              
                                                ∑
                                                m
                                              
                                              
                                                -
                                                1
                                              
                                            
                                            ⁢
                                            
                                              x
                                              n
                                            
                                          
                                        
                                        〉
                                      
                                      
                                        A
                                        p
                                      
                                    
                                    -
                                  
                                
                              
                              
                                
                                  
                                    2
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    
                                      μ
                                      m
                                      T
                                    
                                    ⁢
                                    
                                      
                                        
                                          ∑
                                          m
                                        
                                        
                                          -
                                          1
                                        
                                      
                                      ⁢
                                      
                                        
                                          〈
                                          
                                            x
                                            n
                                          
                                          〉
                                        
                                        
                                          A
                                          p
                                        
                                      
                                    
                                  
                                
                              
                            
                            )
                          
                        
                      
                    
                    ]
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                c
                -
                
                  
                    1
                    2
                  
                  ⁡
                  
                    [
                    
                      
                        
                          
                            
                              
                                〈
                                
                                  log
                                  ⁢
                                  
                                    
                                    
                                      ∑
                                      m
                                    
                                    
                                  
                                
                                〉
                              
                              
                                B
                                p
                              
                            
                            +
                            
                              
                                〈
                                
                                  
                                    μ
                                    m
                                    T
                                  
                                  ⁢
                                  
                                    
                                      
                                        ∑
                                        m
                                      
                                      
                                        -
                                        1
                                      
                                    
                                    ⁢
                                    
                                      μ
                                      m
                                    
                                  
                                
                                〉
                              
                              
                                B
                                p
                              
                            
                            +
                          
                        
                      
                      
                        
                          
                            
                              
                                1
                                
                                  
                                  
                                    B
                                    p
                                  
                                  
                                
                              
                              ⁢
                              
                                
                                  ∑
                                  
                                    m
                                    ∈
                                    
                                      B
                                      p
                                    
                                  
                                
                                ⁢
                                
                                  
                                    〈
                                    
                                      
                                        x
                                        n
                                        T
                                      
                                      ⁢
                                      
                                        
                                          
                                            ∑
                                            m
                                          
                                          
                                            -
                                            1
                                          
                                        
                                        ⁢
                                        
                                          x
                                          n
                                        
                                      
                                    
                                    〉
                                  
                                  
                                    A
                                    p
                                  
                                
                              
                            
                            -
                            
                              2
                              ⁢
                              
                                
                                  〈
                                  
                                    
                                  
                                  ⁢
                                  
                                    
                                      μ
                                      m
                                      T
                                    
                                    ⁢
                                    
                                      
                                        ∑
                                        m
                                      
                                      
                                        -
                                        1
                                      
                                    
                                  
                                  〉
                                
                                
                                  B
                                  p
                                
                              
                              ⁢
                              
                                
                                  〈
                                  
                                    x
                                    n
                                  
                                  〉
                                
                                
                                  A
                                  p
                                
                              
                            
                          
                        
                      
                    
                    ]
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                c
                -
                
                  
                    1
                    2
                  
                  ⁡
                  
                    [
                    
                      
                        
                          
                            
                              
                                〈
                                
                                  log
                                  ⁢
                                  
                                    
                                    
                                      ∑
                                      m
                                    
                                    
                                  
                                
                                〉
                              
                              
                                B
                                p
                              
                            
                            +
                            
                              
                                〈
                                
                                  
                                    μ
                                    m
                                    T
                                  
                                  ⁢
                                  
                                    
                                      
                                        ∑
                                        m
                                      
                                      
                                        -
                                        1
                                      
                                    
                                    ⁢
                                    
                                      μ
                                      m
                                    
                                  
                                
                                〉
                              
                              
                                B
                                p
                              
                            
                            +
                          
                        
                      
                      
                        
                          
                            
                              Tr
                              ⁡
                              
                                (
                                
                                  
                                    
                                      〈
                                      
                                        
                                          ∑
                                          m
                                        
                                        
                                          -
                                          1
                                        
                                      
                                      〉
                                    
                                    
                                      B
                                      p
                                    
                                  
                                  ⁢
                                  
                                    
                                      〈
                                      
                                        
                                          x
                                          n
                                          T
                                        
                                        ⁢
                                        
                                          x
                                          n
                                        
                                      
                                      〉
                                    
                                    
                                      A
                                      p
                                    
                                  
                                
                                )
                              
                            
                            -
                            
                              2
                              ⁢
                              
                                
                                  〈
                                  
                                    
                                  
                                  ⁢
                                  
                                    
                                      μ
                                      m
                                      T
                                    
                                    ⁢
                                    
                                      
                                        ∑
                                        m
                                      
                                      
                                        -
                                        1
                                      
                                    
                                  
                                  〉
                                
                                
                                  B
                                  p
                                
                              
                              ⁢
                              
                                
                                  〈
                                  
                                    x
                                    n
                                  
                                  〉
                                
                                
                                  A
                                  p
                                
                              
                            
                          
                        
                      
                    
                    ]
                  
                
              
            
          
        
      
    
    
      
        (
        31
        )
      
    
  




where




  c
  =
  
    
      -
      
        1
        2
      
    
    ⁢
    Nd
    ⁢
    
      
    
    ⁢
    
      log
      ⁡
      
        (
        
          2
          ⁢
          
            
          
          ⁢
          π
        
        )
      
    
  




with d being the number of features in a data point, <•>Ap and <•>Bp denote averages over nεAp and mεBp, respectively, and Tr(•) denotes the trace of a matrix. Notice that the sufficient statistics factorizes into data-specific and kernel-specific parts.

For the homoscedastic Gaussian kernels, G (Bp|Ap) simplifies to




  
    
      
        
          G
          ⁡
          
            (
            
              B
              |
              A
            
            )
          
        
        =
        
          c
          -
          
            
              1
              2
            
            ⁡
            
              [
              
                
                  
                    
                      
                        log
                        ⁢
                        
                          
                          ∑
                          
                        
                      
                      +
                      
                        Tr
                        ⁢
                        
                          (
                          
                            
                              ∑
                              
                                -
                                1
                              
                            
                            ⁢
                            
                              
                                〈
                                
                                  
                                    μ
                                    m
                                    T
                                  
                                  ⁢
                                  
                                    μ
                                    m
                                  
                                
                                〉
                              
                              
                                B
                                p
                              
                            
                          
                          )
                        
                      
                      +
                    
                  
                
                
                  
                    
                      
                        Tr
                        ⁢
                        
                          (
                          
                            
                              ∑
                              
                                -
                                1
                              
                            
                            ⁢
                            
                              
                                〈
                                
                                  
                                    x
                                    n
                                    T
                                  
                                  ⁢
                                  
                                    x
                                    n
                                  
                                
                                〉
                              
                              
                                A
                                p
                              
                            
                          
                          )
                        
                      
                      -
                      
                        2
                        ⁢
                        
                          
                            〈
                            
                              μ
                              m
                              T
                            
                            〉
                          
                          
                            B
                            p
                          
                        
                        ⁢
                        
                          
                            ∑
                            
                              -
                              1
                            
                          
                          ⁢
                          
                            
                              〈
                              
                                x
                                n
                              
                              〉
                            
                            
                              A
                              p
                            
                          
                        
                      
                    
                  
                
              
              ]
            
          
        
      
    
    
      
        (
        32
        )
      
    
  




Efficient Variational M-Step
The nodes in the MPT will after the E-step in the t'th iteration of the algorithm contain the computed qt+1(Bp|Ap). Recall that qt+1(m|Ap)=qt+1(Bp|Ap) for all mεBp. The update for each xnt can now be efficiently computed by following the path from leaf n to the root in the MPT, while computing the update for the three different variational mode-seeking algorithms as follows.
For heteroscedastic kernels an efficient update for mean shift becomes




  
    
      
        
          
            
              x
              n
              
                t
                +
                1
              
            
            (
            
              
                
                  ∑
                  
                    p
                    :
                    
                      n
                      ∈
                      
                        A
                        p
                      
                    
                  
                
                ⁢
                
                  
                    
                    
                      B
                      p
                    
                    
                  
                  ⁢
                  
                    
                      q
                      
                        t
                        +
                        1
                      
                    
                    ⁡
                    
                      (
                      
                        
                          B
                          p
                        
                        ⁢
                        
                          |
                        
                        ⁢
                        
                          A
                          p
                        
                      
                      )
                    
                  
                
              
              <
              
                
                  
                    ∑
                    m
                  
                  
                    -
                    1
                  
                
                ⁢
                
                  >
                  
                    B
                    p
                  
                
              
            
            )
          
          1
        
        *
        
          
            ∑
            
              p
              :
              
                n
                ∈
                
                  A
                  p
                
              
            
          
          ⁢
          
            
              
              
                B
                p
              
              
            
            ⁢
            
              
                q
                
                  t
                  +
                  1
                
              
              ⁡
              
                (
                
                  
                    B
                    p
                  
                  ⁢
                  
                    |
                  
                  ⁢
                  
                    A
                    p
                  
                
                )
              
            
            ⁢
            
              
                〈
                
                  
                    
                      ∑
                      m
                    
                    
                      -
                      1
                    
                  
                  ⁢
                  
                    μ
                    m
                  
                
                〉
              
              
                B
                p
              
            
          
        
      
    
    
      
        (
        32
        )
      
    
  




For homoscedastic kernels this expression simplifies to




  
    
      
        
          x
          n
          
            t
            +
            1
          
        
        =
        
          
            ∑
            
              p
              :
              
                n
                ∈
                
                  A
                  p
                
              
            
          
          ⁢
          
            
              
                
                
                  B
                  p
                
                
              
              ⁢
              
                
                  q
                  
                    t
                    +
                    1
                  
                
                ⁡
                
                  (
                  
                    
                      B
                      p
                    
                    ⁢
                    
                      |
                    
                    ⁢
                    
                      A
                      p
                    
                  
                  )
                
              
              ⁢
              
                
                  〈
                  
                    μ
                    m
                  
                  〉
                
                
                  B
                  p
                
              
            
            
              
                ∑
                
                  p
                  :
                  
                    n
                    ∈
                    
                      A
                      p
                    
                  
                
                
                  
                
              
              ⁢
              
                
                  
                  
                    B
                    p
                  
                  
                
                ⁢
                
                  
                    q
                    
                      t
                      +
                      1
                    
                  
                  ⁡
                  
                    (
                    
                      
                        B
                        p
                      
                      ⁢
                      
                        |
                      
                      ⁢
                      
                        A
                        p
                      
                    
                    )
                  
                
              
            
          
        
      
    
    
      
        (
        33
        )
      
    
  




Notice that the statistics <Em−1>Bp, <Em−1μm>Bp, and <μm>Bp have already been pre-computed and stored in the kernel partition tree prior to the mode seeking.
Medoid Shift
For heteroscedastic kernels the efficient variational M-step corresponding to the update in (4) can utilize the following equality




  
    
      
        
          
            ∑
            
              m
              =
              1
            
            M
          
          ⁢
          
            
              q
              ⁡
              
                (
                
                  m
                  ⁢
                  
                    |
                  
                  ⁢
                  n
                
                )
              
            
            ⁢
            
              
                D
                
                  ∑
                  m
                
              
              ⁡
              
                (
                
                  x
                  ,
                  
                    μ
                    m
                  
                
                )
              
            
          
        
        =
        
          
            ∑
            
              p
              :
              
                n
                ∈
                
                  A
                  p
                
              
            
          
          ⁢
          
            
              
              
                B
                p
              
              
            
            ⁢
            
              
                q
                
                  t
                  +
                  1
                
              
              ⁡
              
                (
                
                  
                    B
                    p
                  
                  ⁢
                  
                    |
                  
                  ⁢
                  
                    A
                    p
                  
                
                )
              
            
            ⁢
            
              (
              
                
                  
                    〈
                    
                      
                        μ
                        m
                      
                      ⁢
                      
                        
                          
                            ∑
                            m
                          
                          
                            -
                            1
                          
                        
                        ⁢
                        
                          μ
                          m
                          T
                        
                      
                    
                    〉
                  
                  
                    B
                    p
                  
                
                +
                
                  Tr
                  (
                  
                    
                      
                        〈
                        
                          
                            ∑
                            m
                          
                          
                            -
                            1
                          
                        
                        〉
                      
                      
                        B
                        p
                      
                    
                    ⁢
                    
                      x
                      T
                    
                    ⁢
                    x
                  
                  )
                
                -
                
                  2
                  ⁢
                  
                    
                      〈
                      
                        
                          μ
                          m
                          T
                        
                        ⁢
                        
                          
                            ∑
                            m
                          
                          
                            -
                            1
                          
                        
                      
                      〉
                    
                    
                      B
                      p
                    
                  
                  ⁢
                  x
                
              
              )
            
          
        
      
    
    
      
        (
        34
        )
      
    
  




For homoscedastic kernels the equality simplifies as




  
    
      
        
          
            ∑
            
              m
              =
              1
            
            M
          
          ⁢
          
            
              q
              ⁡
              
                (
                
                  m
                  ⁢
                  
                    |
                  
                  ⁢
                  n
                
                )
              
            
            ⁢
            
              
                D
                
                  ∑
                  m
                
              
              ⁡
              
                (
                
                  x
                  ,
                  
                    μ
                    m
                  
                
                )
              
            
          
        
        =
        
          
            ∑
            
              p
              :
              
                n
                ∈
                
                  A
                  p
                
              
            
          
          ⁢
          
            
              
              
                B
                p
              
              
            
            ⁢
            
              
                q
                
                  t
                  +
                  1
                
              
              ⁡
              
                (
                
                  
                    B
                    p
                  
                  ⁢
                  
                    |
                  
                  ⁢
                  
                    A
                    p
                  
                
                )
              
            
            ⁢
            
              (
              
                Tr
                ⁡
                
                  (
                  
                    
                      
                        ∑
                        
                          -
                          1
                        
                      
                      ⁢
                      
                        
                          〈
                          
                            
                              μ
                              m
                            
                            ⁢
                            
                              μ
                              m
                              T
                            
                          
                          〉
                        
                        
                          B
                          p
                        
                      
                    
                    +
                    
                      Tr
                      ⁡
                      
                        (
                        
                          
                            ∑
                            
                              -
                              1
                            
                          
                          ⁢
                          
                            
                              x
                              T
                            
                            ⁢
                            x
                          
                        
                        )
                      
                    
                    -
                    
                      2
                      ⁢
                      
                        
                          〈
                          
                            μ
                            m
                            T
                          
                          〉
                        
                        
                          B
                          p
                        
                      
                      ⁢
                      
                        
                          ∑
                          
                            -
                            1
                          
                        
                        ⁢
                        x
                      
                    
                  
                  )
                
              
            
          
        
      
    
    
      
        (
        35
        )
      
    
  




Notice again that all statistics have already been pre-computed and stored in the kernel partition tree prior to the mode seeking.
Quick Shift
The M-step in quick shift computes the same type of quantities as the M-step for medoid shift. However, instead of the minimization over all data points (as in (*b)), quick shift only investigates nearest neighbors until a guaranteed nearest neighbor which decreases the value is found. This nearest neighbor search can be efficiently conducted by considering the leaf in the data partition tree that represents xn and then backtrack through the tree. During this backtracking phase the knowledge about the pivot and the furthest distance that any data point covered by a node in the tree can have from its pivot can be used to not consider parts of the tree, where it is guaranteed that a closer candidate to the current best candidate cannot be found.
Notice that for Mediod shift and Quick shift that each dynamic data point is shifted to a location that corresponds to a location of a data point in the initial data set. Once a shift has been computed for all initial data points in the data set, the result of the next shift has already been computed. In such situations, the first iteration is expressly computed, while remaining iterations are implicitly derived from the first iteration.
Non-Euclidian Distances
Above, the unified variational view on mode seeking was presented in a Euclidean setting, with the Mahalanobis distance measure introduced from a proper inner product. This view may be extended to a non-Euclidian setting via a finitely positive semi-definite function κ(•,•): XxX→, where X may be a non-Euclidian input space. The finitely positive definiteness of κ(•,•) ensures the existence of a decomposition into an inner product of its arguments under a feature mapping into a Hilbert space , φ(•):X→, i.e.:

κ(x,y)=φ(x)Tφ(y)  (36)

Assuming an explicit representation of the mapping φ(•), which will allow the mode-seeking algorithms to be performed in the Hilbert space.
The G (Bp|Ap) statistics used in the variational mode-seeking algorithms explicitly depends on the induced distance measure in Hilbert space, which can be computed as

D(x,y)=κ(x,x)+κ(y,y)−2κ(x,y)  (37)

The bilinearity of the inner product ensures that these statistics factorize into data-specific and kernel-specific parts, which is useful to store these statistics in the two partition trees.
For example, consider the cosine similarity measure




  
    
      
        
          κ
          ⁡
          
            (
            
              x
              ,
              y
            
            )
          
        
        =
        
          
            cos
            ⁡
            
              (
              
                x
                ,
                y
              
              )
            
          
          =
          
            
              
                x
                T
              
              ⁢
              y
            
            
              
                
                x
                
              
              ⁢
              
                
                y
                
              
            
          
        
      
    
    
      
        (
        38
        )
      
    
  




where x,y are non-negative vectors. The cosine similarity induces an explicit embedding




  
    φ
    ⁡
    
      (
      x
      )
    
  
  =
  
    x
    
      
      x
      
    
  




into a Hilbert space with a proper distance measure

D(φ(x),φ(y))=2−2κ(x,y)  (39)

The expression for G(Bp|Ap) now simplifies to:




  
    
      
        
          G
          ⁡
          
            (
            
              
                B
                p
              
              ⁢
              
                |
              
              ⁢
              
                A
                p
              
            
            )
          
        
        =
        
          c
          -
          
            [
            
              1
              -
              
                
                  〈
                  
                    
                      x
                      T
                    
                    
                      
                      x
                      
                    
                  
                  〉
                
                ⁢
                
                  A
                  p
                
                ⁢
                
                  〈
                  
                    
                      μ
                      m
                    
                    
                      
                      
                        μ
                        m
                      
                      
                    
                  
                  〉
                
                ⁢
                
                  B
                  p
                
              
            
            ]
          
        
      
    
    
      
        (
        40
        )
      
    
  




by exploiting the explicit mapping into the Hilbert space and the bilinearity of the inner product. Notice that the sufficient statistics used to compute G(Bp|Ap) again factorizes into data-specific and kernel-specific parts.
FIG. 8 is a flowchart illustration of an embodiment 800 showing a method for variational mode seeking. Embodiment 800 is an example method by which a set of data points may be analyzed to determine clusters of data using the processes described above.
Other embodiments may use different sequencing, additional or fewer steps, and different nomenclature or terminology to accomplish similar functions. In some embodiments, various operations or set of operations may be performed in parallel with other operations, either in a synchronous or asynchronous manner. The steps selected here were chosen to illustrate some principles of operations in a simplified form.
In block 802, a hierarchical kernel partition may be created. The kernels that are used in this hierarchical partition are defined in such a way that each kernel's location parameter corresponds to a different data point in the data set.
In block 804, the data set may be copied into a set of dynamic data points. The dynamic data points may be moved during a variational expectation-maximization process, and finally the original data points may be assigned to clusters in accordance with the modes in the underlying kernel density function that the dynamic data points moves to, as follows.
In block 806, an iterative step may begin. The process may iterate to convergence.
A hierarchical partition of the dynamic data points may be generated in block 808, and a block partition may be generated in block 810. The block partition in block 810 may be defined by an iterative procedure that involves both the hierarchical kernel and data partitions. An example of this procedure may be the procedure described in embodiment 600. An example of the blocks in a resulting block partition may be the block partition table 206 of embodiment 200.
Within each of the blocks of the block partition table 206, all of the data points may be considered to be similar enough that they can be processed via pre-computed sufficient statistics through the variational expectation and maximization steps. In this manner, the variational expectation and maximization steps may be performed.
The variational expectation step may be performed in block 812. An example of the expectation step may be found earlier in this specification in the section entitled “Efficient Variational E-step” and an algorithmic description in FIG. 7.
A variational maximization step may be performed in block 814. The maximization step may be performed using mean shift, mediod shift, quick shift, or other maximization steps. Examples of such steps may be found earlier in this specification in the section entitled “Efficient Variational M-step”.
If the convergence has not occurred in block 816, the process may return to block 808 for more analysis.
Once convergence has occurred in block 816, the clustering of the original data points may be determined according to the grouping of associated dynamic data points at modes in the underlying kernel density function in block 818.
The foregoing description of the subject matter has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the subject matter to the precise form disclosed, and other modifications and variations may be possible in light of the above teachings. The embodiment was chosen and described in order to best explain the principles of the invention and its practical application to thereby enable others skilled in the art to best utilize the invention in various embodiments and various modifications as are suited to the particular use contemplated. It is intended that the appended claims be construed to include other alternative embodiments except insofar as limited by the prior art.

## Claims

1. A computer-implemented method for generating clusters of data points within a given fixed data set, said method comprising:
generating a hierarchical partition of a plurality of fixed kernels, each of said fixed kernels having a fixed location at a data point in said fixed data set and each kernel's location parameter corresponding to a different data point in the data set;
creating a copy of said data set to create a set of dynamic data points;
iteratively moving said dynamic data points using a variational expectation-maximization process to approximate kernel density modes by iteratively until convergence performing a first method comprising:
generating an initial hierarchical partition of said dynamic data points;
generating a block partition in the product space of fixed kernels and dynamic data points, a block in said block partition containing one or more kernels grouped together by said hierarchical partition of said fixed kernels and one or more dynamic data points grouped together by said hierarchical partition of said dynamic data points;
performing an expectation step to compute a variational distribution assigning the same variational membership probability to all fixed kernels within a block for all dynamic data points in the same said block from said block partition;
performing a variational maximization step that updates said dynamic data points towards said kernel density modes;
at convergence, assigning data points to clusters when corresponding dynamic data points have converged to a same mode, wherein data points are assigned in accordance with modes in an underlying kernel density function.

2. The method of claim 1, trajectories of said dynamic data points constrained to pass through data points within said fixed data set, said method comprising:
explicit computation of shifts for all said dynamic data points in first iteration; and implicit computation of shifts for all said dynamic data point in a subsequent iteration.

3. The method of claim 1, said block partition being represented as a marked partition tree.

4. The method of claim 1, the kernels having Gaussian profiles.

5. The method of claim 4, the distance measure used in kernels being Mahalanobis distance.

6. The method of claim 4, the distance measure used in kernels being induced from a finitely positive semi-definite function, and the mode-seeking algorithm performed under an explicit feature mapping into Hilbert space.

7. The method of claim 6, the finitely positive semi-definite function being cosine similarity defined for non-negative feature vectors.

8. A device comprising:
a processor;
executable instructions operable by said processor, said executable instructions comprising a mode seeking method for generating clusters of data points within a given fixed data set, said method comprising:
generating a hierarchical partition of a plurality of fixed kernels, each of said fixed kernels having a fixed location at a data point in said fixed data set;
creating a copy of said data set to create a set of dynamic data points;
iteratively moving said dynamic data points using a variational expectation-maximization process to approximate kernel density modes by iteratively until convergence performing a first method comprising:
generating an initial hierarchical partition of said dynamic data points;
generating a block partition in the product space of fixed kernels and dynamic data points, a block in said block partition containing one or more kernels grouped together by said hierarchical partition of said fixed kernels and one or more dynamic data points grouped together by said hierarchical partition of said dynamic data points;
performing an expectation step to compute a variational distribution assigning the same variational membership probability to all fixed kernels within a block for all dynamic data points in the same said block from said block partition;
performing a variational maximization step that updates said dynamic data points towards said kernel density modes;

at convergence, assigning data points to clusters when corresponding dynamic data points have converged to a same mode, wherein data points are assigned in accordance with modes in an underlying kernel density function.

9. The device of claim 8, at least two of said kernels having differently scaled bandwidths.

10. The device of claim 8, all of said kernels having the same bandwidth.

11. The device of claim 8, said hierarchical partition of data and kernels comprising:
a data partition tree defining summarizing statistics about groups of said data in partition;
a kernel partition tree summarizing defining statistics about said kernels in partitions; and
using at least one of these statistics in at least one of the variational E-step and the variational M-step.

12. The device of claim 11, said statistics comprising at least one summarizing statistic stored in said kernel partition tree.

13. The device of claim 12, said maximization step comprising a variational mean shift maximization step.

14. The device of claim 12, said maximization step comprising a variational medoid shift maximization step.

15. The device of claim 12, said maximization step comprising a variational quick shift maximization step.

16. A computer readable storage medium for storing computer readable instructions, the computer readable instructions when executed by one or more processing devices that perform a mode seeking method for generating clusters of data points within a given fixed data set, said method comprising:
generating a hierarchical partition of a plurality of fixed kernels, each of said fixed kernels having a fixed location at a data point in said fixed data set and each kernel's location parameter corresponding to a different data point in the data set;
creating a copy of said data set to create a set of dynamic data points;
iteratively moving said dynamic data points using a variational expectation-maximization process to approximate kernel density modes by iteratively until convergence performing a first method comprising:
generating an initial hierarchical partition of said dynamic data points; generating a block partition in the product space of fixed kernels and dynamic data points, a block in said block partition containing one or more kernels grouped together by said hierarchical partition of said fixed kernels and one or more dynamic data points grouped together by said hierarchical partition of said dynamic data points;
performing an expectation step to compute a variational distribution assigning the same variational membership probability to all fixed kernels within a block for all dynamic data points in the same said block from said block partition;
performing a variational maximization step that updates said dynamic data points towards said kernel density modes;
at convergence, assigning data points to clusters when corresponding dynamic data points have converged to a same mode, wherein data points are assigned in accordance with modes in an underlying kernel density function.

17. The computer readable storage medium of claim 16, said expectation step solving a constrained optimization problem comprising:
traversing a marked partition tree representation for said block partition within said product space from a lowest level to a highest level and reducing nested constraints to a single equation at said highest level involving one Lagrange multiplier and solving said single equation to determine said Lagrange multiplier;
traversing said marked partition tree representation from said highest level to said lowest level and resolving Lagrange multipliers for each of said partitions by back-substitution of a previously resolved Lagrange multiplier; and
using said Lagrange multipliers to determine said variational distribution.

18. The computer readable storage medium of claim 17, said method further comprising:
the number of constraints in said constrained optimization being a number of lowest marked nodes in said marked partition tree.

19. The computer readable storage medium of claim 16, wherein the block partition includes a kernel partition corresponding to a kernel partition tree and a data partition corresponding to a data partition tree.

20. The computer readable storage medium of claim 19, wherein the step of generating the block partition comprises starting from a root of the kernel partition tree and a root of data partition tree and recursively expanding a granularity of a group of kernels in the kernel partition or a group of data in the data partition until a predefined criterion is satisfied.