# PACuna: Automated Fine-Tuning of Language Models for Particle Accelerators

Antonin Sulc
DESY,
Hamburg, Germany
<EMAIL_ADDRESS>
Raimund Kammering
DESY,
Hamburg, Germany
Annika Eichler
DESY,
Hamburg, Germany
Tim Wilksen
DESY,
Hamburg, Germany https://github.com/sulcantonin/LLM_NeuralIPS23.git

###### Abstract

Navigating the landscape of particle accelerators has become increasingly
challenging with recent surges in contributions. These intricate devices
challenge comprehension, even within individual facilities. To address this,
we introduce PACuna, a fine-tuned language model refined through publicly
available accelerator resources like conferences, pre-prints, and books. We
automated data collection and question generation to minimize expert
involvement and make the code available. PACuna demonstrates proficiency in
addressing accelerator questions validated by experts. Our approach shows
adapting language models to scientific domains by fine-tuning technical texts
and auto-generated corpora capturing the latest developments can further
produce pre-trained models to answer some specific questions that commercially
available assistants cannot and can serve as intelligent assistants for
individual facilities.

##  1 Introduction

Modern AI assistants like ChatGPT OpenAI (2021) and Claude Anthropic (2023)
have revolutionized artificial intelligence, showcasing impressive creativity.
However, they rely on questionable internet sources and can generate plausible
but incorrect responses when lacking knowledge, well known as hallucinations
Welleck et al. (2019), which is a known and limiting feature of LLMs.
Furthermore, the complexity of the numerous commercial large language models
makes it difficult to easily fine-tune these models to incorporate the latest
advancements. On the other hand, fine-tuning smaller but powerful LLMs like
Touvron et al. (2023) or Chiang et al. (2023) for particular domains on more
reputable sources like scientific papers addresses these issues. Scientific
papers provide a more trustworthy source of information for creating a more
reliable training dataset. This brings a potentially wide range of
applications for the community. For instance, one can fine-tune and automate
an LLM to perform department-specific tasks that consist of a specific
language. These intelligent assistants can improve FAIR principles and can
help in diverse applications like logbooks which are critical infrastructure
components in particle accelerator research and development. To tackle this,
one can consider using off-the-shelf parameter-efficient fine-tuning methods
Hu et al. (2021); Chen et al. (2023) that adapt smaller models Chiang et al.
(2023); Touvron et al. (2023) into domain or facility-specific assistants that
are able to work with complex conceptual questions where commercial chatbots
will often fail. However, the challenging part is the automated preparation of
high-quality training data tailored to the domain.

In this work, we present an approach that automates data preparation for fine-
tuning publicly available models, enabling training customized AI assistants.
We introduce the first accelerator assistant, trained without a human in the
loop in dataset preparation, which can answer questions that commercially
available chatbots are not able to answer. Furthermore, we show an automated
pipeline that enables automation for arbitrary domains without the laborious
creation of a supervised dataset and automates this process instead.

Figure 1: Overview of the training pipeline. The shown pipeline compiles
complementary text sources (Step 1). These sources are processed with Nougat
OCR Blecher et al. (2023) and standardized formats to extract text, equations,
and tables (Step 2). The structured data is used for text prediction training
$\mathcal{T}_{p}$ and to auto-generated question-answer pairs
$\mathcal{T}_{qa}$ (Step 3). Finally, the prepared dataset fine-tunes an LLM
using memory efficient LoRA Hu et al. (2021) for robust training (Step 4).

##  2 LLM in Particle Accelerator Technology

LLMs have the potential to benefit the particle accelerator R&D community,
though applications are not limited to this domain, some examples might be:

  1. 1.

LLMs can advance accelerator control and automation by developing systems that
respond to condition changes, improving stability and safety, improving the
FAIR-ness of logbooks, and helping operators to interpret data, see Section 7.

  2. 2.

LLMs can assist in interpreting facility conditions by harvesting existing
(multi-modal) data.

  3. 3.

A unified LLM could enhance communication and collaboration within and outside
facilities by providing natural language interfaces for discussing complex
concepts, sharing results, and collaborating on experiments.

  4. 4.

LLMs can assist in accelerator design and optimization by consolidating
knowledge about facilities and making it accessible to personnel, aiding the
exploration of configurations and parameters from past or published results
via incorporating additional multimodal inputs (images, screenshots, machine
parameters), see Section 7 for more details.

  5. 5.

LLMs can be used to teach accelerator principles, making this specialized
knowledge more accessible to anyone interested.

##  3 Pipeline of Fine-tuning the LLM

The pipeline can be summarized in the following steps: Preparing training data
begins with collecting corpus sources described in Section 4.1 consisting of
books, conference proceedings, and pre-prints to create a knowledge base in
the form of PDF documents. These sources are processed with optical character
recognition (OCR) to extract text, equations, and tables as we explain in
Section 4.2. The structured data is directly used for text prediction training
(unsupervised dataset $\mathcal{T}_{p}$). For question answering (supervised
dataset $\mathcal{T}_{qa}$), sections of text are prompted to auto-generate
question-answer pairs explained in Section 4.3. In the final step, in Section
5, the prepared dataset then fine-tunes LLM optimized for long contexts and
efficient training, using memory efficient LoRA Hu et al. (2021) to enable
robust training on conventional hardware.

The result is an AI assistant tailored to a scientific domain by leveraging
accessible training data $\mathcal{T}$ spanning current publications and
foundational texts. The automated pipeline enables continuous updating to
remain updated with the state-of-the-art in the field. The steps are shown
Figure 1.

##  4 Dataset

###  4.1 Corpus Sources

To create a dataset, we need text corpus sources. This work uses three
complementary data sources to generate a robust dataset covering foundational
knowledge and recent progress. Publicly available books provide broad,
established knowledge to build a strong basis, referred to as the books
corpus. Conference proceedings from JACoW  contain the most up-to-date
facility developments, referred to as jacow. arXiv arXiv  includes currently
peer-reviewed pre-prints in category physics.acc-ph (accelerator physics) from
2015 till this day and is denoted as arxiv.

The source list, including automated acquisition procedures, will be published
with the dataset to enable continuous updates with new publications. This
corpus establishes a comprehensive foundation while capturing the latest
advancements.

###  4.2 Dataset Pre-processing

In the pre-processing step, we focus on digitizing documents into machine-
readable formats.

Nougat OCR Blecher et al. (2023) uses a visual transformer to process
scientific documents into a computer-readable format. It can transform a
scientific paper into computer-readable text, equations, and tables. Nougat
converts inputs to MultiMarkdown, which is better suited for training than raw
(La)TeX, however since LaTeX is the standard for equation typesetting, we keep
the equations in LaTeX.

We transformed all computer-readable outputs from Nougat into a common format
with text as Markdown, tables as plain text, and equations in LaTeX. Nougat
initially outputs MultiMarkdown, which requires some minor modifications,
namely we transformed equations to LaTeX via regular expressions and tables to
plain text with Pandoc MacFarlane (2023).

Only books and papers sources were processed by Nougat. arXiv texts are
already in LaTeX, so we used Pandoc MacFarlane (2023) to convert to
MultiMarkdown, replaced equation delimiters with LaTeX ($), and rendered other
macros (like image captions) as plain text that are better suited for
training.

###  4.3 Dataset Preparation

The unsupervised dataset $\mathcal{T}_{p}$ for the text prediction does not
require any further steps after pre-processing and we pass the input data as
we describe in the pre-processing step, see Section 4.2.

To generate question-answer supervised pairs we prompted vicuna-7b-16k-v1.5
with a following prompt: Generate ten questions for a paper:"$TEXT" where
$TEXT is the actual paper to generate ten questions per either a section (or
subsection) form book corpus or paper from jacow corpus. If the generated
answer did not follow a pre-specified format, it was discarded.

The entire dataset consists of 633759 samples, from which 24949 are
unsupervised arXiv samples (papers), 1689 samples are from books corpus
(sections or subsections, depending on length), and 338207 samples (papers)
are from papers corpus. Generated supervised question-answer pairs consist of
13705 samples from book (single question and answer pair, if processed
properly) corpus and 255209 papers corpus (single question and answer pair, if
processed properly).

##  5 Fine-tuning

We leverage the pre-trained transformer language model vicuna-7b-16k-v1.5
Chiang et al. (2023). It provides a robust foundational model while being
reasonably small (7 billion parameters) and is trainable on conventional GPUs.
Furthermore, it can handle up to 16k input tokens, essential for often lengthy
scientific texts. Compared to larger models like llama-70b Touvron et al.
(2023), it has fewer parameters and thus it is easier to be continuously
updated and fine-tuned on conventional hardware. Fine-tuning uses LoRA Hu et
al. (2021) to make large language model training accessible on standard
hardware. This combination provides a capable foundation while remaining
efficient and accessible. Considering the input lengths, one may consider
saving computational time by using LongLoRA Chen et al. (2023) in the future.
We set the training LoRA rank to 64 since datasets contain some intricate
texts like equations and tables, $\alpha$ is set to 128. We optimized the
query, key, value, and projection weights. Per-device train batch size set to
2 and gradient accumulation 16 turned out to be a good trade-off between
training time and model efficiency. The training was performed with community-
suggested 4 epochs and with a learning rate $5\times 10^{-5}$. The training
was done on NVIDIA A100.

##  6 Evaluation

We evaluated our model with state-of-the-art open-source falcon-180b AI
Almazrouei et al. (2023) and ChatGPT OpenAI (2021). The shown results are on
the model which was trained on papers that contain mention of DESY. We also
publish a model that is trained on the entire $\mathcal{T}$. When the output
didn’t contain a definitive answer, we omitted the text, indicated by
ellipsis.

#### Question 1 about DESY ARES

: Does ARES use normal or superconducting cavities?

PACuna: ARES uses normal cavities for its accelerator, Correct

falcon-180b: I do not have information about a specific ares system. However,
ares is a general acronym that can refer to various systems…. Wrong, the
answer is missing.

ChatGPT: As of my last knowledge update in September 2021, ARES (Accelerator
for Research in Subatomic Physics) had plans to use superconducting
radiofrequency (SRF) cavities …, Wrong, they are not superconducting.

#### Question 2 about DESY European XFEL

: How many superconducting radio frequency (SRF) cavities does European XFEL
have?

PACuna: European XFEL has a total of 800 superconducting radio frequency (SRF)
cavities., Approximately correct, it is 808.

falcon-180b: The European XFEL has a total of 16 superconducting radio-
frequency (SRF) cavity stations that contain approximately 170 individual SRF
cavities …, Wrong.

ChatGPT: As of my last knowledge update in September 2021, the European XFEL
(X-ray Free-Electron Laser) facility had a total of 100 superconducting
radiofrequency (SRF) cavities …, Wrong, European XFEL has 100 modules.

#### Question 3 about beam emittance at REAGE

: What is the significance of measuring the beam emittance in the REGAE linear
accelerator?

PACuna:Measuring the beam emittance in the REGAE linear accelerator is
significant because it enables the calculation of the beam’s emittance, which
is a measure of the beam’s transverse size and intensity. This information is
crucial for optimizing the performance of the REGAE linear accelerator and the
other devices it serves., Partially correct, word intensity is not correct.

falcon-180b: Measuring the beam emittance in the REGAE linear accelerator is
significant because it allows for the optimization of the accelerator’s
performance. Emittance is a measure of how tightly packed the particles in the
beam are, and a smaller emittance means a more focused and uniform beam…,
Correct.

ChatGPT: Measuring the beam emittance in a linear accelerator like REGAE
(Relativistic Electron Gun for Atomic Exploration) is of significant
importance because emittance is a fundamental parameter that characterizes the
quality of the charged particle beam. The emittance measurement provides
crucial information about the beam’s properties, and it has several
significant implications for accelerator operation and scientific
experiments…, Correct.

Experiments show the power of fine-tuning facility-specific questions, which
is the main strength of our model. The main strength is the model’s ability to
answer facility-specific questions (Questions 1, 2), which is understandable
considering the generality of the larger models. However, the other models
provided a very good explanation for the third question, where PACuna provided
misleading information.

##  7 Future Work

In the future, we plan to expand our data sources to incorporate more relevant
and text-rich sources like Moskovic (2021), while simultaneously enhancing our
data preparation techniques for the sources already used. Notably, some
sources were regrettably excluded due to the absence of source files in the
case of arXiv corpus. This can be mitigated by applying the same processing
methodology successfully used for the JACoW  papers. Additionally, we aim to
generate more intricate and nuanced questions through specialized techniques
like Ushio et al. (2023), refining existing prompts, or instruction mining Cao
et al. (2023). Currently, our generated questions are robust but generic since
we always generate a fixed number of question-answer pairs per input, which
may lead to ignoring some knowledge. We also plan a more detailed evaluation
in future work with a human expert in the loop in the assessment of the
generated data including hallucinations. What we found particularly crucial is
preventing hallucinations, therefore in the future we would like to provide
countermeasures against it either by scoring the answer or giving a source
Tian et al. (2023).

Recently, work combining text, LLMs, and multi-modal data like images Wang et
al. (2023) or even point sets Xu et al. (2023) has emerged. This is
particularly interesting for particle accelerators which generate large
amounts of multi-modal data. AI assistants then can for instance help with
searching parameters (from point sets) or interpret the descriptions and
images from logbooks.

##  8 Conclusion

In conclusion, this work demonstrates an approach for automating the fine-
tuning of language models for specialized domains, using particle accelerator
technology as an example application. We introduced PACuna, an LLM tailored
for the particle accelerators through automated fine-tuning on a large corpus
of domain-specific texts. The corpus was compiled from publicly available
sources like books, conference proceedings, and pre-prints, providing both
foundational knowledge and cutting-edge developments. Equations and tables
were extracted and converted to machine-readable formats with Blecher et al.
(2023) and question-answer pairs were automatically generated to create
training data for fine-tuning. The model shows reasonable performance in
addressing highly facility-specific problems in particle accelerators, as we
show in the evaluation section, and is often on par with theoretical knowledge
available with the pre-trained assistants.

The shown methodology provides a generalizable framework for creating domain-
specific LLMs, overcoming some limitations of the general-purpose chatbots.
This contributes a proof-of-concept for the feasibility of automated fine-
tuning to align LLMs with rapidly advancing scientific fields. By
concentrating knowledge and reasoning skills, PACuna and models derived
through similar approaches can enhance accelerator R&D, control systems,
collaboration, and education.

## Acknowledgement

We acknowledge DESY (Hamburg, Germany), a member of the Helmholtz Association
HGF, for its support in providing resources and infrastructure. Furthermore,
we would like to thank all colleagues of the MCS and MSK groups and management
for their contributions to this work and help in preparing this paper.

## References

  * Almazrouei et al. [2023] Ebtesam Almazrouei, Hamza Alobeidli, Abdulaziz Alshamsi, Alessandro Cappelli, Ruxandra Cojocaru, Maitha Alhammadi, Mazzotta Daniele, Daniel Heslow, Julien Launay, Quentin Malartic, Badreddine Noune, Baptiste Pannier, and Guilherme Penedo.  The falcon series of language models: Towards open frontier models.  2023\.
  * Anthropic [2023] Anthropic.  Claude.ai, 2023.  URL https://www.anthropic.com.  Anthropic company website.
  * [3] arXiv.  arxiv.org e-print archive.  https://arxiv.org/, 2023.  Accessed: 2023-09-25.
  * Blecher et al. [2023] Lukas Blecher, Guillem Cucurull, Thomas Scialom, and Robert Stojnic.  Nougat: Neural optical understanding for academic documents, 2023.
  * Cao et al. [2023] Yihan Cao, Yanbin Kang, and Lichao Sun.  Instruction mining: High-quality instruction data selection for large language models.  _arXiv preprint arXiv:2307.06290_ , 2023.
  * Chen et al. [2023] Yukang Chen, Shengju Qian, Haotian Tang, Xin Lai, Zhijian Liu, Song Han, and Jiaya Jia.  Longlora: Efficient fine-tuning of long-context large language models.  _arXiv:2309.12307_ , 2023.
  * Chiang et al. [2023] Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing.  Vicuna: An open-source chatbot impressing gpt-4 with 90%* chatgpt quality, March 2023.  URL https://lmsys.org/blog/2023-03-30-vicuna/.
  * Hu et al. [2021] Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen.  Lora: Low-rank adaptation of large language models.  _arXiv preprint arXiv:2106.09685_ , 2021.
  * [9] JACoW.  Jacow.  https://www.jacow.org/, 2023.  Accessed: 2023-09-25.
  * MacFarlane [2023] John MacFarlane.  https://pandoc.org/index.html, 2023.  Accessed: 2023-09-25.
  * Moskovic [2021] Micha Moskovic.  The INSPIRE REST API.  12 2021.  doi: 10.5281/zenodo.5788550.  URL https://github.com/inspirehep/rest-api-doc.
  * OpenAI [2021] OpenAI.  Chatgpt: A large-scale generative language model for conversations.  _OpenAI Blog_ , 2021.  URL https://www.openai.com/blog/chatgpt.
  * Tian et al. [2023] Katherine Tian, Eric Mitchell, Huaxiu Yao, Christopher D Manning, and Chelsea Finn.  Fine-tuning language models for factuality.  _arXiv preprint arXiv:2311.08401_ , 2023.
  * Touvron et al. [2023] Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al.  Llama 2: Open foundation and fine-tuned chat models.  _arXiv preprint arXiv:2307.09288_ , 2023.
  * Ushio et al. [2023] Asahi Ushio, Fernando Alva-Manchego, and Jose Camacho-Collados.  A practical toolkit for multilingual question and answer generation.  In _Proceedings of the 61th Annual Meeting of the Association for Computational Linguistics: System Demonstrations_ , Toronto, Canada, July 2023\. Association for Computational Linguistics.
  * Wang et al. [2023] Wenhai Wang, Zhe Chen, Xiaokang Chen, Jiannan Wu, Xizhou Zhu, Gang Zeng, Ping Luo, Tong Lu, Jie Zhou, Yu Qiao, and Jifeng Dai.  Visionllm: Large language model is also an open-ended decoder for vision-centric tasks.  https://arxiv.org/abs/2305.11175), 2023.
  * Welleck et al. [2019] Sean Welleck, Ilia Kulikov, Stephen Roller, Emily Dinan, Kyunghyun Cho, and Jason Weston.  Neural text generation with unlikelihood training.  _arXiv preprint arXiv:1908.04319_ , 2019.
  * Xu et al. [2023] Runsen Xu, Xiaolong Wang, Tai Wang, Yilun Chen, Jiangmiao Pang, and Dahua Lin.  Pointllm: Empowering large language models to understand point clouds.  _arXiv preprint arXiv:2308.16911_ , 2023.

## Checklist

  1. 1.

For all authors…

    1. (a)

Do the main claims made in the abstract and introduction accurately reflect
the paper’s contributions and scope? [Yes]

    2. (b)

Did you describe the limitations of your work? [Yes]

    3. (c)

Did you discuss any potential negative societal impacts of your work? [No]

    4. (d)

Have you read the ethics review guidelines and ensured that your paper
conforms to them? [Yes]

  2. 2.

If you are including theoretical results…

    1. (a)

Did you state the full set of assumptions of all theoretical results? [N/A]

    2. (b)

Did you include complete proofs of all theoretical results? [N/A]

  3. 3.

If you ran experiments…

    1. (a)

Did you include the code, data, and instructions needed to reproduce the main
experimental results (either in the supplemental material or as a URL)? [Yes]

    2. (b)

Did you specify all the training details (e.g., data splits, hyperparameters,
how they were chosen)? [Yes]

    3. (c)

Did you report error bars (e.g., with respect to the random seed after running
experiments multiple times)? [No] At present, we have not encountered a
benchmark dataset in the published work that aligns closely with the aims of
our paper.

    4. (d)

Did you include the total amount of compute and the type of resources used
(e.g., type of GPUs, internal cluster, or cloud provider)? [Yes]

  4. 4.

If you are using existing assets (e.g., code, data, models) or
curating/releasing new assets…

    1. (a)

If your work uses existing assets, did you cite the creators? [Yes]

    2. (b)

Did you mention the license of the assets? [No]

    3. (c)

Did you include any new assets either in the supplemental material or as a
URL? [Yes]

    4. (d)

Did you discuss whether and how consent was obtained from people whose data
you’re using/curating? [No] Most sources are publicly available on-line and we
compile a list of sources on the paper’s website.

    5. (e)

Did you discuss whether the data you are using/curating contains personally
identifiable information or offensive content? [No] Retaining names,
affiliations, and contact details in training data upholds norms of scholarly
attribution and enables potential collaboration between researchers.

  5. 5.

If you used crowdsourcing or conducted research with human subjects…

    1. (a)

Did you include the full text of instructions given to participants and
screenshots, if applicable? [N/A]

    2. (b)

Did you describe any potential participant risks, with links to Institutional
Review Board (IRB) approvals, if applicable? [N/A]

    3. (c)

Did you include the estimated hourly wage paid to participants and the total
amount spent on participant compensation? [N/A]


# Crowd-sensing commuting patterns using multi-source wireless data: a case of
Helsinki commuter trains

1st Zhiren Huang  Dept. of Computer Science
Aalto University
Espoo, Finland
0000-0002-7868-1630  2nd Alonso Espinosa Mireles de Villafranca  Dept. of
Built Environment
Aalto University
Espoo, Finland
0000-0002-4521-0234  3rd Charalampos Sipetas  Dept. of Built Environment
Aalto University
Espoo, Finland
0000-0002-9829-3483  4th Tri Quach  Dept. of Analytics and Research
HSL Helsingin seudun liikenne
Helsinki, Finland

###### Abstract

Understanding the mobility patterns of commuter train passengers is crucial
for developing efficient and sustainable transportation systems in urban
areas. Traditional technologies, such as Automated Passenger Counters (APC)
can measure the aggregated numbers of passengers entering and exiting trains,
however, they do not provide detailed information nor passenger movements
beyond the train itself. To overcome this limitation we investigate the
potential combination of traditional APC with an emerging source capable of
collecting detailed mobility demand data. This new data source derives from
the pilot project TravelSense, led by the Helsinki Regional Transport
Authority (HSL), which utilizes Bluetooth beacons and HSL’s mobile phone
ticket application to track anonymous passenger multimodal trajectories from
origin to destination. By combining TravelSense data with APC we are able to
better understand the structure of train users’ journeys by identifying the
origin and destination locations, modes of transport used to access commuter
train stations, and boarding and alighting numbers at each station. These
insights can assist public transport planning decisions and ultimately help to
contribute to the goal of sustainable cities and communities by promoting the
use of seamless and environmentally friendly transportation options.

###### Index Terms:

mobile application, Bluetooth beacon, automated passenger counting, public
transport, multimodal

##  I Introduction

In today’s urban areas, public transportation (PT) plays a crucial role in
achieving sustainability goals by reducing car usage and emissions [1, 2].
Commuter trains are an important mode of transportation for many people,
especially in urban areas where distance, traffic congestion, and parking can
be a problem [3]. Understanding the mobility patterns of commuter train
passengers is therefore crucial for developing efficient and sustainable
transportation systems. Commuter train ridership [4, 5, 7, 6], travel time and
distance distributions [8, 9], access and egress modes [10, 11, 12, 13, 14,
15], and the origin and destination of commuter train trips [16] are all
important factors in understanding how people move within a city [17].
However, traditional methods for collecting this data, such as travel surveys
[18], are not only time-consuming and costly but are also performed yearly or
even more infrequently. This makes it difficult to capture real-time or near-
real-time data. While Automated Passenger Counters (APC) can provide
aggregated information on the number of passengers entering and exiting trains
[19, 20], they do not provide detailed information nor passenger movements
beyond the train system. In addition, high costs of installing such devices
often leads to low penetration rates within PT systems. These limitations make
it difficult for transportation planners and managers to make informed
decisions about PT systems.

To overcome these limitations, we investigate the potential combination of
conventional APC data with an emerging source of data that can provide a more
detailed understanding of passenger mobility. The new data source derives from
the pilot project TravelSense [21], led by the Helsinki Regional Transport
Authority (HSL). The project utilizes Bluetooth beacons and HSL’s mobile phone
ticket application to track anonymous passenger multimodal trajectories from
origin to destination.

Since this type of door-to-door trajectory can be highly sensitive with
regards to privacy, several methods are applied in collecting and in pre-
processing the data in order to preserve enough anonymity to avoid
identification of individuals:

  * •

The data collected derives from users who have explicitly opted-in to share
their mobility data with HSL. This means that users need to turn on the travel
data sharing option in the settings by themselves.

  * •

Each user’s mobile phone is assigned a random ID for every day about which the
user shares data. This prevents tracking the same individual over several
days.

  * •

Spatial resolution for actual origins and destinations are coarse grained and
timestamps obfuscated for recognitions outside the PT network.

The challenge that arises is captured by the question: does the sparseness of
the data significantly affect its usefulness while also restricting its
applications? We compare the ridership deriving from TravelSense with the one
from APC to validate the TravelSense data representativeness. The assumption
is that if the comparison of ridership between the two data sources shows high
correlation, then other travel patterns sensed from TravelSense (e.g., travel
time and distance distributions, access and egress modes, the origin and
destination of commuter train trips) are also more reliable than what the
above-mentioned concerns might imply.

By combining TravelSense data with APC data, we are able to better describe
and understand the commuting patterns of train users. These insights can
assist PT planning decisions and ultimately contribute to the sustainability
goals of cities and communities by promoting the use of environmentally
friendly transportation options and by helping to enable seamless and user-
centric transport systems. The main contributions of this study are:

  * •

Utilization of the new data source, TravelSense, to demonstrate how mobile
data technologies can enhance the power of sensing near-real-time PT states.

  * •

Development of a data integration framework to capture the commuting train
mobility patterns for a metropolitan region.

The paper is structured in two parts. First, we compare the representativeness
of the TravelSense dataset with commuting train APC data; second, we combine
the two sources to understand the commuting patterns of train passengers.

##  II Study area and data

Figure 1: The study area and the PT network including different transportation
modes: train (purple), subway (orange), tram (green), and bus (blue). Dash
lines represent four ticket zones based on thickness.

###  II-A Study area

The Helsinki metropolitan area is approximately 770 km2 with a population of
approximately 1.2 million inhabitants. The local mobility services include
fixed PT (metro, tram, train, bus, and ferry), micro-mobility (shared
e-scooters and shared bicycles), and ride-hailing services (e.g., UBER), which
vary according to location. A map of the study area including the PT network
is presented in Fig. 1. Purple lines represent the commuter train network.

HSL provides PT services for 9 municipalities (HSL area) which, in addition to
the capital region, include Siuntio, Kirkkonummi, Sipoo, Kerava, and Tuusula
[18]. To facilitate PT trips HSL offers a mobile phone ticketing application
that provides travelers with information on PT operation (e.g., fare zones,
real-time PT vehicle locations, timetables, best routes, delays, and PT news,
among others).

###  II-B Data

The datasets used in this paper (TravelSense and APC counts) were provided by
HSL. They correspond to the same collection period from the 1st to the 30th of
September 2021; details are given below.

#### Automated Passenger Counters (APC)

The APC system of commuter trains records the number of passengers entering
and exiting train vehicles in real-time, making use of sensors installed on-
board commuter train vehicles. The number of units installed varies from one
to three units per vehicle in Helsinki trains. The APC dataset records nine
routes and 45 train stations within the Helsinki PT network. It is noted that
in rare cases the APC devices do not operate properly due to technical
problems, and this leads to the respective trip counts being imputed by the PT
operator. The percentage of imputed values is usually low and differs from day
to day, since the occurrence of technical problems is random and
unpredictable. In this study, the imputed counts, which are based on
historical data, are treated equally to real counts.

#### TravelSense

Figure 2: Data collection infrastructure of TravelSense.

The data collection infrastructure principally relies on the HSL mobile
ticketing app. Through the app, a user’s device is able to recognise the
Bluetooth low energy beacons that are present throughout the PT network. The
app also uses the mobile phone’s GPS coordinates to determine the grid cells
through which the user moves. Finally, the app also uses the activity
recognition modules of the user’s mobile phone to determine whether the user
is still, walking, cycling, or on board of a vehicle. To ensure high standards
of data privacy, devices are anonymised and given random IDs every day for
which data is shared, thus they are not followed longitudinally. Furthermore,
the GPS coordinates are resolved only up to grid cells of 250m $\times$ 250m
and timestamps of locations outside the PT network are rounded to the nearest
quarter-hour.

The physical sources used in the data collection process can be classified in
the following way:

  * •

Moving Bluetooth beacons. These are installed inside PT vehicles (buses,
trams, trains, metros and ferries).

  * •

Portable devices. These are the users’ mobile phones, which recognise the user
activity and movement and also recognise the Bluetooth beacons throughout the
PT network.

The HSL app logs beacon recognition and pushes this information along with
position and activity information to the TravelSense servers. The TravelSense
data collection system is based on the framework described in [21] and [22].
Currently the data collected is from users who have explicitly opted-in to
share their mobility data with HSL; they can choose to stop sharing at any
time.

We use a python library tstrips developed in our previous study [21] to
process the TravelSense data. The information is structured based on _legs_
and _trip chains_ , with the following definitions:

  * •

Leg – an individual segment within a trip chain recognised by the data
collecting system and pre-processing as a discrete stage within the journey,
either because there are pauses in the movement, or there is a change in
recognised activity.

  * •

Trip chain – a series of legs that have been recognised by the system in pre-
processing as being part of a single journey. The end-points of trip chains
are recognised by prolonged periods of remaining in the same location and no
significant changes in activity.

These definitions are similar to those in the travel survey operated by
HSL[18], where the trip chain in this paper equals the journey in HSL’s travel
survey.

##  III Methods

###  III-A Preliminaries

Based on the definitions above, a trip chain is characterised by the legs that
make up each segment and the travel modes used in each of them. A simplified
view of a trip chain is shown in Fig. 3, which highlights the main
characteristics with which we are concerned. Namely,

  * •

Train leg – The leg’s traffic mode is the commuter train, which contains the
timestamp of entering and exiting a train vehicle, as well as the boarding and
alighting stations.

  * •

Origin & destination – The first grid cell of a chain trip which contains a
train leg is the origin of this boarding station. The last grid cell of this
trip chain is the destination of the train leg’s alighting station.

  * •

Access & egress mode – The traffic mode of the last leg before the train leg
is the access mode of this boarding station. The traffic mode of the leg after
this train leg is the egress mode of this alighting station.

Figure 3: Illustration of the leg and the trip chain.

Figure 4: Framework of the proposed methodology.

Fig. 4 shows the framework of this study and the arrows show the data flow.
Due to the limitation of paper length, in this study, we focus on the data
during weekdays. The temporal factors (i.e., hours) are only considered in
representativeness check, while crowd-sensing results are presented without
temporal factors.

###  III-B Representativeness validation

In order to determine the representativeness of the TravelSense dataset, we
compared it to ridership data collected by APC. APC was chosen as the baseline
data source since it is installed on vehicle doors to capture the total number
of passengers. APC is shown to be a more reliable data source when compared to
other movable devices, such as mobile phones[20] . To quantify the correlation
between the two datasets, the following three metrics were used:

  * •

Spearman’s rank correlation coefficient ($\rho$) – to measure how well the
relationship between the two variables can be described using a monotonic
function. $\rho$ ranges from 0 to 1.

  * •

Pearson correlation coefficient (PCC) – to measure the linear correlation
between the two datasets. PCC ranges from -1 to 1.

  * •

R-squared ($R^{2}$) – to measure the proportion of the variance of the
ridership sensed from APC that is explained by the ridership sensed from
TravelSense by a given model. In this study, linear regression was applied.
$R^{2}$ ranges from 0 to 1.

The ridership data was aggregated at the route and station levels; the
temporal factor – the hour of the day was also taken into consideration.

###  III-C Commuting patterns within the commuter train system

Since APC data only records aggregated data, it is difficult to estimate
travel features of a single trip, and therefore it requires sophisticated
methods in order to estimate OD matrices of travel demand at the station level
[23, 24]. TravelSense could help in calculating and inferring several
important commuting mobility features, such as:

  * •

OD matrix – the number of passengers $T_{ij}$ from the station $i$ to the
station $j$ was inferred with the proportion of passengers from the
TravelSense whose train leg starts and ends at those respective stops.

  * •

Travel time distribution – the travel time of a train leg was calculated by
subtracting the time of boarding from the time of alighting.

  * •

Travel distance distribution – the geographic distance (aka great-circle
distance) of a train leg was calculated by the boarding and alighting station
coordinates.

  * •

Travel flow distribution – the distribution of travel flow $T_{ij}$ of OD
pairs.

###  III-D Mobility beyond the train system

The travel demand serviced by a train station is intrinsically tied to
geography and the urban landscape. We use TravelSense to investigate the
relationship between passenger loads with spatial (ODs) and behavioural
(travel mode) characteristics of journeys that use the train stations.

#### Origins and destinations identification

For each train station, two lists of associated grid cells are compiled
corresponding to origins and destinations journeys that use the station. Three
metrics are used to quantify the distributions of origins and destinations:

  * •

The number of grid cells $N$ – the number of unique grid cells associated with
the train station $k$. $N_{k}^{(o)}$ represents the number of unique origins
of a boarding station $k$, $N_{k}^{(d)}$ represents the number of unique
destinations of an alighting station $k$.

  * •

The Gini index $G$ – which measures the inequality among the values of a
distribution [25]. Gini index values close to zero indicate a more uniform
distribution, while values closer to one indicate higher inequality. $G^{(o)}$
measures the inequality of the passenger numbers from boarding stations’
origins and $G^{(d)}$ measures the inequality of the passenger numbers to
alighting stations’ destinations.

  * •

The radius of gyration $rg$ – which captures the characteristic distance
travelled by a person during a specific time period[26]. At the population
level, the radius of gyration for boarding station’s origins is calculated by:

$rg_{k}^{(o)}=\frac{\sum_{i=1}^{N_{k}^{(o)}}(d_{ik}\times
T_{ik})}{\sum_{i=1}^{N_{k}^{(o)}}T_{ik}}.$ (1)

where $d_{ik}$ is the distance between the grid cell $i$ and the station $k$,
$T_{ik}$ is the number of passenger from the grid cell $i$ to the station $k$.
$rg_{k}^{(d)}$ follows the same form of 1 but for alighting station’
destinations.

#### Access and egress modes identification

For each train station, based on the TravelSense trips that use it to access
and egress the train network, we assign two vectors which capture the travel
modes of access and egress legs. We use eight traffic modes in this study:
bus, private car, cycling, subway, train, tram, walking, and unknown.
Therefore the length of the access/egress mode vector is eight.

TABLE I: Correlations between TravelSense and APC Spatial Aggregation | Temporal Aggregation | Event Type | Spearman | PCC | $R^{2}$ | Linear Regression
---|---|---|---|---|---|---
| Weekday | Boardings/Alightings | 1.000* | 0.991* | 0.982 | 40.345$\times x$-10932.415
Route | Hour | Boardings/Alightings | 0.985* | 0.984* | 0.967 | 40.084$\times x$-271.740
|  | Boardings | 0.843* | 0.919* | 0.845 | 43.142$\times x$-13325.953
| Weeday | Alightings | 0.836* | 0.908* | 0.824 | 43.664$\times x$-12398.272
|  | Boardings | 0.888* | 0.918* | 0.842 | 42.847$\times x$-531.369
Station | Hour | Alightings | 0.874* | 0.907* | 0.822 | 41.860$\times x$-451.766
* presents P-value less than 0.001. |  |  |

###  III-E Data integration

A random forest model [27] is used to integrate the APC ridership data with
the crowd-sensing data from TravelSense. From the crowd-sensing data a feature
matrix is constructed composed of the mode and OD data. For each station, the
vectors corresponding to travel modes, origins, and destinations are
concatenated into a single vector. The vectors for all stations then compose
the feature matrix for the whole system. We use the random forest model to
build a regression for the ridership based on the travel modes and OD
structure associated with each station from the feature matrix. To obtain more
insights for understanding the commuting patterns, we use two global model-
agnostic methods: Permutation Feature Importance (PFI) [28] and the Partial
Dependence Plot (PDP) [28].

In the PFI a feature is considered important if in the random forest model it
is frequently selected as a non-leaf node in the decision trees that make up
the forest. Therefore, the importance of a feature can be quantified by the
number of times that the feature is selected as a non-leaf node divided by the
total number of non-leaf nodes.

PDP is used to measure the marginal effect of each feature on the ridership.
This is done by changing the value of each studied feature in turn, while
keeping the values of the other features fixed.

##  IV Results

###  IV-A Representativeness of TravelSense

#### Route-level validations

Fig. 5(a) compares APC and TravelSense boarding demand for nine train routes.
The correlation found between the two data sources is 0.991, for Spearman’s
rank correlation, and 0.982 using the PCC value. This suggests that
TravelSense is able to capture the route’s ridership accurately. In Fig. 5(b)
boarding counts are aggregated hourly per route; there is a data point per
hour for each route. In this case Spearman’s rank correlation is 0.985 and PCC
is 0.984. Therefore TravelSense can also sense the temporal ridership trends
for different routes.

Figure 5: Comparison of boardings between TravelSense and APC considering (a)
routes and (b) routes per hour.

Figure 6: Comparison of station demand between TravelSense and APC considering
(a) boardings per station, (b) alightings per station, (c) boardings per
station and hour (d) alightings per station and hour.

Figure 7: Commuting mobility patterns based on TravelSense. (a) visualization
of the OD matrix; (b) travel time distribution; (c) travel distance
distribution; (d) distribution of travel flows between OD pairs. In (b)-(d)
the mean values are shown with dashed lines.

#### Station-level validations

The demand at train stations is different than for the routes. To properly
capture the passengers that use a station we consider boarding and alightings
separately. In general the boarding and alighting numbers are different for
the same train station, additionally some stations in Helsinki serve very
large number of routes (e.g., Pasila and the Helsinki central station). As
shown in Table. I and Fig. 6, with or without temporal factors, TravelSense
both shows high positive correlations between APC station ridership —
Spearman’s rank correlation ranges from 0.836 to 0.874 — and is statistically
significant (i.e., P-value is less than 0.001). The $R^{2}$ value of
regression of hourly boardings is 0.842, while for hourly alightings it is
0.822. There is a potential in future works to scale the TravelSense data up
according to its regression with APC ridership data; the scaling amplitude is
around 43 (the coefficient of $x$, see Table. I) and gives an idea of the
penetration rate of TravelSense sharing among rail passengers. However, it is
noticed that in the raw data of TravelSense, records of two train stations
(i.e., the station at the airport – Lentoasema and an adjacent one –
Aviapolis) are missing. Therefore, the data quality could be improved and the
level of improvement is yet to be explored.

###  IV-B Commuting patterns within the commuter train system

For the passengers that share their data, TravelSense makes it possible to
identify the exact vehicles and routes that they use at the stations where
they access and egress the rail network. This information allows identifying
passenger flows, travel times, and travel distances which can not be done with
APC alone.

Fig. 7(a) shows a visualization of the OD matrix constructed from TravelSense
data. Generally, people living in the east of both Helsinki and Vantaa are
more reliant on commuter trains than people who live in Espoo. The top two
stations used are Helsinki railway station and Pasila which are geographically
central and also serve most routes. Fig. 7(b) shows the travel time
distribution for train legs. The average travel time is about nine minutes.
According to HSL timetable data, the average travel time between two adjacent
stations is about 2.5 minutes which means, on average, a train leg consists of
between three to four stops. Fig. 7(c) shows the travel distance distribution
for train legs. The average distance of commuter train trips is 10.29 km, the
average speed of commuter trains is around 69.5 km/h yielding the average
travel time of nine minutes.

Broadly, these results are in line with HSL’s travel survey [18], which
reports individual journeys across all travel modes took on average 24 minutes
with an average journey length of 7.3 km. Therefore commuter train legs are
shorter in time while covering larger distances than an average journey, as
expected for the type of travel mode.

Fig. 7(d) shows the observed statistical distribution of travel flows between
station pairs. The average travel flow sensed by TravelSense is 122 passengers
and the maximum travel flow sensed by TravelSense is 2,735 passengers.

###  IV-C Mobility beyond the train system

Figure 8: Distributions of boarding stations’ origins and alighting stations’
destinations. (a) Distributions of borading stations’ origins for five
stations. From left to right, Kirkkonummi (blue), Espoo (orange), Leppävaara
(green), Malminkartano (red) and Tikkurila (purple). Gray solid lines
represent the PT network, the saturation of a grid increases with the
increment of passenger numbers of origins; (b) Number of origin grid cells;
(c) Number of destination grid cells; (d) GINI index of origins; (e) GINI
index of destinations; (f) Radius of gyration of origins; (g) Radius of
gyration of destinations. Dashed lines in (b)-(g) show mean values.

#### Origins and destinations for train stations

The commuter train system’s ridership is influenced by the origin and
destination of the trip chains (see Fig. 3) of the passengers.

By identifying the grid cells from which the passengers start and end their
trip chains, the service coverage areas of stations can be determined. Fig. 8
(a) illustrates the distribution of boarding station’s origins for five
different train stations, which vary in number and geographical distribution.

The Tikkurila train station is a particularly noteworthy since its origins are
not only located around the station, but also along the train line and bus
lines, with several distant spots (Purple grid cells in Fig. 8 (a)). The
reason for this is partly the location and function of this station in the PT
network. It is located in the center of 4th most populous municipality,
Vantaa, and also servea as a top-tier transfer hub [29] in the HSL PT network
design. It serves both local trains as well as longer distance routes that are
also used by commuters coming into the capital region.

In order to quantify the patterns of origins and destinations, the three
metrics described in section III-D were applied to all train stations. As
shown in the distributions of Fig. 8 (b) and (c), stations have more diverse
destination than origins. Fig. 8 (c) and (d) show that the passenger numbers
distribution of origins is more concentrated than that of destinations. The
average radius of gyration for destinations (Fig. 8 (e)) is larger than that
of origins (Fig. 8 (f)), indicating that when leaving the train station,
passengers tend to travel to more remote locations. This asymmetry suggests
that trains are potentially used earlier in the trip chain than other modes.

#### Traffic modes for access/egress to commuter train stations

The traffic modes used by passengers to access or leave a train station are
crucial in designing a transfer-friendly PT system. As shown in Fig. 9,
walking is by far the most commonly used mode of transportation to access
stations. Private car and bus are also commonly used modes. Interestingly,
they have similar proportions, with cars having a narrower distribution
(although more outliers). The proportions of tram mode and subway mode are
lower than 5%, because only few train stations are easy to transfer to/from
subways or trams by the current PT network structure. It is noted that modes
designated as ’Other’ in TravelSense data are either ’running’, ’ferry’ or not
recognized.

To further understand the mode choices of commuter train passengers, here, we
focus on studying the six proportion of modes (cycling, private car, bus,
tram, subway and train, see Fig. 10). We use the Siuntio train station
(labeled in Fig. 7) as an example, where the main modes are bus and private
vehicle, most likely due to its location at the westernmost part of the
commuter train network, and more disperse residential areas. It has the third
largest radius of gyration of origins
($rg^{(o)}_{\text{siuntio}}=5.87>\bar{rg}^{(o)}=3.52$, the average) after
Kerava and Tikkurila. In terms of egress modes (Fig. 10 (b)), the bus
proportion is lower than for the access. There is also a larger use of trains,
suggesting that some passengers are traveling beyond the Helsinki metropolitan
area.

Figure 9: (a) Proportions for access modes and (b) proportions for egress
modes.

Figure 10: (a) Mode vector of access modes and (b) Mode vector of egress
modes. Dotted line box shows the mode vector of Siuntio.

###  IV-D Data integration

The data integration step combines two data sources via regression using a
random forest model. The correlation given by the $R^{2}$ value for estimating
the number of boardings is 0.935, and for the number of alightings, 0.934.
Fig. 11 shows that the contribution of the Gini index for destinations,
$G^{(d)}$, is the most important feature for both the boardings and
alightings. The second most important feature is the number of destinations
$N^{(d)}$, followed by $G^{(o)}$ and $N^{(o)}$ for origins. Some access modes
are also identified as having an impact via PFI. Namely subway, tram, bus and
cycling, in order of imporatnce. This indicates that the destination of trip
chains has a larger influence on passengers’ choice of using trains (i.e.,
whether passengers are willing to use commuter train services or not). This is
a hypothesis to be explored in future research.

We note that radius of gyration and egress modes are shown to play a minor
role in the ridership model, which indicates that the diversity in popularity
destinations and origins is more important than their spatial distribution.

Figure 11: Permutation feature importance for commuting patterns and
ridership.

PDP is then used to explore how the top eight previously identified features
affect the number of boardings and alightings. Fig. 12 shows the sensitivity
of the predicted ridership to these features. We find that both alightings and
baoardings behave similarly, they increase quickly with the destinations,
$N^{(d)}$, in particular for values larger than $2100$ and with the number of
origins when $N^{(o)}$ is larger than 840. As for the Gini coefficients,
ridership shows little change until $G^{(d)}$ is larger than 0.56, from then
on it rises sharply in steps. Similarly for $G^{(o)}$ the threshold value is
around 0.72, with a sharp increase afterwards and a less marked step
behaviour.

The importance of the features is reflected by the nonlinear relationships to
the ridership, the travel mode features show a type of
activation/deactivation, while for the OD features the dependency exhibits
more complex behaviour.

Figure 12: Partial dependence plots for commuting patterns and ridership.

##  V Implications of practice

APC devices are a common technology for counting the passengers entering and
exiting PT vehicles. However, they are often not installed in all vehicles of
a specific mode or route. Technical problems are common which can lead to gaps
in measurements. An additional limitation is the aggregated nature of the
information they provide which does not allow detailed analyses nor further
insights beyond the PT network.

Data from mobile devices, on the other hand, are more promising, however,
their low maturity and penetration within PT networks presents a challenging
task. The main challenge is the low volumes of data requiring validation and
scaling in order to be trusted. Hence, their combination with more
conventional data sources is important, if not mandatory, for the early stages
of their implementation.

The results of our analysis of the TravelSense dataset show that despite its
limitations related with low volume of information, it can indeed be scaled up
using data from conventional APC devices installed in all commuter trains
within the Helsinki network. While more thorough validation is necessary (see
[21]), it is shown to be representative.

The representativeness of TravelSense data allows it to be useful, either
alone or in combination with other data, for several applications. For
example, TravelSense can be scaled using historical data to fill the gaps in
APC measurements when APC devices have technical problems that hinder their
operation [20]. In addition, the representativeness of TravelSense dataset
allows for estimation of passenger flows within the train network, and more
specifically, the probabilities of a passenger travelling to any station based
on the boarding station. Multiplying the probabilities from TravelSense data
within a given time period with the APC historical counts can give estimated
flows.

TravelSense was found to be useful for offering insights on the movements of
passengers outside the train network. Such a notion can be utilized for a
plethora of applications within the transport sector, for instance in studies
related with multimodality and accessibility [30, 31]. Which would allow for
enhancing the understanding of travelers’ habits and their connection to PT
systems.

It is apparent from this study that mobile data are associated with certain
opportunities for PT systems, as long as there is enough background for
filling gaps they might have as a result of their early introduction into the
mobility sector. This study offers several numerical outputs related with the
train mobility within Helsinki, but also insights on how such a dataset can be
utilized within PT and more specifically for commuter train related
applications. However, it is noted that the nature of this dataset allows it
to have several multimodal applications, if properly processed and fused with
additional information and data sources [32, 33, 34, 35, 36].

##  VI Conclusion

This study focused on using multi-source wireless data, such as APC and the
TravelSense mobile phone application, in order to understand the commuting
patterns in the Helsinki metropolitan area. The representativeness of
ridership data was validated using both data sources, showing the ability of
TravelSense to sense near-real-time PT states. The combination of the data
sources provides in-depth information about origin and destination locations,
traffic modes used to access/egress commuter train stations, and number of
passengers boarding and alighting at each station. The proposed data
integration framework could be used to inform PT planning decisions and
promote sustainable transportation options. This study highlights the
potential of the multi-source wireless data approach for efficient
transportation management and operations with an emphasis on smooth
multimodality and sustainability.

Addressing several challenges associated with such dataset and the presented
integration framework (e.g., generating commuting features manually) by means
of different approaches (e.g., by considering applying cross-domain data
fusion methods, graph neural network models and transfer learning methods) is
part of future work. The potentials of fusing or integrating this dataset with
additional conventional PT data sources (e.g., smartcard data and General
Transit Feed Specification (GTFS) data) are also envisioned extensions of this
study.

## Acknowledgment

The authors thank HSL for access to the TravelSense dataset, and for their
time and discussions about this study, We especially thank Pekka Räty and
Hanna Kitti. The work of Z. Huang was supported by the Strategic Research
Council at the Academy of Finland (grant numbers 345188 and 345183). The work
of C. Sipetas was supported by the FinEst Twins Center of Excellence (H2020
Grant 856602). The work of A. Espinosa Mireles de Villafranca was supported by
the Academy of Finland (grant: Profi4). Calculations were performed using
computer resources within the Aalto University School of Science “Science-IT”
project.

## References

  * [1] Newman, P. and Kenworthy, J. The end of automobile dependence how cities are moving beyond car-based planning. Washington, DC: Island Press/Center for Resource Economics. 2015.
  * [2] Ceder, A. “Syncing Sustainable Urban Mobility with public transit policy trends based on Global Data Analysis,” Scientific Reports, 11(1):14597. 2021.
  * [3] Wu, H., Levinson, D. and Sarkar, S. “How transit scaling shapes cities,” Nature Sustainability, 2(12), pp. 1142–1148. 2019.
  * [4] Lin, J. et al. “A model of multimodal ridesharing and its analysis,” in Proceedings of the 2016 17th IEEE International Conference on Mobile Data Management (MDM) Porto, Portugal: IEEE, pp. 174-179. 2016.
  * [5] Börjesson, M. and Rubensson, I. “Satisfaction with crowding and other attributes in public transport,” Transport Policy, 79, pp. 213–222. 2019.
  * [6] Sipetas, C., Keklikoglou, A. and Gonzales, E.J. “Estimation of left behind subway passengers through archived data and Video Image Processing,” Transportation Research Part C: Emerging Technologies, 118, p. 102727. 2020.
  * [7] Jenelius, E. and Cebecauer, M. “Impacts of covid-19 on public transport ridership in Sweden: Analysis of ticket validations, sales and passenger counts,” Transportation Research Interdisciplinary Perspectives, 8, p. 100242. 2020.
  * [8] Zhao, K. et al. “Explaining the power-law distribution of human mobility through transportationmodality decomposition,” Scientific Reports, 5(1). 2015.
  * [9] Zhang, J. et al. “Bicycle-sharing system analysis and trip prediction,” in Proceedings of the 2016 17th IEEE International Conference on Mobile Data Management (MDM). Porto, Portugal: IEEE, pp. 174-179. 2016.
  * [10] Cervero, R. “Walk-and-ride: Factors influencing pedestrian access to transit,” Journal of Public Transportation, 3(4), pp. 1–23. 2001.
  * [11] Bhat, C.R. and Sardesai, R. “The impact of stop-making and travel time reliability on Commute Mode Choice,” Transportation Research Part B: Methodological, 40(9), pp. 709–730. 2006.
  * [12] Givoni, M. and Rietveld, P. “The access journey to the railway station and its role in passengers’ satisfaction with Rail Travel,” Transport Policy, 14(5), pp. 357–365. 2007.
  * [13] Chakour, V. and Eluru, N. “Analyzing commuter train user behavior: A decision framework for access mode and Station Choice,” Transportation, 41(1), pp. 211–228. 2013.
  * [14] Jonkeren, O. et al. “The bicycle-train travellers in the netherlands: Personal Profiles and Travel choices,” Transportation, 48(1), pp. 455–476. 2019.
  * [15] Giansoldati, M., Danielis, R. and Rotaris, L. “Train-feeder modes in Italy. is there a role for active mobility?,” Research in Transportation Economics, 86, p. 100990. 2021.
  * [16] Halldórsdóttir, K., Nielsen, O.A. and Prato, C.G. “Home-end and activity-end preferences for access to and egress from train stations in the Copenhagen Region,” International Journal of Sustainable Transportation, 11(10), pp. 776–786. 2017.
  * [17] Cai, M., Pang, Y. and Sekimoto, Y. “Spatial attention based grid representation learning for predicting origin–destination flow,” in Proceedings of the 2022 IEEE International Conference on Big Data (Big Data). Osaka, Japan: IEEE, pp. 485–494, 2022.
  * [18] Brandt, E., Kantele, S. and Räty, P. “Liikkumistottumukset Helsingin seudulla 2018 (Travel habits in the Helsinki region in 2018),” Helsinki: HSL Helsinki Region Transport, 2019.
  * [19] Nassir, N. et al. “Transit stop-level origin–destination estimation through use of transit schedule and Automated Data Collection System,” Transportation Research Record: Journal of the Transportation Research Board, 2263(1), pp. 140–150. 2011.
  * [20] Roncoli, C., Chandakas, E. and Kaparias, I. “Estimating on-board passenger comfort in public transport vehicles using incomplete automatic passenger counting data,” Transportation Research Part C: Emerging Technologies, 146, p. 103963. 2023.
  * [21] Huang, Z., Espinosa Mireles de Villafranca, A. and Sipetas, C. “Sensing Multi-modal Mobility Patterns: A Case Study of Helsinki using Bluetooth Beacons and a Mobile Application,” in Proceedings of the 2022 IEEE International Conference on Big Data (Big Data). Osaka, Japan: IEEE, pp. 2007–2016. 2022.
  * [22] Rinne, M., Bagheri, M., Tolvanen, T., and Hollmén, J. ”Automatic Recognition of Public Transport Trips from Mobile Device Sensor Data and Transport Infrastructure Information”, Personal Analytics and Privacy. An Individual and Collective Perspective, pp. 76-97, 2017.
  * [23] Zhao, J., Rahbee, A. and Wilson, N. H., “Estimating a rail passenger trip origin-destination matrix using automatic data collection systems,” Computer-Aided Civil and Infrastructure Engineering, vol. 22, no. 5, pp. 376–387, 2007.
  * [24] Hakegard, J. E., Myrvoll, T. A., and Skoglund, T. R., “Statistical modelling for estimation of OD matrices for public transport using wi-fi and APC Data,” 2018 21st International Conference on Intelligent Transportation Systems (ITSC), 2018.
  * [25] Dixon, P. M., Weiner, J., Mitchell-Olds, T. and Woodley, R. “Bootstrapping the Gini coefficient of inequality,” Ecology, vol. 68, no. 5, pp. 1548–1551, 1987.
  * [26] González, M. C., Hidalgo, C. A. and Barabási, A.-L. “Understanding individual human mobility patterns,” Nature, vol. 458, no. 7235, pp. 238–238, 2009.
  * [27] Hastie, T., Friedman, J. and Tisbshirani, R. “The elements of Statistical Learning: Data Mining, Inference, and prediction,” New York: Springer, 2017.
  * [28] Molnar, C. “Interpretable machine learning: A guide for making Black Box models explainable,” Munich: Christoph Molnar, 2022.
  * [29] Holm, M. and Suhonen, M. “Vaihtopaikkojen kehittämisohjelma - Solmu-projektin 5. osatehtävä (Interchange Development Program – Solmu Project, subtask 5),” Helsinki: HSL Helsinki Region Transport, 2016.
  * [30] Kujala, R., Weckström, C., Mladenović, M. N. and Saramäki, J. “Travel Times and transfers in public transport: Comprehensive accessibility analysis based on pareto-optimal journeys,” Computers, Environment and Urban Systems, vol. 67, pp. 41–54, 2018.
  * [31] Weckström, C. et al. “Navigability assessment of large-scale redesigns in nine public transport networks: Open Timetable Data Approach,” Transportation Research Part A: Policy and Practice, 147, pp. 212–229. 2021.
  * [32] Zheng, Y. “Methodologies for cross-domain data fusion: An overview,” IEEE Transactions on Big Data, 1(1), pp. 16–34. 2015.
  * [33] Huang, Z. et al. “Modeling real-time human mobility based on mobile phone and transportation data fusion,” Transportation Research Part C: Emerging Technologies, 96, pp. 251–269. 2018.
  * [34] Weckström, C. et al. “Assessment of large-scale transitions in public transport networks using open timetable data: Case of helsinki metro extension,” Journal of Transport Geography, 79, p. 102470. 2019.
  * [35] Wang, K. et al. “A two-step model for predicting travel demand in expanding subways,” IEEE Transactions on Intelligent Transportation Systems, 23(10), pp. 19534–19543. 2022.
  * [36] Qiu, D. et al. “CityCross: Transferring attention-based knowledge for location-based advertising recommendation,” in Proceedings of the 2022 23rd IEEE International Conference on Mobile Data Management (MDM). Paphos, Cyprus: IEEE, pp. 254-261. 2022.