Email updates

Keep up to date with the latest news and content from BMC Physiology and BioMed Central.

Open Access Methodology article

Inference of mechanical states of intestinal motor activity using hidden Markov models

Lukasz Wiklendt1, Marcello Costa1 and Phil G Dinning12*

Author Affiliations

1 Discipline of Human Physiology, Flinders Medical Science and Technology, Flinders University, Adelaide, Australia

2 Departments of Gastroenterology and Surgery, Flinders Medical Centre, Adelaide, Australia

For all author emails, please log on.

BMC Physiology 2013, 13:14  doi:10.1186/1472-6793-13-14

The electronic version of this article is the complete one and can be found online at: http://www.biomedcentral.com/1472-6793/13/14


Received:30 July 2013
Accepted:5 December 2013
Published:11 December 2013

© 2013 Wiklendt et al.; licensee BioMed Central Ltd.

This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Abstract

Background

Contractions and relaxations of the muscle layers within the digestive tract alter the external diameter and the internal pressures. These changes in diameter and pressure move digesting food and waste products. Defining these complex relationships is a fundamental step for neurogastroenterologists to be able define normal and abnormal gut motility.

Results

Utilising an in vitro technique that allows for the simultaneous recording of intraluminal pressure (manometry) and gut diameter (video) in an isolated section of rabbit colon, we developed a technique to help define the mechanical states of the muscle at any point in space and time during actual peristaltic movements. This was achieved by directly relating the changes in pressure to the changes in diameter along the length of the gut studied. For each individual measure of pressure or diameter, 3 dynamic state components were identified; increasing or decreasing changes or a stable period. Two additional static state components, fully contracted and fully distended, were defined for the diameter. Then qualitative mechanical states of the muscle activity were defined as combinations of these state components. A hidden Markov model was used to correlate adjacent-in-time samples, and the Viterbi algorithm was used to infer the most likely sequence of mechanical states based on the observed data. From this a spatiotemporal map of the mechanical states was produced, showing the regions of active contractions, active relaxations, or passive states along the length of the gut throughout the entire recording period.

Conclusions

The identification of mechanical muscles states based on gut diameter and intraluminal pressure was possible by modelling muscle activation with a hidden Markov model.

Keywords:
Manometry; Peristalsis; Time-series analysis; Muscle mechanics

Background

The gastrointestinal tract extends from the mouth to the anus. Swallowed food travels along the length of this tube at an appropriate speed to allow for the breakdown and absorption of nutrients. The movement of content results from a complex series of muscular contractions and relaxations. These movements of the gut wall alter the pressure profiles within the gut [1] which in-turn cause the digesting contents to move in an oral or anal direction. Abnormalities in these motor patterns are associated with several prevalent and unpleasant disorders that cost health care systems billions of dollars per year [2]. The ability to define the relationship that exist between wall motion, intraluminal pressure and the flow of content is a fundamental step in understanding how altered motor patterns effect the transport of luminal content. However, accurately defining these relationships in the human gut in vivo is problematic; ethical constraints prevent detailed examination of real-time movement of the gut wall. To overcome this problem we developed an in vitro animal preparation that allowed us to record simultaneously, both intraluminal pressure (high-resolution manometry) and gut diameter (video) in real time, across varying length (15–90 cm) of intestine [3] (Figure 1a,b).

thumbnailFigure 1. An overview of data acquisition, and how mechanical muscle states relate to the data.(a) A schematic of the experimental setup. A section of rabbit colon is kept alive in an organ bath and simultaneous intraluminal pressure (fibre-optic catheter, sensors spaced at 10 mm) and diameter (camcorder) are recorded during peristaltic movements. (b) from these recordings a diameter (magenta) and pressure (green) spatiotemporal map is created. (c) at any location within the diameter-pressure map we can plot the values of pressure (green) and diameter (magenta). In this example the values are taken from the 5s white line on the diameter-pressure map. (d) Plotting the relation between pressure and diameter in (c) is then displayed as an orbit plot. From the orbit plot the mechanical states of the muscle can be determined. In the example shown here 3 different mechanical states can been observed during the selected 5s period. The first mechanical state (blue–aqua section of the line) shows a decrease in diameter with no change in pressure (isotonic contraction; itc). In the next mechanical state (aqua–yellow) the pressure begins to increase with a corresponding decease in diameter (auxotonic contraction; atc). In the final mechanical state (yellow–red) the pressure drops with no further change in diameter (occluded isometric relaxation; oimr).

In the next stage of this research we published a theory based paper in which we developed a strategy based on simple principle of biomechanics to deduce the mechanical state of the muscle (active contraction or relaxation, passive dilation, periods of quiescence, etc.) by calculating the relation between pressure and diameter at every point along the gut segment, and establishing where and when the muscle is actively contracting or relaxing [4] (Figure 1c,d). In that paper, space prevented a detailed description of the mathematical model involved in developing this process. In this work we address the details of the strategy that enabled us to confidently identify, for the first time, the mechanical states of the muscle during peristaltic contractions, and plot them as a functional spatiotemporal map.

A major factor in our work involved the use of hidden Markov models (HMM). The HMM have found extensive use in a variety of fields, stemming from their seminal application in speech recognition in the 1970s [5]. In gastroenterology, HMMs have been used to classify the location of a video capsule in the gastrointestinal tract [6]. In their application to hand written recognition, HMMs were utilized by observing lines and curves drawn on a 2D plane and inferring the most probable characters they represent [7]. In developing our intestinal model of mechanical states, one of the major challenges we faced was how to identify the beginning and the end of the periods of the various different states of the muscle. However, analogous to hand written recognition, our diameter-pressure plots can be observed as lines in the 2D plane. Therefore the HMM was adapted to infer the most probable muscles states at any given point in time along the length of the studies gut segment. A description of the steps involved in this process are detailed here.

Identification of muscle states

The circular muscle of the gut is arranged as continuous rings of smooth muscle forming the inner muscle layer of the tubular structure. The circular muscle layer is thicker than the external longitudinal muscle layer and thus is mechanically more powerful. When it contracts, propulsion of the luminal content can occur. This prolusion is made more efficient if the adjacent regions of the gut (proximal or distal) concurrently relax, thus effectively allowing the bolus to move into a region of lower pressure [8]. These regions of contraction and relaxation can be detailed by simultaneously recording the diameter of the gut and the intraluminal pressure (Figure 1a). From the resultant spatiotemporal map of diameter and pressure (Figure 1b) we can plot, at any point in time, pressure and diameter curves (Figure 1c). From these we can then begin to express the mechanical relation between pressure and diameter as a pressure-diameter orbit plot (Figure 1d). In publishing the theory behind this concept [4] we also established that twelve distinct mechanical muscle states can be predicted (Figure 2). The mechanical states are summarized below; Occluded isometric contraction (oimc): active; occurs with an increase in pressure, with no change in diameter, when the gut is at its minimum diameter. Occluded isometric relaxation (oimr): passive; occurs with a decrease in pressure and no change in diameter, when the gut is at its minimum diameter. Distended isometric pressure increase (dipi): passive; occurs with an increase in pressure, no change in diameter, when the gut is at its maximum diameter. Distended isometric pressure decrease (dipd): passive; occurs with a decrease in pressure, no change in diameter, and a maximum diameter. Isotonic contraction (itc): active; occurs with a decrease in diameter and no change in pressure. Isotonic relaxation (itr): active; occurs with an increase in diameter and no change in pressure. Auxotonic contraction (atc): active: occurs with a decrease in diameter and an increase in pressure. Auxotonic relaxation (atr): active: occurs with an increase in diameter and a decrease in pressure. Passive shortening (ps): passive; occurs with a decrease in diameter and pressure. Passive dilation (pd): passive; occurs with an increase in diameter and pressure. Occluded quiescence (oq): passive; occurs with no change in diameter nor pressure, when the gut is at its minimum diameter. Distended quiescence (dq): passive; occurs with no change in diameter nor pressure, when the gut is at a non-minimum diameter.

thumbnailFigure 2. Conceptual directions of observed data and their relation to mechanical muscle states. The left and middle graphs correspond to states where myogenic, or neurogenic excitatory or inhibitory mechanisms are active. The graph on the right corresponds to passive states where no muscle activation is required to exhibit that behaviour.

Having established that 12 mechanical states exist we then need to develop a means to determine when and where each state existed along the gut in an automated fashion. In addition we had to detect both the changes in the mechanical states (transitions of direction of the linear segments of the orbits) and the permanence in that state (the beginning and end of the linear segment).

Methods

The intraluminal pressures were recorded by a manometry catheter with pressure sensors spaced at 10 mm intervals and each of these was considered independent for modelling purposes. At each sensor location, diameter and pressure values were recorded continuously.

Data acquisition

A detailed description of the techniques used to collate the data has been published elsewhere [4]. Here we will provide a brief overview.

Rabbits were euthanized humanely by intravenous injection of pentobarbitone sodium (0.5 ml kg−1) in accordance with approval by the Animal Welfare Committee of Flinders University.

The gut diameter and internal pressure were recorded using two different methods, at different sampling rates, spacial resolutions, and offsets in time and space. Resampling and spatiotemporal alignment was required to coincide values of pressure and diameter for use as a single observation vector for each node in the Markov chain. Each spatial location was assigned its own Markov chain.

A spatiotemporal map of colonic diameter was based on techniques developed in our lab [9]. Briefly the spatiotemporal maps were obtained by recording a top-down video of the colon suspended in a bath of Krebs solution, such that the length of the colon appeared horizontally in the video, and the number of pixels that the colon spans for each vertical pixel line in each frame was counted. Using a reference ruler visible in the recorded video, the colonic diameter in millimetres was obtained.

Pressures were recorded by 10 mm-spaced sensors at 10 Hz with a catheter inserted into the colon. Baseline drift was removed with iterated Gaussian minima smoothing [10].

Different spatiotemporal resolutions and offsets required resampling and alignment. A diameter map and a pressure map were combined by creating a grid of coordinates using the coarsest resolution in time and space from either map aligned with an adjustable spatiotemporal offset, and then binning the original maps into the grid. This resulted in a spatial and time resolution of 10 mm and 0.25 s respectively.

The alignment resulted in a single set of spatiotemporal coordinates that map to coincident diameter and pressure values, allowing diameters and pressures to be quickly compared for analysis without further interpolation. The temporal offset was determined by aligning events that were synchronously recorded by video as flashes from a light bulb (for diameter data) and embedded into the pressure recording as meta-data. The spatial offset was manually obtained by observing overlapping images of the two maps, while adjusting the offset to a value best representative of correct alignment that correlates with the video.

The entire data set consisted of 6 rabbits recorded with approximately 20 sensors over periods of 10 to 20 minutes each, resulting in just over 420,000 samples (almost 30 hours); orbits were created for each sensor.

Hidden Markov model

Given a sequence of observations of diameter and pressure at a single location in the colon, our objective was to infer the most-likely sequence of mechanical muscle states that could have resulted in those observations. Each mechanical muscle state was directly represented as a hidden state in the hidden Markov model. In our application, the dependence of a state on the previous state in the Markov chain was required as an implicit smoothing technique.

Observations

For each sensor location there are two values observed, the diameter d and pressure p, sampled at a frequency of 4 Hz. Sample i of the diameter and pressure is given by di and pi, where i∈{1…N}. The time derivatives of those values are denoted with an overdot and estimated using central differences as

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M1','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M1">View MathML</a>

(1)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M2','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M2">View MathML</a>

(2)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M3','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M3">View MathML</a>

(3)

where Δt=0.25s for the 4 Hz sampling, and <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M4','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M4">View MathML</a> defined in the same manner as <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M5','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M5">View MathML</a>.

Observation i is defined as the vector

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M6','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M6">View MathML</a>

(4)

Any general sequence (xa, xa+1, …, xb−1, xb) will be written as xa:b for the sake of brevity.

States

We segment a sensor’s recording and classify each observation into one of twelve discrete mechanical states of the set

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M7','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M7">View MathML</a>

The conceptual directions and positions of subsequences of observations on a diameter-pressure plot representing examples of each of the twelves states is depicted in Figure 2 and described in Figure 1a. The state-observation model is based on developing a quantitative model for classifying the dynamics depicted in that figure.

State-observation model

The state-observation model defines the conditional probabilities of observations and states. The goal is to arrive at a formula describing the distribution of possible observations, under the assumption that they were produced while the muscle was in any given mechanical state. The sample subscript i is omitted for brevity in this section, since the state-observation model is independent of the sample number.

Each state in S is composed of 3 state components, where each component co corresponds to an element o of the observation o, and non corresponding components and elements are considered independent. The components quiet, pos, and neg correspond to the <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M8','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M8">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M9','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M9">View MathML</a> velocity elements. The quiet component corresponds to a value of the velocity element close to 0, and pos and neg represent the positive and negative values. The components occ, dis, and any correspond to the diameter d, where occ represents an occluded diameter, dis a distended diameter, and any if the diameter is irrelevent. For example, the state dipd is composed of dis, <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M10','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M10">View MathML</a>, and <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M11','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M11">View MathML</a>, where the subscripts disambiguate the corresponding velocity elements.

The states in S can be considered a vector of state components <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M12','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M12">View MathML</a>, where

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M13','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M13">View MathML</a>

(5)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M14','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M14">View MathML</a>

(6)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M15','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M15">View MathML</a>

(7)

Given a velocity observation <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M16','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M16">View MathML</a>, the probability of the corresponding state component being quiet is modelled on the basis of a normal distribution located at 0 with width free parameters <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M17','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M17">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M18','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M18">View MathML</a>. The normal distribution is the most common way to model noise and errors, justified by the central limit theorem. Since very low speeds are considered quiescent, slow tonic muscle activity will be absorbed into passive states, with only phasic contractions exposed as active states. The probability of the state component being pos or neg is modelled on the basis of normal cumulative distribution functions with the same parameters. Probability mass functions are normalised to ensure

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M19','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M19">View MathML</a>

(8)

See (10)–(12) for the formulae, and Figure 3 (a) for a visual example.

thumbnailFigure 3. An example of the PMFs defined by (10)–(15). Given an observation of <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M20','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M20">View MathML</a> or d, the functions model the probability that the observation was generated from the state pertaining to each function. (a) shows examples of velocity-based component PMFs (10)–(12) with parameter σv = 1. (b) shows examples of diameter-based component PMFs (13)–(15) with parameters σd = 1, μd = 8, and mind = 0.

Given an observation of diameter d, the probability of the corresponding state component being occ or dis is modelled on the basis of a normal cumulative distribution function and its complement, located at μd+mind with width σd, where mind is the value of the minimum recorded diameter. The value d−mind is referred to as “dilation”, and μd represents the amount of dilation that separates occluded and distended states. The probability of the state being any given d is a constant. The probability mass functions are normalised to ensure

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M21','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M21">View MathML</a>

(9)

See (13)–(15) for the formulae, and Figure 3 (b) for a visual example.

The probability mass functions (PMFs) f(co|o) are given by

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M22','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M22">View MathML</a>

(10)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M23','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M23">View MathML</a>

(11)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M24','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M24">View MathML</a>

(12)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M25','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M25">View MathML</a>

(13)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M26','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M26">View MathML</a>

(14)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M27','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M27">View MathML</a>

(15)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M28','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M28">View MathML</a>

where Φ is the cumulative standard normal distribution function, v is an alias for either <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M29','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M29">View MathML</a> or <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M30','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M30">View MathML</a>, and Zv and Zd are normalisation constants ensuring the probabilities sum to 1 for any given observation and all corresponding states.

The probability density function (PDF) of the model emitting a particular observation element <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M31','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M31">View MathML</a> given a corresponding state component co, is known as the emission PDF, which can be obtained from Bayes’ theorem

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M32','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M32">View MathML</a>

(16)

The emission PDF is used to determine the distribution of observations that can be made assuming an underlying muscle mechanical state. Since only the relative sizes of emission PDFs are required for calculating the optimal state sequence (rather than the actual probability values themselves), the observation prior density f(o) can be removed which is independent of state and so does not change which state is most likely to have produced a given observation. In a similar way, if we approximate the state component prior distribution f(co) with a constant, then it can also be removed resulting in the following practical approximation

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M33','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M33">View MathML</a>

(17)

Note that under this approximation, f(o|co) no longer represents a PDF, that is, <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M34','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M34">View MathML</a>.

This approximation isn’t necessary for performance, since finding the priors numerically is straight forward with Gaussian kernel density estimation of f(o) and the marginalization <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M35','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M35">View MathML</a>, which resulted in priors of f(co) = 0.33 ± 0.09 for our data. Rather it is our desire to keep the emission PDFs free of any other data-based attributes besides the few parameters that were chosen by hand. This allows for the consistent interpretation of results by having a homogeneous muscle mechanics model which is comparable among different preparations and recordings.

Assuming independence of the variables d, <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M36','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M36">View MathML</a>, and <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M37','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M37">View MathML</a>, the joint emission PDF can be factorized into

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M38','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M38">View MathML</a>

(18)

where the model of the state <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M39','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M39">View MathML</a> subtends the following specific factorisation associations

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M40','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M40">View MathML</a>

with implicit substitutions of (10)–(12) and (13)–(15) to be made in (18) due the approximation (17). The independence assumption is a model simplification rather than an observed independence in the data, and allows for the factorization of the joint emission PDF into component emission PDFs. Making such an independence assumption, where none exists in reality, is common practice in machine learning for simplifying models and algorithms used to make inference. In practice, inference algorithms are often robust despite such assumptions, and we observe that inferences obtained by our technique remain consistent with expected states.

Optimal state sequence

Given an observation sequence o1:N, our goal is to find the optimal sequence of states s1:N that explains the observations. The joint PDF of the observation and state sequences is given by a hidden Markov model [5], which subsumes the following factorisation

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M41','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M41">View MathML</a>

(19)

To keep the number of free parameters small, we choose the state transition probabilities to be independent of state for non self-transitions, given by

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M42','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M42">View MathML</a>

(20)

where γ ∈ (0, 1) is a free parameter that represents a penalty (when <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M43','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M43">View MathML</a>) for changing states between samples. Such a penalty allows the inferred state sequence to be desensitised to noisy observations, resulting in practical smoothing of the sequence. It is important to include this implicit smoothing so that linear segments of orbits containing undulations are not subdivided, which may result in incorrect state inferences based on arbitrary angles of small subsegments of the undulated linear segment. A value of <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M44','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M44">View MathML</a> would result in modelling the states in adjacent samples as independent, effectively eliminating the links in the Markov chain.

Due to the difficulty in quantifying and translating physically realistic dynamics into transition probabilities under our model, state-dependent transition probabilities were not used. However, by plotting all of the transition occurrences from our complete data set (over 420,000 samples) we have been able to demonstrate that qualitatively unlikely transitions were either not observed or rarely observed in the inference results (Figure 4). For example we did not have a single example of a mechanical state moving from occluded quiescence to a distended isometric pressure increase. Thus we are confident that state-independent transition probabilities are sufficient.

thumbnailFigure 4. A matrix of state transition occurrence counts. The vertical and horizontal axes represent each of the 12 states, such that a transition moving from one state (vertical axis) to another state (horizontal axis) is represented as a square shaded from black (0 occurrences of that transition) to white (many occurrences of that transition). Transitions that never occurred are marked with a red circle, and transitions that occurred only very rarely (between 1 and 4 times for the entire data set) are marked with a yellow circle.

The probability of the initial state is modelled with the discrete uniform distribution

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M45','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M45">View MathML</a>

(21)

The solution to the most likely sequence of states for a given sequence of observations is obtained by performing the following maximisation

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M46','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M46">View MathML</a>

(22)

where f(s1:N | o1:N) is proportional over s1:N to (19), and the solution can be found by applying the Viterbi algorithm. The Viterbi algorithm works by calculating the most likely sequence of states based on a sequence of discrete observations. To handle continuous observations we used the value of the emission PDF at each observation as a substitute for the probability of making that observation.

Parameters

Through an iterative trial-and-error approach we manually selected and tuned parameter values, checking selected areas of data where we could verify whether the inference resulted in states consistent with existing domain knowledge of the expected muscular activity. For example, when the gut contracts and squeezes the catheter we expect the pressure to rise. For this approach, data was drawn from a total of 6 rabbits, each with 10 to 20 minutes of recording. The values for parameters are given in the middle column of Table 1.

Table 1. Parameter values used in inference and analysis

To test the classification sensitivity of different parameter values to the ones selected manually, parameters were varied one at a time through a range of values (right column in Table 1). One reference classification, considered as ground-truth, was performed with the manually selected parameter values (middle column in Table 1). The reference classification was compared to many comparison classifications with the varied parameter values. A ratio ε of the number of incorrect active-state classifications to the total number of states which were active in both reference and comparison classification over the entire spatiotemporal map was given by the equation

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M49','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M49">View MathML</a>

(23)

<a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M50','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M50">View MathML</a>

(24)

where the square brackets denote Iverson bracketsa, 1 is the indicator functionb, i and j denote the sample and sensor number (horizontal and vertical position in the spatiotemporal map) respectively. A simplified state <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M51','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M51">View MathML</a> is one of: active contraction ac = {oimr, itc, act}, active relaxation ar = {itr, atr}, or passive states ps = {oimr, dipi, dipd, ps, pd, oq, dq}. A simplified state in the comparison classification is denoted with a prime <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M52','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M52">View MathML</a>.

Results on the error ε as parameter values vary (Figure 5) shows that the model is adequately robust to variations in the parameters, as the errors are qualitatively considered small. The test was performed on a 10-minute recording with 26 sensors of a single isolated rabbit colon which exhibited typical activity (for a combined 62400 samples in total).

thumbnailFigure 5. Comparison of the reference parameter values to values varying within the ranges shown in Table 1. Small errors ε based on equation (23) show that the model is robust to variations in parameter values compared to those selected manually. Parameter ranges were mapped to [0,1] in the figure so that the manually selected values all coincided at the same location <a onClick="popup('http://www.biomedcentral.com/1472-6793/13/14/mathml/M53','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1472-6793/13/14/mathml/M53">View MathML</a> for a clearer visual comparison.

Results and discussion

The optimal state sequence for each of the sensor locations (0–250 mm at 10 mm intervals) was independently inferred. When visualising, each state sequence was placed according to the location of the corresponding sensor in the colon, resulting in a 2D map where horizontal sequence strips are vertically stacked, shown in Figure 6 (a)–(c).

thumbnailFigure 6. Results for a 10 minute recording of an in vitro rabbit distal colon. (a) a composite Diameter/Pressure Map (DPMap). In (b) each of the 12 possible mechanical states are mapped to different colors. The map portrays the periods of quiescence either when the gut remains passively dilated (light-green) or passively occluded (dark-green). Red, orange and yellow areas represent active contractions and mark the propagating area of contraction during neural peristalsis. Active relaxation (cyan and light-blue) precedes both in time and space the propagating contraction. In (c) we present a simplification of the full composite map of states by clustering all areas undergoing active contraction (red) and, active relaxation (blue). All other passive states are in white. (d)(f) show an example of an instant (vertical line in (a)(c); ∼ 3.5 minutes) where the liquid bolus between 190 mm and 230 mm is traveling down the length of the colon from left to right. The actual rabbit colon is shown in (d). In (e) the gut is color coded with the colors from the multiple mechanical states shown in (b). In (f) the simplified mechanical states from (c) are shown. The isotonic contraction at 190 mm (orange) and auxotonic contraction at 180 mm (yellow) push the bolus to the right, while the isometric contraction at 150–170 mm (red) ensures no back-flow. The isotonic relaxation at 210–240 mm (light-blue) help to expand the colon to accommodate the incoming bolus. The distended quiescence at 200 mm (light-green) depicts a momentary stillness where changes in diameter and pressure are trivial. The isometric relaxation between 80–140 mm (dark-blue) represents the recovery from earlier active contractions in that region that resulted in propelling the liquid bolus to the right.

Parameters of the hidden Markov model were chosen manually, giving robust results with respect to variations in the parameters, shown in Figure 5. The γ parameter specifying transition probabilities should be adjusted to account for variations in time sampling frequency, which was not required here as our data consisted entirely of 4 Hz sampling.

The states inferred by our method coincided with hypothesised states based on manual observation of orbital plots and the expected mechanical function of the colon. This allowed qualitative analysis of colon dynamics as given in the description of Figure 6(d)–(f). A more detailed description of these finding can be found in our previous paper [4].

Conclusions

The use of the hidden Markov model to discriminate mechanical states of the intestinal muscle in an isolated preparation of the rabbit colon has given experimental neurogastroenterologists a novel powerful tool to identify the active and passive states of the intestinal muscle.

The graphic representation of where the active contractions and relaxations occur in the intestine at any particular time (Figure 6) will allow for the testing of many hypotheses currently proposed but not validated on the mechanisms responsible for the appropriate mixing and propulsive movements [4].

At the present the parameters described here have been shown to work with the rabbit distal colon. Whether or not the same criteria could be applied to different species with different sized diameters is still to be determined. It is likely that the parameter will need to be adjusted for each species (including human). We are currently setting up studies with different animal species to test this hypothesis.

Endnotes

a [P] = 1 if P is true, 0 if P is false.

b1A(x) = 1 if xA, and 0 otherwise.

Competing interests

The authors declare that they have no competing interests.

Authors’ contributions

LW, MC, and PD - study concept and design, drafting of the manuscript; critical revision of the manuscript for important intellectual content. PD - recorded the data. LW - software development and analysis. All authors read and approved the final manuscript.

Acknowledgements

The work was supported by grants from the Australian Research Council (DP120102192), FMC research foundation and Clinician’s Special Purpose Fund of the Flinders Medical Centre.

References

  1. Arkwright J, Dickson A, Maunder S, Blenman N, Lim J, O’Grady G, Archer R, Costa M, Spencer N, Brookes S, Pullan A, Dinning P: The effect of luminal content and rate of occlusion on the interpretation of colonic manometry.

    Neurogastroenterology Motil 2013, 25:e52-e59. Publisher Full Text OpenURL

  2. Everhart J, Ruhl C: Burden of digestive diseases in the United States part I: overall and upper gastrointestinal diseases.

    Gastroenterology 2009, 136(2):376-386. PubMed Abstract | Publisher Full Text OpenURL

  3. Dinning PG, Arkwright JW, Costa M, Wiklendt L, Hennig G, Brookes SJ, Spencer NJ: Temporal relationships between wall motion, intraluminal pressure, and flow in the isolated rabbit small intestine.

    Am J Physiol-Gastrointest Liver Physiol 2011, 300(4):G577-G585. Publisher Full Text OpenURL

  4. Costa M, Wiklendt L, Arkwright J, Spencer N, Omari T, Brookes SJH, Dinning PG: An experimental method to identify neurogenic and myogenic active mechanical states of intestinal motility.

    Front Syst Neurosci 2013, 7(7):1-18. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  5. Rabiner L: A tutorial on hidden Markov models and selected applications in speech recognition.

    Proc IEEE 1989, 77(2):257-286. Publisher Full Text OpenURL

  6. Mackiewicz M, Berens J, Fisher M: Wireless capsule endoscopy color video segmentation.

    Med Imaging, IEEE Trans 2008, 27(12):1769-1781. OpenURL

  7. Xue H, Govindaraju V: Hidden Markov models combining discrete symbols and continuous attributes in handwriting recognition.

    Pattern Anal Mach Intell, IEEE Trans 2006, 28(3):458-462. OpenURL

  8. Sinnott M, Cleary P, Arkwright J, Dinning P: Investigating the relationships between peristaltic contraction and fluid transport in the human colon using Smoothed Particle Hydrodynamics.

    Comput Biol Med 2012, 42(4):492-503. PubMed Abstract | Publisher Full Text OpenURL

  9. Hennig G, Costa M, Chen B, Brookes S: Quantitative analysis of peristalsis in the guinea-pig small intestine using spatio-temporal maps.

    J Physiol 1999, 517(2):575-590. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  10. Wiklendt L, Mohammed SD, Scott SM, Dinning PG: Classification of normal and abnormal colonic motility based on cross-correlations of pancolonic manometry data.

    Neurogastroenterology Motil 2013, 25(3):e215-e223. Publisher Full Text OpenURL