Writership Analysis Report

library(handwriter)
library(magick)

Questioned Document

The questioned document is shown in Figure 1.

qd_path <- list.files(file.path(params$main_dir, "data", "questioned_docs"), pattern = ".png", full.names = TRUE) 
qd_image <- magick::image_read(qd_path)
qd_image

The handwriter R package processed a PNG scan of the QD by

  1. Converting the image to black and white
  2. Thinning the writing so that it is only one pixel wide
  3. Splitting the writing into component shapes called graphs
handwriter::plotNodes(params$qd_doc)

Figure 2 shows the processed QD split into graphs.

Next, handwriter estimated a writer profile for the QD by assigning its graphs to the cluster template and counting the number of graphs in each cluster. The writer profile estimated from the QD is shown in Figure 3.

handwriter::plot_cluster_fill_counts(params$analysis)

Known Writing Samples

Three known writing samples were collected from each person of interest. The scanned PNG files of the known writing samples are listed in Table 1.

known_docs <- data.frame("files"=params$known_docs)
knitr::kable(
  known_docs, booktabs = TRUE,
  caption = 'Known writing samples from persons of interest.'
)

Each known writing sample was processed with the handwriter package with the same steps as the questioned document:

  1. Converting the image to black and white
  2. Thinning the writing so that it is only one pixel wide
  3. Splitting the writing into component shapes called graphs

Next, handwriter estimated a writer profile each person of interest by first assigning the graphs from the known writing samples to the cluster template and counting the number of graphs in each cluster. Then handwriter fit a statistical model, called a Bayesian hierarchical model, to the cluster fill counts of all known writing samples to estimate the true writer profile of each person of interest. The estimated writer profiles of the persons of interest are displayed in Figure 4.

handwriter::plot_credible_intervals(params$model, facet=TRUE)

Writership Analysis

Using the estimated writer profiles of each person of interest and the writer profile from the QD, handwriter calculates the posterior probability that each person of interest wrote the QD. The posterior probabilities of writership are listed in Table 2.

pp <- params$analysis$posterior_probabilities
colnames(pp) <- c("Person of Interest", "Posterior Probability of Writership")
pp <- pp %>% dplyr::mutate(`Posterior Probability of Writership`=paste0(100*`Posterior Probability of Writership`, "%"))

knitr::kable(
  pp, booktabs = TRUE,
  caption = 'The posterior probability that each person of interest wrote the questioned document.'
)


Try the handwriterApp package in your browser

Any scripts or data that you put into this service are public.

handwriterApp documentation built on April 3, 2025, 8:45 p.m.