Cold front path classification method based on ResNet-50 model
Through the transfer learning method based on the ResNet-50 model, the problems of low efficiency and strong subjectivity in the traditional cold front path classification method were solved, and efficient and accurate cold front path automatic classification and visualization were achieved.
Patent Information
- Application Number
- CN202510775806.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-19
AI Technical Summary
Traditional cold front path classification methods rely on manual analysis, which has low processing efficiency and the results are affected by subjective factors, making it difficult to achieve efficient and accurate cold front path classification.
A transfer learning method based on the ResNet-50 model was adopted to obtain cold front path data in the Eurasian region, screen the cold front paths in China, draw line maps, perform manual label encoding, and use the pre-trained ResNet-50 model for training and testing to achieve automatic classification of cold front paths.
The automation level and accuracy of cold front path classification have been improved, and the spatial distribution characteristics of different types of cold front paths can be intuitively displayed, thereby improving the level of meteorological services.
Smart Images

Figure CN120670949A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cold front path classification, and in particular to a cold front path classification method based on a ResNet-50 model. Background Art
[0002] Cold fronts are one of the key systems that influence weather changes. As an important driving force of weather change, their movement paths have a decisive impact on weather conditions in different regions. Cold fronts with different paths interact with the surrounding atmospheric environment in different ways during their movement, resulting in weather phenomena such as precipitation, strong winds, and cooling in the areas they affect. Classifying cold front paths can more accurately predict future weather changes in specific areas and prepare for extreme weather in advance. Therefore, cold front path classification is an extremely critical and far-reaching task in the field of meteorological research, playing an indispensable role in fully understanding the laws of weather changes and improving the level of meteorological services.
[0003] Traditional cold front path classification methods rely primarily on manual analysis, analyzing the cold front's direction, speed, intensity, and impact on the weather. While this method can describe the movement patterns of cold fronts to a certain extent, it suffers from two limitations: first, its reliance on manual operation leads to low processing efficiency; second, its strong reliance on experience causes the analysis results to be significantly influenced by subjective factors. The development of deep learning technology, especially the successful application of convolutional neural networks (CNNs) in image recognition, has provided new research ideas for cold front path classification. ResNet-50, as a deep residual network, has powerful feature extraction capabilities. By introducing residual connections, it effectively solves the vanishing gradient problem in deep networks and can better capture the complex features of cold front paths.
[0004] Therefore, it is necessary to propose a cold front path classification method for China based on the ResNet-50 model, which can make full use of the ResNet-50 model through transfer learning, break through the limitations of traditional methods, and bring more efficient and accurate solutions to cold front path classification research, greatly promoting the in-depth exploration and development of meteorology in this field. Summary of the Invention
[0005] The purpose of the present invention is to provide a cold front path classification method based on the ResNet-50 model, which can realize the transfer learning classification method based on the ResNet-50 model on the basis of cold front path visualization, and help to improve the automation level and accuracy of cold front path classification.
[0006] To achieve the above object, the present invention provides the following solutions:
[0007] A cold front path classification method based on the ResNet-50 model includes the following steps:
[0008] S1. Obtain a cold front path dataset based on automatic tracking of cold front paths in the Eurasian region;
[0009] S2. Based on the cold front path dataset, the cold front path is filtered according to the China map mask to obtain the cold front path affecting China;
[0010] S3. Draw a line map of the cold front path affecting China, including interpolation processing, path smoothing, and image storage.
[0011] S4. Manually labeling some cold front paths in the cold front path line diagram based on the K-means clustering result to obtain a cold front path label set;
[0012] S5. Input the cold front path label set into the pre-trained ResNet-50 model to train and test the model and obtain a trained classification model.
[0013] S6. identifying and classifying the unlabeled cold front paths in the cold front path line graph based on the trained classification model to obtain a classification result;
[0014] S7. Make the classification results into a cold front path category density map to intuitively display the spatial distribution characteristics of different categories of cold front paths.
[0015] Preferably, in S2, the cold front path is filtered according to the China map mask, and the cold front path affecting China is obtained, which specifically includes:
[0016] S201. Filtering the cold front paths overlapping with the mask area according to the China map mask file;
[0017] S202: Convert the filtered cold front path data into a grd format.
[0018] Preferably, in S3, drawing the cold front path line diagram specifically includes:
[0019] S301, interpolating the screened cold front path into a plurality of evenly distributed points;
[0020] S302, sorting and interpolating the cold front path data to generate a high-resolution smooth path;
[0021] S303: Draw a line diagram of the cold front path and save it as a PNG format image.
[0022] Preferably, in S4, manual label encoding is performed on some cold front paths in the cold front path line diagram based on the K-means clustering result, and the obtained cold front path label set specifically includes:
[0023] S401, using the K-means algorithm to perform unsupervised clustering on the cold front path to obtain a K-means clustering result, and further subdividing the K-means clustering result based on geographical feature differences to obtain an optimized classification result;
[0024] S402 : performing manual label coding on some cold front paths in the cold front path line diagram according to the optimized classification result, and generating a CSV file containing file names and labels.
[0025] Preferably, the training and testing of the model in S5 specifically includes:
[0026] S501, performing data enhancement on the cold front path label set, including random flipping, rotation, brightness or contrast adjustment, and normalization processing;
[0027] S502, dividing the cold front path label set into a training set, a validation set, and a test set in proportion;
[0028] S503. Load the pre-trained ResNet-50 model and improve it by replacing the fully connected layer and adding the Dropout layer and the linear layer to adapt it to the cold front path classification task.
[0029] S504, setting the cross entropy loss function, Adam optimizer and dynamic learning rate adjustment strategy;
[0030] S505. Fine-tune the model weights using the training set and combine it with the validation set early stopping mechanism to prevent overfitting.
[0031] S506: Save the optimal model weights and output the classification performance indicators.
[0032] Preferably, in S503, the improvement to the ResNet-50 model includes:
[0033] The original fully connected layer is replaced with a sequential structure including a Dropout layer, a 256-dimensional linear layer, a ReLU activation function, and a 128-dimensional linear layer, and finally outputs 5 categories of cold front path classification results.
[0034] Preferably, in S7, generating the classification result into a cold front path category density map specifically includes:
[0035] S701, extracting the cold front path file name and corresponding latitude and longitude data from the classification results, and storing them by category;
[0036] S702. Draw overall and categorized cold front path density maps based on geographic information, and mark the proportion and average path of each category.
[0037] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the cold front path classification method based on the ResNet-50 model as described above is implemented.
[0038] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0039] (1) The present invention provides a cold front path classification method based on the ResNet-50 model, based on cold front path data automatically tracked in the Eurasian region. The method includes multiple steps: screening cold front paths that affect China, drawing a line map of the cold front paths, creating a cold front path label set through manual label encoding, training and testing the label set using a pre-trained ResNet-50 model, and classifying the cold front paths using the trained model weights. Through the present invention, a transfer learning classification method based on the ResNet-50 model can be implemented based on the visualization of the cold front paths, which helps to improve the automation level and accuracy of cold front path classification.
[0040] (2) The present invention visualizes the cold front paths that have been screened out and then creates a cold front path label set. It uses the pre-trained deep learning model ResNet-50 to classify the cold front paths, and obtains better cold front path classification results. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 A flow chart of a cold front path classification method for China based on the ResNet-50 model provided by the present invention;
[0043] Figure 2 Schematic diagram of the process of implementing ResNet-50 model training and testing in step S5 of the present invention;
[0044] Figure 3 This is an example of a line diagram of the cold front path obtained in step S3 of the present invention;
[0045] Figure 4 is the K-means clustering density map used in step S4 of the present invention;
[0046] Among them, (a) is the K-means cluster density map of all paths, (b) is the K-means cluster density map of category 1, (c) is the K-means cluster density map of category 2, (d) is the K-means cluster density map of category 3, and (e) is the K-means cluster density map of category 4;
[0047] Figure 5 The manual label coding area map used in step S4 of the present invention;
[0048] Figure 6 This is an example diagram of the cold front path label obtained in step S4 of the present invention;
[0049] Among them, (a)-(b) are examples of cold front paths of category 1 (label 0), (c)-(d) are examples of cold front paths of category 2 (label 1), (e)-(f) are examples of cold front paths of category 3 (label 2), (g)-(h) are examples of cold front paths of category 4 (label 3), and (i)-(j) are examples of cold front paths of category 5 (label 4).
[0050] Figure 7 The cold front path category density map affecting China obtained in step S7 of the present invention;
[0051] Among them, (a) is the total path density map, (b) is the path density map of category 1, (c) is the path density map of category 2, (d) is the path density map of category 3, (e) is the path density map of category 4, and (f) is the path density map of category 5. DETAILED DESCRIPTION
[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0053] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0054] like Figure 1 As shown, the present invention provides a cold front path classification method based on the ResNet-50 model, comprising the following steps:
[0055] S1. Obtain a cold front path dataset based on automatic tracking of cold front paths in the Eurasian region;
[0056] S2. Based on the cold front path dataset, the cold front path is filtered according to the China map mask to obtain the cold front path affecting China;
[0057] S3. Draw a line map of the cold front path affecting China, including interpolation processing, path smoothing, and image storage.
[0058] S4. Manually labeling some cold front paths in the cold front path line diagram based on the K-means clustering result to obtain a cold front path label set;
[0059] S5. Input the cold front path label set into the pre-trained ResNet-50 model to train and test the model and obtain a trained classification model.
[0060] S6. identifying and classifying the unlabeled cold front paths in the cold front path line graph based on the trained classification model to obtain a classification result;
[0061] S7. Make the classification results into a cold front path category density map to intuitively display the spatial distribution characteristics of different categories of cold front paths.
[0062] In a specific embodiment, the method includes: first collecting a cold front path dataset based on automatic tracking of cold front paths in the Eurasian region, screening the cold front paths that affect China, drawing a line map of the cold front paths, manually labeling some of the cold front paths to form a cold front path label set, using the label set to input a pre-trained ResNet-50 model for training and testing, using the trained model to identify and classify unlabeled cold front path data, and finally producing the classification results into a category density map of cold front paths that affect China to intuitively display the classification results. Figure 2 As shown, the dataset is preprocessed and data augmented, and the label set is divided into training, validation, and test sets according to a certain ratio. The pre-trained ResNet-50 is used as the base model. By replacing its fully connected layer, adding a dropout layer and an additional linear layer, it is transformed into a model that can ultimately output num_classes categories. An appropriate loss function and optimizer are set, and the divided dataset is input into the model for classification training and testing. Finally, the model performance in the validation phase is evaluated. The method includes the following steps:
[0063] Step S1: Collection of cold front path data. A cold front path dataset is collected based on automatic tracking of cold front paths in the Eurasian region. Each dataset includes multiple cold fronts at different times. The center point of a cold front constitutes a cold front path. The longitude and latitude of the center point are stored separately in .txt format and named by the initial time of the cold front path: "col / row year-month-day-time_serial number".
[0064] Step S2: Filter the cold front path according to the China map mask to obtain the cold front path affecting China.
[0065] Step S201: Filter cold front paths using the China border mask and extract the corresponding files. Load the China border mask file, china_mask.grd, into a two-dimensional array. Read the longitude and latitude information for each cold front path, creating a two-dimensional array to mark the locations of these paths. Check whether these paths overlap with the China border mask. If so, the path affects China. Copy the longitude and latitude information files for the selected paths from the source folder to the "CN_zzlujing_center" folder.
[0066] Step S202: Convert the cold front path data to grd format. Read the x-coordinate (longitude) and y-coordinate (latitude) of the cold front path, and convert the read coordinates into NumPy arrays x and y. Initialize a 224×480 two-dimensional array cen, with all elements initially set to 0. According to the coordinate values in the x and y arrays, set the corresponding positions in the cen array to 1, indicating that the cold front path passes through these points. Reshape the two-dimensional array cen into a one-dimensional array data_vector, use the struct.pack function to pack the one-dimensional array data_vector into binary format data, and then store it in grd format.
[0067] Step S3: Draw a line diagram of the cold front path.
[0068] Step S301: Interpolate the selected cold front path into 20 points. Define an interpolation function returndot and use the numpy.linspace function of the NumPy library in Python to generate 20 equally spaced points between the starting and ending longitudes of the path. These points will be used as the interpolated x-coordinates. Then use the np.interp function of the NumPy library to linearly interpolate these 20 equally spaced x-coordinates based on the original x- and y-coordinates to obtain the corresponding y-coordinates. Combine the interpolated x- and y-coordinates into a two-dimensional array dot, where each row represents the coordinates of a path point.
[0069] Step S302: Path data processing and interpolation. Read the .grd file obtained in step S202. For each file, reshape the data into a two-dimensional array and reverse the array to match the actual geographic direction. The function then identifies the points on the path and sorts them by longitude. If the distance between the start and end points of a path is at least 20 grid intervals, and the path trajectory is greater than 2 time periods, the path is interpolated using the interpolation function returndot defined in step S301. Each path generates 20 evenly distributed points, and the longitude and latitude of the path are stored as .txt files, still named "col / row year-month-day-time_serial number".
[0070] Step S303: Draw the cold front path line. Read the longitude and latitude data of the cold front path. To ensure the continuity of the path, use the argsort function of the Numpy library to sort the longitude data. Perform the same sorting operation on the corresponding latitude data. Then, interpolate the longitude and latitude data to a resolution of 0.25 degrees to produce a smoother cold front path. Finally, use the ax.plot function to draw the cold front path, where the x and y coordinates correspond to the interpolated longitude and latitude, respectively. Set the line color to blue and the line width to 2. Add a legend (dimensionless units) and set the chart title to include date information.
[0071] Step S304: After the drawing is completed, the result is saved as a .png format file, named "year, month, day, time_serial number", and stored in the "center_images" folder. Figure 3 Taking the cold front moving path numbered n at 12:00 on February 15, 2006 as an example, the drawing results of this cold front path are shown.
[0072] Step 4: Based on K-means clustering results ( Figure 4 ) Manually label some cold front paths and obtain the cold front path label set.
[0073] like Figure 4 As shown in (a)-(e), step S401: performing cold front path classification optimization based on K-means clustering results. Figure 4 This is the density distribution diagram of the K-means clustering results of the cold front path data. First, the K-means algorithm is used to perform unsupervised clustering on the cold front path, and the initial 4 categories are obtained. However, in the clustering results, category 2 ( Figure 4Middle (c) accounts for 46.96%, which covers a vast area from 20°N to 60°N and 100°E to 150°E, including both the high-latitude paths of the Northeast Plain and the low-latitude paths of the South China Hills. Although the K-means algorithm achieves effective clustering in the dimension of spatial continuity, the algorithm itself is not sensitive enough to the differences in geographical features, resulting in the Northeast cold front path and the South China cold front path with significant meteorological differences being merged into the same category. Therefore, this category is further subdivided to achieve a refined expression of the regional characteristics of cold front activity, and finally 5 category ranges are obtained ( Figure 5 ), corresponding to labels 0-4 as shown in Table 1. The mapping relationship between categories and labels is shown in the following table. This method not only retains the statistical significance of the K-means algorithm but also strengthens the meteorological interpretation of the classification results through manual optimization.
[0074] Table 1
[0075]
[0076] Step S402: Manually label the cold front path according to the optimization results to obtain a cold front path label set. Based on the position range of these 5 categories, select some cold front path images and assign them to one of the 5 predefined categories. Then, according to the mapping relationship between categories and labels (as shown in the table above), assign a unique numerical label (0-4) to each image. Record the file name of each image and its corresponding label in a .csv file. The first column of the file is the file name and the second column is the corresponding label. Store the labeled images separately in the "train_images" folder. The present invention defines 5 types of path types (labels 0-4). Typical examples of each type of path are as follows. Figure 6 As shown, Figure 6 (a)-(b) show examples of cold front paths of category 1 (label 0). Figure 6 (c)-(d) show examples of cold front paths of category 2 (label 1). Figure 6 (e)-(f) show examples of cold front paths of category 3 (label 2). Figure 6 (g)-(h) show examples of cold front paths of category 4 (label 3). Figure 6 Panels (i)-(j) show examples of cold front paths of category 5 (label 4).
[0077] Step S5: Input the cold front path label set into the pre-trained ResNet-50 model for training and testing.
[0078] like Figure 2As shown, step S501: preprocessing and data enhancement of the dataset. Call the transforms.Resize() function in torchvision to change the input image size to 224×224. For the initial cold front path image dataset, call the transforms.RandomHorizontalFlip() function to perform random horizontal flipping. Then apply transforms.RandomRotation(15) to randomly rotate the image with a maximum angle of ±15 degrees. Use transforms.ColorJitter to randomly adjust the brightness, contrast, saturation and hue of the image. The specific parameters are brightness = 0.2, contrast = 0.2, saturation = 0.2 and hue = 0.1. Finally, call the transforms.ToTensor() function to convert the image into a Tensor, and normalize the pixel values to the range of [0,1], and then perform normalization through the transforms.Normalize() function.
[0079] Step S502: Split the dataset into training, validation, and test sets according to a certain ratio. Use the train_test_split function to split the dataset into a training set and a temporary set in a ratio of 7:3. The temporary set is further split into a validation set and a test set in a ratio of 1:1. To ensure repeatability of the split, set random_state to 42. Create a ColdFrontDataset object using the split dataset and encapsulate it as an iterable data loader using DataLoader for use in the training, validation, and testing phases.
[0080] Step S503: Use the pre-trained ResNet-50 model and fine-tune it. Use the ResNet-50 pre-trained model and load the weights pre-trained on the ImageNet1K dataset. Replace the original fully connected layer of ResNet-50 with a sequence of multiple linear layers. These linear layers are connected by non-linear activation functions (ReLU) and Dropout layers. From front to back, there is a Dropout layer with p = 0.5. The first linear layer maps the output features of ResNet-50 to 256 dimensions, ReLU activation function, Dropout layer with p = 0.5, the second linear layer maps 256 features to 128 features, ReLU activation function, and the last linear layer maps 128 features to num_classes output categories.
[0081] Step S504: Set the loss function and optimizer. In order to optimize the model training process, the cross entropy loss function is selected as the loss function of the model, and the Adam optimizer is used to further regularize the model through weight decay. Using the ReduceLROnPlateau learning rate scheduler, when the validation set loss does not improve in multiple consecutive epochs, the learning rate will automatically decrease. According to the recognition task of this step, the following training parameters are set: in the target detection stage, set num_classes = 5, batch_size = 32, lr_drop = 5, l = 1e-4, weight_decay = 1e-4, factor = 0.1, patience = 5
[0082] Step S505: Input the partitioned dataset to train and test the model for classification, obtaining a trained classification model. The model first performs forward propagation, passing the input image through the network to generate output predictions. Next, the cross-entropy loss function is used to calculate the loss between the model output and the true label. This loss value reflects the degree of difference between the model prediction and the actual label. Subsequently, the gradient is calculated through the backpropagation mechanism of the loss function, and the model weight parameters are updated using the Adam optimizer. At the beginning of each iteration, the optimizer.zero_grad() call is used to clear the gradient.
[0083] Step S506: Evaluate model performance and save model weights during the validation phase. During the validation phase of each epoch, the model is switched to evaluation mode, disabling mechanisms such as dropout and batch normalization to simulate real-world performance. The model also processes the input images and labels from the validation data loader batch by batch and performs a forward pass to generate output predictions. Similar to the training phase, we use the cross-entropy loss function to calculate the loss for each batch. Based on the model's predictions, we calculate performance metrics such as accuracy, precision, recall, and F1 score on the validation set to help evaluate the model's performance on unseen data. To further optimize the training process and prevent overfitting, we introduce an early stopping mechanism. If the validation set loss does not improve for 10 consecutive epochs, the early stopping mechanism is triggered. After training is complete, the model weights, model_weights.pth, are saved to the specified path.
[0084] Step S6: Use the trained model weights to identify and classify the cold front path data. Set the transform to T.Resize(224, 224) and T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]), load the trained network, set num_classes to 5, call model.eval() to set the model to evaluation mode, disable training-related operations such as Dropout, select the 47-round weights model_weights.pth for classification, and save the classification results of the cold front path dataset, saving each category in a different folder.
[0085] Step S7: The obtained classification results are made into a density map of cold front paths affecting China.
[0086] Step S701: Extract the names of the image files in each category folder and store them as date information in a .txt file named "pathX_date" in the corresponding "pathX" folder. For example, all image file names in the Category 1 folder will be extracted and stored in the path1_date.txt file in the "path1" folder. Similar information applies to other paths. The names of the cold front path dataset are also extracted and stored in the date.txt file.
[0087] Step S702: Copy and rename the relevant path longitude and latitude files. Using the file name list generated in step S701, copy the longitude and latitude files obtained in step S302 (named "col / row+year-month-day-time_serial number") and rename them to "pathX_x / y_year-month-day-time_serial number" to the corresponding "pathX" folder. For example, if path1_date.txt contains the date 2006012000_0, then the longitude information col2006012000_0.txt file and the latitude information row2006012000_0.txt file for the cold front path will be copied to the "path1" folder and renamed path1_x_2006012000_0.txt and path1_y_2006012000_0.txt, respectively.
[0088] Step S703: Visualize the overall and different categories of cold front path data. Define multiple drawing functions, including draw_all and draw_path1 through draw_path5. Taking the draw_all function as an example, a 600×600 density matrix is initialized to store path density information. Date information is read from the date.txt file, and for each date, path data is read from the corresponding longitude and latitude files. Cubic spline interpolation is performed on these path data, increasing their resolution to 0.1 degrees, and the interpolation results are rounded to integer multiples of 0.1. Then, np.digitize is used to map the longitude and latitude data to density matrix indices, ensuring that they cover the range of 40°E to 160°E and 0° to 66°N. For indices within the range, the density matrix values at the corresponding locations are accumulated; for indices outside the range, an out-of-bounds message is output. Finally, a mask is generated based on the density matrix, and a density distribution map is plotted using the plt.get_cmap('Blues') palette. A color bar and map features are added to visualize the path density. The operations of the draw_path1 through draw_path5 functions are similar, except that they read date information from the pathX / pathX_date.txt file (where X is 1 to 5) and longitude and latitude data from the corresponding pathX_x_{dd}.txt and pathX_y_{dd}.txt files. After calculating the density matrix, the percentage of paths in that category relative to the total number of paths (1756) is displayed on the right side of the subplot. The average path is calculated and plotted in red. The corresponding color bar and map features are added, and the subplot title is set.
[0089] Step S704: Draw the cold front path density map. Create a graph with a size of (7,4) and a resolution of 500, and add six subgraphs ax1 to ax6. Call the draw_all, draw_path1 to draw_path5 functions to draw the corresponding cold front path density maps on different subgraphs. Finally, the following is obtained: Figure 7 Density maps of different categories of cold front paths shown in (a)-(f).
[0090] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the cold front path classification method based on the ResNet-50 model as described above is implemented.
[0091] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0092] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.
Claims
1. A cold front path classification method based on the ResNet-50 model, characterized in that: The following steps are involved: S1. Obtain a cold front path dataset based on automatic tracking of cold front paths in the Eurasian region; S2. Based on the cold front path dataset, the cold front path is filtered according to the China map mask to obtain the cold front path affecting China; S3. Draw a line map of the cold front path affecting China, including interpolation processing, path smoothing, and image storage. S4. Manually labeling some cold front paths in the cold front path line diagram based on the K-means clustering result to obtain a cold front path label set; S5. Input the cold front path label set into the pre-trained ResNet-50 model to train and test the model and obtain a trained classification model. S6. identifying and classifying the unlabeled cold front paths in the cold front path line graph based on the trained classification model to obtain a classification result; S7. Make the classification results into a cold front path category density map to intuitively display the spatial distribution characteristics of different categories of cold front paths.
2. The cold front path classification method based on the ResNet-50 model according to claim 1 is characterized in that: In S2, the cold front path is filtered according to the China map mask, and the cold front path affecting China is obtained, which specifically includes: S201. Filter the cold front paths that overlap with the mask area according to the China map mask file; S202: Convert the filtered cold front path data into a grd format.
3. The cold front path classification method based on the ResNet-50 model according to claim 1, characterized in that: In S3, drawing the cold front path line diagram specifically includes: S301, interpolating the screened cold front path into a plurality of evenly distributed points; S302, sorting and interpolating the cold front path data to generate a high-resolution smooth path; S303: Draw a line diagram of the cold front path and save it as a PNG format image.
4. The cold front path classification method based on the ResNet-50 model according to claim 1, characterized in that: In S4, based on the K-means clustering result, manual label encoding is performed on some cold front paths in the cold front path line diagram, and the obtained cold front path label set specifically includes: S401, using the K-means algorithm to perform unsupervised clustering on the cold front path to obtain a K-means clustering result, and further subdividing the K-means clustering result based on geographical feature differences to obtain an optimized classification result; S402 : performing manual label coding on some cold front paths in the cold front path line diagram according to the optimized classification result, and generating a CSV file containing file names and labels.
5. The cold front path classification method based on the ResNet-50 model according to claim 1, characterized in that: The training and testing of the model in S5 specifically include: S501, performing data enhancement on the cold front path label set, including random flipping, rotation, brightness or contrast adjustment, and normalization processing; S502, dividing the cold front path label set into a training set, a validation set, and a test set in proportion; S503. Load the pre-trained ResNet-50 model and improve it by replacing the fully connected layer and adding the Dropout layer and the linear layer to adapt it to the cold front path classification task. S504, setting the cross entropy loss function, Adam optimizer and dynamic learning rate adjustment strategy; S505. Fine-tune the model weights using the training set and combine it with the validation set early stopping mechanism to prevent overfitting. S506: Save the optimal model weights and output the classification performance indicators.
6. The cold front path classification method based on the ResNet-50 model according to claim 5, characterized in that: In S503, the improvements to the ResNet-50 model include: The original fully connected layer is replaced with a sequential structure including a Dropout layer, a 256-dimensional linear layer, a ReLU activation function, and a 128-dimensional linear layer, and finally the cold front path classification result is output.
7. The cold front path classification method based on the ResNet-50 model according to claim 1, characterized in that: In S7, producing the classification results into a cold front path category density map specifically includes: S701, extracting the cold front path file name and corresponding latitude and longitude data from the classification results, and storing them by category; S702. Draw overall and categorized cold front path density maps based on geographic information, and mark the proportion and average path of each category.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements a cold front path classification method based on the ResNet-50 model according to any one of claims 1 to 7.