OP-Reddit-Image / README.md
mtybilly's picture
Declare image column as an Image feature so the viewer renders it
b615ca7 verified
|
Raw
History Blame Contribute Delete
19.4 kB
metadata
license: other
license_name: reddit-user-content
license_link: https://redditinc.com/policies/user-agreement
language:
  - en
task_categories:
  - text-classification
tags:
  - reddit
  - images
  - multimodal
  - public-health
  - harm-reduction
  - opioid
  - substance-use
  - pseudonymized
pretty_name: OP-R1 Reddit Images (37 drug subreddits, 2016-2026)
size_categories:
  - 100K<n<1M
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/*/part-*.parquet
  - config_name: 1P_LSD
    data_files:
      - split: train
        path: data/1P_LSD/part-*.parquet
  - config_name: 1V_LSD
    data_files:
      - split: train
        path: data/1V_LSD/part-*.parquet
  - config_name: 2cb
    data_files:
      - split: train
        path: data/2cb/part-*.parquet
  - config_name: 4acodmt
    data_files:
      - split: train
        path: data/4acodmt/part-*.parquet
  - config_name: 5MeODMT
    data_files:
      - split: train
        path: data/5MeODMT/part-*.parquet
  - config_name: AMT
    data_files:
      - split: train
        path: data/AMT/part-*.parquet
  - config_name: Ayahuasca
    data_files:
      - split: train
        path: data/Ayahuasca/part-*.parquet
  - config_name: CannabisExtracts
    data_files:
      - split: train
        path: data/CannabisExtracts/part-*.parquet
  - config_name: DMT
    data_files:
      - split: train
        path: data/DMT/part-*.parquet
  - config_name: DMXE
    data_files:
      - split: train
        path: data/DMXE/part-*.parquet
  - config_name: DPH
    data_files:
      - split: train
        path: data/DPH/part-*.parquet
  - config_name: DrugCombos
    data_files:
      - split: train
        path: data/DrugCombos/part-*.parquet
  - config_name: Drugs
    data_files:
      - split: train
        path: data/Drugs/part-*.parquet
  - config_name: LSA
    data_files:
      - split: train
        path: data/LSA/part-*.parquet
  - config_name: LSD
    data_files:
      - split: train
        path: data/LSD/part-*.parquet
  - config_name: MDMA
    data_files:
      - split: train
        path: data/MDMA/part-*.parquet
  - config_name: MXE
    data_files:
      - split: train
        path: data/MXE/part-*.parquet
  - config_name: MemantineHCl
    data_files:
      - split: train
        path: data/MemantineHCl/part-*.parquet
  - config_name: Nootropics
    data_files:
      - split: train
        path: data/Nootropics/part-*.parquet
  - config_name: PCP
    data_files:
      - split: train
        path: data/PCP/part-*.parquet
  - config_name: adderall
    data_files:
      - split: train
        path: data/adderall/part-*.parquet
  - config_name: afinil
    data_files:
      - split: train
        path: data/afinil/part-*.parquet
  - config_name: ambien
    data_files:
      - split: train
        path: data/ambien/part-*.parquet
  - config_name: anabolic
    data_files:
      - split: train
        path: data/anabolic/part-*.parquet
  - config_name: benzodiazepines
    data_files:
      - split: train
        path: data/benzodiazepines/part-*.parquet
  - config_name: cannabis
    data_files:
      - split: train
        path: data/cannabis/part-*.parquet
  - config_name: cocaine
    data_files:
      - split: train
        path: data/cocaine/part-*.parquet
  - config_name: dissociatives
    data_files:
      - split: train
        path: data/dissociatives/part-*.parquet
  - config_name: dxm
    data_files:
      - split: train
        path: data/dxm/part-*.parquet
  - config_name: fentanyl
    data_files:
      - split: train
        path: data/fentanyl/part-*.parquet
  - config_name: ketamine
    data_files:
      - split: train
        path: data/ketamine/part-*.parquet
  - config_name: mescaline
    data_files:
      - split: train
        path: data/mescaline/part-*.parquet
  - config_name: meth
    data_files:
      - split: train
        path: data/meth/part-*.parquet
  - config_name: modafinil
    data_files:
      - split: train
        path: data/modafinil/part-*.parquet
  - config_name: noids
    data_files:
      - split: train
        path: data/noids/part-*.parquet
  - config_name: opiates
    data_files:
      - split: train
        path: data/opiates/part-*.parquet
  - config_name: treedibles
    data_files:
      - split: train
        path: data/treedibles/part-*.parquet
extra_gated_heading: Request access to the OP-R1 Reddit corpus
extra_gated_button_content: I agree to all terms above
extra_gated_description: >-
  This dataset contains pseudonymized but re-identifiable social-media content
  about substance use. Access is reviewed manually and granted only for
  public-health / harm-reduction research. Requests without a verifiable
  institutional affiliation and a specific research purpose will be declined.
extra_gated_prompt: >-
  **DATA USE AGREEMENT — read in full before requesting access.**


  This corpus contains Reddit posts and comments about drug use, including
  opioids. Author usernames are replaced by salted HMAC pseudonyms, but the
  dataset **retains original Reddit post/comment identifiers** (`id`, `link_id`,
  `parent_id`). Those identifiers can be resolved on reddit.com to the original
  content and, where not deleted, to the author's real account. **Treat every
  record as identifiable personal data concerning health and potentially
  criminal conduct.**


  By requesting access you represent that you have read this agreement and agree
  to be bound by it.


  **1. Permitted use.** Aggregate public-health, harm-reduction,
  epidemiological, computational-social-science or NLP research, conducted under
  the oversight of an IRB / research ethics committee (or a documented
  determination that such oversight is not required in your jurisdiction).


  **2. Prohibited uses.** You will NOT: (a) attempt to re-identify, deanonymize,
  unmask or determine the real-world identity of any individual, including by
  resolving retained Reddit identifiers, cross-referencing external data, or
  querying any API or web service with dataset content; (b) contact, message,
  survey, recruit, profile, monitor or surveil any individual represented in the
  data; (c) use the data for law-enforcement, prosecutorial, immigration,
  insurance, credit, employment or any other adverse determination about an
  individual; (d) use it for commercial purposes, advertising, or targeting; (e)
  use it to facilitate the acquisition or distribution of controlled substances;
  (f) publish, present or otherwise disclose any verbatim quotation, username,
  pseudonymous `user_id`, Reddit identifier, or any other detail that could
  reasonably permit identification of an individual.


  **3. No redistribution.** You will not republish, mirror, share, sublicense,
  post to any public repository or model hub, or otherwise transfer the data or
  any substantial derivative of it, in whole or in part, to any third party.
  Access is personal to you. Collaborators must request access individually.
  Models trained on this data must not be released if they can reproduce
  identifying content.


  **4. Security.** You will store the data on access-controlled systems,
  restrict access to named personnel covered by this agreement, and not upload
  it to third-party services (including commercial LLM APIs) that may retain,
  train on, or disclose it.


  **5. Underlying rights.** Content remains the intellectual property of its
  original authors and is subject to the Reddit User Agreement. This dataset is
  a research derivative; nothing here grants you rights in the underlying
  content. You are responsible for your own compliance with Reddit's terms and
  with all applicable law, including GDPR, HIPAA and equivalents.


  **6. Deletion.** You will delete all copies upon completion of the stated
  research, upon withdrawal of access, or on request of the maintainers.


  **7. Incident reporting.** You will report any accidental disclosure,
  re-identification, breach, or loss of control of the data to the maintainer
  within 72 hours.


  **8. Publication.** Report results in aggregate. Paraphrase rather than quote.
  Cite the dataset and the upstream arctic_shift project.


  **9. Termination.** Access may be revoked at any time, with or without cause.
  Breach terminates your rights immediately and obliges you to delete all
  copies.


  **10. No warranty.** Provided "as is", without warranty of any kind. The
  maintainers accept no liability arising from your use. The data is a
  non-representative convenience sample and must not be used for clinical,
  diagnostic, or individual decision-making purposes.

  **11. Images  additional restrictions.** This dataset contains photographs
  posted by Reddit users. Images can identify a person in ways text cannot: a
  face, a tattoo, a hand, a recognisable room, a prescription label, a street
  view. In addition to the terms above you will NOT: (a) run face detection,
  face recognition, biometric extraction, or any person-matching or clustering
  technique intended to group images by depicted individual; (b) attempt to
  read, enhance, or reconstruct any text visible in an image that identifies a
  person, address, prescription, or account; (c) perform reverse-image search on
  any image, or submit any image to a third-party service that performs one; (d)
  reproduce any image, crop, or thumbnail in a publication, presentation,
  poster, or model card. Report image findings only in aggregate.


  **12. Image provenance and integrity.** Images were retrieved from the URLs
  recorded in the posts, not from Reddit's API. Some were deleted or replaced by
  the host before retrieval; such records are marked in `image_status` and carry
  no image bytes. EXIF and other embedded metadata are stripped on ingest, but
  you must not treat that as a guarantee that no identifying information remains
  **inside the visible frame**.
extra_gated_fields:
  Full name: text
  Institutional email: text
  Institution / organization: text
  Role:
    type: select
    options:
      - Faculty / PI
      - Postdoc
      - PhD student
      - Masters/Undergrad student
      - Research staff
      - Industry researcher
      - Other
  Country: country
  Supervisor or PI (if student): text
  Describe your specific research question and intended use: text
  IRB / ethics review status:
    type: select
    options:
      - Approved - I can provide the protocol number
      - Submitted, pending approval
      - Formal determination that review is not required
      - Not applicable - please explain above
  I will not attempt to re-identify or deanonymize any individual: checkbox
  I will not contact, survey, profile or surveil anyone in the data: checkbox
  I will not use the data for law-enforcement or any adverse determination about an individual: checkbox
  I will not redistribute the data or share my access with others: checkbox
  I will not publish verbatim quotes, usernames or Reddit identifiers: checkbox
  I will not upload the data to third-party services that may retain or train on it: checkbox
  I will delete all copies when my research concludes or access is withdrawn: checkbox
  I will not run face recognition, biometric extraction or person-matching on the images: checkbox
  I will not reverse-image-search any image or submit images to third-party services: checkbox
  I will not reproduce any image in a publication, presentation or model card: checkbox
  I agree to the full Data Use Agreement above: checkbox
dataset_info:
  - config_name: default
    features: &ref_0
      - name: id
        dtype: string
      - name: kind
        dtype: string
      - name: subreddit
        dtype: string
      - name: source
        dtype: string
      - name: user_id
        dtype: string
      - name: created_utc
        dtype: timestamp[ms, tz=UTC]
      - name: text
        dtype: string
      - name: score
        dtype: int64
      - name: link_id
        dtype: string
      - name: parent_id
        dtype: string
      - name: image_url
        dtype: string
      - name: post_hint
        dtype: string
      - name: is_gallery
        dtype: bool
      - name: has_image
        dtype: bool
      - name: image
        dtype: image
      - name: image_status
        dtype: string
      - name: image_sha256
        dtype: string
      - name: image_bytes
        dtype: int64
      - name: image_mime
        dtype: string
      - name: image_width
        dtype: int64
      - name: image_height
        dtype: int64
  - config_name: 1P_LSD
    features: *ref_0
  - config_name: 1V_LSD
    features: *ref_0
  - config_name: 2cb
    features: *ref_0
  - config_name: 4acodmt
    features: *ref_0
  - config_name: 5MeODMT
    features: *ref_0
  - config_name: AMT
    features: *ref_0
  - config_name: Ayahuasca
    features: *ref_0
  - config_name: CannabisExtracts
    features: *ref_0
  - config_name: DMT
    features: *ref_0
  - config_name: DMXE
    features: *ref_0
  - config_name: DPH
    features: *ref_0
  - config_name: DrugCombos
    features: *ref_0
  - config_name: Drugs
    features: *ref_0
  - config_name: LSA
    features: *ref_0
  - config_name: LSD
    features: *ref_0
  - config_name: MDMA
    features: *ref_0
  - config_name: MXE
    features: *ref_0
  - config_name: MemantineHCl
    features: *ref_0
  - config_name: Nootropics
    features: *ref_0
  - config_name: PCP
    features: *ref_0
  - config_name: adderall
    features: *ref_0
  - config_name: afinil
    features: *ref_0
  - config_name: ambien
    features: *ref_0
  - config_name: anabolic
    features: *ref_0
  - config_name: benzodiazepines
    features: *ref_0
  - config_name: cannabis
    features: *ref_0
  - config_name: cocaine
    features: *ref_0
  - config_name: dissociatives
    features: *ref_0
  - config_name: dxm
    features: *ref_0
  - config_name: fentanyl
    features: *ref_0
  - config_name: ketamine
    features: *ref_0
  - config_name: mescaline
    features: *ref_0
  - config_name: meth
    features: *ref_0
  - config_name: modafinil
    features: *ref_0
  - config_name: noids
    features: *ref_0
  - config_name: opiates
    features: *ref_0
  - config_name: treedibles
    features: *ref_0

OP-Reddit-Image

A full mirror of OP-R1/OP-Reddit-Post — all 46,934,806 rows — with the post's image attached where it could still be retrieved.

Mirroring rather than shipping images alone costs ~7 GB of text on top of the images, and means you never have to join two separately gated datasets to put a post's text next to its picture.

Scale

rows (identical to OP-Reddit-Post) 46,934,806
posts flagged has_image 656,932
images retrieved 366,784
total size ~353 GB
shards 274, partitioned by subreddit

Retrieval outcomes

Every flagged post was attempted exactly once. Rows whose image could not be retrieved are kept, with image_status recording why — a missing image is itself a signal, and dropping those rows would bias the corpus toward newer, better-preserved content.

image_status rows meaning
no_image 46,277,880 not an image post (comments, text posts)
ok 366,784 image retrieved and stored
404 272,241 host no longer has it — deleted
skipped_album 8,978 imgur album; needs the Imgur API, not fetched
placeholder 3,703 host returned a stand-in image, not the original
unsupported_host 2,630 host outside the fetch scope (giphy, discord, …)
removed_page 2,442 host served an HTML removal page instead of an image
not_an_image 141 URL resolved to video (gifv/mp4)
error 7 genuine fetch failure

41.4% of flagged images were already gone. That is the single most important number here for anyone reasoning about coverage: this is a salvage of what survived, not a complete record of what was posted.

placeholder and removed_page deserve attention. imgur answers a request for a deleted image with HTTP 200 — sometimes a 503-byte PNG, sometimes an HTML page. A naive fetcher records both as successes. They are detected here by content hash and by response type, and are never stored as if they were real images.

By host, of what was retrieved: i.redd.it 335,614 and imgur 31,170.

Columns

Every column from OP-Reddit-Post, plus:

Column Type Meaning
image large_binary Image bytes, EXIF-stripped. Null unless image_status = "ok".
image_status string See the table above. Never null.
image_sha256 string SHA-256 of the stored bytes.
image_bytes int64 Size in bytes. Median 626,732; mean 1,030,660.
image_mime string image/jpeg, image/png, image/gif.
image_width / image_height int64 Pixel dimensions.

Processing notes

EXIF is stripped losslessly. JPEG APP1/APP13/APP14 segments and PNG text chunks are removed by walking the container, without re-encoding — so the pixels are byte-identical to what the host served and no generation loss is introduced. This removes GPS coordinates, device serial numbers and capture timestamps. It does not guarantee the visible content of an image is free of identifying detail; see the access agreement.

Row order within each subreddit matches OP-Reddit-Post, which is user-contiguous, so a user's records stay adjacent here too.

Verification. Row counts match OP-Reddit-Post exactly in all 37 partitions; all 46,934,806 rows were checked against the fetch log with zero status mismatches; and 8,005 embedded images across all 37 partitions were re-hashed with zero SHA-256 mismatches, 800 of them re-decoded with zero failures.

Retrieving single images without downloading 353 GB

The repo ships retrieve_images.py plus two indexes, so a record can be pulled by ranged read instead of downloading a shard.

from huggingface_hub import hf_hub_download
import importlib.util, sys

path = hf_hub_download("OP-R1/OP-Reddit-Image", "retrieve_images.py",
                       repo_type="dataset")
spec = importlib.util.spec_from_file_location("opr1_images", path)
mod  = importlib.util.module_from_spec(spec)
sys.modules["opr1_images"] = mod       # required before exec_module: the module
spec.loader.exec_module(mod)           # defines @dataclass(slots=True) types

rec = mod.get_image("kqd030")
open("out.jpg", "wb").write(rec.image)

mod.locate("kqd030")                   # index only - no data shard is touched
mod.get_user_images("<user_id>", limit=10)

Measured against the live repo: fetching one 1.5 MB image transferred 17.1 MB in 2.7 s - 85x less than its 1.46 GB shard, and ~22,000x less than the dataset as a whole.

The indexes are sorted by lookup key, so each parquet row group's footer statistics bound the keys inside it: a lookup reads the footer, picks the single group whose range covers the key, and transfers that alone. id_index also carries image_status and image_bytes, so you can check whether an image exists, and how large it is, without touching a data shard - worth doing when 41% of entries are 404.

file rows purpose
index/id_index.parquet 46,934,806 post id to shard + row group, status, size
index/user_index.parquet 3,212,292 user id to shard + row-group span, image count

Ethics

Same Data Use Agreement as the text datasets, plus image-specific restrictions: no face recognition or biometric extraction, no reverse-image search, and no reproduction of any image in a publication, presentation or model card. See the access request form.