본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트51k · #3449

deepspot-m

하는 일

DeepSpot-M은 현미경 슬라이드 이미지(조직)를 분석해 이미지의 각 부분에서 어떤 유전자가 활성화되어 있는지 예측하는 도구입니다. H&E 이미지를 가상의 공간 유전자 발현 지도로 바꿉니다.

사용하는 경우

  • ✓병든 조직의 여러 부위에서 유전자가 어떻게 발현되는지 연구하는 연구자.
  • ✓조직의 외관과 특정 유전자 활동 사이의 관계를 이해하고 싶을 때.
  • ✓암 시료에서 유전자 활동의 자세한 지도를 만들고 싶을 때.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/deepspot-m/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/deepspot-m/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 조직 슬라이드 이미지를 분석하고 'TP53'과 'BRCA1' 유전자의 발현을 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 이미지 데이터와 유전 데이터로 학습한 AI 모델을 사용합니다. 슬라이드 이미지를 ‘읽고’, 사용자가 묻는 각 유전자에 대해 이미지의 특정 영역에서 얼마나 활발한지 추정합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

DeepSpot-M

Overview

DeepSpot-M is a multimodal foundation model that maps a 224x224 H&E histology tile to spatial gene expression in log1p-CPM. The output is virtual spatial transcriptomics: one value per queried gene per tile, laid out on the grid the tiles came from.

A LoRA-adapted pathology foundation backbone (Midnight) tokenises the tile. A cross-attention gene decoder lets each gene query attend to the patch tokens, and a gene router hypernetwork builds gene-specific projections from frozen biological embeddings (Evo 2, Orthrus, ProtT5, scGPT, Apertus). Genes enter the model as queryable embeddings rather than fixed output slots, so the released model covers a ~19k protein-coding gene panel including genes unseen in training. The panel ships with the weights as tokens.csv and is exposed as model.gene_names; genes outside it cannot be queried in this release.

Applied to TCGA, the model produced a virtual spatial transcriptomics atlas of 28,664 slides across 32 cancer types.

Licensing

The code is PolyForm Noncommercial 1.0.0 and the weights are CC-BY-NC-SA-4.0. The current model access form additionally restricts eligibility to academic/public nonprofit researchers without concurrent commercial affiliations and excludes commercially funded/collaborative use. Read the live declarations before requesting access; a noncommercial intention alone does not establish eligibility. Research use only, not clinical or diagnostic use. Preserve the applicable attribution and licenses.

Installation

uv pip install deepspotm==1.0.0

PyPI 1.0.0 declares Python >=3.10 without an upper bound; that is not proof of compatibility with every future dependency release. Use an isolated environment. Install the PyTorch build that matches your CUDA runtime if using a GPU. The optional histolab 0.7.0 tiler requires Python <3.12 and an older scientific stack: run tiling separately and exchange PNG tiles plus a coordinate manifest.

Model access

The weights are gated:

  1. Open https://huggingface.co/ratschlab/DeepSpotM and request access.
  2. Once access is granted, authenticate the machine that will download them:
hf auth login

The Hugging Face downloader uses cached credentials or HF_TOKEN; approval and authentication are separate. Set HF_HOME before importing Hub libraries if choosing a cache location. Do not put tokens in code. An approved local model directory can be loaded offline.

Quick start

Illustrative gated inference; the loading/query API and local preprocessing were checked without downloading the weights:

import torch
from PIL import Image
from deepspotm import DeepSpotM

device = "cuda" if torch.cuda.is_available() else "cpu"
revision = "48be27af436a50e5c74175680ac2b7b2596a506b"
model, image_processor = DeepSpotM.from_pretrained(
    "ratschlab/DeepSpotM", source="scgpt", device=device, revision=revision
)

with Image.open("tile.png") as image:
    if image.size != (224, 224):
        raise ValueError("Expected a pre-tiled 224x224 image at verified ~0.5 um/px")
    batch = image_processor(image.convert("RGB")).unsqueeze(0).to(device)
genes = ["EPCAM", "CD3D"]
vals = model.predict_genes(batch, genes).cpu()  # shape (1, 2)

image_processor turns a PIL image into a tensor; unsqueeze(0) adds the batch dimension, and predict_genes takes the batch plus a list of HGNC gene symbols. Values come back in log1p-CPM, aligned with the gene list you passed, so keep that list beside the output to keep the columns labelled. Symbols must be in the released ~19k-gene panel (model.gene_names); an unknown symbol raises KeyError naming the offending genes.

Tile requirements

Tiles must be 224x224 RGB at roughly 20x magnification (about 0.5 microns per pixel). Check the size at the boundary of your pipeline rather than passing an unchecked crop through:

TILE_PX = 224

def require_tile(tile):
    """Return an RGB 224x224 tile, or raise if the crop is the wrong size."""
    if tile.size != (TILE_PX, TILE_PX):
        raise ValueError(
            f"DeepSpot-M expects a {TILE_PX}x{TILE_PX} tile at about 20x "
            f"(~0.5 microns per pixel); got {tile.size[0]}x{tile.size[1]}. "
            "Re-tile at the matching level or resample the crop."
        )
    return tile.convert("RGB")

Pixel size alone does not verify magnification. Read both MPP axes and the actual

…

자주 묻는 질문

특별한 설치가 필요한가요?

네, `deepspotm` 라이브러리를 설치하고, Hugging Face에서 모델 데이터에 대한 접근을 요청한 뒤 인증해야 합니다.

어떤 이미지를 써야 하나요?

특정 배율(약 20배)에서 224x224 픽셀의 정사각형 조각으로 잘라진 조직 슬라이드 이미지(H&E)를 사용해야 합니다.

아무 유전자나 물어볼 수 있나요?

아니요, 모델이 알고 있는 약 19,000개 유전자 패널에 속한 유전자에 대해서만 물어볼 수 있습니다. 목록에 없는 유전자는 오류가 발생합니다.

상세 정보

작성자의 원본 설명

Generates transcriptome-wide virtual spatial transcriptomics from H&E histology with DeepSpot-M. Used for predicted log1p-CPM expression from 224x224 tiles at about 20x, querying the released protein-coding gene panel by symbol, and whole-slide prediction after resolution-aware tiling with histolab.

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3449
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬