Agricultural land classification method and device based on satellite image time series
By using spatial coding, temporal coding, and decoding based on satellite image time series, the problem of low accuracy in farmland classification has been solved, achieving higher classification accuracy and robustness, and making it suitable for long-term monitoring of arable land.
Patent Information
- Application Number
- CN202310792142.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2043-06-29
AI Technical Summary
Existing technologies have extremely low accuracy in classifying agricultural land, especially in the classification of arable land.
By inputting the time series of satellite images of farmland into the spatial encoder to generate time series of feature maps at different resolutions, the temporal encoder is used to generate a temporal attention mask, and the farmland semantic segmentation is performed by upsampling and feature fusion in combination with the spatial decoder.
It improves the accuracy and robustness of farmland classification, makes full use of the spatiotemporal information of multi-temporal satellite imagery, and can effectively monitor the non-agricultural and non-grain conversion of arable land.
Smart Images

Figure CN116681953B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of land cover classification in remote sensing image processing, in particular to a farmland classification method and device based on satellite image time series. BACKGROUND
[0002] At present, ensuring food security is the top priority, and arable land is the lifeline of food production. Therefore, to ensure food security, we must firmly guard the 1.8 billion mu of arable land red line, resolutely curb the "non-agriculturalization" of arable land, and effectively prevent "non-foodization". The "non-agriculturalization" of arable land refers to the use of arable land for production and business activities other than agricultural production. Compared with "non-agriculturalization", "non-foodization" more strictly refines the policy of food planting, specifically refers to the planting of three major staple foods, namely wheat, rice and corn, and ensuring the planting area of major staple foods is the key to food security.
[0003] However, the "non-agriculturalization" and "non-foodization" of arable land have the characteristics of randomness, dispersion, wide range and disorder, and only through manual screening to obtain such information will greatly increase the difficulty of supervision.
[0004] In related technologies, by using the intelligent monitoring technology of "AI + remote sensing", the position and area of arable land change can be quickly and efficiently detected, so as to realize the long-term supervision of arable land. Most of the current machine learning algorithms extract statistical information of pixel spectral index in satellite image time series, such as minimum value, maximum value, mean value and standard deviation, and then use these statistical information as features for training and classification. However, this method does not consider the internal relationship between pixel points in the time series, so the classification accuracy for farmland, especially arable land, is very low. SUMMARY
[0005] In view of the defects in the prior art, the purpose of the present application is to provide a farmland classification method and device based on satellite image time series, to solve the problem of low classification accuracy for farmland in related technologies.
[0006] The first aspect of the present application provides a farmland classification method based on satellite image time series, which includes the following steps:
[0007] Input the obtained farmland satellite image time series into a spatial encoder to generate feature map time series of different resolutions;
[0008] Input the lowest resolution feature map time series and the acquisition time corresponding to the time series into a time encoder to obtain a time attention mask of the lowest resolution;
[0009] The time attention mask of the lowest resolution is upsampled according to different multiples to obtain the time attention mask corresponding to the other resolution feature map time series;
[0010] The time attention mask is respectively applied to the feature map time sequence of the corresponding resolution, and feature fusion is performed in the time dimension to obtain feature maps of different resolutions.
[0011] The feature maps of different resolutions are input into the spatial decoder to obtain the semantic segmentation result of the farmland.
[0012] In some embodiments, before inputting the obtained satellite image time sequence of the farmland into the spatial encoder, the method further comprises:
[0013] The multi-temporal satellite images of the farmland are obtained, and the satellite image time sequence is formed in chronological order, and the acquisition time of each satellite image in the satellite image time sequence is recorded.
[0014] In some embodiments, the time sequence of the feature map of the lowest resolution and the acquisition time corresponding to the time sequence are input into the time encoder to obtain the time attention mask of the lowest resolution, specifically comprising:
[0015] The tensor shape of each pixel of the time sequence of the feature map of the lowest resolution is CxT, C is the number of channels, and T is the length of the time sequence; position encoding is added to each pixel, and one-dimensional convolution is performed to expand the number of channels to D, to obtain a key tensor K with a shape of DxT;
[0016] The query tensor Q with a shape of 1xD is scaled and dot multiplied with K to obtain a time attention mask A with a shape of 1xT.
[0017] In some embodiments, the time attention mask A is:
[0018] .
[0019] In some embodiments, the different multiples are 2, 4 and 8 respectively.
[0020] In some embodiments, the time encoder is a lightweight time attention encoder.
[0021] In some embodiments, the obtained satellite image time sequence of the farmland is input into the spatial encoder to generate a time sequence of feature maps of different resolutions, specifically comprising:
[0022] Each satellite image in the satellite image time sequence is processed in parallel through the shared four-layer spatial convolutional encoder to obtain four time sequences of feature maps of different resolutions.
[0023] In some embodiments, the time attention mask is applied to the corresponding resolution feature map time sequence for feature fusion, specifically comprising:
[0024] The corresponding resolution feature map time series is weighted and summed in the time dimension by using the time attention mask to obtain a feature map fusion result of different resolutions as the feature map fusion result of the corresponding layer of the four-layer spatial convolution encoder.
[0025] In some embodiments, the spatial decoder described above is a four-layer spatial convolution decoder, and the structure thereof includes four layers, wherein:
[0026] The first layer up-samples the feature map fusion result of the fourth layer of the spatial convolution encoder by transposed convolution, splices the feature map fusion result of the third layer of the spatial convolution encoder, and then performs convolution twice;
[0027] The second layer up-samples the output result of the first layer, splices the feature map fusion result of the second layer of the spatial convolution encoder, and then performs convolution twice;
[0028] The third layer up-samples the output result of the second layer, splices the feature map fusion result of the first layer of the spatial convolution encoder, and then performs convolution twice;
[0029] The fourth layer performs convolution twice on the output result of the third layer to obtain the semantic segmentation result of the farmland.
[0030] The second aspect of the present application provides a farmland classification device based on satellite image time series, which comprises:
[0031] A spatial encoding module is configured to input the acquired satellite image time series of farmland into a spatial encoder to generate feature map time series of different resolutions;
[0032] A time encoding module is configured to input the feature map time series of the lowest resolution and the acquisition time corresponding to the time series into a time encoder to obtain a time attention mask of the lowest resolution;
[0033] An up-sampling module is configured to up-sample the time attention mask of the lowest resolution according to different multiples to obtain time attention masks corresponding to feature map time series of other resolutions;
[0034] A fusion module is configured to apply each time attention mask to the corresponding resolution feature map time series to perform feature fusion in the time dimension to obtain feature maps of different resolutions;
[0035] A decoding and classification module is configured to input the feature maps of different resolutions into a spatial decoder to obtain a semantic segmentation result of farmland.
[0036] The technical solution provided by the present application has the following beneficial effects:
[0037] The satellite image time sequence based agricultural land classification method and device of the present application inputs the obtained satellite image time sequence of agricultural land into a spatial encoder to generate feature map time sequences of different resolutions; then inputs the feature map time sequence of the lowest resolution and the acquisition time corresponding to the time sequence into a time encoder to obtain a time attention mask of the lowest resolution; then up-samples the time attention mask of the lowest resolution according to different multiples to obtain time attention masks corresponding to feature map time sequences of other resolutions; and respectively applies each time attention mask to the feature map time sequence of the corresponding resolution to perform feature fusion in the time dimension to obtain feature maps of different resolutions; finally, inputs the feature maps of different resolutions into a spatial decoder to obtain a semantic segmentation result of agricultural land. The present application considers the reflection of the internal law of changes of ground objects over time on images, and at the same time, mines the potential information in the time dimension. Compared with the agricultural land classification method using a single image, the present application fully utilizes the space-time information of multi-temporal satellite images, and has higher accuracy and robustness. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0039] Figure 1 The first flowchart of the agricultural land classification method of the present embodiment;
[0040] Figure 2 The spatial encoder schematic diagram of the present embodiment;
[0041] Figure 3 The time encoder schematic diagram of the present embodiment;
[0042] Figure 4 The spatial decoder schematic diagram of the present embodiment;
[0043] Figure 5 The second flowchart of the agricultural land classification method of the present embodiment;
[0044] Figure 6 The flowchart of the sample data set making of the present embodiment;
[0045] Figure 7 The agricultural land classification result of the present embodiment. DETAILED DESCRIPTION
[0046] In order to make the purposes, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0047] As shown in Figure 1 The embodiment of the present application provides a farmland classification method based on satellite image time sequence, which can solve the problem of low classification accuracy of farmland in the related art.
[0048] The farmland classification method of the embodiment specifically includes the following steps:
[0049] S1. Input the acquired satellite image time sequence of farmland into a spatial encoder to generate a feature map time sequence at different resolutions.
[0050] S2. Input the feature map time sequence at the lowest resolution and the acquisition time corresponding to the time sequence into a time encoder to obtain a time attention mask at the lowest resolution.
[0051] S3. Upsample the time attention mask at the lowest resolution according to different multiples to obtain the time attention masks corresponding to the feature map time sequences at other resolutions.
[0052] S4. Apply each time attention mask to the feature map time sequence at the corresponding resolution to perform feature fusion in the time dimension, thereby obtaining feature maps at different resolutions.
[0053] S5. Input the feature maps at different resolutions into a spatial decoder to obtain a semantic segmentation result of farmland, and further obtain a farmland classification result.
[0054] Since the "non-food" phenomenon of cultivated land is difficult to detect on single-time-phase remote sensing images, different crops have different phenological phenomena, and their complex time patterns can be fully characterized by multi-time-phase remote sensing images. Therefore, using satellite image time sequence can realize long-term supervision of the "non-food" of cultivated land.
[0055] The agricultural land classification method of the embodiment, by inputting the obtained satellite image time sequence of the agricultural land into a spatial encoder, a feature map time sequence of different resolutions is generated; then the feature map time sequence of the lowest resolution and the acquisition time corresponding to the time sequence are input into a time encoder, and the time attention mask of the lowest resolution is obtained; then the time attention mask of the lowest resolution is up-sampled according to different multiples, and the time attention mask corresponding to the feature map time sequence of other resolutions is obtained; and each time attention mask is respectively applied to the feature map time sequence of the corresponding resolution, and the feature fusion is performed in the time dimension, and the feature map of different resolutions is obtained; finally, the feature map of different resolutions is input into a spatial decoder, and the semantic segmentation result of the agricultural land is obtained. The application considers the reflection of the internal law of the ground object changing over time on the image, and at the same time, the potential information in the time dimension is mined. Compared with the agricultural land classification method using a single image, the spatio-temporal information of the multi-temporal satellite image is fully utilized, and the accuracy and robustness are higher.
[0056] On the basis of the above-mentioned embodiment, in the embodiment, before the obtained satellite image time sequence of the agricultural land is input into the spatial encoder, the following steps are further included:
[0057] The multi-temporal satellite image of the agricultural land is obtained, and the satellite image time sequence is formed in time sequence, and the acquisition time of each satellite image in the satellite image time sequence is recorded.
[0058] On the basis of the above-mentioned embodiment, in the embodiment, the obtained satellite image time sequence of the agricultural land is input into the spatial encoder to generate a feature map time sequence of different resolutions, which specifically includes:
[0059] Each satellite image in the satellite image time sequence is processed in parallel by the shared four-layer spatial convolutional encoder, and four feature map time sequences of different resolutions are obtained.
[0060] As shown in Figure 2 In the embodiment, the spatial coding is completed by the four-layer spatial convolutional encoder, the convolutional encoder includes four layers, each layer is composed of a series of convolution, rectified linear unit activation and normalization layer, and except for the first layer, the rest are all started from a stride convolution (the height and width of the feature map are all divided by 2).
[0061] Specifically, the first layer contains two sub-layers, mainly expanding the channel number of the feature map from X to 32, and the size of the feature map remains unchanged; the second layer contains three sub-layers, which down-sample the size of the feature map by 2 times and expand the channel number to 64; the third layer contains three sub-layers, which further down-sample the size of the feature map by 2 times and expand the channel number to 128; the fourth layer contains three sub-layers, which further down-sample the size of the feature map by 2 times and expand the channel number to 256. The input channel number X of the first convolution is set according to the channel number of the satellite image, and group normalization and rectified linear unit activation are required after each convolution.
[0062] The four-layer spatial convolutional encoder convolution is configured as shown in Table 1:
[0063] Table 1: Encoder convolution detailed configuration
[0064]
[0065] On the basis of the above-mentioned embodiment, in the present embodiment, the lowest resolution feature map time sequence and the acquisition time corresponding to the time sequence are input into the time encoder to obtain the lowest resolution time attention mask, which specifically includes:
[0066] The tensor shape of each pixel of the lowest resolution feature map time sequence is CxT, C is the channel number, and T is the time sequence length; first, position encoding is added to each pixel of the lowest resolution feature map time sequence, and then one-dimensional convolution is performed to expand the channel number to D, to obtain a key tensor K with a shape of DxT.
[0067] Then, the query tensor Q with a shape of 1xD is scaled and dot multiplied with the key tensor K to obtain a time attention mask A with a shape of 1xT.
[0068] In the present embodiment, before spatial decoding, the feature map time sequence generated by the spatial encoder needs to be fused in the time dimension. The above-mentioned time encoder is a lightweight time attention encoder. The lightweight time attention encoding scheme based on the attention mechanism of the present embodiment only processes the lowest resolution feature map time sequence, and the obtained time attention mask can be up-sampled by different multiples, so that it can be applied to other higher resolution feature map time sequences to complete feature fusion in the time dimension.
[0069] In the present embodiment, the different multiples are 2 times, 4 times and 8 times respectively.
[0070] As Figure 3As shown, specifically, the lightweight temporal attention encoder acts on each pixel of the lowest resolution feature map time series. First, the position encoding is added, then the channel number is expanded to D through one-dimensional convolution to obtain K with a shape of DxT, and finally the self-defined Q with a shape of 1xD and participating in training is scaled and dot product operation is performed with K to obtain the time attention mask with a shape of 1xT.
[0071] Further, the calculation formula of the time attention mask A obtained by the scaled dot product is as follows:
[0072] .
[0073] Wherein, Q and K first perform matrix multiplication operation, then scaling, and finally the inner product result is scaled to a probability value between 0 and 1. The obtained time attention mask can be applied to the higher resolution feature map time series after upsampling.
[0074] Further, the time attention mask is applied to the corresponding resolution feature map time series for feature fusion, which specifically includes:
[0075] The corresponding resolution feature map time series is weighted and summed in the time dimension by using the time attention mask, and the feature map fusion result of different resolutions is obtained as the feature map fusion result of the corresponding layer of the four-layer spatial convolution encoder.
[0076] In this embodiment, the feature fusion of the time attention mask applied to the corresponding resolution feature map time series can obtain the feature map fusion result of each layer of the four-layer spatial convolution encoder, which is used for the four-layer spatial convolution decoder.
[0077] As shown in Figure 4 In this embodiment, the convolution decoder includes convolution, correction linear unit activation and normalization layer. First, the feature map of the previous decoder layer is upsampled using the stride transposed convolution. After upsampling, the feature map of the corresponding encoder layer is spliced as the input of the decoder layer. The finally generated feature map has the same size as the input image, and the channel number is equal to the classification number.
[0078] Preferably, the above-mentioned spatial decoder is a four-layer spatial convolution decoder, and the structure thereof includes four layers, namely a first layer, a second layer, a third layer and a fourth layer. Among them:
[0079] The first layer up-samples the feature map fusion result of the fourth layer of the spatial convolution encoder through transposed convolution, splices the feature map fusion result of the third layer of the spatial convolution encoder, and then performs convolution twice.
[0080] Specifically, the first layer includes four sub-layers, the first sub-layer up-samples the feature map fusion result of the fourth layer of the four-layer spatial convolutional encoder by 2 times through transposed convolution, and the channel number is reduced to 128, the input of the second sub-layer is the feature map fusion result of the third layer of the four-layer spatial convolutional encoder, and after the results of the first sub-layer and the second sub-layer are spliced, two convolutions are performed, the channel number is 128, and the feature map size is unchanged.
[0081] The second layer first up-samples the output result of the first layer, and then splices the feature map fusion result of the second layer of the spatial convolutional encoder, and then performs two convolutions.
[0082] Specifically, the second layer includes four sub-layers, the first sub-layer up-samples the result of the previous layer by 2 times, and the channel number is reduced to 64, the input of the second sub-layer is the feature map fusion result of the second layer of the four-layer spatial convolutional encoder, and after the results of the first sub-layer and the second sub-layer are spliced, two convolutions are performed, the channel number is 64, and the feature map size is unchanged.
[0083] The third layer first up-samples the output result of the second layer, and then splices the feature map fusion result of the first layer of the spatial convolutional encoder, and then performs two convolutions.
[0084] Specifically, the third layer includes four sub-layers, and the processing process is similar to that of the second layer, the first sub-layer up-samples the obtained feature map by 2 times, and the channel number is reduced to 32, the input of the second sub-layer is the feature map fusion result of the first layer of the four-layer spatial convolutional encoder, and after the results of the first sub-layer and the second sub-layer are spliced, two convolutions are performed, the channel number is 32, and the feature map size is unchanged.
[0085] The fourth layer performs two convolutions on the output result of the third layer to obtain the semantic segmentation result of the agricultural land.
[0086] Specifically, the fourth layer includes two sub-layers, and the final prediction result is obtained through the convolution of the two sub-layers.
[0087] The convolution details of the four-layer spatial convolutional encoder are shown in Table 2 as follows:
[0088] Table 2 Decoder convolution details
[0089]
[0090] In this embodiment, the output channel number Y of the last convolution is set according to the classification number, and batch normalization and rectified linear unit activation are sequentially performed after each convolution.
[0091] As shown in Figure 5 The satellite image time series based agricultural land classification method of the embodiment specifically includes the following steps:
[0092] A1. crop and organize the multi-temporal satellite images to obtain a satellite image time sequence;
[0093] A2. record the acquisition time of each satellite image in the satellite image time sequence;
[0094] A3. extract features through a four-layer spatial convolutional encoder to obtain a feature map time sequence;
[0095] A4. input the lowest resolution feature map time sequence and the acquisition time corresponding to the satellite image time sequence into a lightweight temporal attention encoder to obtain a lowest resolution temporal attention mask;
[0096] A5. sequentially upsample the lowest resolution temporal attention mask to obtain temporal attention masks corresponding to feature map time sequences of other resolutions, i.e., other resolution temporal attention masks;
[0097] A6. apply each temporal attention mask to the corresponding resolution feature map time sequence for feature fusion in the time dimension to obtain feature maps of different resolutions;
[0098] A7. input the feature maps of different resolutions into a four-layer spatial convolutional decoder to obtain a semantic segmentation result of the agricultural land.
[0099] The application also provides an embodiment of an agricultural land classification device based on a satellite image time sequence, which comprises a spatial encoding module, a temporal encoding module, an upsampling module, a fusion module, and a decoding and classification module.
[0100] The spatial encoding module is used to input the obtained satellite image time sequence of the agricultural land into a spatial encoder to generate feature map time sequences of different resolutions.
[0101] The temporal encoding module is used to input the lowest resolution feature map time sequence and each acquisition time corresponding to the time sequence into a temporal encoder to obtain a lowest resolution temporal attention mask.
[0102] The upsampling module is used to upsample the lowest resolution temporal attention mask by different multiples to obtain temporal attention masks corresponding to feature map time sequences of other resolutions.
[0103] The fusion module is used to apply each temporal attention mask to the corresponding resolution feature map time sequence for feature fusion in the time dimension to obtain feature maps of different resolutions.
[0104] The decoding and classification module is used to input the feature maps of different resolutions into a spatial decoder to obtain a semantic segmentation result of the agricultural land, and further determine an agricultural land classification result.
[0105] As shown in Figure 6 In this embodiment, a sample data set can be made for training of the agricultural land classification device, and the data processing flow is as follows:
[0106] B1. Select the training sample area, specifically, four different latitude and longitude bands of agricultural land are selected in the training sample area to ensure the diversity and representativeness of the data;
[0107] B2. Crop and screen the labeled data, specifically, the labeled data of the classification results corresponding to the four regions is cropped to N x N size, and only the labels with more than 80% of agricultural land are retained;
[0108] B3. Crop the satellite image time series, specifically, according to the retained labels, 12 consecutive months of image data are cropped from the multi-temporal data set in the same way to form a satellite image time series, and the collection time of each image is recorded;
[0109] B4. Data arrangement and storage, specifically, the obtained labeled data and corresponding satellite image time series are named with the same number and saved to different folders, and the file format is npy.
[0110] As shown in Figure 7 The image data of Sentinel-2 is used to make a sample data set and a test set, and the evaluation indicators include pixel accuracy (PA), average pixel accuracy (MPA), and average intersection over union (mIoU). The method of this embodiment is compared with three other algorithms for experiments, and the experimental results are shown in Table 3 as follows:
[0111] Table 3 Comparison of experimental results
[0112]
[0113] The agricultural land classification device of this embodiment is suitable for the above-mentioned agricultural land classification methods, and as an end-to-end pixel-level agricultural land classification device based on satellite image time series, it uses convolution and attention mechanism to extract rich multi-scale spatio-temporal features. Convolution is used for spatial dimension encoding and decoding, and attention mechanism realizes the fusion of feature map sequences of different resolutions in the time dimension. Compared with the agricultural land classification method using a single image, it fully utilizes the spatio-temporal information and has higher accuracy and robustness.
[0114] The present application also provides an embodiment of an electronic device for agricultural land classification, which comprises a processor and a memory, and the processor executes the code in the memory to realize the above-mentioned agricultural land classification method based on satellite image time series.
[0115] In the description of the present application, it should be noted that the terms "upper", "lower", and the like are used for indicating the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. Unless otherwise explicitly specified and limited, the terms "mounting", "connection", "connecting" should be interpreted broadly, for example, can be fixed connection, can also be detachable connection, or integral connection; can be mechanical connection, can also be electrical connection; can be directly connected, can also be indirectly connected through an intermediate medium, can be internal communication of two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0116] It should be noted that in the present application, relational terms such as "first" and "second", and the like are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus including a series of elements includes not only those elements, but also other elements not explicitly listed, or other elements inherent in such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of other identical elements in the process, method, article or apparatus including the element.
[0117] The above is only a specific embodiment of the present application, which enables those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features applied herein.
Claims
1. A method for agricultural land classification based on time series of satellite imagery, characterized in that, It comprises the steps of: inputting the acquired satellite image time sequence of agricultural land into a spatial encoder to generate feature map time sequences of different resolutions; inputting the lowest resolution feature map time sequence and the acquisition time corresponding to the time sequence into a time encoder to obtain a time attention mask of the lowest resolution; the time attention mask of the lowest resolution is upsampled by different multiples to obtain the time attention mask corresponding to the feature map time sequence of other resolutions; each time attention mask is respectively applied to the feature map time sequence of the corresponding resolution to perform feature fusion in the time dimension to obtain feature maps of different resolutions; inputting the feature maps of different resolutions into a spatial decoder to obtain a semantic segmentation result of agricultural land; inputting the lowest resolution feature map time sequence and the acquisition time corresponding to the time sequence into a time encoder to obtain a time attention mask of the lowest resolution, specifically comprising: the tensor shape of each pixel of the lowest resolution feature map time sequence is CxT, C is the number of channels, and T is the length of the time sequence; a position encoding is added to each pixel, and then a one-dimensional convolution is performed to expand the number of channels to D to obtain a key tensor K with a shape of DxT; scaling point multiplication is performed between a query tensor Q with a shape of 1xD and K to obtain a time attention mask A with a shape of 1xT.
2. The method for agricultural land classification based on time series of satellite imagery according to claim 1, characterized in that, Before inputting the acquired satellite image time sequence of agricultural land into a spatial encoder, it further comprises: acquiring multi-temporal satellite images of agricultural land, forming a satellite image time sequence in chronological order, and recording the acquisition time of each satellite image in the satellite image time sequence.
3. The method for agricultural land classification based on time series of satellite imagery according to claim 1, characterized in that, The time attention mask A is: 。 4. The method for agricultural land classification based on time series of satellite imagery according to claim 1, characterized in that: The different multiples are 2, 4 and 8 respectively.
5. The method for agricultural land classification based on time series of satellite imagery according to claim 1, characterized in that: The time encoder is a lightweight time attention encoder.
6. The method for agricultural land classification based on time series of satellite imagery according to claim 1, wherein, Inputting the acquired satellite image time sequence of agricultural land into a spatial encoder to generate feature map time sequences of different resolutions, specifically comprising: each satellite image in the satellite image time sequence is processed in parallel through a shared four-layer spatial convolutional encoder to obtain four feature map time sequences of different resolutions.
7. The method for agricultural land classification based on time series of satellite imagery according to claim 6, characterized in that, The time attention mask is applied to the corresponding resolution feature map time sequence for feature fusion, specifically comprising: the corresponding resolution feature map time sequence is weighted and summed in the time dimension by using the time attention mask to obtain a feature map fusion result of different resolutions as the feature map fusion result of the corresponding layer of the four-layer spatial convolutional encoder.
8. The method for agricultural land classification based on time series of satellite imagery according to claim 7, characterized in that, The spatial decoder is a four-layer spatial convolutional decoder, and its structure comprises four layers, wherein: the first layer up-samples the feature map fusion result of the fourth layer of the spatial convolutional encoder by transposed convolution, then splices the feature map fusion result of the third layer of the spatial convolutional encoder, and then performs convolution twice; the second layer up-samples the output result of the first layer, then splices the feature map fusion result of the second layer of the spatial convolutional encoder, and then performs convolution twice; the third layer up-samples the output result of the second layer, then splices the feature map fusion result of the first layer of the spatial convolutional encoder, and then performs convolution twice; The fourth layer convolves the output result of the third layer twice to obtain a semantic segmentation result of the farmland.
9. An apparatus for agricultural land classification based on time series of satellite imagery, characterized in that, It comprises: a spatial encoding module configured to input the acquired farmland satellite image time series into a spatial encoder to generate feature map time series of different resolutions; a time encoding module configured to input the feature map time series of the lowest resolution and the acquisition time corresponding to the time series into a time encoder to obtain a time attention mask of the lowest resolution; an up-sampling module configured to up-sample the time attention mask of the lowest resolution by different multiples to obtain time attention masks corresponding to feature map time series of other resolutions; a fusion module configured to apply each time attention mask to the corresponding resolution feature map time series to perform feature fusion in the time dimension to obtain feature maps of different resolutions; a decoding classification module configured to input the feature maps of different resolutions into a spatial decoder to obtain a semantic segmentation result of the farmland; the time encoding module is configured to: the tensor shape of each pixel of the feature map time series of the lowest resolution is CxT, C is the number of channels, and T is the length of the time series; position encoding is added to each pixel, and one-dimensional convolution is performed to expand the number of channels to D to obtain a key tensor K with a shape of DxT; scaling dot product operation is performed between a query tensor Q with a shape of 1xD and K to obtain a time attention mask A with a shape of 1xT.
Citation Information
Patent Citations
Video super-resolution reconstruction method and system based on multi-scale local self-attention
CN115082308A
Video instance segmentation method based on cross-frame instance association
CN116152710A