Railway hazard identification method, device, electronic equipment and storage medium
Through the TE-ResUnet model and multi-scale Lovász-Softmax loss function, the problem of low recognition accuracy of hazardous sources along high-resolution remote sensing images is solved, and the recognition ability of hazardous sources and small targets is improved, and the high-speed High-precision identification of hazardous sources along the railway.
Patent Information
- Application Number
- CN202210280934.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-03-21
AI Technical Summary
The distribution of hazardous sources along high-resolution remote sensing images is relatively sparse, and there are many small targets. The existing land object recognition method based on deep convolutional neural networks has lower land object boundary recognition accuracy and small target recognition accuracy. question.
A method for identifying hazard sources of railways is proposed. By establishing a TE-ResUnet model, using shrink path module, extended path module, texture enhancement module and dimension reduction module, feature recognition and prediction recognition results are performed on high-resolution remote sensing images, combined with multi-scale The Lovász-Softmax loss function is trained end-to-end to optimize the model to improve recognition accuracy and stability.
The accuracy of hazard source identification, especially the accuracy of hazard source boundary identification and small target identification capabilities, improve the stability of the model, and achieve accurate identification of hazard sources along high-speed railways.
Smart Images

Figure CN114821351B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of remote sensing identification technology, and in particular to a railway hazard source identification method, device, electronic equipment and storage medium. Background Art
[0002] Dangerous sources such as aging colored steel roofs, loosely fixed dust-proof nets, and ground films along the high-speed railway are easily blown up by the wind and fall on the rails or high-speed railway power grids, thereby hindering the normal operation of high-speed railway lines and trains, and even causing major safety accidents. Ground surveys have always been the main means of detecting dangerous sources around railways. Notifying relevant departments and units to reinforce dangerous sources through ground surveys can effectively prevent such accidents. However, the limitations of manpower and material resources have an impact on the accuracy and efficiency of ground surveys, resulting in poor survey results. However, high-resolution satellite remote sensing images have the advantages of large range, spatiotemporal continuity, periodicity, easy acquisition, and low cost, and the spatial resolution of high-resolution remote sensing images has reached the centimeter level, which can clearly present railway dangerous sources. Therefore, the use of high-resolution remote sensing image object recognition technology can accurately identify and dynamically monitor the relevant dangerous source information along the railway.
[0003] However, the distribution of hazardous sources along the high-speed railway in high-resolution remote sensing images is relatively sparse, with many small targets, and the intra-class differences of the same type of hazardous sources are also relatively large, which brings certain technical difficulties to the identification of hazardous sources in high-resolution remote sensing images, and puts forward high requirements on the accuracy and stability of the identification method. At present, semantic segmentation technology is usually used in the recognition and classification of objects in high-resolution remote sensing images. Deep convolutional neural networks have achieved good results in the field of semantic segmentation of natural images, and have therefore been widely used in this task. However, although the existing object recognition methods based on deep convolutional neural networks have achieved an improvement in the accuracy of object recognition within a certain range, there are still problems with low accuracy in object boundary recognition and small target recognition. Summary of the invention
[0004] In order to solve the above problems, the present invention provides a railway hazard source identification method, device, electronic equipment and storage medium.
[0005] The present invention provides a railway hazard source identification method, comprising:
[0006] Acquire remote sensing images along the railway;
[0007] The remote sensing image is input into the hazard source identification model to obtain the railway hazard source identification result; wherein the training process of the hazard source identification model is as follows:
[0008] Step 1: Obtain sample remote sensing images along the railway, and annotate the hazard sources in the sample remote sensing images pixel by pixel to generate hazard source labels;
[0009] Step 2: Establish a TE-ResUnet model, which includes a contraction path module, an expansion path module, a texture enhancement module and a dimension reduction module; wherein the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing image to generate multiple feature maps from shallow scale to deep scale; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain a plurality of processed feature maps; the texture enhancement module is used to crop and copy the contraction path module through a jump connection layer in the expansion path module. The two feature maps of the shallower scale output by the expansion path module and the two feature maps of the shallower scale output by the contraction path module are subjected to texture enhancement processing before upsampling; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimension reduction module is used to perform dimension reduction processing on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimension reduction processing on the second feature map upsampled by the expansion path module, so as to obtain multiple hazard source prediction and identification results of different scales;
[0010] Step 3: Calculate the multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label, use back propagation to complete end-to-end training, obtain the optimal TE-ResUnet model, and use the optimal TE-ResUnet model as the hazard source identification model.
[0011] Optionally, the texture enhancement module is used to perform texture enhancement processing on the two feature maps of the shallower scale output by the contraction path module before the expansion path module crops and copies the two feature maps of the shallower scale output by the contraction path module through the skip connection layer and performs upsampling processing on the two feature maps of the shallower scale output by the contraction path module, including:
[0012] The texture enhancement module uses a histogram quantization method to quantize and count the texture information of the two feature maps of the shallower scale output by the contraction path module. Each level of quantization represents a texture, and a learnable graph network is constructed to reconstruct each quantization level to achieve texture detail enhancement.
[0013] Optionally, the multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label is calculated, and the end-to-end training is completed by back propagation to obtain the optimal TE-ResUnet model, including:
[0014] A first Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the first feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A second Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A third Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the upsampling process of the extension path module and the dimensionality reduction process by the dimensionality reduction module, and the hazard source label is performed on the second feature graph.
[0015] The weighted sum of the first Lovász-Softmax loss, the second Lovász-Softmax loss and the third Lovász-Softmax loss is used as the target loss, and the TE-ResUnet model is optimized according to the target loss. When the target loss is less than a preset threshold, the training ends, thereby obtaining the optimal TE-ResUnet model.
[0016] Optionally, the target loss L Total for:
[0017]
[0018] Among them, λ1, λ2, λ3 are the weights of the three scale loss functions, ΔJ L is the Lovász-Softmax loss function, y* is the hazard source label, The hazard source prediction and identification results output by TE-ResUnet are: is the feature graph after dimension reduction processing in the extended path module, y D2 *To downsample the original hazard source label by 2 times, It is the result of dimensionality reduction of the feature map after texture enhancement processing in the extension path module.
[0019] Optionally, before inputting the remote sensing image into the hazard source identification model, the method further includes:
[0020] The sliding window method is used to process remote sensing images whose image size is larger than a preset threshold.
[0021] The present invention also provides a railway hazard source identification device, comprising:
[0022] An acquisition module is used to acquire remote sensing images along the railway;
[0023] The processing module is used to input the remote sensing image into the hazard source identification model to obtain the railway hazard source identification result; wherein the training process of the hazard source identification model is as follows:
[0024] Acquire sample remote sensing images along the railway, and annotate the hazard sources in the sample remote sensing images pixel by pixel to generate hazard source labels;
[0025] A TE-ResUnet model is established, and the TE-ResUnet model includes a contraction path module, an expansion path module, a texture enhancement module and a dimension reduction module; wherein the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing image to generate multiple feature maps from shallow scale to deep scale; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain a plurality of processed feature maps; the texture enhancement module is used to crop and copy the contraction path module through a jump connection layer in the expansion path module. Before upsampling the two feature maps of the shallower scale output by the block and the two feature maps of the shallower scale output by the contraction path module, texture enhancement is performed on the two feature maps of the shallower scale; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimension reduction module is used to perform dimension reduction on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimension reduction on the second feature map upsampled by the expansion path module, so as to obtain multiple hazard source prediction and identification results of different scales;
[0026] The multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label is calculated, and the end-to-end training is completed by back propagation to obtain the optimal TE-ResUnet model, and the optimal TE-ResUnet model is used as the hazard source identification model.
[0027] Optionally, the processing module is further specifically used for:
[0028] A first Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the first feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A second Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A third Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the upsampling process of the extension path module and the dimensionality reduction process by the dimensionality reduction module, and the hazard source label is performed on the second feature graph.
[0029] The weighted sum of the first Lovász-Softmax loss, the second Lovász-Softmax loss and the third Lovász-Softmax loss is used as the target loss, and the TE-ResUnet model is optimized according to the target loss. When the target loss is less than a preset threshold, the training ends, thereby obtaining the optimal TE-ResUnet model.
[0030] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned methods for identifying railway hazards are implemented.
[0031] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned railway hazard source identification methods are implemented.
[0032] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned railway hazard source identification methods are implemented.
[0033] The present invention provides a railway hazard source identification method, device, electronic device and storage medium. First, a remote sensing image along the railway is obtained, and then the remote sensing image is input into a hazard source identification model to obtain a railway hazard source identification result; wherein, the training process of the hazard source identification model is as follows: Step 1: obtain a sample remote sensing image along the railway, and annotate the hazard source in the sample remote sensing image pixel by pixel to generate a hazard source label; Step 2: establish a TE-ResUnet model, and the TE-ResUnet model includes a contraction path module, an expansion path module, a texture enhancement module and a dimensionality reduction module; wherein, the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing image to generate multiple feature maps from shallow scale to deep scale; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain multiple feature maps after processing; the texture enhancement module is used to crop and copy the contraction path module through a jump connection layer in the expansion path module The two feature maps of the shallower scale output by the module and the two feature maps of the shallower scale output by the contraction path module are texture enhanced before upsampling; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimensionality reduction module is used to perform dimensionality reduction processing on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimensionality reduction processing on the second feature map upsampled by the expansion path module, so as to obtain hazard source prediction and identification results of multiple different scales; step 3: calculate the multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label, use back propagation to complete end-to-end training, obtain the optimal TE-ResUnet model, and use the optimal TE-ResUnet model as the hazard source identification model. It can be seen that the present invention establishes a TE-ResUnet model for railway hazard source identification in high-resolution remote sensing images. On the one hand, the texture details of low-level features are enhanced through the texture enhancement module, thereby improving the accuracy of hazard source identification, especially the accuracy of hazard source boundary identification. On the other hand, the model is optimized using the multi-scale Lovász-Softmax loss function, which not only improves the small target recognition ability, but also improves the stability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 It is a schematic diagram of the flow of the railway hazard source identification method provided by the present invention;
[0036] Figure 2 It is a schematic diagram of the hazard source identification model training provided by the present invention;
[0037] Figure 3 It is a structural schematic diagram of the railway hazard source identification device provided by the present invention;
[0038] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.
[0040] like Figure 1 As shown, the railway hazard source identification method provided by the present invention comprises:
[0041] Step 101: Acquire remote sensing images along the railway;
[0042] In this step, optionally, the remote sensing images along the railway obtained in the present invention come from high-resolution remote sensing satellites.
[0043] Step 102: Input the remote sensing image into a hazard source identification model to obtain a high-speed railway hazard source identification result; wherein the training process of the hazard source identification model is as follows:
[0044] Acquire sample remote sensing images along the railway, and annotate the hazard sources in the sample remote sensing images pixel by pixel to generate hazard source labels;
[0045] A TE-ResUnet model is established, and the TE-ResUnet model includes a contraction path module, an expansion path module, a texture enhancement module and a dimension reduction module; wherein the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing image to generate multiple feature maps from shallow scale to deep scale; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain a plurality of processed feature maps; the texture enhancement module is used to crop and copy the contraction path module through a jump connection layer in the expansion path module. Before upsampling the two feature maps of the shallower scale output by the block and the two feature maps of the shallower scale output by the contraction path module, texture enhancement is performed on the two feature maps of the shallower scale; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimension reduction module is used to perform dimension reduction on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimension reduction on the second feature map upsampled by the expansion path module, so as to obtain multiple hazard source prediction and identification results of different scales;
[0046] The multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label is calculated, and the end-to-end training is completed by back propagation to obtain the optimal TE-ResUnet model, and the optimal TE-ResUnet model is used as the hazard source identification model.
[0047] In this step, during the training of the hazard source identification model, a high-resolution remote sensing image hazard source identification dataset is first obtained, and a railway hazard source identification dataset is produced. The dataset includes multiple remote sensing images with hazard source labels. Then, the UNet model is used as the basic architecture, the residual module is used as the contraction path, and the texture enhancement module is introduced to establish the TE-ResUnet model. The TE-ResUnet model is trained and verified using the railway hazard source identification dataset. By calculating the multi-scale Lovász-Softmax loss between the prediction results and the labels, the end-to-end training is completed using back propagation to obtain the optimal TE-ResUnet model. Finally, the high-resolution remote sensing image to be tested is input into the optimal TE-ResUnet model to obtain the high-resolution remote sensing image railway hazard source identification result.
[0048] Among them, the TE-ResUnet model includes: a contraction path module, which includes an input layer, a maximum pooling layer and multiple residual modules, and is used to perform feature recognition and dimensionality reduction on the input remote sensing image; optionally, the residual module has a total of 50 layers, performs 2x downsampling 5 times, and generates feature maps of 5 scales; an expansion path module, which includes a convolution layer and an upsampling layer, and is used to upsample the feature map from the contraction path module to the original image size, and simultaneously perform dimensionality reduction to obtain a recognition result; a jump connection layer, the expansion path module crops and copies the low-level features in the contraction path module through the jump connection layer, and is used for upsampling processing in the expansion path module; a texture enhancement module, which includes two scales, and performs texture enhancement processing on the feature maps of the two shallower scales in the contraction path module respectively; a dimensionality reduction module, which includes two convolution layers, and is used to reduce the dimensionality of the two higher-level scale feature maps in the expansion path module to obtain prediction results of different scales, and is used to calculate multi-scale losses.
[0049] It should be noted that there may be N feature maps of a shallower scale, where N≥2, depending on the number of feature maps output by the shrinking path module. When the shrinking path module outputs feature maps of 5 different scales, there may be 2 feature maps of a shallower scale.
[0050] The railway hazard source identification method provided by the present invention first obtains remote sensing images along the railway, and then inputs the remote sensing images into a hazard source identification model to obtain high-speed railway hazard source identification results; wherein, the training process of the hazard source identification model is as follows: Step 1: obtain sample remote sensing images along the railway, and annotate the hazard sources in the sample remote sensing images pixel by pixel to generate hazard source labels; Step 2: establish a TE-ResUnet model, and the TE-ResUnet model includes a contraction path module, an expansion path module, a texture enhancement module and a dimensionality reduction module; wherein, the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing images to generate multiple feature maps from shallow scale to deep scale; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain multiple processed feature maps; the texture enhancement module is used to crop the feature maps output by the contraction path module through a jump connection layer Before cutting and copying the two feature maps of the shallower scale output by the contraction path module and upsampling the two feature maps of the shallower scale output by the contraction path module, texture enhancement is performed on the two feature maps of the shallower scale; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimension reduction module is used to perform dimensionality reduction processing on the two feature maps of the shallower scale cut and copied by the expansion path module, and to perform dimensionality reduction processing on the second feature map upsampled by the expansion path module, so as to obtain hazard source prediction and identification results of multiple different scales; step 3: calculate the multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label, use back propagation to complete end-to-end training, obtain the optimal TE-ResUnet model, and use the optimal TE-ResUnet model as the hazard source identification model. It can be seen that the present invention establishes a TE-ResUnet model for railway hazard source identification in high-resolution remote sensing images. On the one hand, the texture details of low-level features are enhanced through the texture enhancement module, thereby improving the accuracy of hazard source identification, especially the accuracy of hazard source boundary identification. On the other hand, the model is optimized using the multi-scale Lovász-Softmax loss function, which not only improves the small target recognition ability, but also improves the stability of the model.
[0051] Based on the content of the above embodiment, in this embodiment, the texture enhancement module is used to perform texture enhancement processing on the two feature maps of the shallower scale output by the contraction path module before the expansion path module crops and copies the two feature maps of the shallower scale output by the contraction path module through the skip connection layer and performs upsampling processing on the two feature maps of the shallower scale output by the contraction path module, including:
[0052] The texture enhancement module uses a histogram quantization method to quantize and count the texture information of the two feature maps of the shallower scale output by the contraction path module. Each level of quantization represents a texture, and a learnable graph network is constructed to reconstruct each quantization level to achieve texture detail enhancement.
[0053] In this embodiment, it should be noted that the texture information of the two shallowest scale low-level features is quantized and counted by using the idea of histogram equalization. Each level of quantization represents a texture. Then a learnable graph network is constructed to reconstruct each quantization and to enhance the original texture details. Specifically, the input feature map A of the input texture enhancement module C×H×W The specific processing method is as follows: First, it is converted into g through global average pooling. C×1 , which can be regarded as the mean of all pixels in A. Each element of A has a dimension of C×1, with a total of H×W. The cosine similarity between each element and the mean g is calculated to obtain S H×W , where S ij The calculation method is as follows:
[0054]
[0055] Then quantize the element values in S, the quantization level is N, and get the quantization coding graph E N×HW , E and L together represent the histogram, where L is the horizontal axis, indicating the number of quantized gray levels, and E is the vertical axis, indicating the weight corresponding to each bin. The final histogram uses C N×2 =concat(E,L). C undergoes an MLP transformation and global average pooling output, and is connected by depth as the final output D C1×N (Histogram).
[0056] After that, according to the histogram quantization method, a new quantization level L′ needs to be obtained through D. Each new level should be obtained by perceiving the statistical information of all original levels and can be treated as a graph. To this end, a graph is constructed to propagate information from each level. The statistical features of each quantization level are defined as a node. In the traditional histogram quantization algorithm, the adjacent matrix is a manually defined diagonal matrix, which is expanded into a learning matrix as follows:
[0057] X = Softmax(φ1(D) T φ2(D)
[0058] Among them, φ1 and φ2 represent two different 1×1 convolutional layers, and after performing Softmax on the first dimension as a nonlinear normalization function, each node is updated to obtain the reconstructed quantization level by fusing the features of all other nodes.
[0059] L′=φ3(D)·X
[0060] Where φ3 represents another 1×1 convolutional layer, followed by the quantized coding map E∈R n×hw , assign the reconstruction level L' to each pixel and get the final output R, because E can reflect the original quantization level of each pixel. R is obtained by:
[0061] R=L′·E
[0062] Then restructure R into That is, the feature map after texture enhancement.
[0063] Based on the content of the above embodiment, in this embodiment, the multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label is calculated, and the end-to-end training is completed by back propagation to obtain the optimal TE-ResUnet model, including:
[0064] A first Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the first feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A second Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A third Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the upsampling process of the extension path module and the dimensionality reduction process by the dimensionality reduction module, and the hazard source label is performed on the second feature graph.
[0065] The weighted sum of the first Lovász-Softmax loss, the second Lovász-Softmax loss and the third Lovász-Softmax loss is used as the target loss, and the TE-ResUnet model is optimized according to the target loss. When the target loss is less than a preset threshold, the training ends, thereby obtaining the optimal TE-ResUnet model.
[0066] In this embodiment, it should be noted that in the model training stage, all training data are input into the TE-ResUnet model in batches, the loss between the output result of the TE-ResUnet model and the label is continuously iterated and calculated, and the network model parameters are adjusted by back propagation. Since the important characteristics of the hazardous source data set are the sparsity of hazardous source samples and the imbalance of categories, this feature makes it impossible for the model to pay better attention to pixels with small areas and easy to confuse during the optimization process, and cannot better balance the impact of the loss of target and background pixels on the optimization process. When the classic cross entropy loss function is used for such problems, the model will be seriously biased towards the background with a large proportion of pixels, resulting in poor results. Lovász-Softmax loss is a metric-based measurement method. This type of metric-based loss function is different from the cross entropy loss that focuses on a single pixel, but pays more attention to the metric indicators of the entire image, that is, there is no need to consider the problem of sample distribution balance. It is better for binary classification problems where the proportion of foreground pixels is much smaller than that of the background. In order to better supervise the two texture enhancement modules, the present invention uses a multi-scale Lovász-Softmax loss, which includes calculating the loss function based on feature maps at three scales. In addition to calculating the loss of the final prediction result and the label, the feature map processed by texture enhancement in the extension path module and the label after downsampling are respectively subjected to Lovász-Softmax loss calculation, and the feature map processed by dimensionality reduction in the extension path module and the label are subjected to Lovász-Softmax loss calculation. Finally, the weighted sum of the losses of the three parts is taken as the overall loss.
[0067] Based on the content of the above embodiment, in this embodiment, the target loss L Total for:
[0068]
[0069] Among them, λ1, λ2, λ3 are the weights ΔJ of the three scale loss functions L is the Lovász-Softmax loss function, y* is the hazard source label, The hazard source prediction and identification results output by TE-ResUnet are: is the feature graph after dimension reduction processing in the extended path module, y D2 *To downsample the original hazard source label by 2 times, is the result of the feature map dimensionality reduction after texture enhancement processing in the extension path module; wherein the training hyperparameters are set as follows, optionally, the training image is cropped into image blocks of size 512×512, and the learning rate is set to 10 -3, the batch size is set to 4, and the SGD momentum is set to 0.9. The three weights λ1, λ2, and λ3 of the loss function are set to 0.7, 0.2, and 0.1 respectively. When the training meets the condition that the loss does not continue to decrease after 10 epochs, the above iteration stops.
[0070] Based on the content of the above embodiment, in this embodiment, in the testing phase, before the remote sensing image is input into the hazard source identification model, the following is further included:
[0071] The sliding window method is used to process remote sensing images whose image size is larger than the preset threshold to avoid video memory overflow, and the average of the recognition results of the original image and the flipped image is used as the final high-speed railway hazard source identification result.
[0072] In this embodiment, it should be noted that the test image input into the optimal model TE-ResUnet can be of any size; among them, for larger sizes, test images larger than the preset size threshold, the sliding window method is used to avoid video memory overflow, and the average of the original image and flipped image recognition results is used as the final recognition result, thereby improving the test accuracy.
[0073] The following is described by specific embodiments:
[0074] Embodiment 1:
[0075] In this embodiment, the data of the present invention is optionally from the high-resolution satellite No. 2. The original image of the high-resolution No. 2 data set is a fusion image of the panchromatic band and the multispectral band with a spatial resolution of 0.8 meters, using three bands of red, green and blue. The label making method is to annotate the dangerous sources along the railway pixel by pixel in a professional visual interpretation manner, with the dangerous source pixel as label 1 and the background as label 0. The categories of high-speed railway dangerous sources included in the data include color steel houses and dustproof nets.
[0076] Color-coated steel houses are typical temporary urban buildings. They are made of color-coated steel plates. The colors are mainly blue, white, and red, with large tonal differences. The common characteristics of high-resolution remote sensing images are high brightness of color and a generally rectangular or rectangular shape. The main function of dust nets is to control dust and protect the environment. The exposed surface and dust-prone materials in cities usually require dust nets to be covered. Dust nets are generally made of polyethylene materials and are light green in color. Through professional visual interpretation, the image is annotated pixel by pixel, and the color-coated steel house and dust net in the original image are assigned label 1, and the background is assigned label 0, and finally the sample label is obtained.
[0077] The dataset contains 153 1000*1000 image slices of color steel houses and 139 image slices of dust screens. In the data preprocessing step, data enhancement is performed through 90°, 180°, and 270° rotations, horizontal and vertical inversions, and random cropping, resulting in 3672 and 3336 image slices of 512*512 size, respectively.
[0078] In this embodiment, if Figure 2 As shown, the TE-ResUnet model of the present invention includes a contraction path module 1, which includes an input layer C1 and multiple residual modules, and is used to perform feature recognition and dimensionality reduction on the input remote sensing image; preferably, the contraction path module has a total of 50 layers, performs 2-fold downsampling 5 times, and generates feature maps of 5 scales; an expansion path module 2, which includes a convolution layer and an upsampling layer, is used to upsample the feature map from the contraction path module to the original image size, and simultaneously perform feature dimensionality reduction to obtain a recognition result; a jump connection layer 3, the four scales of the expansion path module are cropped and copied through the jump connection layer. The low-level features in the contraction path module are used for upsampling processing in the expansion path module; a texture enhancement module 4, which includes two scales, respectively performs texture enhancement processing on the feature maps of the two shallower scales in the contraction path module; a dimensionality reduction module 5, which includes three convolution layers, is used to reduce the dimensionality of the two higher-level scale feature maps in the expansion path module, obtain prediction results of different scales, and is used to calculate the multi-scale Lovász-Softmax loss.
[0079] In this embodiment, the high-resolution remote sensing image is first input into the shrinkage path module 1, which includes an input layer C1, residual modules D1, D2, D3, and D4. The input layer C1 includes 64 7×7 convolution kernels with a step size of 2 to generate a feature map F1. Module D1 includes a maximum pooling layer with a step size of 2 and three three-layer residual modules, which respectively include 64 1×1 convolution kernels with a step size of 1, 64 3×3 convolution kernels with a step size of 1, and 256 1×1 convolution kernels with a step size of 1 to generate a feature map F2. Module D2 contains 4 three-layer residual modules. The first residual module contains 128 1×1 convolution kernels with a step size of 1, 128 3×3 convolution kernels with a step size of 2, and 512 1×1 convolution kernels with a step size of 1; the remaining 3 residual modules contain 128 1×1 convolution kernels with a step size of 1, 128 3×3 convolution kernels with a step size of 1, and 512 1×1 convolution kernels with a step size of 1, respectively, to generate feature map F3. Module D3 contains 6 three-layer residual modules. The first residual module contains 256 1×1 convolution kernels with a step size of 1, 256 3×3 convolution kernels with a step size of 2, and 1024 1×1 convolution kernels with a step size of 1; the remaining 5 residual modules contain 256 1×1 convolution kernels with a step size of 1, 256 3×3 convolution kernels with a step size of 1, and 1024 1×1 convolution kernels with a step size of 1, respectively, to generate feature map F4. Module D4 contains three three-layer residual modules. The first residual module contains 512 1×1 convolution kernels with a step size of 1, 512 3×3 convolution kernels with a step size of 2, and 2048 1×1 convolution kernels with a step size of 1; the remaining two residual modules contain 512 1×1 convolution kernels with a step size of 1, 512 3×3 convolution kernels with a step size of 1, and 2048 1×1 convolution kernels with a step size of 1, respectively, to generate feature map F5.
[0080] In this embodiment, the feature map F5 after the contraction path module is downsampled to 1 / 16 of the original image, and then input to the expansion path module 2 for upsampling. F5 is first input to module U1, which includes 1 convolution layer and 1 transposed convolution layer. The convolution layer includes 192 3×3 convolution kernels with a step size of 1, and the transposed convolution layer includes 128 4×4 convolution kernels with a step size of 2. Modules U2, U3, and U4 also include 1 convolution layer and 1 transposed convolution layer. The convolution layer includes 128, 96, and 48 3×3 convolution kernels with a step size of 1, respectively, and the transposed convolution layer includes 96, 64, and 32 4×4 convolution kernels with a step size of 2, respectively. Finally, the feature map output by U4 is restored to the resolution of the original image and output to the dimension reduction module 5 for dimensionality reduction by the two 1×1 convolution kernels of the C2 layer. The five-scale feature maps F1, F2, F3, F4, and F5 generated by the contraction path module are cropped and copied through the jump connection layer 3. Each scale is fused with the corresponding features in the expansion path module 2 to restore the detailed features of the hazard source and refine the edges. However, the low-level features recognized by the shallow network are often of low quality, especially low contrast, which leads to blurred texture details and has a negative impact on the recognition and utilization of low-level information. Therefore, before F1 and F2 enter the jump connection layer, they are first input into the texture enhancement module 4 for texture detail enhancement. The dimension reduction module 5, which includes C2, C3, and C4, all contain two 1×1 convolution kernels with a step size of 1, which are used to reduce the dimensions of feature maps of different scales, and then generate prediction results of different scales to calculate the calculation of multi-scale Lovász-Softmax loss, and obtain the final prediction results at the same time.
[0081] In this embodiment, optionally, the computing environment is based on Intel(R) Xeon(R) Gold 5218 CPU, GeForceRTX 2080Ti GPU, the operating system is Ubuntu 18.04, the deep learning framework used for model construction is Pytorch, and the programming language is Python.
[0082] In this embodiment, during the model training phase, all training data are input into the TE-ResUnet model in batches, the loss between the output result of the TE-ResUnet model and the label is continuously iterated and calculated, and the network model parameters are adjusted using back propagation. Since the important characteristics of the hazardous source data set are the sparsity of hazardous source samples and the imbalance of categories, this feature makes it impossible for the model to pay better attention to pixels with small areas and easy to confuse during the optimization process, and better balance the impact of the loss of target and background pixels on the optimization process. When the classic cross entropy loss function is used for such problems, the model will be seriously biased towards the background with a large proportion of pixels, resulting in poor results. Lovász-Softmax loss is a metric-based measurement method. This type of metric-based loss function is different from the cross entropy loss that focuses on a single pixel, but pays more attention to the metric indicators of the entire image, that is, there is no need to consider the problem of sample distribution balance. It is better for binary classification problems where the proportion of foreground pixels is much smaller than that of the background. In order to better supervise the two texture enhancement modules, the present invention uses a multi-scale Lovász-Softmax loss, which includes calculating the loss function based on feature maps at three scales. In addition to calculating the loss of the final prediction result and the label, the extended path F8 is reduced in dimension and the Lovász-Softmax loss is calculated with the downsampled label, and the output of U4 is reduced in dimension and the Lovász-Softmax loss is calculated with the label. Finally, the weighted sum of the three parts of the loss is taken as the overall target loss, and the TE-ResUnet model is optimized according to the target loss. When the target loss is less than the preset threshold, the training ends, thereby obtaining the optimal TE-ResUnet model. It can be seen that the present invention uses a multi-scale Lovász-Softmax loss function to optimize TE-ResUnet to improve the small target recognition capability and the stability of the model, and finally obtains the optimal model that can directly generate the hazard source recognition result; the trained optimal model is used to identify the hazard source of the remote sensing image to be identified. The present invention can realize accurate and effective identification of high-speed railway hazard sources, and can also ensure high identification accuracy for hazard sources with smaller areas, thus solving the problem of poor effectiveness of traditional ground survey methods.
[0083] like Figure 3 As shown, the present invention also provides a railway hazard source identification device, comprising:
[0084] Acquisition module 1, used to acquire remote sensing images along the railway;
[0085] Processing module 2 is used to input the remote sensing image into the hazard source identification model to obtain the railway hazard source identification result; wherein the training process of the hazard source identification model is as follows:
[0086] Acquire sample remote sensing images along the railway, and annotate the hazard sources in the sample remote sensing images pixel by pixel to generate hazard source labels;
[0087] A TE-ResUnet model is established, and the TE-ResUnet model includes a contraction path module, an expansion path module, a texture enhancement module and a dimension reduction module; wherein the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing image to generate multiple feature maps from shallow scale to deep scale; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain a plurality of processed feature maps; the texture enhancement module is used to crop and copy the contraction path module through a jump connection layer in the expansion path module. Before upsampling the two feature maps of the shallower scale output by the block and the two feature maps of the shallower scale output by the contraction path module, texture enhancement is performed on the two feature maps of the shallower scale; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimension reduction module is used to perform dimension reduction on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimension reduction on the second feature map upsampled by the expansion path module, so as to obtain multiple hazard source prediction and identification results of different scales;
[0088] The multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label is calculated, and the end-to-end training is completed by back propagation to obtain the optimal TE-ResUnet model, and the optimal TE-ResUnet model is used as the hazard source identification model.
[0089] In this embodiment, during the training process of the hazard source identification model, a high-resolution remote sensing image hazard source identification dataset is first obtained, and a railway hazard source identification dataset is produced, which includes multiple remote sensing images with hazard source labels. Then, the UNet model is used as the basic architecture, the residual module is used as the contraction path, and the texture enhancement module is introduced to establish the TE-ResUnet model. The TE-ResUnet model is trained and verified using the railway hazard source identification dataset. By calculating the multi-scale Lovász-Softmax loss between the prediction results and the labels, the end-to-end training is completed using back propagation to obtain the optimal TE-ResUnet model. Finally, the high-resolution remote sensing image to be tested is input into the optimal TE-ResUnet model to obtain the high-resolution remote sensing image railway hazard source identification result.
[0090] Among them, the TE-ResUnet model includes: a contraction path module, which includes an input layer, a maximum pooling layer and multiple residual modules, and is used to perform feature recognition and dimensionality reduction on the input remote sensing image; optionally, the residual module has a total of 50 layers, performs 2x downsampling 5 times, and generates feature maps of 5 scales; an expansion path module, which includes a convolution layer and an upsampling layer, and is used to upsample the feature map from the contraction path module to the original image size, and simultaneously perform dimensionality reduction to obtain a recognition result; a jump connection layer, the expansion path module crops and copies the low-level features in the contraction path module through the jump connection layer, and is used for upsampling processing in the expansion path module; a texture enhancement module, which includes two scales, and performs texture enhancement processing on the feature maps of the two shallower scales in the contraction path module respectively; a dimensionality reduction module, which includes two convolution layers, and is used to reduce the dimensionality of the two higher-level scale feature maps in the expansion path module to obtain prediction results of different scales, and is used to calculate multi-scale losses.
[0091] The railway hazard source identification device provided by the present invention first obtains remote sensing images along the railway, and then inputs the remote sensing images into a hazard source identification model to obtain railway hazard source identification results; wherein, the training process of the hazard source identification model is as follows: Step 1: obtain sample remote sensing images along the railway, and annotate the hazard sources in the sample remote sensing images pixel by pixel to generate hazard source labels; Step 2: establish a TE-ResUnet model, and the TE-ResUnet model includes a contraction path module, an expansion path module, a texture enhancement module and a dimensionality reduction module; wherein, the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing images to generate multiple feature maps from shallow scale to deep scale; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain multiple feature maps after processing; the texture enhancement module is used to crop the feature maps output by the contraction path module through a jump connection layer Copy the two feature maps of the shallower scale output by the contraction path module and before upsampling the two feature maps of the shallower scale output by the contraction path module, perform texture enhancement on the two feature maps of the shallower scale; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimension reduction module is used to perform dimension reduction on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimension reduction on the second feature map upsampled by the expansion path module, so as to obtain hazard source prediction and identification results of multiple different scales; step 3: calculate the multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label, use back propagation to complete end-to-end training, obtain the optimal TE-ResUnet model, and use the optimal TE-ResUnet model as the hazard source identification model. It can be seen that the present invention establishes a TE-ResUnet model for railway hazard source identification in high-resolution remote sensing images. On the one hand, the texture details of low-level features are enhanced through the texture enhancement module, thereby improving the accuracy of hazard source identification, especially the accuracy of hazard source boundary identification. On the other hand, the model is optimized using the multi-scale Lovász-Softmax loss function, which not only improves the small target recognition ability, but also improves the stability of the model.
[0092] Based on the content of the above embodiment, in this embodiment, the processing module is further specifically used for:
[0093] A first Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the first feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A second Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A third Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the upsampling process of the extension path module and the dimensionality reduction process by the dimensionality reduction module, and the hazard source label is performed on the second feature graph.
[0094] The weighted sum of the first Lovász-Softmax loss, the second Lovász-Softmax loss and the third Lovász-Softmax loss is used as the target loss, and the TE-ResUnet model is optimized according to the target loss. When the target loss is less than a preset threshold, the training ends, thereby obtaining the optimal TE-ResUnet model.
[0095] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4As shown, the electronic device may include: a processor (processor) 410, a communication interface (Communications Interface) 420, a memory (memory) 430 and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call the logic instructions in the memory 430 to execute the railway hazard source identification method, which includes: obtaining remote sensing images along the railway; inputting the remote sensing images into the hazard source identification model to obtain railway hazard source identification results; wherein the training process of the hazard source identification model is as follows: Step 1: obtaining sample remote sensing images along the railway, and annotating the hazards in the sample remote sensing images pixel by pixel to generate hazard source labels; Step 2: establishing a TE-ResUnet model, the TE-ResUnet model includes a contraction path module, an expansion path module, a texture enhancement module and a dimensionality reduction module; wherein the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing images to generate multiple feature maps from shallow scales to deep scales; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain multiple processed feature maps; the texture enhancement module is used in the expansion path The module crops and copies the two feature maps of the shallower scale output by the contraction path module through a jump connection layer, and before upsampling the two feature maps of the shallower scale output by the contraction path module, the two feature maps of the shallower scale are texture enhanced; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimensionality reduction module is used to perform dimensionality reduction processing on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimensionality reduction processing on the second feature map upsampled by the expansion path module, so as to obtain hazard source prediction and identification results of multiple different scales; step 3: calculate the multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label, use back propagation to complete end-to-end training, obtain the optimal TE-ResUnet model, and use the optimal TE-ResUnet model as the hazard source identification model.
[0096] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0097] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the railway hazard source identification method provided by the above-mentioned methods, and the method includes: obtaining remote sensing images along the railway; inputting the remote sensing images into a hazard source identification model to obtain railway hazard source identification results; wherein the training process of the hazard source identification model is as follows: Step 1: Obtain sample remote sensing images along the railway, and annotate the hazard sources in the sample remote sensing images pixel by pixel to generate hazard source labels; Step 2: Establish a TE-ResUnet model, and the TE-ResUnet model includes a contraction path module, an expansion path module, a texture enhancement module and a dimensionality reduction module; wherein the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing images to generate multiple feature maps from shallow scales to deep scales; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map Sample processing is performed to obtain multiple feature maps after processing; the texture enhancement module is used to perform texture enhancement processing on the two feature maps of the shallower scale output by the contraction path module before the expansion path module crops and copies the two feature maps of the shallower scale output by the contraction path module through the jump connection layer and before upsampling the two feature maps of the shallower scale output by the contraction path module; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimension reduction module is used to perform dimensionality reduction processing on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimensionality reduction processing on the second feature map upsampled by the expansion path module, so as to obtain multiple hazard source prediction and identification results of different scales; Step 3: Calculate the multi-scale Lovász-Softmax loss between the multiple hazard source prediction and identification results of different scales and the hazard source label, use back propagation to complete end-to-end training, obtain the optimal TE-ResUnet model, and use the optimal TE-ResUnet model as the hazard source identification model.
[0098] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented by a processor to execute the railway hazard source identification method provided by the above-mentioned methods when executed, the method comprising: obtaining remote sensing images along the railway; inputting the remote sensing images into a hazard source identification model to obtain railway hazard source identification results; wherein the training process of the hazard source identification model is as follows: Step 1: obtaining sample remote sensing images along the railway, and annotating the hazard sources in the sample remote sensing images pixel by pixel to generate hazard source labels; Step 2: establishing a TE-ResUnet model, the TE-ResUnet model comprising a contraction path module, an expansion path module, a texture enhancement module and a dimensionality reduction module; wherein the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing images to generate multiple feature maps from shallow scales to deep scales; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain multiple feature maps after processing. ; The texture enhancement module is used to perform texture enhancement processing on the two feature maps of the shallower scale output by the contraction path module before the expansion path module crops and copies the two feature maps of the shallower scale output by the contraction path module through the jump connection layer and before upsampling the two feature maps of the shallower scale output by the contraction path module; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimensionality reduction module is used to perform dimensionality reduction processing on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimensionality reduction processing on the second feature map upsampled by the expansion path module, so as to obtain hazard source prediction and identification results of multiple different scales; Step 3: Calculate the multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label, use back propagation to complete end-to-end training, obtain the optimal TE-ResUnet model, and use the optimal TE-ResUnet model as the hazard source identification model.
[0099] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0100] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for 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 some parts of the embodiments.
[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A railway hazard source identification method, characterized in that: include: Acquire remote sensing images along the railway; The remote sensing image is input into the hazard source identification model to obtain the railway hazard source identification result; wherein the training process of the hazard source identification model is as follows: Step 1: Obtain sample remote sensing images along the railway, and annotate the hazard sources in the sample remote sensing images pixel by pixel to generate hazard source labels; Step 2: Establish a TE-ResUnet model, which includes a contraction path module, an expansion path module, a texture enhancement module and a dimension reduction module; wherein the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing image to generate multiple feature maps from shallow scale to deep scale; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain a plurality of processed feature maps; the texture enhancement module is used to crop and copy the contraction path module through a jump connection layer in the expansion path module. The two feature maps of the shallower scale output by the expansion path module and the two feature maps of the shallower scale output by the contraction path module are subjected to texture enhancement processing before upsampling; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimension reduction module is used to perform dimension reduction processing on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimension reduction processing on the second feature map upsampled by the expansion path module, so as to obtain multiple hazard source prediction and identification results of different scales; Step 3: Calculate the multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label, use back propagation to complete end-to-end training, obtain the optimal TE-ResUnet model, and use the optimal TE-ResUnet model as the hazard source identification model.
2. The railway hazard source identification method according to claim 1 is characterized in that: The texture enhancement module is used to perform texture enhancement processing on the two feature maps of the shallower scale output by the contraction path module before the expansion path module crops and copies the two feature maps of the shallower scale output by the contraction path module through the skip connection layer and performs upsampling processing on the two feature maps of the shallower scale output by the contraction path module, including: The texture enhancement module uses a histogram quantization method to quantize and count the texture information of the two feature maps of the shallower scale output by the contraction path module. Each level of quantization represents a texture, and a learnable graph network is constructed to reconstruct each quantization level to achieve texture detail enhancement.
3. The railway hazard source identification method according to claim 1 is characterized in that: The multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label is calculated, and the end-to-end training is completed by back propagation to obtain the optimal TE-ResUnet model, including: A first Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the first feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A second Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A third Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the upsampling process of the extension path module and the dimensionality reduction process by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. The weighted sum of the first Lovász-Softmax loss, the second Lovász-Softmax loss and the third Lovász-Softmax loss is used as the target loss, and the TE-ResUnet model is optimized according to the target loss. When the target loss is less than a preset threshold, the training ends, thereby obtaining the optimal TE-ResUnet model.
4. The railway hazard source identification method according to claim 3 is characterized in that: The target loss L Total for: Among them, λ1, λ2, λ3 are the weights of the three scale loss functions, ΔJ L is the Lovász-Softmax loss function, y* is the hazard source label, The hazard source prediction and identification results output by TE-ResUnet are: is the feature map after dimension reduction processing in the extended path module, y D2 *To downsample the original hazard source label by 2 times, It is the result of dimensionality reduction of the feature map after texture enhancement processing in the extension path module.
5. The railway hazard source identification method according to claim 1 is characterized in that: Before inputting the remote sensing image into the hazard source identification model, the method further includes: The sliding window method is used to process remote sensing images whose image size is larger than a preset threshold.
6. A railway hazard source identification device, characterized in that: include: An acquisition module is used to acquire remote sensing images along the railway; The processing module is used to input the remote sensing image into the hazard source identification model to obtain the railway hazard source identification result; wherein the training process of the hazard source identification model is as follows: Acquire sample remote sensing images along the railway, and annotate the hazard sources in the sample remote sensing images pixel by pixel to generate hazard source labels; A TE-ResUnet model is established, and the TE-ResUnet model includes a contraction path module, an expansion path module, a texture enhancement module and a dimension reduction module; wherein the contraction path module is used to perform feature recognition and downsampling on the sample remote sensing image to generate multiple feature maps from shallow scale to deep scale; the expansion path module is used to crop and copy each feature map output by the contraction path module through a jump connection layer, and upsample each feature map to obtain a plurality of processed feature maps; the texture enhancement module is used to crop and copy the contraction path module through a jump connection layer in the expansion path module. Before upsampling the two feature maps of the shallower scale output by the block and the two feature maps of the shallower scale output by the contraction path module, texture enhancement is performed on the two feature maps of the shallower scale; wherein the two feature maps of the shallower scale include a first feature map and a second feature map, and the scale of the first feature map is smaller than the scale of the second feature map; the dimension reduction module is used to perform dimension reduction on the two feature maps of the shallower scale cropped and copied by the expansion path module, and to perform dimension reduction on the second feature map upsampled by the expansion path module, so as to obtain multiple hazard source prediction and identification results of different scales; The multi-scale Lovász-Softmax loss between the hazard source prediction and identification results of the multiple different scales and the hazard source label is calculated, and the end-to-end training is completed by back propagation to obtain the optimal TE-ResUnet model, and the optimal TE-ResUnet model is used as the hazard source identification model.
7. The railway hazard source identification device according to claim 6, characterized in that: The processing module is further specifically used for: A first Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the first feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A second Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. A third Lovász-Softmax loss calculation is performed on the hazard source prediction and identification result obtained after the second feature graph is processed by the upsampling process of the extension path module and the dimensionality reduction process by the dimensionality reduction module, and the hazard source label is performed on the second feature graph. The weighted sum of the first Lovász-Softmax loss, the second Lovász-Softmax loss and the third Lovász-Softmax loss is used as the target loss, and the TE-ResUnet model is optimized according to the target loss. When the target loss is less than a preset threshold, the training ends, thereby obtaining the optimal TE-ResUnet model.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the railway hazard identification method as described in any one of claims 1 to 5 are implemented.
9. 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 steps of the railway hazard identification method as described in any one of claims 1 to 5 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the railway hazard identification method as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Remote sensing image cloud detection method based on Gabor transformation and attention
CN111738124A
Ground object target identification method and device based on deep learning segmentation network
CN112101309A