## 3 Methods
### Optimization Algorithm  
The HSR trip assignment model outputs the predicted demand for each station when influencing factors are input. An artificial neural network algorithm that has recently been used in many ways owing to its high prediction performance could be applied to this problem. This algorithm learns the relationship between inputs and outputs based on collected data and then highly accurately outputs the results by optimizing the weight using a backpropagation algorithm [43]. The backpropagation algorithm optimizes the weight to minimize loss, which is the error margin between a prediction and the actual target value. After a gradient is obtained for each weight, the weight is updated in the opposite (negative) direction. In this study, we used the trip assignment probability concept, but the probability could not be used as an output in the modeling because of limitations in data acquisition. When we applied backpropagation to this problem, the trip assignment probability could be recognized as the weight optimized in the artificial neural network. In other words, it could be approached as an optimization problem: finding a trip assignment probability that minimizes loss, that is, the difference between the estimated volume based on this probability and the observed volume. Therefore, the trip assignment probability was estimated using an optimization technique based on backpropagation. Figure 3: The trip assignment probability concept. In addition, considering that accessible stations may vary depending on the line, the trip assignment probability was estimated using a combination of zones and lines, not just zones. We assumed that there were \(n\) accessible stations for each combination of zones and lines; thus, \(n\) probabilities for each combination were estimated using the optimization algorithm. If there were \(N\) combinations and \(n\) accessible stations for each combination, (\(N\times n\)) probabilities needed to be estimated. The sum of the probabilities for \(n\) accessible stations is 1. The trips provided as a combination of zones and lines were assigned to each accessible station, along with their probabilities, and the assigned trips were added up for each station to calculate the boarding/alighting volume at each station. However, to apply this backpropagation concept, the loss calculation process must be differentiable. In this study, PyTorch 1.11 [44] was used, a deep learning framework used for artificial neural network learning, and it provided the loss value using only differentiable calculations. Backpropagation is the basic principle for weight updates, and several optimization algorithms exist depending on how backpropagation is applied. In this study, the AdamW algorithm [45] was applied as the optimization algorithm, and MSELoss (mean squared error loss) was used as the loss function as shown in Figure 11. The procedure is shown in Figure 4, and its detailed codes are presented in Figure 12 for readers to better analyze and repeat the experiment. The optimization calculation process is explained based on an example with a smaller dataset than the actual dataset used. The initial value of the trip assignment probability weight was constructed to be inversely proportional to the square of the Euclidean distance from zones to stations and proportional to the train frequency at the station, with reference to the gravity model [46]. The accessible stations were set to the three nearest stations. First, to obtain the trip assignment probability weight tensor of only accessible stations, the probability weight tensor for all stations (\(T_{a}\)) with each combination of zones and lines is multiplied by the accessible station tensor (\(T_{b}\)), where each entry has a value of \(1\) if  
Figure 4: The backpropagation-based optimization algorithm in this study. the station is accessible; otherwise, it is 0 (a tensor refers to any data structure with a scalar, vector, matrix, or more dimensions).