Previous topic

medpy.features.histogram.gaussian_membership

Next topic

Image iterators (medpy.iterators)

This Page

medpy.features.histogram.sigmoidal_difference_membership

medpy.features.histogram.sigmoidal_difference_membership(bin_center, bin_width, smoothness)[source]

Create the difference of two sigmoids as membership function for a fuzzy histogram bin.

Parameters:

bin_center : number

The center of the bin of which to compute the membership function.

bin_width : number

The width of a single bin (all expected to be of equal width).

smoothness : number, optional

The smoothness of the function; determines the neighbourhood affected. See below and fuzzy_histogram for a more detailed explanation

Returns:

sigmoidal_difference_membership : function

A sigmoidal difference membership function centered on the bin.

Notes

Since the sigmoidal membership function is infinite, it is not actually true that it does not contribute to bins outside of the neighbourhood range. But the contribution is so marginal (eps <= 0.001 per value) that it can be safely ignored.

The sigmoidal membership function is defined as

\[\mu_{sigmoid}(x) = \left[1+e^{-\alpha_1 (x-\zeta_1)}\right]^{-1} - \left[1+e^{-\alpha_2 (x-\zeta_2)}\right]^{-1}\]

where \(\alpha_1 = \alpha_2 = \alpha\) is computed throught the smoothness term and \(\zeta_1\) and \(\zeta_2\) constitute the left resp. right borders of the bin.

The following figure shows three sigmoidal membership functions for bins at the centers -2, -0 and 2 with a bin width of 2 and a smoothness of 2:

“Sigmoidal functions (1)”

The central (green) membership functions extends to its up till the second bin (centered around -4) and the same to the right (until the bin centered around +4). Therefore all values from -5 to +5 are considered for membership in this bin. Values out of this range would only contribute marginally to this bin. Furthermore it is inteligable that the sum of all membership functions at each point is equal to 1, therefore all values are equally represented (i.e. contribute with 1 to the overall histogram).

The influence of the smoothness term can be observed in the following figure:

“Sigmoidal functions (2)”

Here smoothness has been chosen to be 1. The green function therefore extends just into the directly adjunct bins to its left and right.