Coastal change detection method based on attention mechanism and joint loss function

By using an attention mechanism and a joint loss function, this method addresses the problems of time-consuming, labor-intensive, and low-accurate traditional coastal zone change detection algorithms, achieving more efficient and accurate coastal zone change detection.

CN118628919BActive Publication Date: 2025-12-30SANYA SCI & EDUCATION INNOVATION PARK WUHAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410932161.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2025-12-30
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

Traditional coastal zone change detection algorithms are time-consuming and labor-intensive, have poor robustness and generalization ability, and have low accuracy in complex scenes and multi-category changes. Optical remote sensing images are easily affected by weather conditions and sensors, resulting in unclear detection.

Method used

A method based on attention mechanism and joint loss function is adopted to detect coastal zone changes by combining feature extraction, nonlinear transformation attention module and difference extraction module with cross-entropy and edge loss function to optimize the model.

Benefits of technology

It improves the accuracy and robustness of coastal zone change detection, reduces errors caused by brightness differences, and enhances detection capabilities in complex scenes, especially change detection in areas with obvious edges.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628919B_ABST
    Figure CN118628919B_ABST
Patent Text Reader

Abstract

The application provides a coastal zone change detection method based on an attention mechanism and a joint loss function, and belongs to the technical field of coastal zone change detection.The application uses a nonlinear transformation attention mechanism and a joint loss function to solve the problem of coastal zone change detection in optical remote sensing images, and performs pixel-level subtraction operation on double-time-phase features, so that the model effectively locates the specific position of the coastal zone change, reduces the error caused by brightness difference, and improves the accuracy of change detection.The joint loss function combines a cross-entropy loss function and an edge extraction loss function, improves the performance of the change detection model in processing complex scenes, reduces the confusion between the target domain and the background, and improves the change detection of the edge obvious area.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of coastal zone change detection, and particularly relates to a coastal zone change detection method and device based on an attention mechanism and a joint loss function. BACKGROUND

[0002] Coastal zone change detection is an important task, which is of great significance for understanding the dynamic changes of the coastline, the rational development and utilization of coastal zone resources, and the protection of the coastal zone. Coastal zone change detection can be achieved through various remote sensing technologies, including but not limited to optical remote sensing, synthetic aperture radar (SAR), and laser radar (LiDAR).

[0003] Optical remote sensing images, as a technology for obtaining information about the Earth's surface using electromagnetic waves (light), have the advantages of high resolution, rich waveband data, efficient and fast acquisition, and wide scanning coverage. These advantages make optical remote sensing images widely used in environmental protection, resource management, land use, urban planning, disaster management, and other fields. With the continuous evolution of remote sensing information technology, optical remote sensing technology has been widely applied to the field of coastal zone change detection.

[0004] Traditional coastal zone change detection algorithms usually require manual feature extraction, which is extremely time-consuming and labor-intensive. Moreover, such methods have poor robustness and generalization ability, and cannot achieve automatic detection. In addition, traditional coastal zone change detection algorithms have low accuracy when dealing with complex scenes and multi-class changes. Furthermore, optical remote sensing images may be affected by weather conditions and sensor images, resulting in unclear images and affecting the detection of coastal zone changes. SUMMARY

[0005] To solve the above problems in the prior art, the present application proposes a coastal zone change detection method based on an attention mechanism and a joint loss function to improve the accuracy and robustness of coastal zone detection.

[0006] To achieve the above-mentioned purpose, in a first aspect, the present application discloses a coastal zone change detection method based on an attention mechanism and a joint loss function, comprising:

[0007] Step S1, acquiring optical remote sensing images of a to-be-detected region at different time phases, and performing image preprocessing on the optical remote sensing images to obtain a preprocessed image dataset, wherein the image dataset includes a training dataset and a to-be-detected dataset;

[0008] Step S2, constructing a coastal zone change detection model, wherein the model includes a feature extraction module, a nonlinear transformation attention module, and a difference extraction module;

[0009] Step S3, input the training data set of different time phases of the region to be detected into the feature extraction module, obtain the extracted image features of different time phases, and map the image data to the feature space to obtain the feature maps of different time phases, wherein the training data set of different time phases is a training data set of time phase A and a training data set of time phase B, and the time phase A is later than the time phase B;

[0010] Step S4, input the feature maps of time phase A and time phase B into the nonlinear transformation attention module respectively to obtain the global feature maps of time phase A and time phase B;

[0011] Step S5, input the global feature maps of time phase A and time phase B into the difference extraction module to obtain the difference features of the global feature maps of time phase A and time phase B, and obtain the change detection result according to the difference features;

[0012] Step S6, construct a joint loss function according to a cross-entropy loss function and an edge loss function, optimize the coastal zone change detection model by using the joint loss function, and obtain an optimized change detection model;

[0013] Step S7, input the images to be detected of different time phases into the optimized change detection model to obtain the change detection result of the coastal zone.

[0014] Further, the image preprocessing of the optical remote sensing image in step S1 includes one or more of radiation correction, geometric correction and image enhancement.

[0015] Further, in step S4, the feature maps of different time phases are respectively input into the nonlinear transformation attention module to obtain the global feature maps of different time phases, which includes:

[0016] (1) input the feature maps of time phase A and time phase B into the nonlinear transformation attention module, first perform normalization processing on the input feature maps, and then use linear projection to generate three vector matrices Query, Key and Value, and the specific formula is:

[0017] wherein , and are learnable weight matrices for capturing key features in the input feature map, is the feature map of different time phases, , , are three vector matrices of different time phases, and x takes A or B;

[0018] (2) calculate the attention weight value according to the calculated vector matrices Query, Key and Value:

[0019]

[0020] Where tanh is the hyperbolic tangent activation function, which performs a non-linear transformation on each element in the Query, Key, and Value matrices, with a feature dimension of [missing value]. It is usually used as a scaling factor for normalization. For dot product calculation, express The function is computed along the last dimension of the tensor;

[0021] (3) Calculate the global feature map based on the attention weights and Value:

[0022] .

[0023] Further, in step S5, the global feature maps of time phase A and time phase B are input into the difference extraction module to obtain the difference features between the global feature maps of time phase A and time phase B, including:

[0024] The difference feature map is obtained by performing pixel-level subtraction on the global feature maps of time phase A and time phase B. The specific formula is as follows:

[0025]

[0026] in This is the result obtained through pixel-level subtraction. Position in the global feature map of phase A The red channel value at that location, Position in the global feature map of phase B The red channel value at that location. Position in the global feature map of phase A The green channel value at that location Position in the global feature map of phase B The green channel value at that location. Position in the global feature map of phase A The blue channel value at that location, Position in the global feature map of phase B The blue channel value at that location.

[0027] Furthermore, step S5, which involves obtaining the change detection result based on the difference features, also includes:

[0028] The difference features between the global feature maps of time phase A and time phase B are combined with the feature map of time phase A to perform a Hadamard product operation to obtain the change detection result.

[0029] Furthermore, in step S6, a joint loss function is constructed based on the cross-entropy loss function and the edge loss function, with the specific formula as follows:

[0030]

[0031] wherein, is a total loss function, is a cross-entropy loss function, is an edge loss function, , is an adjustment weight of the loss function.

[0032] Further, the step S6 of constructing the joint loss function according to the cross-entropy loss function and the edge loss function further comprises:

[0033] The calculation formula of the cross-entropy loss function is:

[0034]

[0035] wherein, y is a probability value output by the detection model, indicating the probability of belonging to a positive class; t is a real label, taking a value of 0 or 1, indicating the real class of the sample;

[0036] The calculation formula of the edge loss function is:

[0037]

[0038] wherein, is a coefficient greater than 0, N represents a neighborhood of c containing n points, c represents the center of the N region, represents the label value of the k point, represents the label value of the c point, and take a value of 0 or 1, then represents a probability value of correct classification.

[0039] In the second aspect of the present application, a coastal zone change detection system based on an attention mechanism and a joint loss function is disclosed, and the system is characterized by comprising a preprocessing module, a change detection module based on an attention mechanism and a joint loss function, and a control output module.

[0040] The preprocessing module is used for image data preprocessing of the input optical remote sensing image to be detected to form a preprocessed image set.

[0041] The change detection module based on the attention mechanism and the joint loss function comprises a feature extraction module, a nonlinear transformation attention module, and a difference extraction module, and is used for obtaining a change detection result.

[0042] The control output module is used for outputting the change detection result obtained by the change detection module based on the attention mechanism and the joint loss function to a user.

[0043] In a third aspect of the present application, a computer device is disclosed, comprising a memory, a processor and program instructions stored in the memory and executable by the processor, and the processor executes the program instructions to implement the method in any one of the first aspect.

[0044] In a fourth aspect of the present application, a computer readable storage medium is disclosed, storing a computer program, and the computer program is executable by a processor to implement the method in any one of the first aspect.

[0045] The present application proposes a coastal zone change detection method based on attention mechanism and joint loss function for the task of coastal zone change detection. Compared with the change detection model used in the prior art, the present application uses nonlinear transformation attention mechanism and joint loss function to solve the problem of coastal zone change detection in optical remote sensing images, and performs pixel-level subtraction operation on the dual-time feature, so that the model effectively locates the specific position of the coastal zone change, reduces the error caused by brightness difference, and improves the accuracy of change detection. The joint loss function combines the cross-entropy loss function and the edge extraction loss function, improves the performance of the change detection model in processing complex scenes, reduces the confusion between the target domain background, and improves the change detection of the edge obvious area. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 The present application embodiment realizes a schematic diagram of a coastal zone change detection method based on nonlinear transformation attention mechanism and joint loss function;

[0047] Figure 2 A real optical remote sensing image coastal zone change detection label map;

[0048] Figure 3 A real optical remote sensing image coastal zone change detection effect diagram. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present application will be further described in detail below with reference to the drawings in the embodiments of the present application. It should be noted that the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0050] To make the inventive objectives, technical solutions, and advantages of this application clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of this invention, and these all fall within the protection scope of this application.

[0051] The embodiments of this application will be described in further detail below with reference to the accompanying drawings:

[0052] Example 1 Figure 1 As shown, this embodiment provides a coastal zone change detection method based on an attention mechanism and a joint loss function, including:

[0053] Step S1: Obtain optical remote sensing images of the area to be detected at different times, and perform image preprocessing on the optical remote sensing images to obtain a preprocessed image dataset, which includes a training dataset and a dataset to be detected.

[0054] Optical remote sensing imagery, a technology that uses electromagnetic waves (light) to acquire information about the Earth's surface, boasts advantages such as high resolution, abundant spectral data, efficient and rapid acquisition, and wide scanning coverage. These advantages have led to its widespread application in fields such as environmental protection, resource management, land use, urban planning, and disaster management. This implementation selects optical remote sensing imagery to detect changes in the coastal zone. Image preprocessing is performed on optical remote sensing images of the area to be detected at different time phases to obtain a preprocessed image dataset.

[0055] It should be noted that image preprocessing is a crucial step in change detection based on remote sensing images, as it helps improve the accuracy and reliability of change detection. Step S1 involves image preprocessing of the optical remote sensing image, including one or more of radiometric correction, geometric correction, and image enhancement. The optical remote sensing image after image preprocessing has higher geometric and pixel accuracy.

[0056] When performing change detection based on a change detection model, in order to improve the detection accuracy, the model needs to be trained using a training dataset to obtain optimal model parameters. In this embodiment, the preprocessed remote sensing image dataset is divided into a training dataset and a dataset to be detected. The training dataset contains results of known changed areas, while the dataset to be detected contains the data for which change detection calculations are required. Both the training dataset and the dataset to be detected include remote sensing image data of the same area at different time phases.

[0057] Step S2: Construct a coastal zone change detection model, which includes a feature extraction module, a nonlinear transformation attention module, and a difference extraction module.

[0058] The coastal zone change detection model in the embodiment includes a feature extraction module, a nonlinear transformation attention module, and a difference extraction module. The feature extraction module is used to extract features from the preprocessed remote sensing images as input. The features of remote sensing images at different time phases are extracted respectively. The purpose is to improve the key feature information in the remote sensing images, eliminate redundant information irrelevant to change detection, and improve the accuracy and efficiency of change detection calculation.

[0059] Generally, remote sensing images have rich multi-band data and complex data characteristics. In the embodiment, the nonlinear transformation attention module is used for feature processing, which is conducive to improving the expression of the model and enabling the model to capture more complex data relationships. The nonlinear transformation attention module can adapt to different change types and improve the robustness and accuracy of change detection. Further, the feature maps processed by the nonlinear transformation attention module are processed by the difference extraction module, which can extract the difference features of remote sensing images at different time phases and then output the results of change detection.

[0060] Further, the change detection model in the embodiment is based on the BIT network. The overall network can be divided into a feature extraction part on the left, a feature fusion part in the middle, and a difference extraction part. The feature extraction part uses different layer features with down-sampling rates. The feature fusion part adds a nonlinear transformation attention module. Finally, the difference extraction part obtains the final detection result based on the fused feature maps.

[0061] The feature extraction module in the embodiment is generally a general network trunk, such as Resnet18, Cspdarknet53, etc. Its main function is to down-sample the data images through convolution and extract features of different scales. The feature fusion part in the prior art is mainly a structure similar to a feature pyramid. For general feature fusion, such as a feature pyramid or a bidirectional feature pyramid, they often only consider the information fusion between different layers, while ignoring the boundary feature information. The embodiment adds a nonlinear transformation attention mechanism to the feature fusion part to extract the target boundary information.

[0062] In step S3, the same area and different time phase training data sets are input into the feature extraction module to obtain extracted image features at different time phases, and the image data is mapped to a feature space to obtain feature maps at different time phases. The different time phase training data sets are a training data set at time phase A and a training data set at time phase B, wherein time phase A is later than time phase B.

[0063] In the change detection process of the coastal zone, a pair of remote sensing images of different time periods are generally selected for change detection. After the change detection model is constructed, the preprocessed remote sensing image training data set is input into the feature extraction module of the change detection model in this embodiment for feature extraction, and then the image features of different time periods are obtained, which are then mapped to the feature space to obtain the feature maps of different time periods.

[0064] In this embodiment, the input image is , where R represents the real number set, and respectively represent the width and height, and the feature map obtained by the feature extraction network is , where S is the output stride, K is the number of feature channels, and S is the same as the down-sampling multiple set by the feature extraction network.

[0065] In step S4, the feature maps of time phase A and time phase B are input into the nonlinear transformation attention module to obtain the global feature maps of time phase A and time phase B.

[0066] The feature maps of different time phases obtained by feature extraction are input into the nonlinear transformation attention module for feature calculation, and the global feature maps of different time phases can be obtained. In this embodiment, the nonlinear transformation attention adjusts the features of different channels on the feature map, obtains the global importance weights of each channel through global pooling, adjusts these weights through nonlinear transformation, obtains the attention weights of each position, and finally applies the obtained weights to the features obtained by the feature extraction network to obtain the final global feature map.

[0067] Further, in this embodiment, the feature maps of different time phases are input into the nonlinear transformation attention module in step S4 to obtain the global feature maps of different time phases, including:

[0068] (1) The feature maps of time phase A and time phase B are input into the nonlinear transformation attention module. First, the input feature map is normalized, and then linear projection is used to generate three vector matrices Query, Key and Value. The specific formula is:

[0069] where , and are learnable weight matrices for capturing key features in the input feature map, is the feature map of different time phases, , , are three vector matrices of different time phases, and x takes the value of A or B;

[0070] (2) Calculate the attention weight value according to the calculated vector matrix Query, Key and Value matrix:

[0071]

[0072] wherein tanh is the hyperbolic tangent activation function, each element in the Query, Key and Value matrix is nonlinearly transformed, the feature dimension is Usually as a normalized scaling factor, for dot product calculation, denotes The function is calculated along the last dimension of the tensor;

[0073] (3) Calculate the global feature map according to the attention weight value and Value:

[0074] .

[0075] Step S5, input the global feature maps of phase A and phase B into the difference extraction module to obtain the difference features of the global feature maps of phase A and phase B, and obtain the change detection result according to the difference features.

[0076] The difference extraction module is used to process the global feature maps of different time phases to obtain difference features. In this embodiment, pixel-level subtraction operation is used to obtain the difference features, specifically:

[0077] The pixel-level subtraction operation is performed on the global feature maps of phase A and phase B to obtain the difference feature map, and the specific formula is:

[0078]

[0079] wherein is the result obtained by pixel-level subtraction, is the red channel value of the global feature map of phase A at position , is the red channel value of the global feature map of phase B at position . is the green channel value of the global feature map of phase A at position , is the green channel value of the global feature map of phase B at position . is the blue channel value of the global feature map of phase A at position , is the blue channel value of the global feature map of phase B at position .

[0080] Further, obtaining the change detection result according to the difference feature further comprises:

[0081] The difference feature of the obtained global feature maps of the time phase A and the time phase B is subjected to Hadamard product operation with the feature map of the time phase A to obtain the change detection result.

[0082] In step S6, a joint loss function is constructed according to the cross-entropy loss function and the edge loss function, and the joint loss function is used to optimize the coastal zone change detection model to obtain an optimized change detection model.

[0083] In order to seek the optimal model parameters, each model parameter that makes the loss function minimum needs to be found. In the embodiment, a joint loss function of the cross-entropy loss function and the edge extraction loss function is proposed. The cross-entropy loss function is introduced, which can more accurately evaluate the probability distribution difference between the model output and the true label, which helps to improve the accuracy of the coastal zone change detection, especially in dealing with complex scenes and multi-class changes. The edge extraction loss function focuses on the edge information of the target, which helps to strengthen the target contour and improve the spatial resolution of the change detection, which reduces the confusion between the target interior and the background. For the areas with obvious edges such as the coastline, the change can be better revealed.

[0084] In the embodiment, the joint loss function is constructed according to the cross-entropy loss function and the edge loss function in step S6, and the specific formula is:

[0085]

[0086] wherein, is the total loss function, is the cross-entropy loss function, is the edge loss function, , is the adjustment weight of the loss function.

[0087] Further, the calculation formula of the cross-entropy loss function in step S6 is:

[0088]

[0089] wherein, y is the probability value output by the detection model, indicating the probability of belonging to the positive class; t is the true label, taking the value of 0 or 1, indicating the true class of the sample;

[0090] The calculation formula of the edge loss function is:

[0091]

[0092] wherein, is a coefficient greater than 0, N represents a neighborhood of c containing n points, and c represents the center of the N region, denotes a label value of the k-th point, denotes a label value of the c-th point, and the value of is 0 or 1, denotes a probability value of correct classification.

[0093] In the process of optimizing the change detection model based on the loss function, the gradient of each model parameter is calculated by calculating the difference between the result of the model prediction output and the true label, the parameters of the change detection model are updated using the optimization algorithm, and the above process is iterated until the loss function reaches the minimum value and the number of iterations is satisfied, and the parameters of the change detection model at this time are obtained.

[0094] It should be noted that in other embodiments of the present embodiment, the hyperparameters can also be optimized using the validation dataset while obtaining the model parameters of the change detection model, and the corresponding calculation belongs to the prior art, which will not be described here.

[0095] Step S7, inputting the to-be-detected images of different time phases into the optimized change detection model to obtain a coastal zone change detection result. After obtaining the optimized change detection model in step S6, the to-be-detected data of the to-be-detected region are input into the change detection model for calculation, and the difference features between the remote sensing images of different time phases are extracted, and then the change detection result of the to-be-detected region is obtained.

[0096] In the second embodiment of the present application, the present application provides a coastal zone change detection system based on an attention mechanism and a joint loss function, which comprises a preprocessing module, a change detection module based on an attention mechanism and a joint loss function, and a control output module.

[0097] The preprocessing module is used for image data preprocessing of the input to-be-detected optical remote sensing image to form a preprocessed image set.

[0098] The change detection module based on the attention mechanism and the joint loss function comprises a feature extraction module, a nonlinear transformation attention module and a difference extraction module, and is used for obtaining a change detection result.

[0099] The control output module is used for outputting the change detection result obtained by the change detection module based on the attention mechanism and the joint loss function to a user.

[0100] In the third embodiment of the present application, the present application provides a computer device, characterized in that it comprises a memory, a processor and program instructions stored in the memory and executable by the processor, and the processor executes the program instructions to implement the method described in the first embodiment.

[0101] In the fourth embodiment of the present application, the present application provides a computer readable storage medium, storing a computer program, characterized in that the computer program is executed by a processor to realize the method in the first embodiment.

[0102] The present application proposes a coastal zone change detection method based on attention mechanism and joint loss function for the task of coastal zone change detection. Compared with the change detection model used in the prior art, the present application uses nonlinear transformation attention mechanism and joint loss function to solve the problem of coastal zone change detection in optical remote sensing images. Pixel-level subtraction operation is performed on the dual-time feature to effectively locate the specific position of the coastal zone change, reduce the error caused by brightness difference, and improve the accuracy of change detection. The joint loss function combines the cross-entropy loss function and the edge extraction loss function to improve the performance of the change detection model in handling complex scenes, reduce the confusion between the target domain and the background, and improve the change detection in the edge obvious area.

[0103] The contents not described in detail in the specification belong to the prior art known to those skilled in the art.

[0104] Finally, it should be noted that the above specific embodiments are only used to illustrate the technical solutions of the present patent and are not limiting. Although the present patent has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present patent can be modified or replaced equivalently without departing from the spirit and scope of the present patent, and they should be covered in the scope of the claims of the present patent.

Claims

1. A method for detecting coastal changes based on an attention mechanism and a joint loss function, characterized in that, The method comprises the following steps: Step S1, acquiring optical remote sensing images of a to-be-detected region at different time phases, and performing image preprocessing on the optical remote sensing images to obtain a preprocessed image data set, wherein the image data set comprises a training data set and a to-be-detected data set; Step S2, constructing a coastal zone change detection model, wherein the model comprises a feature extraction module, a nonlinear transformation attention module and a difference extraction module; Step S3, inputting the training data set of the same region at different time phases into the feature extraction module to obtain extracted image features at different time phases, and mapping the image data to a feature space to obtain feature maps at different time phases, wherein the training data set at different time phases comprises a training data set at time phase A and a training data set at time phase B, and time phase A is later than time phase B; Step S4, inputting the feature maps at time phase A and time phase B into the nonlinear transformation attention module to obtain global feature maps at time phase A and time phase B; In the step S4, the feature maps at different time phases are inputted into the nonlinear transformation attention module to obtain global feature maps at different time phases, which comprises: (1) inputting the feature maps at time phase A and time phase B into the nonlinear transformation attention module, first performing normalization processing on the inputted feature maps, and then adopting linear projection to generate three vector matrices Query, Key and Value, and the specific formula is as follows: wherein , and are learnable weight matrices to capture key features in the input feature maps, are feature maps at different time steps, , , are three vector matrices at different time steps, respectively, with x taking values of A or B; (2) calculating attention weight values according to the calculated vector matrices Query, Key and Value: ; where tanh is the hyperbolic tangent activation function, which performs a non-linear transformation on each element in the Query, Key, Value matrices, with feature dimension Usually as a normalized scaling factor, for dot product computation, denotes The function is computed along the last dimension of the tensor; (3) calculating global feature maps according to the attention weight values and Value: ; Step S5, inputting the global feature maps at time phase A and time phase B into the difference extraction module to obtain difference features of the global feature maps at time phase A and time phase B, and obtaining a change detection result according to the difference features; in the step S5, the change detection result is obtained according to the difference features, which further comprises: performing Hadamard product operation on the obtained difference features of the global feature maps at time phase A and time phase B and the feature map at time phase A to obtain the change detection result; Step S6, constructing a joint loss function according to a cross-entropy loss function and an edge loss function, optimizing the coastal zone change detection model by using the joint loss function, and obtaining an optimized change detection model; Step S7, inputting the to-be-detected images at different time phases into the optimized change detection model to obtain a coastal zone change detection result. 2.The coastal change detection method based on attention mechanism and joint loss function according to claim 1, wherein, In the step S1, the image preprocessing on the optical remote sensing images comprises one or more of radiation correction, geometric correction and image enhancement. 3.The coastal change detection method based on attention mechanism and joint loss function according to claim 1, characterized in that, In the step S5, the global feature maps at time phase A and time phase B are inputted into the difference extraction module to obtain difference features of the global feature maps at time phase A and time phase B, which comprises: performing pixel-level subtraction operation on the global feature maps at time phase A and time phase B to obtain a difference feature map, and the specific formula is as follows: ; wherein is a result of a pixel-wise subtraction, is a red channel value at position in the global feature map of phase A, is a red channel value at position in the global feature map of phase B; the green channel value at the position in the global feature map for time phase A, the green channel value at the position in the global feature map for time phase B; the blue channel value at the position in the global feature map for time phase A, the blue channel value at the position in the global feature map for time phase B. 4.The coastal change detection method based on attention mechanism and joint loss function according to claim 1, characterized in that, In the step S6, the joint loss function is constructed according to the cross-entropy loss function and the edge loss function, and the specific formula is as follows: ; wherein, is a total loss function, is a cross-entropy loss function, is a margin loss function, , is a tuning weight for the loss function.

5. The coastal change detection method based on attention mechanism and joint loss function according to claim 4, characterized in that, In the step S6, the joint loss function is constructed according to the cross-entropy loss function and the edge loss function, and the specific formula is as follows: The calculation formula of the cross-entropy loss function is as follows: ; Wherein, y is a probability value output by the detection model, representing a probability of belonging to a positive class; t is a real label, taking a value of 0 or 1, representing a real class of the sample; A calculation formula of the edge loss function is as follows: ; wherein is a coefficient greater than 0, denotes a neighborhood of c containing n points, c denoting the center of the N region, denotes the label value of the k-th point, denotes the label value of the c-th point, and takes the value 0 or 1, denotes the probability value of a correct classification.

6. A computer device, comprising: The computer program is executed by the processor to implement the method of any one of claims 1 to 5.

7. A computer readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to implement the method of any one of claims 1 to 5.