Skip to content

About

Code for the paper "Collision Patterns and Evidence Availability in 971 California Autonomous Vehicle Collision Reports" (Traffic Injury Prevention). Uses an LLM to extract data from DMV OL 316 reports, then builds the collision taxonomy and evidence-availability analysis, with human validation and interactive figures.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Collision patterns and evidence availability in 971 California autonomous vehicle collision reports

LLM-assisted, rule-based and human-validated analysis of every public California DMV autonomous vehicle collision report (OL 316), October 2014 to March 2026

Paper Data Python uv Figures

Overview · Key findings · Figures · Human validation · Quick start · Data · Citation

Overview

Autonomous vehicle (AV) collision reports mix form fields, checkboxes and free-text narratives, which makes them hard to analyse consistently at scale. This repository contains the complete pipeline behind the paper: a large language model (LLM) reads each report under a fixed prompt, the answers are parsed into a structured dataset, explicit rules assign every report to one of eight scenario classes, and every step is checked for how much evidence it rests on. Two human reviewers independently coded a stratified sample of 100 reports, so the LLM extraction is measured against people and not against itself.

Pipeline: 971 California DMV collision reports are read by an LLM under a fixed prompt, parsed and assigned to scenario classes by explicit rules, and checked for evidence availability; a stratified sample of 100 reports is coded independently by two reviewers and compared with the LLM.

The analysis keeps three things apart:

  1. Post extraction unavailability: a value is missing in the structured dataset after extraction.
  2. Report context: information that is in the regulatory form or narrative.
  3. External context: information obtained through online enrichment (street type, lane number, speed limit).

A value that is unavailable after extraction is not proof that the report lacked it. Telling source absence from extraction failure needs the original PDF, which is what the human validation provides for its sample.

Key findings

Reports analysed 971 California DMV OL 316 reports (14 October 2014 to 18 March 2026), all retained
Largest scenario classes AV stopped rear end 27.8%, intersection lateral conflict 18.5%, lane change or merge conflict 16.2%
Reported harm injury in 139 reports, one fatality
Evidence gaps other party speed unavailable after extraction in 88.0% of reports, AV speed in 75.6%
Human agreement high for AV operating mode (98.0%, κ = 0.96) and checkbox movement (96.0% to 99.0%), lower for narrative movement (75.0%) and intersection status (67.0% to 70.0%)
LLM vs humans derived scenario class agreed with each reviewer in 76.0% of reports (κ = 0.72), against 84.0% (κ = 0.81) between the reviewers
Sensitivity excluding 457 reports with contradictory movement evidence cuts lane change or merge conflicts from 16.2% to 7.4%; the leading class is unchanged

LLM-assisted review can support analysis of bounded report fields when outputs stay traceable to the source, rules are explicit and human validation is part of the workflow. Narrative movement still needs human review.

Scenario class Reports Share
AV stopped rear end 270 27.8%
Other or ambiguous 206 21.2%
Intersection lateral conflict 180 18.5%
Lane change or merge conflict 157 16.2%
Curbside or parked vehicle conflict 116 11.9%
Vulnerable road user interaction 17 1.8%
Turn across path conflict 16 1.6%
Low speed stop or obstruction case 9 0.9%

Reported attribution is descriptive, not a legal or causal fault determination.

Figures

All figures are clickable: each image opens its interactive version, with hover details, zoom and filtering. Plotly is embedded in the HTML files, so they render in the browser through htmlpreview without any installation.

Animated tour of the interactive figures: hovering over flows in the 5W1H Sankey diagram, zooming into the sunburst diagram, hovering over report locations on the map, and the scenario class chart.
A tour of the interactive figures: hover the Sankey flows, zoom into the sunburst and inspect the map.

Who, where, what, when and why

Accident 5W1H Sankey diagram

Every report flows from the other road user (Who) through location (Where), collision type (What) and time of day (When) to the reported attribution (Why). Flow widths are report counts; colours follow the Why category the flow ends in.

Scenario classes and attribution

Bar chart of the eight scenario classes Reported attribution within each scenario class
Scenario classes. Frequency of the eight classes in the 971 reports (paper Figure 3). Attribution within scenario. Share of reports in each class attributed to the other road user, the AV, the environment or unclear (paper Figure 4).

Evidence availability and location

Unavailability after extraction for selected fields Map of geocoded report locations
Post extraction unavailability. Report fields and online enrichment fields are shown separately, because their gaps have different causes (paper Figure 5). Where the collisions happened. 966 reports geocoded to 310 locations, clustered in the San Francisco Bay Area and Los Angeles.

The complete figure gallery below shows all 23 figures that analysis.py exports. The journal versions of the paper figures (one 7.6 cm column, Times New Roman, readable in greyscale) are written to figures/paper/ by the same run.

Human validation

Two reviewers independently coded the same 100 reports from the original PDFs in a dedicated interface that shows the report beside fixed response options. They never saw the LLM output, the automated scenario labels or each other's answers. The sample was stratified so that all eight scenario classes and all levels of rule support were covered.

The human validation interface: the collision report PDF on the left and the coding form on the right; the reviewer moves from the form fields on page 1 to the narrative on page 2 and the checkbox grid on page 3 while answering the matching questions.
The validation interface (human_validation.py): report on the left, coding form on the right, autosaved.

Variable Human 1 vs Human 2 LLM vs Human 1 LLM vs Human 2
Road user type 82.0% (κ = 0.71) 78.0% (κ = 0.56) 62.0% (κ = 0.30)
AV operating mode 98.0% (κ = 0.96) 100.0% (κ = 1.00) 98.0% (κ = 0.96)
AV narrative movement 75.0% (κ = 0.67) 56.0% (κ = 0.43) 53.0% (κ = 0.39)
Other party narrative movement 75.0% (κ = 0.71) 51.0% (κ = 0.39) 42.0% (κ = 0.30)
AV checkbox movement 99.0% (κ = 0.99) 98.0% (κ = 0.97) 99.0% (κ = 0.99)
Other party checkbox movement 96.0% (κ = 0.95) 97.0% (κ = 0.96) 97.0% (κ = 0.96)
AV intersection status 70.0% (κ = 0.50) 77.0% (κ = 0.62) 68.0% (κ = 0.51)
Other party intersection status 67.0% (κ = 0.51) 74.0% (κ = 0.61) 68.0% (κ = 0.54)
AV collision type 90.0% (κ = 0.87) 92.0% (κ = 0.90) 96.0% (κ = 0.95)
Other party collision type 90.0% (κ = 0.87) 92.0% (κ = 0.89) 96.0% (κ = 0.95)
AV responsibility attribution 85.0% (κ = 0.68) 94.0% (κ = 0.85) 86.0% (κ = 0.70)
Derived scenario class 84.0% (κ = 0.81) 76.0% (κ = 0.72) 76.0% (κ = 0.72)

Each cell gives exact agreement and Cohen's κ over all 100 reports. "Not stated" and "present but ambiguous" are answers, not missing values, so two matching codes count as agreement, and LLM NA values count as "not stated". The values describe the stratified sample; weighted by inverse sampling probability, scenario agreement is 89.2% between the reviewers and 80.4% and 83.2% between the LLM and each reviewer. Neither reviewer is treated as a gold standard, and the LLM is compared with each separately.

Quick start

git clone https://github.com/bazilinskyy/llm-events.git
cd llm-events
uv sync --frozen            # Python 3.12 and the locked dependencies
cp default.config config    # the analysis needs a config file

Download the supplementary material and place its files as described in Data. Then run:

uv run python analysis.py           # tables, figures and validation analyses
uv run python human_validation.py   # optional: the reviewer interface at http://127.0.0.1:5000

The analysis needs no GPU and takes about two minutes, plus about 20 minutes on the first run to geocode report locations for the map (the results are cached in _output/geocode_cache.json). On macOS, where port 5000 is used by AirPlay, start the interface with VALIDATION_PORT=5055 uv run python human_validation.py.

Data

The data are published at 4TU.ResearchData: doi.org/10.4121/fcc7383e-6af1-4f1d-8b7b-757bc301cc9d. The package contains the 971 report PDFs, the instruction prompt and query document, the verbatim LLM answers (Output.csv), the raw output of both reviewers and the frozen validation sample. Copy them into the repository like this:

llm-events/
├── data/
│   ├── Output.csv                  # LLM answers: columns Report and Output
│   └── Reports/                    # the 971 OL 316 PDFs
└── validation_results/
    └── complete/                   # reviewer coding, reviewer orders, validation sample

Everything else is produced by the code: _output/ (tables and summaries), figures/ (README and paper figures) and validation_results/analysis/ (agreement tables, including Appendix Tables A1 and A2 of the paper). The reports are public records from the California DMV.

Repository structure

llm-events/
├── analysis.py            # full pipeline: parsing, scenario rules, evidence checks, figures, validation analyses
├── human_validation.py    # Flask interface for blind human coding of the validation sample
├── utils/
│   ├── parsing.py         # LLM answers to canonical fields
│   ├── normalise.py       # cleaning and grouping of values
│   ├── research.py        # derived variables, scenario rules, summary tables
│   ├── summary_plots.py   # overview figures (Sankey, sunburst, map)
│   ├── research_plots.py  # research figures
│   ├── paper_figures.py   # journal-format figures of the paper
│   └── ...
├── figures/               # exported figures (PNG and interactive HTML)
├── assets/                # README diagram and animations
├── default.config         # settings that reproduce the paper
└── CITATION.cff           # citation metadata

All figures

Every figure that analysis.py exports under the default configuration. Click a figure to open its interactive version.

Accident overview Sankey diagram
Accident overview Sankey diagram
Accident 5W1H Sankey diagram
Accident 5W1H Sankey diagram
Accident overview sunburst diagram
Accident overview sunburst diagram
Accident transition graph
Accident transition graph
Accident location map
Accident location map
Histogram of road user type
Histogram of road user type
Histogram of collision group
Histogram of collision group
Histogram of blame group
Histogram of blame group
Histogram of scenario class
Histogram of scenario class
Histogram of grouped main factor
Histogram of grouped main factor
Taxonomy overview
Taxonomy overview
Post extraction unavailability
Post extraction unavailability
Accountability by taxonomy
Accountability by taxonomy
Report completeness
Report completeness
Taxonomy by road user
Taxonomy by road user
Provenance availability
Provenance availability
Context gap
Context gap
Movement field agreement
Movement field agreement
Scenario rule support
Scenario rule support
Environment profile
Environment profile
Blame confidence alignment
Blame confidence alignment
Stopped AV subtype
Stopped AV subtype
Intersection detail quality
Intersection detail quality
Descriptions of all figures
  • counts: integers.

Overview figures

Accident overview Sankey diagram

Accident overview Sankey diagram

Accident overview Sankey diagram showing the flow of parsed accident attributes across the selected plot fields. Each flow is coloured by the scenario class the reports end in, so every path can be followed to its outcome.

Accident 5W1H Sankey diagram

Accident 5W1H Sankey diagram

Accident 5W1H Sankey diagram showing the flow across Who, Where, What, When, and Why, with flows coloured by the Why stage. For the paper figure, the Where stage uses the reader facing labels Intersection and Road segment rather than the ambiguous intersection roadway wording.

Accident overview sunburst diagram

Accident overview sunburst diagram

Accident overview sunburst diagram with three rings. The inner ring is the scenario class, the middle ring splits each scenario by blame group (who the report attributes the collision to), and the outer ring splits that by collision group (rear end, side swipe, and so on). Each segment's angle is proportional to its number of reports. Colours follow the scenario class, with lighter shades in the outer rings, and grey marks the residual "Other or ambiguous" scenario. Hover over a segment to see its full path and report count.

Accident transition graph

Accident transition graph

Accident transition graph with one column per stage. Node size shows the number of reports, line width shows the number of reports moving between consecutive stages, and transitions involving under 1% of reports are hidden.

Accident location map

Accident location map

Accident location map showing geocoded report locations derived from questionnaire address fields. 966 of the 971 reports were geocoded, to 310 distinct locations. Each marker is one location, with its area proportional to the number of reports there. The largest marker (370 reports) is a single central San Francisco point, where addresses could only be resolved to city and ZIP code level. Reports cluster in the San Francisco Bay Area and Los Angeles. Hover over a marker for the place name and report count.

Histogram figures

Histogram of road user type

Histogram of road user type

Histogram of road user types extracted from the accident reports.

Histogram of collision group

Histogram of collision group

Histogram of collision groups extracted from the accident reports.

Histogram of blame group

Histogram of blame group

Histogram of blame groups extracted from the accident reports.

Histogram of scenario class

Histogram of scenario class

Histogram of scenario classes derived from the accident reports.

Histogram of grouped main factor

Histogram of grouped main factor

Histogram of the grouped main contributing factor extracted from the report responses. Free text factors with fewer than five reports are combined into one "Other" bar.

Research figures

Taxonomy overview

Taxonomy overview

Bar chart showing the frequency of the eight scenario classes in the 971 report corpus. This is Figure 3 in the manuscript.

Post extraction unavailability

Blind spots missingness

Bar chart showing unavailable values after extraction across selected context fields. The chart does not identify whether the source report, the form design, or the extraction process accounts for an unavailable value. Report fields and online enrichment fields are coloured separately because their unavailability has different causes. Displayed percentages follow the manuscript convention of one decimal place.

Accountability by taxonomy

Accountability by taxonomy

Grouped horizontal bar chart showing the percentage of reports within each scenario assigned to each responsibility attribution group. The groups are shown side by side with distinct colours and a legend. This is Figure 4 in the manuscript and is intentionally complementary to Figure 3: Figure 3 shows scenario frequency, whereas Figure 4 shows within scenario attribution composition.

Report completeness

Report completeness

Figure showing report completeness scores across the parsed accident reports.

Taxonomy by road user

Taxonomy by road user

Heatmap of the number of reports by scenario class and other road user group (vehicle, cyclist, pedestrian, other or object, unknown).

Provenance availability

Provenance availability

Figure showing mean field availability by provenance source.

Context gap

Context gap

Figure comparing coarse report context, fine report context, and external online context availability.

Movement field agreement

Movement consistency

Figure showing exact, compatible, contradictory, and unavailable movement comparisons across checkbox and narrative fields.

Scenario rule support

Scenario determinability

Figure showing internal rule support for deterministic scenario assignments. This measure is not a validated classification accuracy score.

Environment profile

Environment profile

Figure showing the distribution of environmental friction profiles across the accident set.

Blame confidence alignment

Blame confidence alignment

Figure showing alignment between blame assignment and confidence related evidence.

Stopped AV subtype

Stopped AV subtype

Figure showing subtype patterns within stopped automated vehicle scenarios.

Intersection detail quality

Intersection detail quality

Figure showing the quality and completeness of intersection related detail in the parsed reports.

Details

Installation step by step (uv, Python 3.12, Windows and macOS)

1. Install uv

macOS or Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows PowerShell:

irm https://astral.sh/uv/install.ps1 | iex

Alternative:

pip install uv

2. Fix uv permissions if required

On macOS or Linux:

mkdir -p ~/.local/share/uv
chown -R "$(id -un)":"$(id -gn)" ~/.local/share/uv
chmod -R u+rwX ~/.local/share/uv

On Windows:

New-Item -ItemType Directory -Force "$env:LOCALAPPDATA\uv"
icacls "$env:LOCALAPPDATA\uv" /grant "$($env:UserName):(OI)(CI)F"

3. Verify uv

uv --version

4. Clone the repository

git clone https://github.com/bazilinskyy/llm-events.git
cd llm-events

5. Install the required Python version

uv python install 3.12.13

The repository should contain a .python-version file so uv can select the expected version automatically.

6. Create and synchronise the environment

uv sync --frozen

The human validation interface also requires Flask. If Flask is not yet included in the project environment, install it with:

uv pip install flask

7. Activate the environment

macOS or Linux:

source .venv/bin/activate

Windows PowerShell:

.\.venv\Scripts\Activate.ps1

Windows Command Prompt:

.\.venv\Scripts\activate.bat
Configuration parameters

Project configuration is stored in config. Use default.config as the base structure.

A typical local configuration can include:

{
  "data": "data/Output.csv",
  "output_dir": "_output",
  "figures_dir": "figures",
  "logger_level": "INFO",
  "auto_open_html": true,
  "save_final": true,
  "filter_rows_with_na": false,
  "na_filter_fields": [
    "road_user_type",
    "av_mode_group",
    "av_movement_group",
    "collision_group",
    "blame_group",
    "scenario_class"
  ],
  "include_plot_fields": [
    "road_user_type",
    "av_mode_group",
    "av_movement_group",
    "collision_group",
    "blame_group",
    "scenario_class"
  ],
  "exclude_plot_fields": [],
  "histogram_fields": [
    "road_user_type",
    "collision_group",
    "blame_group",
    "scenario_class",
    "main_factor_grouped"
  ],
  "blind_spot_fields": [
    "v1_lane",
    "v2_lane",
    "v1_speed",
    "v2_speed",
    "v1_intersection",
    "v2_intersection",
    "direction",
    "lane_number",
    "street_type",
    "street_busy",
    "q0_confidence",
    "v1_damage_desc",
    "v2_damage_desc"
  ],
  "max_categories": 12,
  "min_count": 2,
  "row_keep_policy": "best_per_row",
  "validation_sample_size": 100,
  "validation_seed": 42,
  "validation_include_text": true,
  "paper_plot_top_n": 8,
  "font_family": "verdana",
  "font_size": 18,
  "plotly_template": "plotly_white",
  "reviewer": "Reviewer 1",
  "validation_pdf_list": "data/validation_100.csv"
}

Analysis configuration parameters

data specifies the input CSV containing the LLM generated responses.

output_dir specifies where processed tables, summaries, audit files, and standard plot outputs are written.

figures_dir specifies where final figure copies are written when save_final is enabled.

logger_level controls the logging level, such as INFO, DEBUG, WARNING, or ERROR.

auto_open_html controls whether generated interactive HTML plots open automatically.

save_final controls whether final figure copies are written to figures_dir.

filter_rows_with_na controls whether rows with unavailable values in important plot fields are excluded from plot specific analyses.

na_filter_fields lists the fields used by the missing value plot filter.

include_plot_fields defines the ordered variables used in overview plots.

exclude_plot_fields removes selected fields from the configured overview sequence.

histogram_fields lists fields for which categorical histogram figures are generated.

blind_spot_fields lists detailed context variables used to quantify post extraction unavailability. The configuration name is retained for backwards compatibility.

max_categories limits the number of categories retained per stage in selected overview plots.

min_count defines the minimum Sankey edge count.

row_keep_policy controls which response text is retained before extraction. Supported values are output_only, best_available, and best_per_row.

validation_sample_size defines the size of the validation table generated by the main analysis pipeline.

validation_seed controls reproducible sampling in the main analysis pipeline.

validation_include_text controls whether the analysis validation table includes the model text.

paper_plot_top_n controls the number of leading categories retained in selected paper figures.

font_family, font_size, and plotly_template control plot appearance.

Human validation configuration parameters

reviewer must be exactly:

Reviewer 1

or:

Reviewer 2

validation_pdf_list points to the shared CSV or text file containing the exact 100 PDF filenames used for human review.

For example:

"reviewer": "Reviewer 1",
"validation_pdf_list": "data/validation_100.csv"

The second reviewer uses the same project and the same validation list, but changes only:

"reviewer": "Reviewer 2"
Human validation workflow

Purpose

human_validation.py provides a browser based interface for independently checking the LLM extraction against the original California DMV PDFs.

Two humans independently reviewed the same fixed set of 100 reports using the original source PDFs. The completed validation exports record the same nominal presentation sequence for both reviewers. The study therefore does not claim different reviewer presentation orders; independence rests on separate coding and blinding to the LLM output, automated scenario labels, and the other reviewer's responses.

The review interface does not display the LLM response or the LLM derived scenario labels.

Shared validation list

The validation set is defined by one shared file:

data/validation_100.csv

Recommended CSV format:

pdf_name
Waymo_010720.pdf
Cruise_010220.pdf
Apple_082418.pdf

The file must contain exactly 100 unique PDF filenames.

A plain text file is also supported. In that case, include one filename per line:

Waymo_010720.pdf
Cruise_010220.pdf
Apple_082418.pdf

Lines beginning with # are ignored in text files.

The shared validation file is authoritative. If it already exists, the application reads it and does not regenerate or overwrite it.

This means the first author or study coordinator can freeze the 100 report sample once and distribute exactly the same CSV or text file to both reviewers.

Creating the 100 report list

If the configured validation list does not yet exist and the active configuration is:

"reviewer": "Reviewer 1"

the application generates a reproducible stratified sample of 100 reports and writes the shared validation list once.

The sampling design deliberately includes reports across scenario classes and scenario rule support groups. The current target allocation is:

High rule support:    55
Medium rule support:  30
Low rule support:     15

The sample is drawn only from records that can be matched to a PDF in the report directory. The completed sample contains 100 reports, corresponding to 10.3% of the 971 report corpus, and includes all eight scenario classes with 55 high support, 30 medium support, and 15 low support reports.

If the validation list already exists, it is treated as the source of truth and is not replaced.

If Reviewer 2 starts the application without the shared list, execution stops. Reviewer 2 therefore cannot accidentally generate a different set.

Recommended coordinator workflow

  1. Place Output.csv under data/.
  2. Place the complete PDF collection under data/Reports/.
  3. Set the config to "reviewer": "Reviewer 1".
  4. Set "validation_pdf_list": "data/validation_100.csv".
  5. Run human_validation.py once.
  6. Confirm that data/validation_100.csv has been created.
  7. Keep a master copy of this file.
  8. Give both reviewers the exact same validation_100.csv.
  9. Give both reviewers access to the same complete PDF collection.
  10. Set one reviewer's config to Reviewer 1 and the other's to Reviewer 2.

The reviewers do not need separate folders containing only the selected 100 PDFs. The shared validation list filters the full Reports/ directory.

Validation set identity

The application calculates a short fingerprint from the exact set of 100 filenames and stores it in:

_validation/validation_set_id.txt

The home page also displays this identifier.

Reviewer 1 and Reviewer 2 should see the same validation set ID. For the completed study the frozen validation set ID is 6d23c2baa7387f94. This provides a simple check that both reviewers used the same 100 source reports.

Starting the validation interface

Run:

python3 human_validation.py

Typical terminal output is:

Human validation interface ready
Active reviewer: Reviewer 1
Review URL:      http://127.0.0.1:5000/review/1
Outputs:         /path/to/llm-events/_validation

Open:

http://127.0.0.1:5000/

for the validation home page, or:

http://127.0.0.1:5000/review/1

to begin reviewing.

The Flask development server is intended for local validation work. It should not be exposed directly as a public production service.

Reviewer ordering

Both reviewers used the same 100 validation IDs.

For the completed study, reviewer_orders.csv records the same nominal sequence for Reviewer 1 and Reviewer 2. This file is part of the frozen study record and should not be regenerated or overwritten.

The reviewer order does not determine independence of the coding. The validation interface did not display the LLM output, the automated scenario label, rule support, or the other reviewer's annotations. Any future rerun that uses a different ordering should be documented as a new validation run rather than substituted for the completed study record.

What the reviewers code

The interface asks each reviewer to independently code the source report for variables required by the collision taxonomy and the paper's main claims.

The core fields include:

  • other road user type
  • AV operating mode
  • AV movement from narrative or form text
  • other party movement from narrative or form text
  • AV movement from checkbox evidence
  • other party movement from checkbox evidence
  • AV intersection status
  • other party intersection status
  • collision type
  • parked or curbside evidence
  • obstruction, yield, blockage, or uncertainty evidence
  • AV occupant injury status
  • other party injury status
  • AV responsibility assessment

Fine context fields are also coded for source availability:

  • AV lane
  • other party lane
  • AV speed
  • other party speed
  • direction of travel

For these fine context fields, the reviewer records whether the information is clearly present, ambiguous, or not stated. This makes it possible to distinguish source absence from extraction failure.

Responsibility assessment

Responsibility is treated separately from direct extraction because it is an interpretive judgement.

Reviewers independently assign a responsibility category based only on the report and provide a short explanation of the supporting evidence.

Blinding

The review page does not show the LLM output, the LLM scenario class, rule support, movement agreement status, or the other reviewer's annotations.

Output.csv may be used internally by the validation application to reconstruct hidden sampling metadata and to create LLM versus human comparison exports. It is not rendered in the reviewer interface.

Reviewers should therefore perform the task only through the validation interface and should not inspect Output.csv while coding.

Saving progress

Annotations are autosaved to SQLite:

_validation/validation.sqlite3

Manual Save and Submit & next controls are also provided.

Do not delete _validation/ after review work has started unless you intentionally want to restart the local validation state.

Human validation outputs

The validation application can generate:

_validation/
├── validation.sqlite3
├── validation_sample_manifest.csv
├── reviewer_orders.csv
├── validation_set_id.txt
├── missing_pdfs.csv
├── human_annotations.csv
├── human_field_evidence.csv
├── human_disagreements.csv
├── interrater_agreement.csv
├── llm_vs_humans.csv
├── source_presence_vs_llm.csv
└── validation_exports.zip

validation_sample_manifest.csv stores the hidden validation metadata needed for later analysis.

reviewer_orders.csv stores the recorded presentation sequence for each reviewer. In the completed study, both reviewers have the same nominal sequence.

human_annotations.csv stores one wide annotation record per reviewer and validation report.

human_field_evidence.csv stores the human coding in long format.

human_disagreements.csv lists report and field combinations on which the two reviewers disagree.

interrater_agreement.csv reports exact agreement and Cohen's kappa for categorical variables.

llm_vs_humans.csv compares the LLM output separately with each human reviewer for the principal coded variables.

source_presence_vs_llm.csv summarises source availability coding and LLM extraction outcomes for the human reviewed sample. Because the two reviewers can disagree about whether information is clearly present or ambiguous, this output should not be treated as a single adjudicated gold standard unless a separate adjudication step is completed.

validation_exports.zip packages the principal validation outputs.

Separate reviewer computers

If the two reviewers work on separate computers, each machine creates its own local _validation/validation.sqlite3.

Each reviewer should return their validation output to the study coordinator after finishing.

Cross reviewer agreement requires the two independent annotation sets to be brought together for analysis. Do not replace either reviewer's original independent responses during this process. Any later adjudicated reference should be stored separately from the original Reviewer 1 and Reviewer 2 coding. For the completed paper analysis, the immutable reviewer exports and validation metadata should be copied to validation_results/complete/ before any adjudication work begins.

Injury status and reproducibility notes

Injury status interpretation

reported_injury_status is a conservative extraction based category.

no_injury_marked means that the extracted injury fields contained an explicit None or no injury marker. It does not establish a clinically verified absence of injury.

reported_injury and reported_fatality refer to what was marked in the extracted fields and should not be interpreted as independently validated medical outcomes.

Reproducibility notes

The deterministic analysis and validation settings should be retained when producing the final paper results.

For human validation in particular, preserve:

data/validation_100.csv
_validation/validation_set_id.txt
_validation/reviewer_orders.csv
validation_results/complete/

The shared validation list defines the exact source reports selected for human review. The validation set ID confirms the report set. For the completed study, reviewer_orders.csv records the same nominal presentation sequence for both reviewers and must not be regenerated merely to create different orders retrospectively.

Original Reviewer 1 and Reviewer 2 annotations should always be retained even if disagreements are later adjudicated. Any adjudicated reference should be stored separately, for example under validation_results/adjudicated/. The completed reviewer specific LLM agreement values should remain separate rather than being averaged into a single accuracy number.

Citation

If you use this code or data, please cite the paper and, for the data, the dataset:

Alam, M. S., Zhang, L., Li, J., Dou, F., & Bazilinskyy, P. (2026). Collision patterns and evidence availability in 971 California autonomous vehicle collision reports. Traffic Injury Prevention. In press.

Alam, M. S., Zhang, L., Li, J., Dou, F., & Bazilinskyy, P. (2026). Supplementary material of the paper "Collision patterns and evidence availability in 971 California autonomous vehicle collision reports" [Data set]. 4TU.ResearchData. https://doi.org/10.4121/fcc7383e-6af1-4f1d-8b7b-757bc301cc9d

@article{alam2026collision,
  title   = {Collision Patterns and Evidence Availability in 971 California Autonomous Vehicle Collision Reports},
  author  = {Alam, Md Shadab and Zhang, Linghan and Li, Jiahui and Dou, Fei and Bazilinskyy, Pavlo},
  journal = {Traffic Injury Prevention},
  year    = {2026},
  note    = {In press}
}

@dataset{alam2026supplementary,
  title     = {Supplementary material of the paper ``Collision Patterns and Evidence Availability in 971 California Autonomous Vehicle Collision Reports''},
  author    = {Alam, Md Shadab and Zhang, Linghan and Li, Jiahui and Dou, Fei and Bazilinskyy, Pavlo},
  publisher = {4TU.ResearchData},
  year      = {2026},
  doi       = {10.4121/fcc7383e-6af1-4f1d-8b7b-757bc301cc9d}
}

GitHub also offers this citation through Cite this repository in the sidebar, based on CITATION.cff.

Contact

The code is open source and free to use. It is intended primarily for academic research, but other uses are welcome. Contributions, forks and pull requests are encouraged in the spirit of open science. For collaboration enquiries, contact Md Shadab Alam (md_shadab_alam@outlook.com) or Pavlo Bazilinskyy (pavlo.bazilinskyy@gmail.com).

About

Code for the paper "Collision Patterns and Evidence Availability in 971 California Autonomous Vehicle Collision Reports" (Traffic Injury Prevention). Uses an LLM to extract data from DMV OL 316 reports, then builds the collision taxonomy and evidence-availability analysis, with human validation and interactive figures.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages