SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1803.02353 · 2018

Multi-level Attention Model for Weakly Supervised Audio Classification

arXiv · PDF · Open in the Atlas

Code that ran

10 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 10 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1803.02353.json · badge: /api/ran/1803.02353.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
deephdc/audio-classification-tf community (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
IBM/MAX-Audio-Classifier community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
catch_error Ran
ran on a synthesized input
deephdc/audio-classification-tf/audioclas/api.py
code served (permissive licence) · get_code("6caa9ea74b6d3d4e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from functools import wraps

def catch_error(f):
    @wraps(f)
    def wrap(*args, **kwargs):
        try:
            pred = f(*args, **kwargs)
            return {'status': 'OK', 'predictions': pred}
        except Exception as e:
            return {'status': 'error', 'message': str(e)}
    return wrap

# Define a simple function to decorate
def sample_function(x, y):
    return x + y

# Apply the decorator
decorated_func = catch_error(sample_function)

# Set up arguments
ARGS = {
    'f': decorated_func
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_model Ran
ran on a synthesized input
deephdc/audio-classification-tf/audioclas/model_utils.py
code served (permissive licence) · get_code("f841a666a816cd65")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
from tensorflow.keras.layers import Input, Dense
from tensorflow.keras.models import Model

# Create a minimal base_model that satisfies the function's requirements
# The function accesses: base_model.layers[-3].output and base_model.input
input_layer = Input(shape=(10,))
x = Dense(8, activation='relu')(input_layer)
x = Dense(6, activation='relu')(x)
x = Dense(4, activation='relu')(x)
base_model = Model(inputs=input_layer, outputs=x)

# Create CONF dict with all required nested keys
CONF = {
    'model': {
        'num_classes': 5
    },
    'training': {
        'l2_reg': 0.001
    }
}

ARGS = {
    'CONF': CONF,
    'base_model': base_model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_audiofiles Ran
ran on a synthesized input
deephdc/audio-classification-tf/audioclas/misc.py
code served (permissive licence) · get_code("e4f3d3fc80850e1f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure with some audio files
temp_dir = tempfile.mkdtemp()

# Create subdirectories
audio_subdir = os.path.join(temp_dir, "audio_folder")
os.makedirs(audio_subdir, exist_ok=True)

# Create some dummy audio files by writing minimal valid audio file headers
# Create a simple WAV file header
def create_dummy_audio_file(filepath):
    # Minimal WAV file header
    with open(filepath, 'wb') as f:
        f.write(b'RIFF')  # Chunk ID
        f.write(b'\x24\x00\x00\x00')  # Chunk size
        f.write(b'WAVE')  # Format
        f.write(b'fmt ')  # Subchunk1 ID
        f.write(b'\x10\x00\x00\x00')  # Subchunk1 size
        f.write(b'\x01\x00')  # Audio format (PCM)
        f.write(b'\x01\x00')  # Num channels
        f.write(b'\x44\xac\x00\x00')  # Sample rate
        f.write(b'\x88\x58\x01\x00')  # Byte rate
        f.write(b'\x02\x00')  # Block align
        f.write(b'\x10\x00')  # Bits per sample
        f.write(b'data')  # Subchunk2 ID
        f.write(b'\x00\x00\x00\x00')  # Subchunk2 size

# Create some audio files
create_dummy_audio_file(os.path.join(audio_subdir, "test_audio1.wav"))
create_dummy_audio_file(os.path.join(audio_subdir, "test_audio2.wav"))
create_dummy_audio_file(os.path.join(temp_dir, "test_audio3.wav"))

# Create a non-audio file that should be ignored
with open(os.path.join(audio_subdir, "test.txt"), 'w') as f:
    f.write("This is not an audio file")

ARGS = {
    "folder_path": temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
frame Ran
ran on a synthesized input
IBM/MAX-Audio-Classifier/core/mel_features.py
code served (permissive licence) · get_code("3f76530d9bfe10a4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (8, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a simple 1D array with 20 samples
data_1d = np.arange(20, dtype=np.float32)

# Create a 2D array with shape (20, 3) to test with additional dimensions
data_2d = np.arange(60, dtype=np.float32).reshape(20, 3)

# Test with 1D data
window_length = 5
hop_length = 2

ARGS = {
    "data": data_1d,
    "window_length": window_length,
    "hop_length": hop_length,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (8, 5) — shape (8, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_audio Ran
ran on a synthesized input
deephdc/audio-classification-tf/audioclas/misc.py
code served (permissive licence) · get_code("203fb22ce3ba8219")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import mimetypes

# The function is_audio takes a path parameter and checks if it's an audio file
# by using mimetypes.guess_type() to determine the MIME type.
# We need to provide a path string that will be recognized as audio.

# Test with a valid audio file path
ARGS = {
    'path': 'test_audio.mp3'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_class_names Ran
ran on a synthesized input
deephdc/audio-classification-tf/audioclas/data_utils.py
code served (permissive licence) · get_code("8ee89543c8a663b9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import numpy as np

# Create a temporary directory with a classes.txt file
temp_dir = tempfile.mkdtemp()
classes_file = os.path.join(temp_dir, 'classes.txt')

# Write some sample class names to the file
class_names_data = ['class1', 'class2', 'class3', 'class4']
with open(classes_file, 'w') as f:
    f.write('\n'.join(class_names_data))

ARGS = {
    'splits_dir': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_data_splits Ran
ran on a synthesized input
deephdc/audio-classification-tf/audioclas/data_utils.py
code served (permissive licence) · get_code("72e572ebf4ebd962")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import numpy as np

# Create temporary directories and files for testing
temp_splits_dir = tempfile.mkdtemp()
temp_dataset_dir = tempfile.mkdtemp()

# Create a train.txt file with sample data
train_data = np.array([
    ['image1.jpg', '0'],
    ['image2.jpg', '1'],
    ['image3.jpg', '2']
])
np.savetxt(os.path.join(temp_splits_dir, 'train.txt'), train_data, fmt='%s', delimiter=' ')

# Create a val.txt file with sample data
val_data = np.array([
    ['image4.jpg', '0'],
    ['image5.jpg', '1']
])
np.savetxt(os.path.join(temp_splits_dir, 'val.txt'), val_data, fmt='%s', delimiter=' ')

# Create a test.txt file without labels (single column)
test_data = np.array(['image6.jpg', 'image7.jpg'])
np.savetxt(os.path.join(temp_splits_dir, 'test.txt'), test_data, fmt='%s')

ARGS = {
    'splits_dir': temp_splits_dir,
    'dataset_dir': temp_dataset_dir,
    'split_name': 'train'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
open_compressed Ran
ran on a synthesized input
deephdc/audio-classification-tf/audioclas/misc.py
code served (permissive licence) · get_code("1ce325daf49dbb55")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tarfile
import zipfile
import io
import tempfile

# Create a temporary directory for output
temp_dir = tempfile.mkdtemp()

# Create a valid tar.gz byte stream
tar_bytes = io.BytesIO()
tar = tarfile.open(mode='w:gz', fileobj=tar_bytes)

# Add a simple file to the tar
info = tarfile.TarInfo(name='test_folder/')
info.type = tarfile.DIRTYPE
tar.addfile(info)

info = tarfile.TarInfo(name='test_folder/file.txt')
info.size = 5
tar.addfile(info, io.BytesIO(b'hello'))

tar.close()
tar_bytes.seek(0)

ARGS = {
    'byte_stream': tar_bytes,
    'file_format': 'gz',
    'output_folder': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
periodic_hann Ran
ran on a synthesized input
IBM/MAX-Audio-Classifier/core/mel_features.py
code served (permissive licence) · get_code("ed0ef7fc8a5f1840")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (512,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    "window_length": 512
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (512,) — shape (512,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
stft_magnitude Ran
ran on a synthesized input
IBM/MAX-Audio-Classifier/core/mel_features.py
code served (permissive licence) · get_code("0f0fa853ceaa04db")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (5, 129) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create a simple 1D time-domain signal
signal = np.random.randn(512).astype(np.float32)

# Define FFT parameters
fft_length = 256
hop_length = 64
window_length = 256

ARGS = {
    'signal': signal,
    'fft_length': fft_length,
    'hop_length': hop_length,
    'window_length': window_length,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (5, 129) — shape (5, 129) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mount_nextcloud Not yet run
unverified (harvested, no recorded run)
deephdc/audio-classification-tf/audioclas/data_utils.py
code served (permissive licence) · get_code("49e5bbc639f49bb4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
frame 6 other papers
1 dated earlier, 5 later
1609.09430 (2016-09)
CNN Architectures for Large-Scale Audio Classification
1903.00765 (2019-03)
Weakly Labelled AudioSet Tagging with Attention Neural Networks
1909.06654 (2019-09)
musicnn: Pre-trained convolutional neural networks for music audio tagging
and 3 more not named here
periodic_hann 6 other papers
1 dated earlier, 5 later
1609.09430 (2016-09)
CNN Architectures for Large-Scale Audio Classification
1903.00765 (2019-03)
Weakly Labelled AudioSet Tagging with Attention Neural Networks
1909.06654 (2019-09)
musicnn: Pre-trained convolutional neural networks for music audio tagging
and 3 more not named here
stft_magnitude 6 other papers
1 dated earlier, 5 later
1609.09430 (2016-09)
CNN Architectures for Large-Scale Audio Classification
1903.00765 (2019-03)
Weakly Labelled AudioSet Tagging with Attention Neural Networks
1909.06654 (2019-09)
musicnn: Pre-trained convolutional neural networks for music audio tagging
and 3 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In this paper, we propose a multi-level attention model to solve the weakly labelled audio classification problem. The objective of audio classification is to predict the presence or absence of audio events in an audio clip. Recently, Google published a large scale weakly labelled dataset called Audio Set, where each audio clip contains only the presence or absence of the audio events, without the onset and offset time of the audio events. Our multi-level attention model is an extension to the previously proposed single-level attention model. It consists of several attention modules applied on intermediate neural network layers. The output of these attention modules are concatenated to a vector followed by a multi-label classifier to make the final prediction of each class. Experiments shown that our model achieves a mean average precision (mAP) of 0.360, outperforms the state-of-the-art single-level attention model of 0.327 and Google baseline of 0.314.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1803.02353")
get_code_for_paper("1803.02353")
have("1803.02353")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1803.02353.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1803.02353.svg)](https://syntology.ai/paper/1803.02353)

Connect an agent — have() is free.