Skip to main content

Physics-Informed Fractional Operator Learning for Real-Time Neurological Biomarker Detection: A Framework for Memory-Driven EEG Analysis

Project description

Neurological LRD Analysis

Python 3.11+ License: MIT PyPI Documentation

A comprehensive library for estimating Hurst exponents in neurological time series data, featuring multiple estimation methods, realistic data generation, and advanced benchmarking capabilities.

Developed as part of PhD research in Biomedical Engineering at the University of Reading, UK by Davian R. Chin, focusing on Physics-Informed Fractional Operator Learning for Real-Time Neurological Biomarker Detection: A Framework for Memory-Driven EEG Analysis.

Author: Davian R. Chin (PhD Candidate in Biomedical Engineering, University of Reading, UK)
Email: d.r.chin@pgr.reading.ac.uk
ORCiD: https://orcid.org/0009-0003-9434-3919

๐Ÿš€ Quick Start

Installation

# Install from PyPI (recommended)
pip install neurological-lrd-analysis

# Install with GPU support
pip install neurological-lrd-analysis[gpu]

# Install with development dependencies
pip install neurological-lrd-analysis[dev]

# Or install from source
git clone https://github.com/dave2k77/neurological_lrd_analysis.git
cd neurological_lrd_analysis
pip install -e .

Basic Usage

from neurological_lrd_analysis import BiomedicalHurstEstimatorFactory, EstimatorType

# Create factory instance
factory = BiomedicalHurstEstimatorFactory()

# Estimate Hurst exponent using DFA
result = factory.estimate(
    data=your_time_series,
    method=EstimatorType.DFA,
    confidence_method="bootstrap",
    n_bootstrap=100
)

print(f"Hurst exponent: {result.hurst_estimate:.3f}")
print(f"Confidence interval: {result.confidence_interval}")
print(f"Data quality score: {result.data_quality_score:.3f}")

โœจ Features

๐Ÿงฎ Multiple Estimation Methods

  • Temporal: DFA, R/S Analysis, Higuchi, Generalized Hurst Exponent
  • Spectral: Periodogram, GPH, Whittle MLE
  • Wavelet: DWT, NDWT, Abry-Veitch
  • Multifractal: MFDFA, MF-DMA

๐Ÿฅ Biomedical Scenarios

  • EEG: Rest, eyes closed/open, sleep, seizure patterns
  • ECG: Normal heart rate, tachycardia, realistic QRS complexes
  • Respiratory: Breathing patterns, irregular breathing
  • Neurological: Memory-driven EEG analysis, neurological biomarker detection
  • Artifacts: Electrode pops, motion, baseline drift, powerline interference
  • Physics-Informed Features: Fractional operator learning, real-time biomarker detection

๐Ÿ“Š Statistical Analysis

  • Bootstrap confidence intervals
  • Theoretical confidence intervals
  • Uncertainty quantification
  • Comprehensive error metrics (bias, MAE, RMSE)

๐Ÿ† Enhanced Benchmarking

  • Parametrized scoring functions for different applications
  • Application-specific rankings (BCI, research, clinical)
  • Comprehensive statistical reporting
  • Publication-ready visualizations

โšก Performance Optimization

  • JAX GPU acceleration
  • Numba CPU optimization
  • Intelligent backend selection
  • Lazy imports for efficiency

๐Ÿ“– Documentation

๐ŸŽฏ Use Cases

BCI/Real-time Applications

python scripts/run_benchmark.py --success-weight 0.4 --accuracy-weight 0.2 --speed-weight 0.3 --robustness-weight 0.1

Research Applications

python scripts/run_benchmark.py --success-weight 0.2 --accuracy-weight 0.4 --speed-weight 0.1 --robustness-weight 0.3

Biomedical Scenarios

python scripts/run_benchmark.py --biomedical-scenarios eeg_rest,ecg_normal --contaminations none,noise,electrode_pop

Neurological Conditions

python scripts/run_benchmark.py --biomedical-scenarios eeg_parkinsonian,eeg_epileptic --contaminations heavy_tail,neural_avalanche

๐Ÿงช Examples and Demos

# Run biomedical scenarios demonstration
python scripts/biomedical_scenarios_demo.py

# Run neurological conditions demonstration
python scripts/neurological_conditions_demo.py

# Run NumPyro integration demonstration
python scripts/numpyro_integration_demo.py

# Run application scoring demonstration
python scripts/application_scoring_demo.py

๐Ÿงช Testing

# Run all tests
python -m pytest tests/ -v

# Run specific test categories
python -m pytest tests/test_accuracy.py -v
python -m pytest tests/test_backends.py -v
python -m pytest tests/test_registry.py -v

๐Ÿ“Š Project Structure

neurological_lrd_analysis/
โ”œโ”€โ”€ neurological_lrd_analysis/     # Main package directory
โ”‚   โ”œโ”€โ”€ biomedical_hurst_factory.py    # Main library file
โ”‚   โ”œโ”€โ”€ benchmark_core/                # Core benchmarking functionality
โ”‚   โ”œโ”€โ”€ benchmark_backends/            # Backend selection and optimization
โ”‚   โ””โ”€โ”€ benchmark_registry/            # Estimator registry system
โ”œโ”€โ”€ docs/                         # Documentation
โ”œโ”€โ”€ scripts/                      # Demo scripts and utilities
โ”œโ”€โ”€ tests/                        # Test suite
โ”œโ”€โ”€ examples/                     # Example notebooks and code
โ”œโ”€โ”€ results/                      # Benchmark results and outputs
โ”œโ”€โ”€ pyproject.toml               # Package configuration
โ”œโ”€โ”€ setup.py                     # Setup script
โ””โ”€โ”€ requirements.txt             # Dependencies

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with JAX for GPU acceleration and physics-informed learning
  • Uses NumPyro for Bayesian inference in fractional operators
  • Leverages PyWavelets for wavelet-based fractional analysis
  • Inspired by research in physics-informed machine learning and memory-driven neurological signal processing

๐Ÿ“š Citation

If you use this library in your research, please cite:

@software{neurological_lrd_analysis,
  title={Neurological LRD Analysis: A Comprehensive Library for Physics-Informed Fractional Operator Learning and Real-Time Neurological Biomarker Detection},
  author={Davian R. Chin},
  year={2025},
  institution={University of Reading, UK},
  email={d.r.chin@pgr.reading.ac.uk},
  orcid={https://orcid.org/0009-0003-9434-3919},
  note={PhD Research in Biomedical Engineering: A Framework for Memory-Driven EEG Analysis},
  url={https://github.com/dave2k77/neurological_lrd_analysis}
}

๐Ÿ“ฆ Releases and Versioning

This project follows Semantic Versioning and uses GitHub Actions for automated releases to PyPI.

Creating a New Release

  1. Bump version: python scripts/bump_version.py 0.4.1
  2. Commit changes: git add . && git commit -m "Bump version to 0.4.1"
  3. Create tag: git tag v0.4.1
  4. Push to GitHub: git push origin main --tags
  5. GitHub Actions will automatically:
    • Run tests
    • Build the package
    • Publish to PyPI
    • Create a GitHub release

Development Releases

For testing, you can publish to TestPyPI:

# Push to develop branch to trigger TestPyPI publishing
git checkout develop
git push origin develop

Installation Options

  • Stable releases: pip install neurological-lrd-analysis
  • Development versions: pip install git+https://github.com/dave2k77/neurological_lrd_analysis.git
  • Test versions: pip install --index-url https://test.pypi.org/simple/ neurological-lrd-analysis

๐Ÿ”— Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neurological_lrd_analysis-0.4.1.tar.gz (239.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neurological_lrd_analysis-0.4.1-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file neurological_lrd_analysis-0.4.1.tar.gz.

File metadata

File hashes

Hashes for neurological_lrd_analysis-0.4.1.tar.gz
Algorithm Hash digest
SHA256 07796abc91fccc83f0dc35e000f69192bdab043d323f5f6ce7c200976cb3038e
MD5 cc6bbe6e33c5a69e43efe0bdf79cff9d
BLAKE2b-256 d66fde05a9d930e81ae7cf5b4d8b2dddc46a374fabd369d2284944fcac9fc0ff

See more details on using hashes here.

File details

Details for the file neurological_lrd_analysis-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for neurological_lrd_analysis-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f85096e2aea060c7d6225cf086da76fe82b908ca88d6e9c25c55d4686c7654cf
MD5 5a318f4e6dd0da34a869c911c7c86c85
BLAKE2b-256 58ae6937e3a2711e3d6d209a594be66d31303c8b670a425d05bce1cbbfe00812

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page