SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.10049 · ICLR · 2024

Inherently Interpretable Time Series Classification via Multiple Instance Learning

Joseph Early, Gavin Cheung, Kurt Cutajar, Hanting Xie, Jas Kandola, Niall Twomey

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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 0 have no contract verdict; 6 failures of our instrument; 3 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/2311.10049.json · badge: /api/ran/2311.10049.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
jaearly/miltimeseriesclassification canonical (classifier label)
classifier basis: classifier_2025
6 ran · 3 no recorded run
FunctionStatusWhere it lives
_calculate_aopc Ran
ran; our contract draft was wrong, not the code
jaearly/miltimeseriesclassification/millet/model/millet_model.py
code served (permissive licence) · get_code("70f76f85191e0560")
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. 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
import torch.nn as nn
import numpy as np
import math
from functools import partial
from tqdm import tqdm
import sys

torch.manual_seed(0)

# Define a minimal MILLETModel that satisfies the function's usage
class MILLETModel(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.input_dim = input_dim
        self.num_classes = num_classes
        self.fc = nn.Linear(input_dim, num_classes)
    
    def forward(self, bags, positions):
        """
        bags: List of 2D tensors
        positions: Stacked tensor of positions
        Returns dict with 'bag_logits' key
        """
        batch_logits = []
        for bag in bags:
            # Aggregate bag instances (simple mean pooling)
            agg = bag.mean(dim=0)
            logits = self.fc(agg)
            batch_logits.append(logits)
        batch_logits = torch.stack(batch_logits)
        return {'bag_logits': batch_logits}

# Create minimal test data
model = MILLETModel(input_dim=4, num_classes=3)

# Create 2 bags with 5 instances each, 4 features
bags = [
    torch.randn(5, 4),
    torch.randn(5, 4)
]

# Original batch logits (2 bags, 3 classes)
batch_orig_logits = torch.randn(2)

# Predicted classes for each bag
clzs = [1, 2]

# Interpretation scores (2 bags, 5 instances each)
batch_interpretation_scores = torch.randn(2, 5)

# Perturbation parameters
stop = 0.5
step = 0.1
verbose = False

ARGS = {
    'model': model,
    'bags': bags,
    'batch_orig_logits': batch_orig_logits,
    'clzs': clzs,
    'batch_interpretation_scores': batch_interpretation_scores,
    'stop': stop,
    'step': step,
    'verbose': verbose
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
_calculate_random_aopc Ran
ran; our contract draft was wrong, not the code
jaearly/miltimeseriesclassification/millet/model/millet_model.py
code served (permissive licence) · get_code("8bae1493f34b31ad")
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. 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
import torch.nn as nn
from typing import List, Dict, Any

torch.manual_seed(0)

# Build a minimal MILLETModel that satisfies the function's usage
class MILLETModel(nn.Module):
    def __init__(self, n_classes: int = 3, feature_dim: int = 4):
        super().__init__()
        self.n_classes = n_classes
        self.feature_dim = feature_dim
        # Minimal layers to process bags
        self.fc = nn.Linear(feature_dim, n_classes)
    
    def forward(self, bags: List[torch.Tensor], bag_positions: torch.Tensor) -> Dict[str, torch.Tensor]:
        """
        Process bags and return bag_logits.
        bags: list of 2D tensors (each is [n_instances, feature_dim])
        bag_positions: stacked tensor of positions
        """
        # Simple aggregation: mean pooling over instances in each bag
        batch_size = len(bags)
        bag_logits = []
        
        for bag in bags:
            # Mean pool the bag to get a single representation
            pooled = bag.mean(dim=0, keepdim=True)  # [1, feature_dim]
            logits = self.fc(pooled)  # [1, n_classes]
            bag_logits.append(logits)
        
        bag_logits = torch.cat(bag_logits, dim=0)  # [batch_size, n_classes]
        
        return {'bag_logits': bag_logits}


# Create model
model = MILLETModel(n_classes=3, feature_dim=4)

# Create bags (list of 2D tensors)
# bag 0: 5 instances, 4 features
# bag 1: 5 instances, 4 features
bags = [
    torch.randn(5, 4),
    torch.randn(5, 4),
]

# Compute original logits
with torch.no_grad():
    bag_positions_dummy = torch.arange(5).unsqueeze(0).repeat(2, 1)
    orig_output = model(bags, bag_positions_dummy)
    batch_orig_logits = orig_output['bag_logits'][:, 0]  # logits for class 0

# Predicted classes for each bag
clzs = [0, 1]

# Perturbation parameters
stop = 0.5
step = 0.1
verbose = False
n_repeats = 2
seed = 42

ARGS = {
    'model': model,
    'bags': bags,
    'batch_orig_logits': batch_orig_logits,
    'clzs': clzs,
    'stop': stop,
    'step': step,
    'verbose': verbose,
    'n_repeats': n_repeats,
    'seed': seed,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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_perturbed_bag Ran
ran; our contract draft was wrong, not the code
jaearly/miltimeseriesclassification/millet/model/millet_model.py
code served (permissive licence) · get_code("9d83fb3730c86507")
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. 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

torch.manual_seed(0)

# Construct arguments for _create_perturbed_bag
bag = torch.randn(5, 4)  # Small bag with 5 instances, 4 features each
bag_morf = torch.tensor([2, 0, 4])  # Indices of instances ordered by importance
n_to_remove = 2  # Remove 2 instances

ARGS = {
    "bag": bag,
    "bag_morf": bag_morf,
    "n_to_remove": n_to_remove,
}
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 tuple — a tuple output has no array shape of its own; none is 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
calculate_ndcg_at_n Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jaearly/miltimeseriesclassification/millet/model/millet_model.py
code served (permissive licence) · get_code("2dce7fe2b42833d0")
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 float, 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 torch
import math

torch.manual_seed(0)

# The function expects:
# 1. instance_importance_scores: torch.Tensor - scores for each instance
# 2. instance_labels: torch.Tensor - binary labels (1 = important, 0 = not important)

# Create a small example:
# - 6 instances total
# - 2 of them are labeled as important (1)
# - 4 of them are labeled as not important (0)

instance_importance_scores = torch.tensor([0.9, 0.1, 0.8, 0.2, 0.7, 0.3], dtype=torch.float32)
instance_labels = torch.tensor([1, 0, 1, 0, 0, 0], dtype=torch.long)

ARGS = {
    "instance_importance_scores": instance_importance_scores,
    "instance_labels": instance_labels,
}
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 float, 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
cross_entropy_criterion Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jaearly/miltimeseriesclassification/millet/model/millet_model.py
code served (permissive licence) · get_code("437e0e6962fe1685")
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 Tensor, 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 torch
from torch import nn

torch.manual_seed(0)

# Create predictions tensor: batch_size=2, num_classes=4
predictions = torch.randn(2, 4)

# Create targets tensor: batch_size=2 with class indices in range [0, 3]
targets = torch.tensor([1, 3], dtype=torch.float32)

ARGS = {
    "predictions": predictions,
    "targets": targets,
}
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 Tensor, 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
mil_collate_fn Ran
ran; our contract draft was wrong, not the code
jaearly/miltimeseriesclassification/millet/model/millet_model.py
code served (permissive licence) · get_code("d370d48f01c0b9a8")
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 dict. 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

torch.manual_seed(0)

# Create sample batch items for MIL (Multiple Instance Learning)
# Each item should have 'bag', 'target', and optionally 'instance_targets'

bag1 = torch.randn(5, 4)  # 5 instances, 4 features
bag2 = torch.randn(3, 4)  # 3 instances, 4 features

instance_targets1 = torch.tensor([0, 1, 0, 1, 0], dtype=torch.long)
instance_targets2 = torch.tensor([1, 0, 1], dtype=torch.long)

batch_item1 = {
    'bag': bag1,
    'target': 1,
    'instance_targets': instance_targets1
}

batch_item2 = {
    'bag': bag2,
    'target': 0,
    'instance_targets': instance_targets2
}

orig_batch = [batch_item1, batch_item2]

ARGS = {
    'orig_batch': orig_batch
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
MILLETModel Not yet run
unverified (harvested, no recorded run)
jaearly/miltimeseriesclassification/millet/model/millet_model.py
code served (permissive licence) · get_code("a51741819fc82c72")
How it ran

no invocation recorded.

MILTSCDataset Not yet run
unverified (harvested, no recorded run)
jaearly/miltimeseriesclassification/millet/model/millet_model.py
code served (permissive licence) · get_code("c72a6521fa1ce293")
How it ran

no invocation recorded.

calculate_aopcr Not yet run
unverified (harvested, no recorded run)
jaearly/miltimeseriesclassification/millet/model/millet_model.py
code served (permissive licence) · get_code("72440c23e33b975b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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

Conventional Time Series Classification (TSC) methods are often black boxes that obscure inherent interpretation of their decision-making processes. In this work, we leverage Multiple Instance Learning (MIL) to overcome this issue, and propose a new framework called MILLET: Multiple Instance Learning for Locally Explainable Time series classification. We apply MILLET to existing deep learning TSC models and show how they become inherently interpretable without compromising (and in some cases, even improving) predictive performance. We evaluate MILLET on 85 UCR TSC datasets and also present a novel synthetic dataset that is specially designed to facilitate interpretability evaluation. On these datasets, we show MILLET produces sparse explanations quickly that are of higher quality than other well-known interpretability methods. To the best of our knowledge, our work with MILLET, which is available on GitHub 1 , is the first to develop general MIL methods for TSC and apply them to an extensive variety of domains.

For agents

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

get_harvested_code_for_paper("2311.10049")
get_code_for_paper("2311.10049")
have("2311.10049")

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

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

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

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

Connect an agent — have() is free.