MyNixOS website logo
Description

Handwriting Analysis with Random Forests.

Perform forensic handwriting analysis of two scanned handwritten documents. This package implements the statistical method described by Madeline Johnson and Danica Ommen (2021) <doi:10.1002/sam.11566>. Similarity measures and a random forest produce a score-based likelihood ratio that quantifies the strength of the evidence in favor of the documents being written by the same writer or different writers.

handwriterRF

R-CMD-check MacOS R-CMD-check Ubuntu R-CMD-check Windows Codecov test coverage

HandwriterRF is designed to assist forensic document examiners by performing a statistical analysis on two handwriting samples. One or both of the samples could be from unknown writers. Two hypotheses are considered:

$H_p: \text{The two documents were written by the same writer.}$ $H_d: \text{The two documents were written by different writers.}$

The statistical analysis produces a score-based likelihood ratio (SLR). An SLR greater than one, indicates that the evidence supports $H_p$ over $H_d$, and the larger the SLR, the stronger the support. An SLR less than one, indicates that the evidence supports $H_d$ over $H_p$, and the closer the SLR is to zero, the stronger the support.

Quick Start

Installation

HandwriterRF requires R and RStudio IDE.

  • Install R from POSIT
  • Install RStudio IDE from POSIT

Install the handwriterRF R package. Open RStudio, navigate to the console window, and type

install.packages("handwriterRF")

Compare Two Handwriting Samples

Calculate a Score-base Likelihood Ratio

Open RStudio, navigate to the console window, and load handwriterRF.

library(handwriterRF)

The package includes 4 example handwriting samples from the CSAFE Handwriting Database. Compare 2 of these samples. In this case, both samples are from writer 30.

sample1 <- system.file(file.path("extdata", "docs", "w0005_s01_pLND_r03.png"), package = "handwriterRF")
sample2 <- system.file(file.path("extdata", "docs", "w0005_s02_pWOZ_r02.png"), package = "handwriterRF")
slr <- calculate_slr(sample1, sample2)

If you would like to use your own handwriting samples, scan and save them as PNG images.

sample1 <- "path/to/your_sample1.png"
sample2 <- "path/to/your_sample2.png"
slr <- calculate_slr(sample1, sample2)

The result is a dataframe:

  • docname1 is the file name of the first sample.
  • writer1 is “unknown1”.
  • docname2 is the file name of the second sample.
  • writer2 is “unknown2”.
  • score is the similarity score between the two samples.
  • slr is a score-based likelihood ratio that quantifies the strength of evidence in favor of same writer or different writer.

Display the slr dataframe. We hide the file path columns here so that the dataframe fits on this page.

slr
            docname1  writer1           docname2  writer2 score      slr
1 w0005_s01_pLND_r03 unknown1 w0005_s02_pWOZ_r02 unknown2 0.635 1.482318

Interpret the Score-base Likelihood Ratio

View a verbal interpretation of the score-based likelihood ratio.

interpret_slr(slr)
[1] "A score-based likelihood ratio of 1.5 means the likelihood of observing a similarity score of 0.635 if the documents were written by the same person is 1.5 times greater than the likelihood of observing this score if the documents were written by different writers."
Metadata

Version

1.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows