## 3 Materials and Methods
### Crash Data  
The UD-10 crash data collected by the Michigan State Police (MSP) are the cornerstone of this study. These data provide a systematic method for recording and documenting various aspects of crashes, including driver characteristics, vehicle details, environmental conditions, and contributing factors. Their comprehensive nature and extensive use in traffic safety analysis make them a valuable tool for understanding the causes and consequences of traffic crashes. Our analysis of the 2020-2023 UD-10 crash reports from Michigan's urban and rural areas aims to identify and understand pedestrian-related risk factors derived from crash diagrams to enhance pedestrian safety.  
Pedestrian crash reports were sourced from the Michigan Traffic Crash Facts (MTCF) website [38]. These reports were downloaded as PDFs and included detailed crash diagrams and accompanying narratives. A Python 3.10.0 script was employed to extract the crash narratives, diagrams, and associated IDs, systematically organizing each report's textual and visual data. A multi-step processing approach was used to enhance the accuracy of crash diagram extraction further. Since the crash reports are available in PDF format, direct diagram extraction may introduce inconsistencies due to formatting variations. To mitigate this, an intermediate format conversion step was implemented before extracting diagrams, ensuring higher fidelity in the retrieved images. This additional step helped standardize the input data and reduce the likelihood of missing or distorted diagrams. Furthermore, extracted diagrams were systematically cross-checked against their corresponding metadata to improve data integrity.  
To refine the dataset, crashes were filtered to include only those occurring in rural and large urbanized areas, resulting in 6107 pedestrian crash diagrams. A rigorous debugging procedure was implemented to eliminate records containing inconsistent or incomplete data, ensuring the dataset's reliability. The final database consists of 5437 pedestrian crash diagrams from large urbanized areas and 609 from rural areas, totaling 6046 diagrams.  
These diagrams capture various crash conditions, including intersection configurations, roadway types, the presence of marked crosswalks, intersection skewness, and surrounding land use factors. Structuring the dataset ensures that critical crash attributes are accurately represented, facilitating automated classification using CNN models.  
While the dataset provides valuable insights into pedestrian crash characteristics, certain biases and limitations must be acknowledged. Since the data are derived from official police crash reports, the quality and accuracy of crash diagrams depend on the consistency of documentation by reporting officers. Some crash reports may contain simplified or generalized representations, which could lead to potential misclassifications in CNN-based analysis. Additionally, the dataset is heavily skewed towards urban areas, with a significantly smaller representation of rural crashes. This imbalance may impact the model's ability to generalize effectively across different geographic settings.  
To address these challenges, efforts were made to ensure data consistency before model training. The dataset was carefully curated to remove duplicate or incomplete records, ensuring that only high-quality diagrams were included in the analysis. Additionally, metadata accompanying each crash diagram, such as location and crash severity, were reviewed to validate the dataset's integrity. These steps helped improve the reliability of the dataset while maintaining transparency in the study's methodology.