cat.cog doescat.cog automates CERAD Constructional
Praxis scoring using vision-capable LLMs. CERAD is a
widely-used cognitive assessment in dementia research; one of its
subtests asks subjects to copy four geometric shapes (circle, diamond,
two overlapping rectangles, cube). Standard scoring assigns 0–11 points
based on visible drawing features following published rubrics.
cerad_drawn_score() sends each image to a vision model,
classifies the relevant drawing features (closure, symmetry,
intersection, depth cues, etc.), then applies the CERAD scoring rules to
return a numeric score per drawing.
The function is a thin wrapper over
cat.stack::classify() with image input, plus the
CERAD-specific scoring logic baked in.
scores <- cerad_drawn_score(
shape = "circle",
image_input = "./circle_drawings/", # directory of PNG/JPG files
api_key = Sys.getenv("OPENAI_API_KEY"),
user_model = "gpt-4o" # vision-capable
)
head(scores[, c("image_file", "score")])The returned data.frame has one row per image with the
integer score, the raw classification of each scoring feature, and the
image filename for joining back to participant records.
shapes <- c("circle", "diamond", "rectangles", "cube")
max_scores <- c(circle = 2, diamond = 3, rectangles = 2, cube = 4)
# Total possible: 11
for (s in shapes) {
scores <- cerad_drawn_score(
shape = s,
image_input = file.path("./drawings", s),
api_key = Sys.getenv("OPENAI_API_KEY"),
user_model = "gpt-4o"
)
saveRDS(scores, paste0("./scores_", s, ".rds"))
}Smaller models often miss subtle scoring features (e.g., whether
rectangles actually intersect, whether the cube has visible depth
lines). For research use, gpt-4o or
claude-3-5-sonnet is recommended over the mini/haiku
tier.
Always benchmark against expert human scoring on a subsample before trusting LLM scores at scale. Compute weighted Cohen’s κ between the LLM and a clinician — values around 0.7+ are generally acceptable for secondary analysis; pre-registered primary outcomes warrant higher agreement.
vignette("getting-started", package = "cat.llm")?cat.cog::cerad_drawn_score