Lesson 4.2.3: Statistical features for disease classification
Lesson 4.2.3: Statistical features for disease classification
Learning Objectives
- Define statistical features used in spectral disease classification.
- Explain how statistical measures are extracted from spectral data.
- Analyse the impact of statistical features on classification accuracy.
- Compare statistical feature sets with other feature extraction methods.
Key Terms
| Statistical Feature | A quantitative descriptor derived from data that summarises characteristics such as mean, variance, skewness, or kurtosis. |
|---|---|
| Spectral Data | Information obtained from analysing the frequency components of a signal, often used in medical imaging and biosensing. |
| Feature Extraction | The process of transforming raw data into a set of measurable attributes that can be used for classification. |
| Classification Accuracy | The proportion of correctly identified instances out of the total number of instances tested. |
| Feature Comparison | Evaluating different feature sets to determine which provides the best performance for a given task. |
Definition of Statistical Features in Spectral Analysis
In the context of disease classification, spectral analysis of biomedical signals—such as electroencephalography (EEG), magnetic resonance spectroscopy (MRS), or mass spectrometry—provides a high‑dimensional representation of underlying physiological processes. However, raw spectra are often noisy, redundant, and difficult to interpret directly. Statistical features summarise key aspects of spectral content, reducing dimensionality while preserving discriminative information. This section introduces the most commonly employed statistical descriptors, discusses their mathematical foundations, and compares alternative approaches through concrete examples.
Using a sample spectrum array, calculate the mean power and compare it to the spectral centroid. Discuss how each metric might differ for a healthy vs. diseased signal.
1. Mean Power and Spectral Centroid
The simplest descriptor is the arithmetic mean of power spectral density (PSD) values across a frequency band of interest. For a discrete spectrum P(f_i) sampled at frequencies f_i, i = 1…N, the mean power is
mean_power = sum(P) / N
This yields an overall energy measure. A more refined variant is the spectral centroid, defined as the frequency‑weighted mean:
centroid = sum(f_i * P(f_i)) / sum(P(f_i))
Centroid captures the “centre of mass” of the spectrum and is especially informative in distinguishing between diseases that shift spectral power towards lower or higher frequencies. For instance, in Parkinson’s disease, the centroid of the EEG alpha band often shifts downward relative to healthy controls.
Which of these two metrics would you prioritise for classifying neurodegenerative disorders and why? Provide at least two arguments.
2. Variance, Standard Deviation, and Spread
While mean values describe central tendency, variance quantifies dispersion:
variance = sum((P - mean_power)**2) / N
std_dev = sqrt(variance)
A higher variance indicates a more heterogeneous spectral profile. In multiple sclerosis, studies have reported increased PSD variance in the beta band, reflecting irregular neural conduction.
Consider a dataset where variance is high across all subjects. How might this affect your choice of classification algorithm? Discuss potential strategies to handle high-variance data.
3. Skewness and Kurtosis
These higher‑order moments assess asymmetry and peakedness of the spectral distribution. Skewness is defined as the third central moment normalised by the cube of the standard deviation:
skew = sum((P - mean_power)**3) / (N * std_dev**3)
Kurtosis measures the fourth central moment normalised by the fourth power of the standard deviation:
kurtosis = sum((P - mean_power)**4) / (N * std_dev**4)
Skewness can reveal whether spectral power is biased toward lower or higher frequencies, while kurtosis indicates the presence of sharp peaks. In epilepsy, the PSD of interictal EEG often exhibits a pronounced right‑skew, reflecting occasional high‑frequency bursts.
Imagine you are analysing EEG data from patients with temporal lobe epilepsy. Which of the two higher‑order moments would you monitor more closely to predict an imminent seizure? Justify your choice.
4. Spectral Entropy
Entropy quantifies the unpredictability or complexity of a spectrum. Normalising the PSD to obtain a probability distribution p_i = P(f_i) / sum(P), the Shannon entropy is
entropy = -sum(p * log2(p))
Higher entropy signals a flatter spectrum with less dominant frequency components. In Alzheimer’s disease, reduced entropy in the theta band has been linked to impaired neural synchronisation.
- What is the effect of a uniform spectral distribution on the Shannon entropy?
5. Peak‑to‑Valley Ratio (PVR)
PVR captures the prominence of spectral peaks relative to the surrounding troughs:
peak = max(P)
valley = min(P)
pvr = peak / valley
A high PVR indicates a strongly dominant frequency band. For example, the 6‑Hz peak in the basal ganglia spectrum of Parkinsonian patients yields a markedly higher PVR than in healthy subjects.
Using a provided EEG spectrum, calculate the PVR and interpret its significance in the context of Parkinson’s disease.
6. Band‑Specific Energy Ratios
Diseases often affect specific frequency bands. Ratios such as the alpha‑to‑beta energy ratio provide a simple yet powerful discriminator:
alpha_energy = sum(P_alpha)
beta_energy = sum(P_beta)
ratio = alpha_energy / beta_energy
In schizophrenia, studies report an elevated gamma‑to‑theta ratio, reflecting aberrant high‑frequency activity.
Which band‑specific ratio would you propose for distinguishing bipolar disorder from major depressive disorder? Explain your reasoning.
7. Correlation Coefficients Across Bands
Cross‑band relationships can be summarised by computing Pearson’s correlation between power in two bands across subjects or time windows:
corr = corrcoef(P_band1, P_band2)[0,1]
In autism spectrum disorder, a negative correlation between delta and gamma power has been observed, suggesting compensatory mechanisms.
How might you utilise cross‑band correlations to improve a machine‑learning model’s performance? Provide two concrete suggestions.
8. Alternative Approaches: Non‑Linear and Time‑Frequency Features
While the above features are strictly statistical, alternative descriptors capture different aspects of spectral data:
- Wavelet‑based moments: Decompose signals into time‑frequency atoms, then compute statistics on wavelet coefficients. This preserves temporal localisation.
- Hjorth parameters (activity, mobility, complexity) summarise the instantaneous spectral slope and curvature.
- Fractal dimensions estimate self‑similarity, useful in characterising pathological oscillations.
Comparatively, purely statistical features are computationally inexpensive and interpretable, making them attractive for real‑time clinical applications. Non‑linear descriptors often provide complementary information but may introduce additional complexity and require larger datasets to avoid overfitting.
In a low‑resource setting, would you prioritise statistical features over wavelet‑based ones? Discuss the trade‑offs.
9. Practical Example: Classifying Parkinson’s vs. Healthy Controls
Consider an EEG dataset sampled at 256 Hz, filtered to isolate the 4–30 Hz band. For each recording, we extract the following features:
- Mean power in the alpha band (8–12 Hz)
- Spectral centroid in the 4–30 Hz band
- Standard deviation of the PSD across the entire band
- Spectral entropy (normalised to the number of frequency bins)
- Alpha‑to‑beta energy ratio (8–12 Hz vs. 13–30 Hz)
A logistic regression model trained on these five features achieved an accuracy of 87 % in distinguishing Parkinsonian patients from healthy controls, with the spectral centroid and alpha‑to‑beta ratio contributing the most to the decision boundary.
Using the provided dataset, reproduce the logistic regression model and plot the ROC curve. Comment on any differences you observe.
10. Summary of Key Takeaways
Statistical features provide a concise, interpretable summary of spectral data, essential for disease classification pipelines. Mean, variance, skewness, kurtosis, entropy, and band‑specific ratios each capture distinct facets of spectral organisation. When combined, they often yield robust classifiers, though care must be taken to avoid redundancy and over‑fitting. Alternative non‑linear descriptors can supplement these features, particularly when temporal dynamics or self‑similarity play a crucial role in the pathology under investigation.
| Feature | Mathematical Definition | Typical Clinical Interpretation |
|---|---|---|
| Spectral Centroid | \(\displaystyle \frac{\sum f_i P(f_i)}{\sum P(f_i)}\) | Shift indicates disease‑related frequency bias (e.g. Parkinson’s) |
| Variance / Standard Deviation | \(\displaystyle \frac{\sum (P-\bar P)^2}{N}\) | Higher dispersion reflects neural irregularities (e.g. MS) |
| Entropy | \(-\sum p_i\log_2 p_i\) | Lower entropy suggests reduced neural synchronisation (e.g. Alzheimer’s) |
Definition: Spectral features are quantitative descriptors extracted from the power spectral density of biomedical signals, summarising characteristics such as central tendency, dispersion, asymmetry, complexity, and band‑specific energy relationships. These features facilitate dimensionality reduction and enhance the discriminative power of machine‑learning classifiers in disease diagnosis.
Think about how the statistical features you have just defined—mean, variance, skewness, kurtosis, and spectral entropy—can influence the accuracy of disease classification models. Consider a scenario where you need to choose the most informative feature for distinguishing between healthy and diseased spectra. What criteria would you use to decide, and how might you validate your choice?
Implement a recursive feature elimination (RFE) pipeline to select the top 5 features from the Parkinson’s dataset. Compare the resulting model performance to the baseline.
Mechanisms of Feature Extraction from Spectral Data
In the context of disease classification, raw spectra are typically high‑dimensional, noisy and rife with redundant information. Feature extraction transforms these spectra into a compact representation that preserves the discriminative structure necessary for subsequent machine learning. This section outlines the principal computational steps and algorithms used to derive statistical features, compares alternative approaches, and illustrates each with concrete numerical examples.
How do you decide between vector normalisation and baseline correction for a given dataset? Provide examples where one might be preferable over the other.
Pre‑processing: Normalisation and Baseline Correction
Before any statistical descriptor can be computed, the spectra must be stabilised. Two common pre‑processing stages are normalisation and baseline correction.
- Vector Normalisation: Each spectrum \(x = (x_1, x_2, \dots, x_n)\) is divided by its Euclidean norm \[ x' = \frac{x}{\|x\|_2}, \] ensuring that variances arise from shape rather than intensity.
- Baseline Correction: Low‑frequency drift is removed using polynomial fitting or asymmetric least squares. For example, a second‑order polynomial \(p(\lambda) = a\lambda^2 + b\lambda + c\) is fitted to the baseline and subtracted, yielding the corrected spectrum \(x'' = x' - p\).
Both steps reduce inter‑sample variability that is unrelated to pathology.
Apply both vector normalisation and polynomial baseline correction to a sample FT‑IR spectrum and visualise the before/after effect.
Statistical Descriptors
Statistical features quantify global and local characteristics of the spectrum. They are broadly divided into first‑order (univariate) and higher‑order (multivariate) statistics.
First‑Order Features
These are computed on the intensity values alone, ignoring any correlation structure.
| Feature | Formula | Interpretation |
|---|---|---|
| Mean | \(\displaystyle \mu = \frac{1}{n}\sum_{i=1}^{n} x_i\) | Average absorbance. |
| Standard Deviation | \(\displaystyle \sigma = \sqrt{\frac{1}{n}\sum_{i=1}^{n} (x_i-\mu)^2}\) | Spectral spread. |
| Skewness | \(\displaystyle \gamma_1 = \frac{1}{n}\sum_{i=1}^{n}\left(\frac{x_i-\mu}{\sigma}\right)^3\) | Asymmetry of intensity distribution. |
| Kurtosis | \(\displaystyle \gamma_2 = \frac{1}{n}\sum_{i=1}^{n}\left(\frac{x_i-\mu}{\sigma}\right)^4-3\) | Peakedness. |
| Root Mean Square (RMS) | \(\displaystyle \sqrt{\frac{1}{n}\sum_{i=1}^{n} x_i^2}\) | Energy of the spectrum. |
For instance, a spectrum with a prominent absorption band at 1650 cm⁻¹ will exhibit a higher mean and RMS compared to a flat spectrum, while a sharp peak will increase the kurtosis.
- Which first‑order statistic would you use to quantify the overall intensity of a Raman spectrum?
Higher‑Order Features
These capture relationships between different spectral points, often revealing subtle pattern differences.
Peak‑Based Features
Identify local maxima and compute attributes such as peak height, width, area and position.
import scipy.signal as sig
peaks, _ = sig.find_peaks(x, height=0.5)
peak_heights = x[peaks]
peak_widths = sig.peak_widths(x, peaks, rel_height=0.5)[0]
In a Raman spectrum of malignant tissue, the 1585 cm⁻¹ band may be broader and higher than in healthy tissue, providing a discriminative cue.
Discuss how peak width could serve as a biomarker for tumour aggressiveness.
Correlation‑Based Features
The covariance matrix \(\Sigma\) of the spectrum (or of a selected subset of wavelengths) captures inter‑wavelength relationships.
- Eigenvalues of \(\Sigma\) quantify variance along principal components.
- The trace \(\operatorname{tr}(\Sigma)\) equals the total variance.
- Off‑diagonal elements indicate coupling between wavenumbers.
For example, a covariance between 1450 cm⁻¹ and 1650 cm⁻¹ that is higher in diseased samples suggests a pathological shift in protein conformation.
What are the potential pitfalls of using raw covariance as a feature? Suggest alternatives.
Entropy Measures
Shannon entropy, \[ H = -\sum_{i=1}^{n} p_i \log p_i, \] where \(p_i = x_i / \sum_j x_j\), estimates spectral disorder. A more heterogeneous spectrum yields higher entropy, often seen in tumours.
Compute entropy for a set of spectra and compare across healthy vs. malignant samples.
Dimensionality‑Reduction‑Based Features
Instead of hand‑crafted statistics, one can derive features through linear or non‑linear dimensionality reduction.
Principal Component Analysis (PCA)
PCA projects the spectrum onto orthogonal axes of maximal variance. The first few principal component (PC) scores serve as features.
from sklearn.decomposition import PCA
pca = PCA(n_components=3)
pc_scores = pca.fit_transform(x.reshape(1, -1))
In practice, the first PC often captures the overall intensity trend, while the second may capture subtle band shifts.
Apply PCA to the FT‑IR dataset and visualise the explained variance ratio.
Linear Discriminant Analysis (LDA)
LDA maximises class separability by projecting onto directions that maximise between‑class variance relative to within‑class variance. The resulting discriminant scores are highly informative for classification.
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
lda = LinearDiscriminantAnalysis()
lda_scores = lda.fit_transform(x.reshape(1, -1), label)
Because LDA is supervised, it may produce more compact features than PCA for disease classification.
When would you prefer LDA over PCA for feature extraction? Provide two scenarios.
Autoencoders
Neural network autoencoders learn non‑linear embeddings. The bottleneck layer provides dense features that capture complex spectral patterns.
import tensorflow as tf
input_dim = x.shape[0]
encoding_dim = 10
input_vec = tf.keras.Input(shape=(input_dim,))
encoded = tf.keras.layers.Dense(encoding_dim, activation='relu')(input_vec)
decoded = tf.keras.layers.Dense(input_dim, activation='sigmoid')(encoded)
autoencoder = tf.keras.Model(input_vec, decoded)
encoder = tf.keras.Model(input_vec, encoded)
autoencoder.compile(optimizer='adam', loss='mse')
autoencoder.fit(x.reshape(1, -1), x.reshape(1, -1), epochs=100, verbose=0)
latent_features = encoder.predict(x.reshape(1, -1))
Autoencoders can capture non‑linear interactions that linear methods miss, albeit at the cost of increased computational complexity.
Build a simple autoencoder for the EEG dataset and compare the resulting latent features to PCA features.
Feature Selection and Evaluation
High‑dimensional feature sets risk over‑fitting. Two common strategies are:
- Filter Methods: Compute a univariate relevance score (e.g., mutual information) for each feature and retain the top‑k. For example, mutual information between a peak height and class label can rank its importance.
- Wrapper Methods: Use a classifier (e.g., Random Forest) to evaluate feature subsets via cross‑validation. Recursive Feature Elimination (RFE) systematically removes the least important features.
Both approaches have trade‑offs: filter methods are fast but ignore feature interactions; wrappers are accurate but computationally intensive.
Which feature selection method would you choose for a real‑time clinical decision support system and why?
Comparative Analysis of Feature Types
Below is a concise comparison of the feature families discussed.
| Feature Class | Computational Cost | Interpretability | Robustness to Noise | Typical Use‑Case |
|---|---|---|---|---|
| First‑Order Statistics | Low | High | High | Baseline screening |
| Peak‑Based | Moderate | High | Moderate | Band‑specific disease markers |
| Correlation‑Based | High | Moderate | Low | Complex tissue heterogeneity |
| Entropy | Low | Medium | High | Overall disorder assessment |
| PCA/LDA | Moderate | Low–Medium | High | Dimensionality reduction for any classifier |
| Autoencoders | High | Low | Variable | Capturing non‑linear patterns |
Given a dataset with 200 samples and 50 features, which feature family would you prioritise to minimise over‑fitting? Justify your choice.
Concrete Example: Differentiating Benign vs. Malignant Breast Tissue via FT‑IR
Suppose we have FT‑IR spectra from 100 samples (50 benign, 50 malignant) measured between 4000–400 cm⁻¹ at 4 cm⁻¹ resolution. The workflow proceeds as follows:
- Pre‑processing: Vector normalise each spectrum and apply asymmetric least squares baseline correction.
- Feature extraction:
- Compute mean, RMS, skewness, kurtosis.
- Detect peaks at 1650 cm⁻¹ (amide I) and 1540 cm⁻¹ (amide II); record height, width, area.
- Calculate the covariance between 1450 cm⁻¹ and 1650 cm⁻¹.
- Derive the first three PCA scores.
- Feature selection: Use mutual information to rank features; retain the top 12.
- Classification: Train a Support Vector Machine with a radial basis function kernel, tuned via grid search.
Cross‑validation yields an accuracy of 92 %, sensitivity of 90 % and specificity of 94 %, demonstrating that a modest set of statistically grounded features can achieve clinically relevant performance.
Replicate the described workflow and report any differences in performance.
Conclusion
Deriving statistical features from raw spectra is a multi‑step, algorithmic process that balances computational feasibility, interpretability and discriminative power. By carefully selecting and combining first‑order, peak‑based, correlation‑based and dimensionality‑reduction techniques, practitioners can construct robust feature sets that enable accurate disease classification while retaining biological insight.
Reflect on the challenges of translating statistical feature extraction into routine clinical workflows. What steps would you take to ensure reproducibility and regulatory compliance?
Implications for Disease Classification Performance
In the context of disease classification, the statistical features we extract from raw clinical data are the raw material upon which machine‑learning models build their predictive power. The choice of features is therefore not a purely technical decision; it carries direct consequences for model accuracy, robustness to noise and variation, and ultimately for the clinical utility of the system. The following discussion unpacks these implications, compares common feature families, and illustrates with concrete examples drawn from cardiovascular, oncological and infectious disease studies.
How would you balance the need for high accuracy with the need for interpretability in a model used for screening asymptomatic patients?
1. Accuracy Enhancement Through Feature Informativeness
Accuracy is the most immediately measurable metric, but it is highly contingent on the signal‑to‑noise ratio that the chosen features provide. Features that capture distinct pathophysiological signatures will enable a classifier to separate classes with higher fidelity. Consider the case of myocardial infarction (MI) detection from electrocardiogram (ECG) signals. A feature set comprising the RR interval, QRS complex duration, and ST‑segment elevation can achieve >95 % sensitivity and specificity in a random forest model. In contrast, a feature set limited to heart rate alone falls to <80 % sensitivity, even if the same algorithm is used.
- Which ECG feature contributes most to MI detection: heart rate or ST‑segment elevation?
2. Robustness to Variability and Noise
Robustness refers to a model’s ability to maintain performance when confronted with data that differ from the training distribution.
- Normalised features – Scaling features to zero mean and unit variance reduces sensitivity to absolute measurement units. In a lung‑cancer CT classification task, normalising radiomic texture measures by the mean intensity of the tumour mask reduced performance variability across scanners.
- Aggregated statistics – Summarising a time series by mean and standard deviation rather than raw points reduces the impact of transient artefacts. For heart‑sound analysis, using the mean heart‑sound amplitude over a 30‑second window preserved 92 % of the classification accuracy that a 5‑second window achieved, while eliminating outliers caused by patient movement.
- Robust distance metrics – Employing median absolute deviation (MAD) instead of standard deviation for spread estimation increases resilience to outliers. In sepsis prediction from bedside monitors, a model that used MAD of lactate levels retained 4 % higher AUC when tested on a noisy ICU dataset.
Which noise‑robust statistic would you incorporate into a real‑time monitoring system and why?
3. Clinical Relevance and Interpretability
Beyond statistical performance, clinicians require that features be interpretable and actionable. A model that relies on opaque, high‑dimensional embeddings may achieve high accuracy but face resistance in clinical deployment.
Tabular features derived from routine laboratory tests (e.g. haemoglobin, C‑reactive protein) are easily understood by clinicians. In a study of pneumonia severity scoring, the inclusion of CRP as a feature not only improved the AUC from 0.82 to 0.87 but also allowed clinicians to trust the model’s recommendations, as evidenced by a 35 % reduction in unnecessary antibiotic prescriptions.
Augment the FT‑IR classification model with a simple clinical score (e.g. age, BMI) and evaluate the change in performance.
4. Feature Redundancy and Dimensionality Reduction
High dimensionality can lead to over‑fitting, especially with limited sample sizes. Redundant features—those that convey the same information—do not improve accuracy and may even degrade robustness.
from sklearn.decomposition import PCA
pca = PCA(n_components=0.95) # retain 95% variance
X_reduced = pca.fit_transform(X)
Principal Component Analysis (PCA) is a common technique to compress correlated features into orthogonal components. In a breast cancer prognosis study, reducing 120 radiomic features to 15 principal components maintained AUC at 0.89 while reducing training time by 70 %. However, the loss of interpretability can be significant, so PCA is often used in conjunction with other feature selection methods that preserve clinically meaningful variables.
When would you prefer PCA over RFE for feature reduction?
5. Comparative Analysis of Feature Families
| Feature Family | Typical Sources | Pros | Cons | Example Study |
|---|---|---|---|---|
| Statistical Moments | Time‑series, imaging intensity histograms | Simple, fast to compute, interpretable | May miss complex patterns | Heart‑sound analysis, 92 % accuracy |
| Shape / Morphology | Radiology, pathology images | Captures structural abnormalities | Requires segmentation, sensitive to noise | Lung‑cancer CT, 0.87 AUC |
| Texture / Radiomics | CT, MRI, PET | High discriminative power | Computationally intensive, less interpretable | Head‑and‑neck tumours, 0.90 AUC |
| Clinical Scores | Lab values, vital signs | Immediate clinical relevance | May be coarse, limited granularity | Pneumonia severity, 35 % antibiotic reduction |
| Deep‑Learning Embeddings | Raw images, signals | Automatic feature extraction | Black‑box, data hungry | Diabetic retinopathy detection, 0.98 AUC |
Choose a feature family for a resource‑constrained setting and explain your rationale.
6. Integration into Clinical Decision Support Systems
When a model is to be embedded within an electronic health record (EHR), the computational cost of feature extraction matters. Features that require minimal pre‑processing—such as mean blood pressure or total cholesterol—are favoured for real‑time decision support. In contrast, features that entail extensive image processing may be reserved for offline batch analysis or specialist consultation.
Measure the time required to compute each feature class on a standard workstation.
7. Future Directions and Emerging Trends
Recent advances in transfer learning for medical imaging allow pre‑trained convolutional neural networks to extract features that capture subtle disease patterns while requiring fewer labelled examples. These learned features often outperform hand‑crafted radiomic descriptors in terms of accuracy but pose new challenges for interpretability.
Another trend is the utilisation of longitudinal feature trajectories. Rather than summarising a single snapshot, models can incorporate the slope and variability of biomarkers over time, which has been shown to improve prognostication in chronic kidney disease by 5 % AUC.
Finally, the incorporation of multi‑modal features—combining imaging, genomics, and clinical data—has the potential to capture complementary disease dimensions. Early studies in breast cancer risk stratification report up to a 12 % increase in predictive accuracy when genomic risk scores are combined with radiomic texture features, although the added complexity necessitates careful feature selection to avoid over‑fitting.
What are the key challenges in integrating genomic and imaging features for a single predictive model?
In summary, the statistical features


Comments are closed.