Skip to main content

miniML: A deep learning framework for synaptic event detection

minimal Python version TensorFlow DOI

This repository contains the code described in the following publication:
O'Neill P.S., Baccino-Calace M., Rupprecht P., Lee, S., Hao, Y.A., Lin, M.Z., Friedrich R.W., Müller, M., and Delvendahl, I. (2025) A deep learning framework for automated and generalized synaptic event analysis. eLife 13:RP98485 (doi:10.7554/eLife.98485)

🧠 ABOUT

miniML is a deep-learning-based tool to detect synaptic events in 1d time-series data. It uses a CNN-LSTM network architecture that was trained using a large dataset of synaptic events (miniature excitatory postsynaptic currents) from cerebellar mossy fiber to granule cell synapses.

In this repository, we provide documentation, pre-trained models, and Python code to run model inference on recorded data. In addition, an application example (cerebellar granule cell mEPSC recording) is included.

📢 RELEASES

v.1.1.0 - 04 September 2026

  • package installable from PyPI ("miniml-detect")
  • major updates to GUI implementation and the code base
  • several small bug fixes
  • updated documentation
  • switch to using pyheka package for .dat file import

v.1.0.0 - 24 July 2026

  • Initial release as package

📈 ROADMAP

Next versions of miniML will move to Keras3 and/or pyTorch backends, in order to support newer pacjkage and Python versions.

💻 INSTALLATION

To use miniML, either clone the repository and install it locally, or install it directly from PyPI using pip:

pip install miniml-detect

Local installation:

git clone https://github.com/delvendahl/miniML.git
cd miniML
pip install .

It is strongly recommended to install miniML into its own virtual environment! miniML requires Python 3.11. The default Python dependencies are: sklearn, matplotlib, h5py, numpy, scipy, tensorflow, pyabf, ruptures.

[!IMPORTANT] The release of TensorFlow 2.16 and Keras 3 introduced breaking changes that raise an error when loading models trained with earlier TensorFlow versions. To avoid this, it is recommended to use TensorFlow 2.14 or 2.15.

Installation with GUI

For the GUI, additional dependencies are required (PyQt5, qt-material, and pyqtgraph). Install miniML with pip install .[gui] to include these dependencies and get full GUI support. An executable script miniml-gui will be created to start the application.

📚 DOCUMENTATION

Detailed documentation for miniML can be found here.

⏱ RUNNING MINIML

Analysis workflow in Python

First, a miniML MiniTrace object needs to be created containing 1d timeseries data. Currently, miniML supports direct loading from HEKA .dat files, Axon .abf files as well as HDF .h5 files. The miniml.fileio.TraceLoader object features discrete methods for loading from these file formats (e.g., TraceLoader.from_h5_file()). Data in other file formats need to be imported as Python objects.

Next, a miniML EventDetection object is initiated. Here, one needs to specify a miniML model file to use as well as the Trace object to operate on.

miniML model inference can then be run using the detect_events() method. This method will run miniML over the given data using the specified model. Runtime will depend on data length.

Following event detection, the individual detected events are analyzed and descriptive statistics are calculated for the recording.

miniML includes several plotting methods. They can be found in the Plotter class in plotting.py. A detection object has to be passed as data argument.

Event data and statistics can be saved in different formats (.pickle, .h5, .csv).

💡 EXAMPLE

The folder "example_data/" contains an example recording from a cerebellar mossy fiber to granule cell synapse. To use miniML on this data, run the commented example Jupyter Notebook (tutorial) illustrating the use of miniML.

📦 MODELS

The documentation includes notebooks showing how to train miniML models. You can also use the following links to Kaggle to train mminiML models on the cloud:

1 - Transfer learning
2 - Full training
3 - Training dataset

The repository contains trained models for several event detection scenarios, as outlined in the associated paper. If you have trained a model that could be useful for other researchers, please consider opening a pull request or get in touch with us in order to add it to the repository.

📝 CITATION

If you use miniML in your work, please cite:

@article{ONeill2025,
  article_type = {journal},
  title = {A deep learning framework for automated and generalized synaptic event analysis},
  author = {O'Neill, Philipp S and Baccino-Calace, Martín and Rupprecht, Peter and Lee, Sungmoo and Hao, Yukun A and Lin, Michael Z and Friedrich, Rainer W and Mueller, Martin and Delvendahl, Igor},
  volume = 13,
  year = 2025,
  month = {mar},
  pub_date = {2025-03-05},
  pages = {RP98485},
  citation = {eLife 2025;13:RP98485},
  doi = {10.7554/eLife.98485},
  url = {https://doi.org/10.7554/eLife.98485},
}

🙏 ACKNOWLEDGEMENTS

The development of miniML was funded by the Swiss National Science Foundation, the University of Zurich Research Talent Development Fund, and the German Research Foundation.

The GUI uses Material Icons by Google (https://fonts.google.com/icons).

The Python code to read HEKA Patchmaster files was adapted from https://github.com/campagnola/heka_reader

The template matching implementation was adapted from https://github.com/samuroi/SamuROI

🐛 ISSUES

Please feel free to contact us in case of questions, either via email, or by opening an Issue here on GitHub.

✉️ CONTACT

philipp.oneill@physiologie.uni-freiburg.de or igor.delvendahl@physiologie.uni-freiburg.de

Metadata

Release files for miniml-detect 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for miniml-detect 1.1.0
File Size Uploaded
miniml_detect-1.1.0.tar.gz 17.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for miniml-detect 1.1.0
File Interpreter ABI Platform
miniml_detect-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.5 MB

Release files / miniml_detect-1.1.0.tar.gz

Download URL miniml_detect-1.1.0.tar.gz
Size 17.7 MB
Tags Source
SHA-256 checksum
How to use checksums
7f585b1b93387e9278f761306c22e2b8ad66b3c34ece14b08a003b3ef0530c49
BLAKE2b-256 checksum
How to use checksums
0edecd662b828b634707a948edf15fef1e499924a8e259f4d45fe7c63890e91d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Release files / miniml_detect-1.1.0-py3-none-any.whl

Download URL miniml_detect-1.1.0-py3-none-any.whl
Size 17.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ce5a150ef1e85589c584355bac2c082528205f37ef67059f090351b82608735d
BLAKE2b-256 checksum
How to use checksums
860618f992e971e2d0fac4b63818d7cbd194007e9e628ae8eec7a116a79fa479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Release history Release notifications | RSS feed

1.1.1

2 release files

This release

1.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page