## 3 Network Model Construction
### Microshock Magnitude Classification Model  
Convolutional neural networks (CNNs) learn hierarchical image features through successive convolution and pooling layers. However, increasing the network depth often leads to the vanishing gradient problem and performance degradation, which slows down convergence and reduces the classification accuracy. To address this issue, this study adopts a residual neural network (ResNet) architecture, which introduces shortcut connections between convolutional layers to form residual blocks. These connections enable the network to learn identity mappings, thereby preventing the loss function from increasing even as the depth grows. Transfer learning, particularly through pretraining and fine-tuning, has proven highly effective in image classification tasks. By leveraging pretrained weights from a large source domain (e.g., ImageNet), the model shown in Figure 4 can rapidly adapt to the target domain with a limited amount of labeled data. Specifically, we pretrain the ResNet on a source dataset, transfer the learned feature extractors, and retrain only the final fully connected layers on the target microseismic dataset. This approach exploits the similarities in the feature space between domains, thus enabling efficient knowledge transfer. To further enhance performance, an attention mechanism is integrated to dynamically weight feature channels, which helps focus on discriminative information and mitigate overfitting. The resulting transfer learning framework effectively leverages ResNet's capability for hierarchical feature extraction and attention-guided channel selection to improve the accuracy of microseismic magnitude classification. Transfer Learning Strategy Selection: Three common transfer learning approaches were considered. Last-layer fine-tuning: Only update the parameters of the final fully connected layer (classification head) while keeping all other layers frozen. Scratch training: Randomly initialize all weights and train the entire network from scratch. Full-modelfine-tuning: Use the pretrained ResNet18 weights as initialization, modify the classification layer, and fine-tune all layers on the target dataset [19]. Given the substantial domain shift between ImageNet (natural images) and microseismic waveform images, we adopted ResNet18 pretrained on ImageNet with full fine-tuning as the base model for this study. This approach was chosen for the following reasons:  
Rationale for Pretrained Model Selection: Despite the inherent differences between natural images and waveform line plots, the low-level convolutional kernels of the pre-trained ResNet18 (e.g., edge and texture detectors) can function as effective initial extractors for local waveform features. For instance, these kernels are capable of capturing critical amplitude jumps in waveforms, which are indicative of P-wave and S-wave arrivals. Fine-Tuning Strategy: By updating the weights of all layers during training, the higher layers of the network can adapt to waveform-specific patterns, such as temporal correlations between different seismic phases. This strategy effectively alleviates the domain mismatch between natural images and seismic data. Advantages Over Training from Scratch: Preliminary tests indicated that utilizing pretrained weights yields significantly better performance compared to training from scratch. The pretrained initialization provides a more robust starting point, enabling the model to converge more rapidly and achieve higher accuracy. This approach leverages the strengths of transfer learning while allowing the model to fully adapt to the unique characteristics of microseismic waveform data. Training with Cross-Entropy Loss: The model was trained using the cross-entropy loss function to minimize the divergence between the predicted and ground-truth probability distributions.