# Urban Color Perception and Sentiment Analysis Based on Deep Learning and Street View Big Data
## 2 Data and Methods
### Image-Aware Score Calculation and Classification  
This study employs a quantitative approach based on a deep learning framework initially proposed by Dr. [PERSON] [17], with the objective of modeling and predicting people's subjective perceptions of the physical environment of a specific location. In particular, this study utilizes a Deep Convolutional Neural Network (DCNN) model based on a Residual Network (ResNet) to parse high-level semantic information from images by employing street-level image representations of locations in conjunction with deep learning techniques. This approach enables the automatic and efficient measurement of subjective human perceptions of large urban environments, thereby offering novel perspectives and tools for urban environmental assessment and planning.  
In order to evaluate each image sample, a single-sample rating calculation method was employed. This method entailed comparing each image sample with as many other images as possible, with the perceived intensity of a particular dimension serving as the scoring criterion. The specific scoring process was calculated based on the percentage of selected images and their weighted sum. The specific calculation method is as follows:  
Firstly, the positive rate (P) and negative rate (N) of image i on a specific perceptual metric are defined as follows [17]:  
\[P_{i}=\frac{p_{i}}{p_{i}+e_{i}+n_{i}} \tag{1}\]  
\[N_{i}=\frac{n_{i}}{p_{i}+e_{i}+n_{i}} \tag{2}\]  
In this context, the variable \(p_{i}\) represents the number of times image i has been selected, while \(n_{i}\) denotes the number of times it has not been selected. The variable \(e_{i}\), on the other hand, signifies the number of times image i has been considered as equal to another image.  
Secondly, based on the aforementioned data, the Q-score of image i on a specific perceptual metric is further delineated as follows [17]:  
\[\text{Q}_{i}=\frac{10}{3}\left(P_{i}+\frac{1}{p_{i}}\text{$\sum_{k_{1}=1}^{p_ {i}}P_{k_{1}}$}-\frac{1}{n_{i}}\text{$\sum_{k_{2}=1}^{n_{k_{1}}}N_{k_{2}}$}+1\right) \tag{3}\]  
where \(k_{1}\) denotes the number of times image \(i\) is selected and \(k_{2}\) denotes the number of times image \(i\) is not selected. Although the final Q-score is actually calculated using the positive rate \(P_{i}\) of image \(i\), it needs to be corrected based on the selected and unselected frequencies \(P_{i^{\prime}}\) and \(N_{i^{\prime}}\) of the other images with which image i is compared. Finally, in order to normalize the scores to a range from 0 to 10, a multiplying factor of 10/3 is introduced into the equation and a constant term is added.  
The human perception prediction problem is approached as a binary classification task, whereby the dataset is divided into positive and negative groups based on the Q-scores of the samples. This approach allows for the straightforward categorization of the predicted images as either positive or negative. In order to minimize the introduction of noise and error, we initially calculated the mean \(\mu_{v}\) and standard deviation \(\sigma_{v}\) of the dataset, and introduced a ratio variable \(\delta\) to determine the threshold for classification. In particular, for image \(i\), whose Q-score is denoted as \(Q_{i}^{v}\) and its label as \(y_{i}^{v}\), this can be expressed as [17]:  
\[y_{i}^{v}=\left\{\begin{matrix}-1&if&Q_{i}^{v}<\mu_{v}-\delta\sigma_{v}\\ 1&if&Q_{i}^{v}>\mu_{v}+\delta\sigma_{v}\end{matrix}\right. \tag{4}\]  
where two thresholds \(-\mu_{v}-\delta\sigma_{v}\) and \(\mu_{v}+\delta\sigma_{v}\) define the boundaries of the positive and negative samples, with any data that fall between these two thresholds being deemed as \"noisy\" and subsequently being removed. The data are labeled as \"\(-1\)\" for negative samples and \"\(1\)\" for positive samples [17]. The variable \(\delta\) is employed to adjust the interval (i.e., bandwidth) between these two thresholds. By modifying the value of \(\delta\), we can observe and analyze changes in model performance.