The Estimation of Auditory Representations Network (EARNET): a Neural Network Approximation to the Auditory Periphery Model
EARNET produces multiple auditory representations, specifically inner hair cell voltages in the formof a IHCogram, and synaptic firing rates in the form of Neurogram. Additionally, EARNET takes as input an audiogram at runtime, corresponding to specific hearing impairment. The input to the model is an acoustic waveform, sampled at 16 kHz (focused on speech inputs). This code runs a neural network-based joint IHC/Neurogram emulator based of cochlear filtering and hair-cell transduction stages of the Zilany & Bruce auditory model (J. Acoust. Soc. Am. 120(3), 1446–1466, 2006).
When using the EARNET auditory model, please cite the following paper: Placeholder for paper or zenodo reference here.
The code requires Python 3.8 and Tensorflow 2.13. The required conda environment is described in the file 'earnet.yaml', and can be created using the following command: conda env create -f earnet.yaml The required conda environment is described in the file 'earnet.yaml' for linux. The linux and Windows (WSL2) install instructions assume use of NVDIA GPU.
conda env create -f earnet.yaml
conda env create -f earnet-mac.yaml
sudo apt update && sudo apt -y upgrade
sudo apt -y install wget git build-essential
# Download latest Miniforge installer for Linux (arm64 if on Apple Silicon; x86_64 for WSL on PC)
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
# Make it executable
chmod +x Miniforge3-Linux-x86_64.sh
# Run installer
./Miniforge3-Linux-x86_64.sh
# create conda env
conda env create -f earnet-wsl2.yaml
conda activate earnet
# ----- CUDA 11.8 (WSL) -----
# From NVIDIA's CUDA on WSL instructions (add repo and install):
# (If you've installed other CUDA versions before, purge them first.)
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update && sudo apt -y upgrade
sudo apt -y install cuda-toolkit-11-8
sudo apt install -y cuda-compiler-11-8 # smaller
# (or) sudo apt install -y cuda-11-8 # full toolkit including samples
# Ensure the tools are on PATH
echo 'export CUDA_HOME=/usr/local/cuda-11.8' | sudo tee /etc/profile.d/cuda.sh
echo 'export PATH=/usr/local/cuda-11.8/bin:$PATH' | sudo tee -a /etc/profile.d/cuda.sh
source /etc/profile.d/cuda.sh
# Verify ptxas
which ptxas
ptxas --version
# Verify nvcc (optional)
nvcc --version
apt install sox
The main script for running the system is ‘run_emulator.py’. The command-line arguments are:
-f : specify an individual audio file to process
-l : process the content of a list of audio files
-d : the output directory to which output files are written (default : ‘processed’)
-s : the sound pressure level, in dB, at which to process the signal
-a : the audiogram corresponding to the auditory system to emulate, saved as a .csv file
-c : the channel to process (for audio files with multiple channels)
-v : model version to use; 1 designates the large EARNET model with 4.4M parameters, and 2 designates the small model with 1.4M parameters
The system outputs a matlab .mat file for each input audio file that is processed. If the input audio file contains multiple channels, a separate .mat file for each, with the '_ch.mat' extension used to denote input channel 'x'. The output .mat files contain 3 variables:
-
'waveform' : the waveform from the input audio file
-
'ihc' : the 80-channel approximated IHCogram, generated by the emulator
-
'ngram' : the 80-channel approximated Neurogram, generated by the emulator
DISTRIBUTION STATEMENT A. Approved for public release. Distribution is unlimited. This material is based upon work supported by the Department of the Army under Air Force Contract No. FA8702-15-D-0001 or FA8702-25-D-B002. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Department of the Army. © 2025 Massachusetts Institute of Technology.
Subject to FAR52.227-11 Patent Rights - Ownership by the contractor (May 2014) The software/firmware is provided to you on an As-Is basis
Delivered to the U.S. Government with Unlimited Rights, as defined in DFARS Part 252.227-7013 or 7014 (Feb 2014). Notwithstanding any copyright notice, U.S. Government rights in this work are defined by DFARS 252.227-7013 or DFARS 252.227-7014 as detailed above. Use of this work other than as specifically authorized by the U.S. Government may violate any copyrights that exist in this work.