Skip to main content

hobj: human object learning benchmarks

CI

This repository contains benchmarks for comparing models of object learning against measurements of human behavior, from Lee and DiCarlo 2023 ("How well do rudimentary plasticity rules predict adult visual object learning?"). It also lets you download the raw data and images from the experiments in the paper.

Alt text

If you just want to download the raw data and images without using the hobj library, you can do so at the OSF repository for this project.

Quickstart

Install

The hobj package works for Python >=3.12.

Install it from PyPI:

pip install hobj

If you prefer to use uv, you can install it with:

uv pip install hobj

Using hobj to comparing a linear learner against human learning data

The template script below shows you how you can run a benchmark on a linear learning model based on your image encoding model.

All you need to do is have a way to process a PIL.Image into a vector of image features (as an np.ndarray). There are ~18,000 images that you'd need to compute image features for.

import hobj
import numpy as np 

# Compute your features for the images 
my_image_features: dict[str, np.ndarray] = {}
for image_id in hobj.list_image_ids():
    image = hobj.load_image(image_id=image_id) # PIL.Image
    
    # Compute your features here:  
    my_image_features[image_id] = ... # replace right hand side with your image-computable model

# Assemble the learning model:
model = hobj.create_linear_learner(
    image_id_to_features=my_image_features,
    update_rule_name='Square', # "Square", "Perceptron", "Hinge", "MAE", "Exponential", "CE", "REINFORCE",
    alpha=1, # learning rate between [0, 1]
)

# Load the benchmark:
benchmark = hobj.MutatorHighVarBenchmark()  # or hobj.MutatorOneshotBenchmark()

# Score the model:
result = benchmark.score_model(model)

# Print its score and its CI:
print(result.msen, result.msen_CI95)

# You can also check out more granular statistics of the model's behavior, like its learning curves: 
# print(result.model_statistics)

For more details (e.g., how to load the raw behavioral data or images in Python), check out the Jupyter notebooks in examples/.

To use a different location, pass cachedir=... to a data loader or benchmark constructor, or prefetch manually with hobj-download-data --cachedir /path/to/data.

Contact

If you have any questions, need help, or experience a bug, please don't hesitate to email me (mil@mit.edu), or open an issue on this repo!

Changes to codebase since publication

This codebase was overhauled in 2026 to improve its accessibility, performance, and quality. Along the way, minor changes to the statistical analysis procedure were introduced, along with changes to the names of the original filenames (see changelist). To see the codebase at the time of publication, check out the repo with the v1 tag here.

Citation

@article{lee2023well,
  title={How well do rudimentary plasticity rules predict adult visual object learning?},
  author={Lee, Michael J and DiCarlo, James J},
  journal={PLOS Computational Biology},
  volume={19},
  number={12},
  pages={e1011713},
  year={2023},
  publisher={Public Library of Science San Francisco, CA USA}
}

Metadata

Release files for hobj 2.0.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 hobj 2.0.0
File Size Uploaded Provenance Actions
hobj-2.0.0.tar.gz 23.0 kB Without provenance Details for hobj-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hobj 2.0.0
File Interpreter ABI Platform Actions
hobj-2.0.0-py3-none-any.whl Python 3 none any Details for hobj-2.0.0-py3-none-any.whl

Total release size: 57.1 kB

Release files / hobj-2.0.0.tar.gz

Download URL hobj-2.0.0.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e37f8412231b94f307f5e568abdca7fe48e4e3aaa6d6f6cb5d9e79011d1c6b28
BLAKE2b-256 checksum
How to use checksums
6351fe9a9dac516e78be73f11569d321fbbf04d82c70ea8f9c2d3f18554e42d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.12

Release files / hobj-2.0.0-py3-none-any.whl

Download URL hobj-2.0.0-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
959c62b66567cc9403b15070c4052871683ce9ca9fbbf7f4675bbe738505b518
BLAKE2b-256 checksum
How to use checksums
0e293960c13d18ee24818c147a8ea7f1dc8998e6c02a9a610cb7ff4b0db96af2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.12

Security for hobj 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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