Table of Contents
Fetching ...

Circuit design in biology and machine learning. II. Anomaly detection

Steven A. Frank

TL;DR

This work reframes biological anomaly detection as a problem of learning and using internal models of typical environmental patterns to identify deviations. It develops minimal, cell-scale circuit motifs inspired by machine-learning concepts—atemporal and temporal anomaly detection, multivariate integration, cascaded boosting, and dimensionality reduction via encoders—for robust classification with small circuits. The paper demonstrates, through illustrative models, that simple Hill-function–based receptors, moving-average trend tracking, and encoder-based representations can achieve substantial anomaly-detection performance and offer plausible evolutionary pathways for circuit design. Overall, the study provides a unified, cross-disciplinary framework linking biological circuit design to ML strategies, with implications for synthetic biology, neuroscience, and understanding evolution of computational strategies in living systems.

Abstract

Anomaly detection is a well-established field in machine learning, identifying observations that deviate from typical patterns. The principles of anomaly detection could enhance our understanding of how biological systems recognize and respond to atypical environmental inputs. However, this approach has received limited attention in analyses of cellular and physiological circuits. This study builds on machine learning techniques -- such as dimensionality reduction, boosted decision trees, and anomaly classification -- to develop a conceptual framework for biological circuits. One problem is that machine learning circuits tend to be unrealistically large for use by cellular and physiological systems. I therefore focus on minimal circuits inspired by machine learning concepts, reduced to cellular scale. Through illustrative models, I demonstrate that small circuits can provide useful classification of anomalies. The analysis also shows how principles from machine learning -- such as temporal and atemporal anomaly detection, multivariate signal integration, and hierarchical decision-making cascades -- can inform hypotheses about the design and evolution of cellular circuits. This interdisciplinary approach enhances our understanding of cellular circuits and highlights the universal nature of computational strategies across biological and artificial systems.

Circuit design in biology and machine learning. II. Anomaly detection

TL;DR

This work reframes biological anomaly detection as a problem of learning and using internal models of typical environmental patterns to identify deviations. It develops minimal, cell-scale circuit motifs inspired by machine-learning concepts—atemporal and temporal anomaly detection, multivariate integration, cascaded boosting, and dimensionality reduction via encoders—for robust classification with small circuits. The paper demonstrates, through illustrative models, that simple Hill-function–based receptors, moving-average trend tracking, and encoder-based representations can achieve substantial anomaly-detection performance and offer plausible evolutionary pathways for circuit design. Overall, the study provides a unified, cross-disciplinary framework linking biological circuit design to ML strategies, with implications for synthetic biology, neuroscience, and understanding evolution of computational strategies in living systems.

Abstract

Anomaly detection is a well-established field in machine learning, identifying observations that deviate from typical patterns. The principles of anomaly detection could enhance our understanding of how biological systems recognize and respond to atypical environmental inputs. However, this approach has received limited attention in analyses of cellular and physiological circuits. This study builds on machine learning techniques -- such as dimensionality reduction, boosted decision trees, and anomaly classification -- to develop a conceptual framework for biological circuits. One problem is that machine learning circuits tend to be unrealistically large for use by cellular and physiological systems. I therefore focus on minimal circuits inspired by machine learning concepts, reduced to cellular scale. Through illustrative models, I demonstrate that small circuits can provide useful classification of anomalies. The analysis also shows how principles from machine learning -- such as temporal and atemporal anomaly detection, multivariate signal integration, and hierarchical decision-making cascades -- can inform hypotheses about the design and evolution of cellular circuits. This interdisciplinary approach enhances our understanding of cellular circuits and highlights the universal nature of computational strategies across biological and artificial systems.

Paper Structure

This paper contains 27 sections, 5 equations, 9 figures.

Figures (9)

  • Figure 1: Receptor response for atemporal anomaly detection. When the input is at the typical value of $u^*=3$, the receptor responds with a minimal value. As the input increasingly deviates from its typical value, the receptor returns an increasing response. The likelihood of an anomalous condition rises with the receptor response value. Thus, this receptor provides a simple atemporal way to classify inputs as normal or anomalous. This figure derives from eqn \ref{['eq:anomRecept']}, with $m_1=1$, $k=2$, and $a$ set so that $u^*=3$ is a minimum. To get a minimum at $u^*$, we search for $a$ such that $\textrm{d} \hat{r}/\textrm{d} u=0$ and $\textrm{d}^2\hat{r}/\textrm{d} u^2>0$ when evaluated at $u^*$. For $k=2$ and $m_1>m_2$, we obtain $a = \left(2m_1^2+u^*+4\right) \left(m_2^2+u^*+2\right)^2{/}\left(2 m_2^2+u^*+4\right)\left(m_1^2+u^*+2\right)^2.$ As $m_1$ and $m_2$ become large, $a\rightarrow (m_2/m_1)^2$.
  • Figure 2: Receptor response for temporal anomaly detection. (a) The blue input signal, $u$, was generated by a stochastic process $\textrm{d} u = 0.0002(10000-u)\,\textrm{d} t + 0.02u\,\textrm{d} W + zu\,\textrm{d} N$, in which $\textrm{d} W$ is a Wiener process that generates continuous Gaussian noise with a mean of $0$ and a standard deviation of $1$, and $\textrm{d} N$ is a Poisson jump process that generates random discrete jumps at rate $0.2$. Each jump multiplies the current input, $u$, by $z$, which for each jump takes on a value $0.95$ or $1.05$ with equal probability. The gold moving average, $u^*$, is given by eqn \ref{['eq:anomtrend']} with $\lambda=10$. (b) The blue spikes show the timing and direction of the random anomalous jumps for this sample run. The levels of $\pm1$ for the spikes are arbitrary values. The gold curve shows the receptor output from eqn \ref{['eq:anomRecept']} multiplied by $25$, with $k=2$, $m_1=10,000$, $m_2=1000$, and $a$ given by the solution in the caption for Fig. \ref{['fig:anomaly']} with $u^*=m_1$. The gold receptor spikes match the blue anomalous input jumps, signaling anomalies. The freely available Julia computer code provides full details about assumptions and methods for all figures in this article frank24circuit-codeb.
  • Figure 3: Classification of input as typical or anomalous by a circuit that averages $n$ independent input values and makes a decision based on the average value. Inputs are continuous numerical values. In this example, I generated inputs by randomly sampling a normal distribution with a standard deviation of $\sigma=40$. For typical and anomalous inputs, the distribution means are $100$ and $120$, respectively. (a) The circuit takes $n=1$ dimensions of input. The circuit uses a threshold, $\tau$, such that the circuit classifies inputs below the threshold as typical and above the threshold as anomalous. The curve plots the frequency of truly predicted anomalies as a function of $\tau$ versus the frequency of falsely predicted anomalies as a function of $\tau$, generating a receiver operating characteristic (ROC) curve. The area under the curve (AUC) measures the resolving power of the circuit that describes the tradeoff between true positive and false positive classifications over all of the thresholds. (b) For each case in which the true generating process is either typical or anomalous, I generated $n$ independent samples for the associated probability distribution. The circuit measures the average of the inputs, which, when compared to the $n=1$ case in the left panel, has the same mean and a reduced standard deviation, $\sigma/\sqrt{n}=40/\sqrt{n}$. The reduced variation provides the circuit with greater resolving power, described by the increasing AUC with increasing $n$.
  • Figure 4: Anomaly classifier in which each sensor does an analog to digital conversion, with $n=1,4,16, 64$ sensors for curves from bottom to top. The generation of continuous input into each sensor is described in the caption of Fig. \ref{['fig:oneR']}. In this case, each sensor receives an independent input value and independently scores its input as $0$ for typical or $1$ for anomalous based on the threshold shared by all sensors. Colored circles on each curve denote particular threshold values for the individual sensors. The overall classification by the circuit depends on the frequency of $1$ values returned by the individual sensors. The circuit returns an anomaly if the frequency of $1$ values by individual sensors is greater than $\mathrm{ceiling}(\phi n)/n$, in which the ceiling function returns the smallest integer greater than or equal to its argument. (a) Curves for $\phi=1/3$. (b) Curves for $\phi=2/3$. Increasing the frequency threshold, $\phi$, lowers both the true and false positive classification rates, which can be seen by comparing the same sensor threshold values between the two panels. When $\phi=1/2$, the threshold locations, $\tau$, are intermediate between the two panels. The AUCs are $0.64,0.72,0.87,0.99$ for curves from bottom to top in both panels. The AUC values for $\phi=1/2$ are slightly higher in the third significant digit for larger $n$. Overall, the AUC circuit performance is very flat as a function of varying frequency cutoff, $\phi$, over $(1/3,2/3)$, suggesting that $\phi$ may be a nearly neutral trait over a wide range in the AUC sense of measuring performance over a range of individual sensor thresholds, $\tau$.
  • Figure 5: The cost of digitizing the response of individual sensors. The curves show that an increase in the number of sensors, $n$, reduces the total error rate as the sum of the false negative and false positive rates. In prior figures, the false negative rate is the false predicted anomaly rate, and the false positive rate is one minus the true predicted anomaly rate. The lower blue analog curve corresponds to a circuit that averages the values perceived by the $n$ individual sensors. The upper gold digital curve corresponds to a circuit in which each sensor transforms its input into a $0$ response when the input value is below a sensor-specific threshold and a $1$ response otherwise. For a given number of sensors, $n$, the digital circuit produces more errors because digitization at the individual sensor level loses information.
  • ...and 4 more figures