## 2 Method
### Domain Sparse Constrained Loss Function  
Building upon the foundational concepts of computer vision and image classification, the third component of our research introduces a uniquely tailored mechanism--the Domain Sparse Constrained Loss Function. This innovative approach to handling the intricacies of pavement distress classification is borne out of the need to explicitly incorporate the sparse nature of pavement distresses into our model's learning process.  
Figure 4 portrays the distinct difference in feature space distribution between conventional image classification tasks and the specialized domain of pavement images. The left shows the feature distribution pattern of usual computer vision tasks, the middle shows the sparse feature distribution specific to the road distress domain, and the right shows our proposed loss function dedicated to optimizing the feature extraction by exploiting the distance between sparse clusters. The key objective of our function is to discern and distinguish these sparse, yet critical, features in the pavement images. The loss function, by imposing a distance-based separation, helps to accentuate the sparse features, thereby facilitating their recognition and classification.  
Unlike traditional loss functions, our design takes into account the sparsity of target features in pavement image data. This tailoring to the specifics of pavement distresses ensures the optimal extraction and classification of the sparse features. In essence, we modify the original loss function by incorporating a term for \(L1\) regularization, which helps enforce sparsity in the extracted features:  
\[L_{final}=L_{CrossEntropy}+\lambda\times L1\_loss \tag{1}\]  
where \(L_{CrossEntropy}\) is the cross entropy loss function typically used in classification tasks, and \(L1_{loss}\) is the \(L1\) regularization term. The \(\lambda\) factor in this equation is a hyperparameter that controls the degree of regularization, striking a balance between the original loss and the imposed sparsity constraint (is 1 in this case). The \(L1\) regularization term is defined as the sum of the absolute values of the weights in our model's dilated convolution modules, a formulation known for its property of promoting sparsity:  
\[L1\_loss=\sum_{\text{Sparse Module}}||\text{weight}||_{1} \tag{2}\]  
In this equation, \(||weight||_{1}\) represents the \(L1\) norm of the weight matrix in the convolutional layer of each dilated convolution module.  
Moreover, the Domain Sparse Constrained Loss Function addresses the common challenges in handling sparse data. Conventional models often fall short in dealing with  
Figure 4: The figure illustrates the feature space for the conventional task as well as the feature space in the pavement image. In general, the feature distribution is more even, whereas the pavement domain is more sparse and concentrated, and the loss function we designed aims to clearly separate sparse features with distance.  
sparse data due to the risk of overfitting or inadequate feature extraction. Our custom loss function mitigates this by imposing a constraint that not only aligns with the data's natural distribution but also aids in maintaining a robust model by discouraging overfitting.  
To recap, the Domain Sparse Constrained Loss Function serves a dual purpose: Firstly, it improves the quality of feature extraction from sparse data by incorporating the nature of the data directly into the model's learning process. Secondly, it improves the overall robustness and performance of the model by mitigating the common challenges associated with handling sparse data.