Analysis of Residential Traffic Patterns Using a Raspberry Pi

Over just a two-week period, a subsection of Drew Hill Ln in Chapel Hill, North Carolina was observed with over 74,000 object counts, including cyclists, pedestrians, cars, heavy vehicles, and unidentified. Drew Hill Ln is a small public road that primarily serves Notting Hill apartment residents and visitors. These observations were recorded continuously from September 23, 2026 to October 10, 2026 on a Raspberry Pi. On October 6th and 7th, construction occurred on the recorded section of the street, significantly disrupting recorded traffic patterns during that period. This report analyzes how traffic patterns changed during and following this period, and how the methodology impacts and limits the validity and accuracy of these findings.

The map above shows the approximate location of the sensor for the duration of the data collection period.

Overview of the Data

The initial analytical portion of this narrative, focused on reviewing records with class labels which narrowed our object count down to 18,696. The below tables depict a summary of these records broken down by class type, number of observations, share of the data, and average confidence of the classification.

Overview of the traffic dataset
Measure Count
total_records 74156
missing_labels 55460
missing_confidence 55460
missing_label_or_confidence 55460
usable_records 18696
Classification counts and average confidence
Road-user type Number of records Share of records (%) Average confidence (%)
Car 11756 62.9 74.6
Pedestrian 5163 27.6 67.9
Heavy vehicle 1662 8.9 77.4
Cyclist 115 0.6 61.5

Comparing Classification Confidence Across Road-User Types

The average confidence of identified by typer anges from 61.5% to 77.4%, a range that could suggest limitations of our data and its collection process. To evaluate this idea, we started by comparing the average classification confidence for each type of road user and the number of records for each category. The aim was to provide theories as to the cause of variations in road-user types confidence and whether there was a relationship between confidence and the number of records.

These figures showed that cyclists had the lowest average confidence at 61.5%, along with the fewest records, though there did not appear to be a strong correlation to observation counts. This stood out in the data because a residential area would expect to see elevated cyclist activity.

Investigating Possible Missed Detections

Our next question was: Are cyclists being missed entirely, or are they being detected but classified as pedestrians or another road-user type? To research this, cyclists records were grouped by date then summarized.

Daily Number of Cyclist Records
Date Records labeled cyclist
Sep 02, 2026 0
Sep 21, 2026 0
Sep 23, 2026 1
Sep 24, 2026 6
Sep 25, 2026 3
Sep 26, 2026 1
Sep 27, 2026 1
Sep 28, 2026 2
Sep 29, 2026 1
Sep 30, 2026 6
Oct 01, 2026 3
Oct 02, 2026 3
Oct 03, 2026 0
Oct 04, 2026 0
Oct 05, 2026 2
Oct 06, 2026 51
Oct 07, 2026 32
Oct 08, 2026 0
Oct 09, 2026 3
Summary of Daily Cyclist Records
average_per_day median_per_day highest_daily_count
6.05 2 51

These tables show large variation in counts per day. To better view the distribution of cyclists over the study period, a graph was created of daily records with the number of recorded cyclists.

Checking Cyclist Images and Missing Classification Labels

Given this variation across the observation period, we reviewed images in the Google Drive folders, especially the No Detection folder, to look for examples that could help explain the results. Ultimately, no cyclists were found in the No Detection folder, so focus was then diverted to the cyclist category, where manual verification of the images from several dates occurred. Multiple images were found containing visible cyclists and then matched with their corresponding records in the dataset. Some of these records had NA for class_label. This means the Pi had saved a record associated with a visible cyclist, but the record did not have a classification label. This raised another possibility: the number of cyclists recorded in the dataset may be lower than the actual number because some cyclist-related records have missing labels. To investigate this further, we manually counted visible cyclists on three dates and compared our counts with the number of records labeled as cyclists in the dataset.

Manual Cyclist Counts Compared with Pi Records
Date Manual cyclist count Pi cyclist records Difference
Sep 25, 2026 2 3 1
Sep 26, 2026 2 1 -1
Oct 05, 2026 4 2 -2
Oct 06, 2026 6 51 45

The peak on October 6, 2026 reached 51 cyclist-labeled records, compared to only 6 cyclists counted manually. Reviewing the images revealed that some records were actually construction vehicles, suggesting misclassification contributed to the spike.

Construction Vehicles Classified as Cyclists
id time_start class_label confidence direction
53802 2026-10-06 8:53:57 cyclist 0.5889058 RL
58654 2026-10-06 11:58:04 cyclist 0.5129679 LR

The camera classified a Caterpillar skid steer loader and a Caterpillar mini excavator as cyclists. These examples suggest that the model may struggle to distinguish unusual construction vehicles from cyclists.

Visual Inspection of Classification and Detection Issues

While sorting through the images, we noticed another concern: repeated captures of the same vehicle. The Raspberry Pi sometimes captures the same vehicle in multiple images as it moves through the camera’s view. These repeated captures can increase the number of records without representing additional vehicles. Below depicts a slow-moving car that was counted twice in the records within a span of three seconds.

Two Records of the Same Moving Vehicle
id time_start class_label confidence direction
73862 2026-10-09 13:23:04 heavy_vehicle 0.8871141 RL
73863 2026-10-09 13:23:07 heavy_vehicle 0.9080949 LR

Classification of Unusual Vehicles

The classification also sometimes inappropriately identified objects. A serious of images below show objects incorrectly labeled in their matching record.

Golf Cart Classification Examples
id time_start class_label confidence direction
1538 2026-09-23 15:41:47 heavy_vehicle 0.7772031 LR
52174 2026-10-05 11:20:49 heavy_vehicle 0.8022027 LR
73843 2026-10-09 13:08:51 heavy_vehicle 0.6995968 RL

While all three golf carts were classified as heavy vehicles, this is likely not the most appropriate category for golf carts. This may be a limitation of the camera’s classification system, since its categories are broad and may not include unusual types of road users. As a result, vehicles that don’t fit neatly into the available categories may be misclassified.

Car and Person in the Same Frame
id time_start class_label confidence direction
52527 2026-10-05 15:12:51 car 0.9021476 RL

The camera classified a scene with a person standing beside a car as a car, with 90.2% confidence.

Tow Truck Carrying a Car
id time_start class_label confidence direction
52665 2026-10-05 18:13:36 car 0.7960538 LR

The camera classified a tow truck carrying a car as a car, with 79.6% confidence.

Two Cars in the Same Frame
id time_start class_label confidence direction
1469 2026-09-23 15:17:29 car 0.8764458 RL

The camera correctly classified the image of two cars as a car, with 87.6% confidence.

Four People in the Same Frame
id time_start class_label confidence direction
11329 2026-09-25 12:51:43 pedestrian 0.66724 RL

The camera classified an image of four people as a pedestrian, with 66.7% confidence.

Analyze Construction Vs. Non-Construction

During our data collection period, construction occurred within our camera’s view on October 6th through 7th, leading to unexpected results in our counts of traffic along the road. Initially, we were concerned that this disruption would pose challenges for our project; however, we realized that it gave us a unique example of how construction disrupts normal travel behaviors within residential areas.

Pedestrian and heavy vehicle counts increased during the construction period, and pedestrian counts in particular drastically increased. To visualize this event, we first identified observations within the construction time period to compare their total and average daily traffic counts across classification type.

We first compared total average traffic counts between construction and non-construction days, and found that there was a fairly large increase in pedestrian and heavy vehicle observations on construction days. We anticipated that both of these types would be recorded more often on construction days due to the presence of construction vehicles and workers walking back and forth. Naturally, heavy vehicle counts were higher during construction times. We were concerned that car counts would be artificially higher than average on construction days than on non-construction days due to work trucks being parked and moved around. While these artificial car observations are likely to factor in for some of our counts, our data found that, on average, fewer cars were counted on construction days than on non-construction days.

Total counts by construction status and class label
construction class_label total_count
Construction car 1089
Construction cyclist 83
Construction heavy_vehicle 1180
Construction pedestrian 4194
Construction NA 9213
Non-Construction car 10667
Non-Construction cyclist 32
Non-Construction heavy_vehicle 482
Non-Construction pedestrian 969
Non-Construction NA 46247
Average daily summary by construction status and class label
construction class_label mean_daily_count
Construction car 544.500000
Construction cyclist 41.500000
Construction heavy_vehicle 590.000000
Construction pedestrian 2097.000000
Construction NA 4606.500000
Non-Construction car 711.133333
Non-Construction cyclist 2.666667
Non-Construction heavy_vehicle 32.133333
Non-Construction pedestrian 57.000000
Non-Construction NA 2720.411765

To better understand this change, we calculated the percent change of pedestrian and vehicle types during constructions and non-construction periods. There was a 23% decrease in car activity, but a 1456% increase in cyclists, 1736% increase in heavy vehicles, and 3579% increase in pedestrians. These alarmingly high numbers indicate that we are most likely correct in assuming construction activity artificially inflated our collected data.

Percent change of activity during construction by class label
class_label Construction Non-Construction pct_change
car 544.5 711.133333 -23.43208
cyclist 41.5 2.666667 1456.25000
heavy_vehicle 590.0 32.133333 1736.09959
pedestrian 2097.0 57.000000 3578.94737
NA 4606.5 2720.411765 69.33098

Despite these challenges, we still wanted to understand just how construction impacted people’s usage of this residential road. While we knew that the counts during the construction period were likely unreliable, we wanted to know how travel behaviors differed before and after the construction. We split the dates into time periods and calculated the averages per classification type. This found that car travel decreased after construction, meaning that people were aware that construction was happening in that corridor and wanted to avoid it if they could. However, we found that pedestrian, cyclist, and heavy vehicles increased after construction. An idea for this observation based on images we looked at was that office staff and construction workers came by for the next couple of days to check on the work and remove cones. Similar to the previous pedestrian issue, the sensor may have picked up on these people walking into and out of the frame and counted it as multiple observations. However, another idea for the increase is that people may have been curious about what construction was happening and decided to use their morning walk to snoop.

Further Limitations and Conclusion

Raspberry Pi data collection can raise several accuracy issues. The environmental conditions associated with the collection process, including glare, lightning, weather, setup, and position, can all impact the quality of the records. In this report, both under- and over-classification of labels occurred on various days, reflected in object confidence. Abnormal objects or activities can also confuse the Pi’s algorithm. In our case, construction days proved to have strong outliers in counts resulting from misclassification of construction vehicles. However, these results do not have to be fully discounted; we can still draw a general trend from this report. Despite overclassification of some classes, construction likely affected the typical travel behavior of individuals within this study area.