SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.08747 · 2024

MicroSSIM: Improved Structural Similarity for Comparing Microscopy Data

arXiv · PDF · Open in the Atlas

Code that ran

11 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; 4 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 5 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2408.08747.json · badge: /api/ran/2408.08747.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
juglab/microssim canonical (classifier label)
classifier basis: census
11 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_norm_parameters Ran
ran, violated the contract we drafted
juglab/microssim/src/microssim/image_processing/micro_ssim_normalization.py
code served (permissive licence) · get_code("2eb3ef1b01791600")
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 numpy as np

# Create small test images (ground truth and prediction)
np.random.seed(0)
gt = np.random.rand(4, 3).astype(np.float32) * 100 + 10
pred = np.random.rand(4, 3).astype(np.float32) * 100 + 15

ARGS = {
    "gt": gt,
    "pred": pred,
    "bg_percentile": 3.0,
    "offset_gt": None,
    "offset_pred": None,
    "max_val": None,
}
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 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
compute_scaled_ssim Ran
ran, honoured the contract we drafted
juglab/microssim/src/microssim/ssim/ssim_utils.py
code served (permissive licence) · get_code("2c78c8ccebadcc45")
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 float64, ndim 0, 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 numpy as np
from dataclasses import dataclass
from typing import Union

@dataclass
class SSIMElements:
    """Dataclass holding the various values necessary for the computation of the SSIM."""
    ux: np.ndarray
    'Weighted mean of the first image.'
    uy: np.ndarray
    'Weighted mean of the second image.'
    vxy: np.ndarray
    'Weighted covariance of the two images.'
    vx: np.ndarray
    'Weighted variance of the first image.'
    vy: np.ndarray
    'Weighted variance of the second image.'
    C1: float
    'Algorithm parameter, C1.'
    C2: float
    'Algorithm parameter, C2.'

    def get_args_tuple(self):
        """Return the elements as a list."""
        return [self.ux, self.uy, self.vxy, self.vx, self.vy, self.C1, self.C2]


# Create small numpy arrays for SSIM computation
# Shape (2, 4) for batch size 2 and 4 spatial elements
np.random.seed(0)

ux = np.random.randn(2, 4).astype(np.float64)
uy = np.random.randn(2, 4).astype(np.float64)
vxy = np.random.randn(2, 4).astype(np.float64)
vx = np.abs(np.random.randn(2, 4).astype(np.float64))
vy = np.abs(np.random.randn(2, 4).astype(np.float64))
C1 = 6.5025
C2 = 58.5225

elements = SSIMElements(
    ux=ux,
    uy=uy,
    vxy=vxy,
    vx=vx,
    vy=vy,
    C1=C1,
    C2=C2
)

ARGS = {
    "elements": elements,
    "alpha": 1.0,
    "return_individual_components": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, typing_extensions — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
compute_ssim_elements Ran
ran; our contract draft was wrong, not the code
juglab/microssim/src/microssim/ssim/ssim_utils.py
code served (permissive licence) · get_code("d6c119c1ab71fbe8")
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 SSIMElements. 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 numpy as np
from dataclasses import dataclass
from typing import Optional

@dataclass
class SSIMElements:
    """Dataclass holding the various values necessary for the computation of the SSIM."""
    ux: np.ndarray
    uy: np.ndarray
    vxy: np.ndarray
    vx: np.ndarray
    vy: np.ndarray
    C1: float
    C2: float

    def get_args_tuple(self):
        """Return the elements as a list."""
        return [self.ux, self.uy, self.vxy, self.vx, self.vy, self.C1, self.C2]


# Create small test images as numpy arrays
# Using distinct dimensions: 4x3 for image1 and 4x3 for image2
image1 = np.random.rand(4, 3).astype(np.float64)
image2 = np.random.rand(4, 3).astype(np.float64)

# Normalize to a specific data range [0, 1]
image1 = (image1 - image1.min()) / (image1.max() - image1.min() + 1e-8)
image2 = (image2 - image2.min()) / (image2.max() - image2.min() + 1e-8)

ARGS = {
    'image1': image1,
    'image2': image2,
    'win_size': 3,  # odd value, smaller than image dimensions
    'data_range': 1.0,  # explicit data range for floating point
    'channel_axis': None,  # grayscale image
    'gaussian_weights': False,  # use uniform weights
    'K1': 0.01,
    'K2': 0.03,
    'K3': None,
    'sigma': 1.5,
    'use_sample_covariance': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, skimage, typing_extensions — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SSIMElements — a SSIMElements output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SSIMElements 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
get_background Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
juglab/microssim/src/microssim/image_processing/background.py
code served (permissive licence) · get_code("3d78d52fcb55e0be")
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 (1, 1) 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 small test image/array
# Using a 2D array with shape (4, 3) to represent a small image
x = np.random.rand(4, 3) * 100  # Random values scaled to 0-100 range

# Define the arguments dict
ARGS = {
    "x": x,
    "percentage": 3
}
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 (1, 1) — shape (1, 1) 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
get_mse_ri_factor Ran
ran, honoured the contract we drafted
juglab/microssim/src/microssim/ri_factor/mse_ri_factor.py
code served (permissive licence) · get_code("e7cf2b781246c262")
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 (2, 1) 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 small test arrays with distinct dimensions
# Shape: (batch_size=2, flattened_features=4)
gt = np.random.randn(2, 4).astype(np.float32)
pred = np.random.randn(2, 4).astype(np.float32)

ARGS = {
    'gt': gt,
    'pred': pred,
}
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 (2, 1) — shape (2, 1) 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
linearize_list Ran
ran, honoured the contract we drafted
juglab/microssim/src/microssim/image_processing/linearize.py
code served (permissive licence) · get_code("4af3008e158e6f45")
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 (52,) 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 list of small numpy arrays with distinct shapes
images = [
    np.random.rand(4, 5).astype(np.float32),  # 4x5 image
    np.random.rand(3, 6).astype(np.float32),  # 3x6 image
    np.random.rand(2, 7).astype(np.float32),  # 2x7 image
]

ARGS = {
    "images": images
}
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 (52,) — shape (52,) 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
normalize_care Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
juglab/microssim/src/microssim/image_processing/care_normalization.py
code served (permissive licence) · get_code("be65e77106895f44")
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 (4, 3) 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 small test image as a numpy array
x = np.random.rand(4, 3).astype(np.float32) * 100  # Random values between 0-100

# Define ARGS dictionary with all parameters for normalize_care
ARGS = {
    "x": x,
    "pmin": 3,
    "pmax": 99.8,
    "axis": None,
    "eps": 1e-20,
    "dtype": np.float32
}
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 (4, 3) — shape (4, 3) 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
normalize_min_max Ran
ran; our contract draft was wrong, not the code
juglab/microssim/src/microssim/image_processing/care_normalization.py
code served (permissive licence) · get_code("f18b16eabcf058db")
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 (2, 3) 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 small test image (2D array)
x = np.array([[1.0, 2.0, 3.0], 
              [4.0, 5.0, 6.0]], dtype=np.float32)

# Define min and max values
min_val = 1.0
max_val = 6.0

# Define epsilon for numerical stability
eps = 1e-20

# Define output data type
dtype = np.float32

ARGS = {
    "x": x,
    "min_val": min_val,
    "max_val": max_val,
    "eps": eps,
    "dtype": dtype
}
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 (2, 3) — shape (2, 3) 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
normalize_min_max Ran
ran, violated the contract we drafted
juglab/microssim/src/microssim/image_processing/micro_ssim_normalization.py
code served (permissive licence) · get_code("69d42f6523482852")
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 3, dtype family float, shape (4, 5, 3) 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 sample images for testing
# Single image case: 3D array (height, width, channels)
single_image = np.random.rand(4, 5, 3) * 100  # values between 0-100

# List of images case: list of 3D arrays
image_list = [
    np.random.rand(4, 5, 3) * 100,
    np.random.rand(4, 5, 3) * 100,
]

# Define normalization parameters
min_val = 0.0
max_val = 100.0

ARGS = {
    "images": single_image,
    "min_val": min_val,
    "max_val": max_val,
}
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 3, dtype family float, shape (4, 5, 3) — shape (4, 5, 3) 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
normalize_min_mse Ran
ran, honoured the contract we drafted
juglab/microssim/src/microssim/image_processing/care_normalization.py
code served (permissive licence) · get_code("9059d028a1b3ebc3")
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 (4, 3) 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 small distinct-sized numpy arrays
x = np.random.randn(4, 3).astype(np.float32)
target = np.random.randn(4, 3).astype(np.float32)

ARGS = {
    "x": x,
    "target": target,
}
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 (4, 3) — shape (4, 3) 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
remove_background Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
juglab/microssim/src/microssim/image_processing/background.py
code served (permissive licence) · get_code("f12ab61d168b290b")
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 (4, 3) 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 small test image array
# Using a 4x3 array (distinct dimensions for later probing)
x = np.random.rand(4, 3).astype(np.float64) * 100

# Define arguments for remove_background function
ARGS = {
    "x": x,
    "percentage": 3,
    "dtype": np.float32
}
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 (4, 3) — shape (4, 3) 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

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, 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 11 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-22.

Repositories linked to this paper

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

Abstract

Microscopy is routinely used to image biological structures of interest. Due to imaging constraints, acquired images, also called as micrographs, are typically low-SNR and contain noise. Over the last few years, regression-based tasks like unsupervised denoising and splitting have found utility in working with such noisy micrographs. For evaluation, Structural Similarity (SSIM) is one of the most popular measures used in the field. For such tasks, the best evaluation would be when both low-SNR noisy images and corresponding high-SNR clean images are obtained directly from a microscope. However, due to the following three peculiar properties of the microscopy data, we observe that SSIM is not well suited to this data regime: (a) high-SNR micrographs have higher intensity pixels as compared to low-SNR micrographs, (b) high-SNR micrographs have higher intensity pixels than found in natural images, images for which SSIM was developed, and (c) a digitally configurable offset is added by the detector present inside the microscope which affects the SSIM value. We show that SSIM components behave unexpectedly when the prediction generated from low-SNR input is compared with the corresponding high-SNR data. We explain this by introducing the phenomenon of saturation, where SSIM components become less sensitive to (dis)similarity between the images. We propose an intuitive way to quantify this, which explains the observed SSIM behavior. We introduce MicroSSIM, a variant of SSIM, which overcomes the above-discussed issues. We justify the soundness and utility of MicroSSIM using theoretical and empirical arguments and show the utility of MicroSSIM on two tasks: unsupervised denoising and joint image splitting with unsupervised denoising. Since our formulation can be applied to a broad family of SSIM-based measures, we also introduce MicroMS3IM, a microscopy-specific variation of MS-SSIM.

For agents

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

get_harvested_code_for_paper("2408.08747")
get_code_for_paper("2408.08747")
have("2408.08747")

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

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

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

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

Connect an agent — have() is free.