Remote sensing image classification method and device, processor and electronic equipment
By enhancing semantic information through the feature extraction layer and semantic filter of the target network model, the problem of low feature extraction accuracy in remote sensing image classification is solved, and the accuracy of remote sensing image classification is improved.
Patent Information
- Application Number
- CN202310499776.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-05
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2043-05-05
AI Technical Summary
In existing technologies, the low accuracy of feature extraction during remote sensing image classification leads to low classification accuracy.
Feature extraction is performed on remote sensing images through the feature extraction layer of the target network model. Semantic information is enhanced by semantic filters to obtain the second target feature matrix, and classification is performed based on the matrix.
This improves the accuracy of feature extraction from remote sensing images, thereby enhancing classification accuracy.
Smart Images

Figure CN116385803B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a method and apparatus for classifying remote sensing images, a processor, and electronic equipment. Background Technology
[0002] The core of remote sensing technology applications lies in identifying the types and distribution of ground features based on their electromagnetic radiation intensity as perceived in remote sensing images. This depends on factors such as the remote sensing channel, the spectral characteristics of the ground features, atmospheric propagation characteristics, and sensor response characteristics. Different types of remote sensing images (multispectral, hyperspectral, and synthetic aperture radar images) require different classification methods. Current remote sensing image classification primarily relies on manually extracted image features. These methods depend on experts with extensive domain knowledge and practical experience to design various image features, such as color, shape, texture, and spectral information. These features contain a wealth of useful information for target classification. However, with the rapid development of remote sensing technology and increasingly higher image resolution, manual feature extraction is becoming increasingly difficult to achieve accurately, resulting in lower accuracy in remote sensing image feature extraction during classification.
[0003] There is currently no effective solution to the problem that the classification accuracy of remote sensing images is relatively low due to the low precision of feature extraction. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, processor, and electronic device for classifying remote sensing images, in order to solve the problem that the classification accuracy of remote sensing images is relatively low due to the low precision of feature extraction in the remote sensing images.
[0005] To achieve the above objectives, according to one aspect of this application, a method for classifying remote sensing images is provided. The method includes: acquiring a target remote sensing image to be classified; extracting features from the target remote sensing image through a feature extraction layer in a target network model to obtain a first target feature matrix; enhancing the semantic information of the first target feature matrix through a semantic filter in the target network model to obtain a second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image; and classifying the target remote sensing image based on the second target feature matrix to obtain a classification result for the target remote sensing image.
[0006] Furthermore, before extracting features from the target remote sensing image through the feature extraction layer in the target network model to obtain the first target feature matrix, the method further includes: acquiring a first remote sensing image sample set and a second remote sensing image sample set, wherein the first remote sensing image sample set includes N remote sensing image categories, each remote sensing image category includes M first remote sensing sample images, and the second remote sensing image sample set includes at least a second remote sensing sample image and Z third remote sensing sample images obtained by rotating the second remote sensing sample image by Z angles, wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 2, and Z is a positive integer greater than or equal to 2; Feature extraction is performed on the first remote sensing image sample set using an initial network model to obtain M third target feature matrices corresponding to each remote sensing image category. Feature extraction is then performed on the second remote sensing image sample set using the same initial network model to obtain a target feature matrix set, wherein the feature matrix set includes at least a fourth target feature matrix corresponding to the second remote sensing sample image and a fifth target feature matrix corresponding to each third remote sensing sample image. Based on the M third target feature matrices corresponding to each remote sensing image category and the target feature matrix set, a multivariate loss function is determined, and the initial network model is trained based on the multivariate loss function to obtain the target network model.
[0007] Further, the feature extraction of the first remote sensing image sample set through the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category includes: extracting features from the first remote sensing image sample set through the feature extraction layer in the initial network model to obtain M third initial feature matrices corresponding to each remote sensing image category in the first remote sensing image sample set; and enhancing the semantic information corresponding to the remote sensing image category in the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter in the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category.
[0008] Furthermore, before enhancing the semantic information of the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter in the initial network model to obtain the M third target feature matrices corresponding to each remote sensing image category, the method further includes: extracting semantic information from the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter to obtain semantic information corresponding to N remote sensing image categories; training the semantic filter based on the semantic information corresponding to the N remote sensing image categories so that the weight layer of the semantic filter includes the semantic information corresponding to the N remote sensing image categories.
[0009] Further, the process of extracting features from the second remote sensing image sample set using the initial network model to obtain the target feature matrix set includes: extracting features from the second remote sensing image sample set using the feature extraction layer of the initial network model to obtain an initial feature matrix set corresponding to the second remote sensing image sample set; and enhancing the semantic information of the initial feature matrix set using the semantic filter based on the semantic information corresponding to the N remote sensing image categories to obtain the target feature matrix set.
[0010] Further, determining the multivariate loss function based on the M third target feature matrices corresponding to each remote sensing image category and the target feature matrix set includes: determining a first loss function based on the cosine distance between the M third target feature matrices corresponding to each remote sensing image category and the fourth target feature matrix; determining a second loss function based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fourth target feature matrix; determining a third loss function based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fifth target feature matrix; determining a fourth loss function based on a sixth target feature matrix and the fourth target feature matrix, wherein the sixth target feature matrix is a feature matrix among the M third target feature matrices corresponding to each remote sensing image category whose Euclidean distance to the fourth target feature matrix is less than a preset value; and determining the multivariate loss function based on the first loss function, the second loss function, the third loss function, and the fourth loss function.
[0011] Furthermore, the second remote sensing image sample set also includes the real remote sensing image categories corresponding to the second remote sensing sample images. Determining the first loss function based on the cosine distance values between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category includes: calculating the cosine distance values between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category to obtain the M cosine distance values corresponding to each remote sensing image category; determining S remote sensing image categories based on the M cosine distance values corresponding to each remote sensing image category, and defining the S remote sensing image categories as the first predicted remote sensing image categories corresponding to the second remote sensing sample images, where S is a positive integer greater than or equal to 2; and determining the first loss function based on the first predicted remote sensing image categories and the real remote sensing image categories.
[0012] Furthermore, the second remote sensing image sample set also includes the real remote sensing image categories corresponding to the second remote sensing sample images. Determining the second loss function based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fourth target feature matrix includes: calculating the cross-entropy between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category to obtain the M cross-entropy values corresponding to each remote sensing image category; determining P remote sensing image categories based on the M cross-entropy values corresponding to each remote sensing image category, and determining the P remote sensing image categories as the second predicted remote sensing image categories corresponding to the second remote sensing sample images, where P is a positive integer greater than or equal to 2; and determining the second loss function based on the second predicted remote sensing image categories and the real remote sensing image categories.
[0013] Furthermore, the second remote sensing image sample set also includes the real remote sensing image category corresponding to the second remote sensing sample image. Determining the third loss function based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fifth target feature matrix includes: determining the third predicted remote sensing image category corresponding to each third remote sensing sample image based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fifth target feature matrix; and determining the third loss function based on the third predicted remote sensing image category and the real remote sensing image category.
[0014] Furthermore, the second remote sensing image sample set also includes the real remote sensing image category corresponding to the second remote sensing sample image. Determining the fourth loss function based on the sixth target feature matrix and the fourth target feature matrix includes: calculating the Euclidean distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category using the Euclidean norm, obtaining multiple Euclidean distances; determining the sixth target feature matrix based on the multiple Euclidean distances, and determining the remote sensing image category corresponding to the sixth target feature matrix as the fourth predicted remote sensing image category corresponding to the second remote sensing sample image; and determining the fourth loss function based on the fourth predicted remote sensing image category corresponding to the second remote sensing sample image and the real remote sensing image category corresponding to the second remote sensing sample image.
[0015] To achieve the above objectives, according to another aspect of this application, a remote sensing image classification apparatus is provided. The apparatus includes: a first acquisition unit for acquiring a target remote sensing image to be classified; a first extraction unit for extracting features from the target remote sensing image through a feature extraction layer in a target network model to obtain a first target feature matrix; a filtering unit for enhancing the semantic information of the first target feature matrix through a semantic filter in the target network model to obtain a second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image; and a classification unit for classifying the target remote sensing image based on the second target feature matrix to obtain a classification result for the target remote sensing image.
[0016] Furthermore, the apparatus further includes: a second acquisition unit, configured to acquire a first remote sensing image sample set and a second remote sensing image sample set, wherein the first remote sensing image sample set includes N remote sensing image categories, each remote sensing image category includes M first remote sensing sample images, and the second remote sensing image sample set includes at least a second remote sensing sample image and Z third remote sensing sample images obtained by rotating the second remote sensing sample images by Z angles, wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 2, and Z is a positive integer greater than or equal to 2; and a second extraction unit, configured to perform special processing on the first remote sensing image sample set using an initial network model. The system extracts features to obtain M third target feature matrices corresponding to each remote sensing image category. A third extraction unit is used to extract features from the second remote sensing image sample set using the initial network model to obtain a target feature matrix set, wherein the feature matrix set includes at least a fourth target feature matrix corresponding to the second remote sensing sample image and a fifth target feature matrix corresponding to each third remote sensing sample image. A first training unit is used to determine a multivariate loss function based on the M third target feature matrices corresponding to each remote sensing image category and the target feature matrix set, and to train the initial network model based on the multivariate loss function to obtain the target network model.
[0017] Further, the second extraction unit includes: a first extraction module, used to extract features from the first remote sensing image sample set through the feature extraction layer in the initial network model to obtain M third initial feature matrices corresponding to each remote sensing image category in the first remote sensing image sample set; and a first filtering module, used to enhance the semantic information corresponding to the remote sensing image category in the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter in the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category.
[0018] Furthermore, the device further includes: a fourth extraction unit, configured to extract semantic information from the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter, to obtain semantic information corresponding to N remote sensing image categories; and a second training unit, configured to train the semantic filter based on the semantic information corresponding to the N remote sensing image categories, so that the weight layer of the semantic filter includes the semantic information corresponding to the N remote sensing image categories.
[0019] Furthermore, the third extraction unit includes: a second extraction module, used to extract features from the second remote sensing image sample set through the feature extraction layer of the initial network model to obtain an initial feature matrix set corresponding to the second remote sensing image sample set; and a second filtering module, used to enhance the semantic information of the initial feature matrix set based on the semantic information corresponding to the N remote sensing image categories through the semantic filter to obtain the target feature matrix set.
[0020] Further, the first training unit includes: a first determining module, configured to determine a first loss function based on the cosine distance between the M third target feature matrices corresponding to each remote sensing image category and the fourth target feature matrix; a second determining module, configured to determine a second loss function based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fourth target feature matrix; a third determining module, configured to determine a third loss function based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fifth target feature matrix; a fourth determining module, configured to determine a fourth loss function based on a sixth target feature matrix and the fourth target feature matrix, wherein the sixth target feature matrix is a feature matrix among the M third target feature matrices corresponding to each remote sensing image category whose Euclidean distance to the fourth target feature matrix is less than a preset value; and a fifth determining module, configured to determine the multivariate loss function based on the first loss function, the second loss function, the third loss function, and the fourth loss function.
[0021] Further, the first determining module includes: a first calculation submodule, used to calculate the cosine distance values between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category, to obtain the M cosine distance values corresponding to each remote sensing image category; a first determining submodule, used to determine S remote sensing image categories based on the M cosine distance values corresponding to each remote sensing image category, and to determine the S remote sensing image categories as the first predicted remote sensing image categories corresponding to the second remote sensing sample image, where S is a positive integer greater than or equal to 2; and a second determining submodule, used to determine the first loss function based on the first predicted remote sensing image category and the real remote sensing image category.
[0022] Further, the second determining module includes: a second calculation submodule, used to calculate the cross-entropy between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category, to obtain the M cross-entropy values corresponding to each remote sensing image category; a third determining submodule, used to determine P remote sensing image categories based on the M cross-entropy values corresponding to each remote sensing image category, and to determine the P remote sensing image categories as the second predicted remote sensing image categories corresponding to the second remote sensing sample image, where P is a positive integer greater than or equal to 2; and a fourth determining submodule, used to determine the second loss function based on the second predicted remote sensing image category and the real remote sensing image category.
[0023] Furthermore, the third determining module includes: a fifth determining submodule, used to determine the third predicted remote sensing image category corresponding to each third remote sensing sample image based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fifth target feature matrix; and a sixth determining submodule, used to determine the third loss function based on the third predicted remote sensing image category and the real remote sensing image category.
[0024] Further, the fourth determining module includes: a third calculation submodule, used to calculate the Euclidean distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category using the Euclidean norm, to obtain multiple Euclidean distances; a seventh determining submodule, used to determine the sixth target feature matrix based on the multiple Euclidean distances, and determine the remote sensing image category corresponding to the sixth target feature matrix as the fourth predicted remote sensing image category corresponding to the second remote sensing sample image; and an eighth determining submodule, used to determine the fourth loss function based on the fourth predicted remote sensing image category corresponding to the second remote sensing sample image and the real remote sensing image category corresponding to the second remote sensing sample image.
[0025] This application employs the following steps: acquiring a target remote sensing image to be classified; extracting features from the target remote sensing image using a feature extraction layer in a target network model to obtain a first target feature matrix; enhancing the semantic information of the first target feature matrix using a semantic filter in the target network model to obtain a second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image; and classifying the target remote sensing image based on the second target feature matrix to obtain the classification result of the target remote sensing image. This solves the problem in related technologies where the classification accuracy of remote sensing images is relatively low due to the low precision of remote sensing image feature extraction. In this application, feature extraction is performed on the target remote sensing image to be classified through the feature extraction layer of the target network model. Then, the semantic filter in the target network model enhances the semantic information of the first target feature matrix extracted by the feature extraction layer to obtain the second target feature matrix. The target remote sensing image is classified according to the enhanced semantic information in the second target feature matrix to obtain the classification result of the target remote sensing image. By performing feature extraction and semantic information enhancement on the target remote sensing image, the accuracy of feature extraction on the target remote sensing image is improved, thereby achieving the effect of improving the classification accuracy of the remote sensing image. Attached Figure Description
[0026] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0027] Figure 1 This is a flowchart of a remote sensing image classification method provided according to an embodiment of this application;
[0028] Figure 2 This is a schematic diagram of a semantic filter provided according to an embodiment of this application;
[0029] Figure 3 This is a schematic diagram of a remote sensing image classification method provided according to an embodiment of this application;
[0030] Figure 4 This is a schematic diagram of a remote sensing image classification device provided according to an embodiment of this application;
[0031] Figure 5 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0032] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0033] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.
[0036] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a remote sensing image classification method provided according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0037] Step S101: Obtain the remote sensing image of the target to be classified.
[0038] When classifying remote sensing images, the first step is to acquire the remote sensing image to be classified, namely the target remote sensing image mentioned above.
[0039] Step S102: Extract features from the target remote sensing image through the feature extraction layer in the target network model to obtain the first target feature matrix.
[0040] The main features related to the remote sensing image category are extracted from the target remote sensing image by the feature extraction layer in the target network model, and the first target feature matrix of the target remote sensing image is obtained. The feature extraction layer can be a pre-trained neural network.
[0041] Step S103: The semantic information of the first target feature matrix is enhanced by the semantic filter in the target network model to obtain the second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image.
[0042] The semantic information representing the target remote sensing image category in the first target feature matrix is enhanced by the semantic filter in the target network model to obtain the second target feature matrix. The semantic filter used in this application is a semantic filter built based on the transformer structure.
[0043] Step S104: Classify the target remote sensing image based on the second target feature matrix to obtain the classification result of the target remote sensing image.
[0044] The target remote sensing image is classified based on the enhanced semantic information in the second target feature matrix, and the classification result of the target remote sensing image is obtained.
[0045] In summary, this application extracts features from the target remote sensing image to be classified through the feature extraction layer of the target network model. Then, the semantic filter in the target network model enhances the semantic information of the first target feature matrix extracted by the feature extraction layer to obtain a second target feature matrix. Based on the enhanced semantic information in the second target feature matrix, the target remote sensing image is classified to obtain the classification result of the target remote sensing image. By performing feature extraction and semantic information enhancement on the target remote sensing image, the accuracy of feature extraction from the target remote sensing image is improved, thereby achieving the effect of improving the classification accuracy of the remote sensing image.
[0046] Optionally, in the remote sensing image classification method provided in this application embodiment, before extracting features from the target remote sensing image through the feature extraction layer in the target network model to obtain the first target feature matrix, the method further includes: obtaining a first remote sensing image sample set and a second remote sensing image sample set, wherein the first remote sensing image sample set includes N remote sensing image categories, each remote sensing image category includes M first remote sensing sample images, and the second remote sensing image sample set includes at least a second remote sensing sample image and Z third remote sensing sample images obtained by rotating the second remote sensing sample image by Z angles, wherein N is a positive integer greater than or equal to 2, and M is a positive integer greater than or equal to 2. Z is a positive integer greater than or equal to 2. Features are extracted from the first remote sensing image sample set using the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category. Features are extracted from the second remote sensing image sample set using the initial network model to obtain a target feature matrix set, wherein the feature matrix set includes at least a fourth target feature matrix corresponding to the second remote sensing sample image and a fifth target feature matrix corresponding to each third remote sensing sample image. Based on the M third target feature matrices and the target feature matrix set corresponding to each remote sensing image category, a multivariate loss function is determined, and the initial network model is trained based on the multivariate loss function to obtain the target network model.
[0047] For example, before classifying a target remote sensing image using a target network model, the initial network model needs to be trained to obtain the target network model. First, a first remote sensing image sample set and a second remote sensing image sample set are obtained for training. The category information of the first remote sensing image sample is known. Before inputting it into the initial network model, the first remote sensing image sample is labeled, thus obtaining a first remote sensing image sample set including N remote sensing image categories. The second remote sensing image sample set includes second remote sensing image sample images with unknown categories and a third remote sensing image sample. The third remote sensing image sample is obtained by rotating the second remote sensing image sample by multiple angles. For example, the second remote sensing image sample can be rotated by four angles: [30°, 90°, 180°, 270°]. By rotating the second remote sensing image sample, the purpose of expanding the training samples is achieved, and the accuracy of the initial network model in classifying remote sensing images can be verified from multiple angles.
[0048] The initial network model is trained using the first and second remote sensing image sample sets. Based on the remote sensing image categories in the first remote sensing image sample set, the second and third remote sensing sample images in the second remote sensing image sample set are predicted and classified.
[0049] Then, feature extraction is performed on the first remote sensing image sample set using the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category. The third target feature matrices include feature information of the first remote sensing sample images corresponding to the first remote sensing image sample set. Feature extraction is then performed on the second remote sensing image sample set using the initial network model to obtain a target remote sensing image sample set including a fourth target feature matrix corresponding to the second remote sensing sample images and a fifth target feature matrix corresponding to each third remote sensing sample image. The fourth target feature matrix includes feature information of the second remote sensing sample images, and the fifth target feature matrix includes feature information of the third remote sensing sample images.
[0050] Finally, based on the obtained third target feature matrix and target feature matrix set, the corresponding multivariate loss function can be determined. The initial network model is then trained based on the determined multivariate loss function to obtain the target network model for classifying remote sensing images of the target to be classified.
[0051] Feature extraction is performed on the first and second remote sensing image sample sets using an initial network model. A multivariate loss function is determined based on the extracted features, and the initial network model is then trained using the multivariate loss function to obtain the target network model. By training the initial network model using the multivariate loss function, the accuracy of the initial network model in classifying remote sensing images is improved. The initial network model that meets the accuracy requirements for remote sensing image classification is determined as the target network model, thereby improving the accuracy of remote sensing image classification.
[0052] Optionally, in the remote sensing image classification method provided in this application embodiment, the process of extracting features from the first remote sensing image sample set through an initial network model to obtain M third target feature matrices corresponding to each remote sensing image category includes: extracting features from the first remote sensing image sample set through the feature extraction layer in the initial network model to obtain M third initial feature matrices corresponding to each remote sensing image category in the first remote sensing image sample set; and enhancing the semantic information corresponding to the remote sensing image category in the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter in the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category.
[0053] For example, when the initial network model extracts features from the first remote sensing image sample set, it first extracts feature information from the first remote sensing image sample set through the feature extraction layer in the initial network model, obtaining M third initial feature matrices corresponding to each remote sensing image category. These third initial feature matrices include the main feature information related to the remote sensing image category in the first remote sensing sample images. Then, the semantic filter in the initial network model enhances the linguistic information corresponding to the remote sensing image category in the third initial target feature matrix. The specific process is as follows: Figure 2As shown, the third initial feature matrix and the weight parameters in the semantic filter are subjected to matrix calculation. After matrix calculation, they are processed by the normalized exponential function. After processing, they are subjected to matrix calculation again with the initial weight parameters in the semantic filter to obtain a sub-matrix. The sub-matrix and the third initial feature matrix are concatenated (concat) to reorganize the sub-matrix and the third initial feature matrix to obtain the third target feature matrix.
[0054] After the feature extraction layer in the initial network model extracts features from the first remote sensing image sample set, the semantic filter based on transformer is used to enhance the semantic information corresponding to the remote sensing image category in the third initial feature matrix. This enhances the main image features related to the remote sensing image category in the first remote sensing sample image. By extracting features and enhancing semantic information, the category features of the first remote sensing sample image become more prominent, improving the accuracy of feature extraction and thus improving the accuracy of remote sensing image classification.
[0055] Optionally, in the remote sensing image classification method provided in this application embodiment, before enhancing the semantic information of the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter in the initial network model to obtain the M third target feature matrices corresponding to each remote sensing image category, the method further includes: extracting semantic information from the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter to obtain semantic information corresponding to N remote sensing image categories; and training the semantic filter based on the semantic information corresponding to the N remote sensing image categories so that the weight layer of the semantic filter includes the semantic information corresponding to the N remote sensing image categories.
[0056] For example, when the semantic filter in the initial network model enhances the linguistic information corresponding to the remote sensing image categories in the third initial feature matrix, the semantic filter extracts the semantic information of the third initial feature matrix to obtain the semantic information corresponding to N categories in the first remote sensing sample image set. The semantic filter is trained according to formula (1), and the extracted semantic information corresponding to the N categories is embedded into the weight layer of the semantic filter. Formula (1) is shown below:
[0057] f′=FFN(f+δ(fθ T )θ)(1)
[0058] Where f′ is the third target feature matrix, f is the third initial target feature matrix, and θ is the obtained semantic information matrix. T Let θ be the transpose of θ, δ be the softmax function, and FFN be the forward propagation network in the transformer structure.
[0059] Through the above calculations, the semantic information corresponding to the N categories in the first remote sensing sample set is embedded into the weight layer of the semantic filter. When the semantic filter processes the remote sensing image in the subsequent process, the corresponding target information can be obtained from the weight layer to enhance the semantic information of the remote sensing image, thereby improving the accuracy of semantic information enhancement of the remote sensing image.
[0060] Optionally, in the remote sensing image classification method provided in this application embodiment, the process of extracting features from a second remote sensing image sample set using an initial network model to obtain a target feature matrix set includes: extracting features from the second remote sensing image sample set using the feature extraction layer of the initial network model to obtain an initial feature matrix set corresponding to the second remote sensing image sample set; and enhancing the semantic information of the initial feature matrix set using a semantic filter based on the semantic information corresponding to N remote sensing image categories to obtain the target feature matrix set.
[0061] For example, feature extraction is performed on the second remote sensing image sample set in the initial network model to obtain the initial feature matrix set corresponding to the second remote sensing image sample set. The initial feature matrix set includes the fourth initial feature matrix corresponding to the second remote sensing sample image and the fifth initial feature matrix corresponding to each third remote sensing sample image. The fourth initial feature matrix includes the main feature information related to the remote sensing image category in the second remote sensing sample image, and the fifth initial feature matrix includes the main feature information related to the remote sensing image category in the third remote sensing sample image. The semantic information of the initial feature matrix set is enhanced by the semantic information corresponding to the N remote sensing image categories contained in the semantic filter to obtain the target feature matrix set.
[0062] The semantic information of the initial feature matrix set is enhanced by the semantic information corresponding to the N remote sensing image categories in the semantic filter. This is equivalent to enhancing the semantic information of the second remote sensing image sample set by the semantic information of the first remote sensing image sample set. This allows the remote sensing image features in the second remote sensing image sample set to better fit the remote sensing image category features in the first remote sensing image sample set, thus providing feature support for the subsequent classification of the second remote sensing image sample set.
[0063] Optionally, in the remote sensing image classification method provided in this application embodiment, determining the multivariate loss function based on the M third target feature matrices and the target feature matrix set corresponding to each remote sensing image category includes: determining a first loss function based on the cosine distance between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category; determining a second loss function based on the cross-entropy between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category; determining a third loss function based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category; determining a fourth loss function based on the sixth target feature matrix and the fourth target feature matrix, wherein the sixth target feature matrix is a feature matrix among the M third target feature matrices corresponding to each remote sensing image category whose Euclidean distance to the fourth target feature matrix is less than a preset value; and determining the multivariate loss function based on the first loss function, the second loss function, the third loss function, and the fourth loss function.
[0064] For example, based on the cosine distance between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category, the first predicted remote sensing image category of the second remote sensing sample image is obtained based on the cosine distance, and the first loss function is determined based on the first predicted remote sensing image category and the true category of the second remote sensing sample image.
[0065] Based on the cross-entropy between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category, the second predicted remote sensing image category of the second remote sensing sample image is determined according to the calculated cross-entropy value. The second loss function is then determined based on the second predicted remote sensing image category and the true category of the second remote sensing sample image.
[0066] Based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category, the third predicted remote sensing image category of the second remote sensing sample image is determined according to the calculated cross-entropy value. The third loss function is then determined based on the third predicted remote sensing image category and the true category of the second remote sensing sample image.
[0067] Based on the sixth and fourth target feature matrices, which are among the M third target feature matrices corresponding to each remote sensing image category and whose Euclidean distance to the fourth target feature matrix is less than a preset value, a fourth loss function is determined. Based on the obtained first, second, third, and fourth loss functions, a multivariate loss function is determined.
[0068] In an optional embodiment, a multivariate loss function is obtained by summing the first loss function, the second loss function, the third loss function, and the fourth loss function.
[0069] In an optional embodiment, a multivariate loss function can also be obtained by weighted summation of the first loss function, the second loss function, the third loss function, and the fourth loss function.
[0070] The multivariate loss function is determined based on the M third target feature matrices corresponding to each remote sensing image category and the target feature matrix set corresponding to the second remote sensing image sample set. The obtained multivariate loss function can be used to train the initial network model, improve the accuracy of the initial network model in classifying remote sensing images, and determine the initial network model that meets the accuracy requirements for remote sensing image classification as the target network model, thereby improving the accuracy of remote sensing image classification.
[0071] Optionally, in the remote sensing image classification method provided in this application embodiment, the second remote sensing image sample set also includes the real remote sensing image category corresponding to the second remote sensing sample image. Determining the first loss function based on the cosine distance values between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category includes: calculating the cosine distance values between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category to obtain the M cosine distance values corresponding to each remote sensing image category; determining S remote sensing image categories based on the M cosine distance values corresponding to each remote sensing image category, and determining the S remote sensing image categories as the first predicted remote sensing image categories corresponding to the second remote sensing sample image, where S is a positive integer greater than or equal to 2; and determining the first loss function based on the first predicted remote sensing image category and the real remote sensing image category.
[0072] For example, the cosine distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category is calculated to obtain the M cosine distance values corresponding to each remote sensing image category. Based on the M cosine distance values corresponding to each remote sensing image category, the probability that the second remote sensing sample image belongs to each remote sensing image category is determined, so as to determine S remote sensing image categories through this probability. For example, if the k-th category is the building category, the probability calculation method for identifying the second remote sensing sample image as the k-th category is shown in formula (2):
[0073]
[0074] in, Let σ represent the variance, which is the probability of identifying the second remote sensing sample image as the k-th class. Let P be the feature matrix of the fourth target. k Let be the third target feature matrix corresponding to the k-th class, GAP is the global average pooling, and d is the cosine distance.
[0075] Based on the calculated probability values, S remote sensing image categories are determined. Then, based on the S remote sensing image categories, the first predicted remote sensing image category corresponding to the second remote sensing sample image is determined. Finally, based on the first predicted remote sensing image category and the actual remote sensing image category, the first loss function is determined.
[0076] By calculating the cosine distance between the fourth target feature matrix and the third target feature matrix, the first predicted category of the second remote sensing sample image is determined. The first predicted remote sensing image category and the true category of the second remote sensing sample image are then used to determine the first loss function. The obtained first loss function will be used to determine the multivariate loss function. The initial network model is trained by optimizing the loss function to improve the accuracy of the initial network model in classifying remote sensing images.
[0077] Optionally, in the remote sensing image classification method provided in this application embodiment, the second remote sensing image sample set further includes the real remote sensing image category corresponding to the second remote sensing sample image. Determining the second loss function based on the cross-entropy between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category includes: calculating the cross-entropy between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category to obtain the M cross-entropy values corresponding to each remote sensing image category; determining P remote sensing image categories based on the M cross-entropy values corresponding to each remote sensing image category, and determining the P remote sensing image categories as the second predicted remote sensing image categories corresponding to the second remote sensing sample image, where P is a positive integer greater than or equal to 2; and determining the second loss function based on the second predicted remote sensing image category and the real remote sensing image category.
[0078] For example, the cross-entropy between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category is calculated to obtain the M cross-entropy values corresponding to each remote sensing image category. Based on the obtained M cross-entropy values corresponding to each remote sensing image category, the P remote sensing image categories to which the second remote sensing sample image belongs are determined. Thus, the obtained P remote sensing image categories are determined as the second predicted remote sensing image categories of the second remote sensing sample image. Based on the second predicted remote sensing image categories and the true remote sensing image categories of the second remote sensing sample image, the second loss function is calculated. The second loss function is shown in formula (3):
[0079]
[0080] in, is the second loss function, PCE represents the cross-entropy function, Q represents the second predicted remote sensing image category, and C represents the true remote sensing image category of the second remote sensing sample image.
[0081] The second loss function is obtained by calculating the cross-entropy between the fourth target feature matrix and the third target feature matrices corresponding to the P remote sensing image categories. The obtained second loss function will be used to determine the multivariate loss function, and then the initial network model will be trained to improve the accuracy of the initial network model in classifying remote sensing images.
[0082] Optionally, in the remote sensing image classification method provided in this application embodiment, the second remote sensing image sample set also includes the real remote sensing image category corresponding to the second remote sensing sample image. Determining the third loss function based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category includes: determining the third predicted remote sensing image category corresponding to each third remote sensing sample image based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category; and determining the third loss function based on the third predicted remote sensing image category and the real remote sensing image category.
[0083] For example, based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category, the third predicted remote sensing image category corresponding to each third remote sensing sample image is determined based on the calculated cross-entropy value. Since the third remote sensing sample image is obtained by rotating the second remote sensing sample image, the remote sensing image category to which the third remote sensing sample image belongs is consistent with the remote sensing image category to which the second remote sensing sample image belongs. Based on the third predicted remote sensing image category and the real remote sensing image category of the third remote sensing sample image, it is equivalent to determining the third predicted remote sensing image category of the second remote sensing sample image. Based on the third predicted remote sensing image category and the real remote sensing image category of the third remote sensing sample image, the third loss function is calculated. The third loss function is shown in formula (4):
[0084] L R =PCE(P,B)(4)
[0085] Among them, L R The third loss function is P, which represents the third predicted remote sensing image category, and B represents the third remote sensing sample image's true remote sensing image category.
[0086] By calculating the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category, and determining the third loss function based on the cross-entropy value, it is ensured that the classification of remote sensing images will not be significantly affected by changes in the angle of the remote sensing images, thus improving the generalization ability of the initial network model for remote sensing image classification.
[0087] Optionally, in the remote sensing image classification method provided in this application embodiment, the second remote sensing image sample set also includes the real remote sensing image category corresponding to the second remote sensing sample image. Determining the fourth loss function based on the sixth target feature matrix and the fourth target feature matrix includes: calculating the Euclidean distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category using the Euclidean norm to obtain multiple Euclidean distances; determining the sixth target feature matrix based on the multiple Euclidean distances, and determining the remote sensing image category corresponding to the sixth target feature matrix as the fourth predicted remote sensing image category corresponding to the second remote sensing sample image; and determining the fourth loss function based on the fourth predicted remote sensing image category corresponding to the second remote sensing sample image and the real remote sensing image category corresponding to the second remote sensing sample image.
[0088] For example, the Euclidean distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category is calculated using the Euclidean norm. A Euclidean distance value is obtained between the fourth target feature matrix and each third target feature matrix, resulting in multiple Euclidean distances. The specific calculation formula is shown in formula (5).
[0089]
[0090] in, This represents the eigenvector in the third target feature matrix. ε represents the eigenvector of the fourth target feature matrix. i,j This represents the Euclidean distance between the eigenvectors in the third target feature matrix and the eigenvectors in the fourth target feature matrix.
[0091] Through the above calculations, multiple Euclidean distances will be obtained. Based on the obtained Euclidean distances, the third target feature matrix with the smallest distance value to the fourth target feature matrix will be determined as the sixth target feature matrix. The remote sensing image category to which the sixth target feature matrix belongs will be determined as the fourth predicted remote sensing image category of the second remote sensing sample image. Based on the fourth predicted remote sensing image category corresponding to the second remote sensing sample image and the actual remote sensing image category corresponding to the second remote sensing sample image, L will be determined. EA The fourth loss function is shown in formula (6):
[0092]
[0093] Where, ε i,i+1 Let E represent the feature difference between the fourth predicted remote sensing image category and the second true remote sensing image category, where E is the number of eigenvectors in the fourth target feature matrix.
[0094] By calculating the Euclidean distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category, the sixth target feature matrix is determined based on the obtained Euclidean distance value, thereby determining the fourth loss function. The calculation of the Euclidean distance value expands the supported data types for remote sensing image classification, evaluates the predicted classification of remote sensing images from multiple dimensions, and then trains the initial network model to improve the accuracy of the initial network model in remote sensing image classification.
[0095] In an alternative embodiment, the following can be employed: Figure 3 The schematic diagram shown illustrates the training of the initial network model. The specific steps are as follows: Obtain the first remote sensing image sample set and the second remote sensing image sample set, and input the first remote sensing image sample set and the second remote sensing image sample set into the initial network model. Perform preliminary feature extraction on the two sample sets through the feature extraction layer in the initial network model to obtain the third initial feature matrix and the initial feature matrix set. Enhance the semantic information of the third initial feature matrix through the semantic filter, and embed the semantic information corresponding to each remote sensing image category information included in the third initial feature matrix into the weight layer of the semantic filter. Perform semantic enhancement on the initial feature matrix set according to the remote sensing image category information of the third initial feature matrix in the semantic filter to obtain the third target feature matrix and the target feature matrix set. Then, output the first loss function through the metric classifier, the second loss function through the global classifier, the third loss function through the rotation classifier, and the fourth loss function through the adaptive loss. Then, determine the multivariate loss function according to formula (7), and train the initial network model according to the multivariate loss function. Formula (7) is as follows:
[0096]
[0097] in, Represents a multivariate loss function. It is a learnable variable; when j = G, for Let w represent the second loss function. j For w G These are the coefficients of the second loss function, when j = R. for Let w represent the third loss function. j For w R These are the coefficients of the third loss function, and λ and u are the hyperparameters that are set.
[0098] The remote sensing image classification method provided in this application involves: acquiring a target remote sensing image to be classified; extracting features from the target remote sensing image using a feature extraction layer in a target network model to obtain a first target feature matrix; enhancing the semantic information of the first target feature matrix using a semantic filter in the target network model to obtain a second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image; and classifying the target remote sensing image based on the second target feature matrix to obtain the classification result of the target remote sensing image. This method solves the problem in related technologies where the classification accuracy of remote sensing images is relatively low due to the low precision of remote sensing image feature extraction. In this application, feature extraction is performed on the target remote sensing image to be classified through the feature extraction layer of the target network model. Then, the semantic filter in the target network model enhances the semantic information of the first target feature matrix extracted by the feature extraction layer to obtain the second target feature matrix. The target remote sensing image is classified according to the enhanced semantic information in the second target feature matrix to obtain the classification result of the target remote sensing image. By performing feature extraction and semantic information enhancement on the target remote sensing image, the accuracy of feature extraction on the target remote sensing image is improved, thereby achieving the effect of improving the classification accuracy of the remote sensing image.
[0099] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0100] This application also provides a remote sensing image classification device. It should be noted that the remote sensing image classification device of this application can be used to execute the remote sensing image classification method provided in this application. The remote sensing image classification device provided in this application will be described below.
[0101] Figure 4 This is a schematic diagram of a remote sensing image classification device according to an embodiment of this application. Figure 4 As shown, the device includes: a first acquisition unit 401, a first extraction unit 402, a filtering unit 403, and a classification unit 404.
[0102] The first acquisition unit 401 is used to acquire remote sensing images of the target to be classified.
[0103] The first extraction unit 402 is used to extract features from the target remote sensing image through the feature extraction layer in the target network model to obtain the first target feature matrix;
[0104] The filtering unit 403 is used to enhance the semantic information of the first target feature matrix through the semantic filter in the target network model to obtain the second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image.
[0105] The classification unit 404 is used to classify the target remote sensing image based on the second target feature matrix to obtain the classification result of the target remote sensing image.
[0106] The remote sensing image classification device provided in this application embodiment acquires a target remote sensing image to be classified through a first acquisition unit 401; a first extraction unit 402 extracts features from the target remote sensing image through a feature extraction layer in a target network model to obtain a first target feature matrix; a filtering unit 403 enhances the semantic information of the first target feature matrix through a semantic filter in the target network model to obtain a second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image; and a classification unit 404 classifies the target remote sensing image according to the second target feature matrix to obtain the classification result of the target remote sensing image, thus solving the problem in the related art when classifying remote sensing images. Due to the low accuracy of feature extraction from remote sensing images, the classification accuracy of remote sensing images is relatively low. In this application, the feature extraction layer of the target network model extracts features from the target remote sensing image to be classified. Then, the semantic filter in the target network model enhances the semantic information of the first target feature matrix extracted by the feature extraction layer to obtain a second target feature matrix. The target remote sensing image is classified according to the enhanced semantic information in the second target feature matrix to obtain the classification result of the target remote sensing image. By performing feature extraction and semantic information enhancement on the target remote sensing image, the accuracy of feature extraction from the target remote sensing image is improved, thereby achieving the effect of improving the classification accuracy of remote sensing images.
[0107] Optionally, in the remote sensing image classification device provided in this application embodiment, the device further includes: a second acquisition unit, configured to acquire a first remote sensing image sample set and a second remote sensing image sample set, wherein the first remote sensing image sample set includes N remote sensing image categories, each remote sensing image category includes M first remote sensing sample images, and the second remote sensing image sample set includes at least a second remote sensing sample image and Z third remote sensing sample images obtained by rotating the second remote sensing sample image by Z angles, wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 2, and Z is a positive integer greater than or equal to 2; and a second extraction unit, configured to extract the image through an initial network model. Feature extraction is performed on the first remote sensing image sample set to obtain M third target feature matrices corresponding to each remote sensing image category; the third extraction unit is used to extract features from the second remote sensing image sample set through the initial network model to obtain a target feature matrix set, wherein the feature matrix set includes at least a fourth target feature matrix corresponding to the second remote sensing sample image and a fifth target feature matrix corresponding to each third remote sensing sample image; the first training unit is used to determine a multivariate loss function based on the M third target feature matrices and the target feature matrix set corresponding to each remote sensing image category, and train the initial network model based on the multivariate loss function to obtain the target network model.
[0108] Optionally, in the remote sensing image classification device provided in this application embodiment, the second extraction unit includes: a first extraction module, used to extract features from the first remote sensing image sample set through the feature extraction layer in the initial network model to obtain M third initial feature matrices corresponding to each remote sensing image category of the first remote sensing image sample set; and a first filtering module, used to enhance the semantic information corresponding to the remote sensing image category in the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter in the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category.
[0109] Optionally, in the remote sensing image classification device provided in the embodiments of this application, the device further includes: a fourth extraction unit, used to extract semantic information from the M third initial feature matrices corresponding to each remote sensing image category through a semantic filter to obtain semantic information corresponding to N remote sensing image categories; and a second training unit, used to train the semantic filter according to the semantic information corresponding to the N remote sensing image categories so that the weight layer of the semantic filter includes the semantic information corresponding to the N remote sensing image categories.
[0110] Optionally, in the remote sensing image classification device provided in this application embodiment, the third extraction unit includes: a second extraction module, used to extract features from a second remote sensing image sample set through the feature extraction layer of an initial network model to obtain an initial feature matrix set corresponding to the second remote sensing image sample set; and a second filtering module, used to enhance the semantic information of the initial feature matrix set based on the semantic information corresponding to N remote sensing image categories through a semantic filter to obtain a target feature matrix set.
[0111] Optionally, in the remote sensing image classification apparatus provided in this application embodiment, the first training unit includes: a first determining module, configured to determine a first loss function based on the cosine distance between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category; a second determining module, configured to determine a second loss function based on the cross-entropy between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category; a third determining module, configured to determine a third loss function based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category; a fourth determining module, configured to determine a fourth loss function based on a sixth target feature matrix and the fourth target feature matrix, wherein the sixth target feature matrix is a feature matrix among the M third target feature matrices corresponding to each remote sensing image category whose Euclidean distance to the fourth target feature matrix is less than a preset value; and a fifth determining module, configured to determine a multivariate loss function based on the first loss function, the second loss function, the third loss function, and the fourth loss function.
[0112] Optionally, in the remote sensing image classification device provided in this application embodiment, the first determining module includes: a first calculation submodule, used to calculate the cosine distance value between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category, to obtain the M cosine distance values corresponding to each remote sensing image category; the first determining submodule, used to determine S remote sensing image categories based on the M cosine distance values corresponding to each remote sensing image category, and to determine the S remote sensing image categories as the first predicted remote sensing image categories corresponding to the second remote sensing sample image, where S is a positive integer greater than or equal to 2; and a second determining submodule, used to determine a first loss function based on the first predicted remote sensing image category and the real remote sensing image category.
[0113] Optionally, in the remote sensing image classification apparatus provided in this application embodiment, the second determining module includes: a second calculation submodule, used to calculate the cross-entropy between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category, to obtain the M cross-entropy values corresponding to each remote sensing image category; a third determining submodule, used to determine P remote sensing image categories based on the M cross-entropy values corresponding to each remote sensing image category, and to determine the P remote sensing image categories as the second predicted remote sensing image categories corresponding to the second remote sensing sample image, where P is a positive integer greater than or equal to 2; and a fourth determining submodule, used to determine a second loss function based on the second predicted remote sensing image categories and the real remote sensing image categories.
[0114] Optionally, in the remote sensing image classification device provided in this application embodiment, the third determining module includes: a fifth determining submodule, used to determine the third predicted remote sensing image category corresponding to each third remote sensing sample image based on the cross entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category; and a sixth determining submodule, used to determine the third loss function based on the third predicted remote sensing image category and the real remote sensing image category.
[0115] Optionally, in the remote sensing image classification apparatus provided in this application embodiment, the fourth determining module includes: a third calculation submodule, used to calculate the Euclidean distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category using the Euclidean norm, to obtain multiple Euclidean distances; a seventh determining submodule, used to determine the sixth target feature matrix based on the multiple Euclidean distances, and determine the remote sensing image category corresponding to the sixth target feature matrix as the fourth predicted remote sensing image category corresponding to the second remote sensing sample image; and an eighth determining submodule, used to determine the fourth loss function based on the fourth predicted remote sensing image category corresponding to the second remote sensing sample image and the real remote sensing image category corresponding to the second remote sensing sample image.
[0116] The remote sensing image classification device includes a processor and a memory. The first acquisition unit 401, the first extraction unit 402, the filtering unit 403, and the classification unit 404 are all stored in the memory as program units. The processor executes the program units stored in the memory to realize the corresponding functions.
[0117] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the problem of low classification accuracy in remote sensing images due to the low precision of feature extraction.
[0118] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0119] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements a method for classifying remote sensing images.
[0120] This invention provides a processor for running a program, wherein the program executes a classification method for the remote sensing image.
[0121] like Figure 5 As shown, this embodiment of the invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: acquiring a target remote sensing image to be classified; extracting features from the target remote sensing image through a feature extraction layer in a target network model to obtain a first target feature matrix; enhancing the semantic information of the first target feature matrix through a semantic filter in the target network model to obtain a second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image; and classifying the target remote sensing image according to the second target feature matrix to obtain a classification result of the target remote sensing image.
[0122] Optionally, before extracting features from the target remote sensing image through the feature extraction layer in the target network model to obtain the first target feature matrix, the method further includes: acquiring a first remote sensing image sample set and a second remote sensing image sample set, wherein the first remote sensing image sample set includes N remote sensing image categories, and each remote sensing image category includes M first remote sensing sample images; the second remote sensing image sample set includes at least a second remote sensing sample image and Z third remote sensing sample images obtained by rotating the second remote sensing sample images by Z angles, wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 2, and Z is a positive integer greater than or equal to 2. Integers; feature extraction is performed on the first remote sensing image sample set using the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category; feature extraction is performed on the second remote sensing image sample set using the initial network model to obtain a target feature matrix set, wherein the feature matrix set includes at least a fourth target feature matrix corresponding to the second remote sensing sample image and a fifth target feature matrix corresponding to each third remote sensing sample image; based on the M third target feature matrices and the target feature matrix set corresponding to each remote sensing image category, a multivariate loss function is determined, and the initial network model is trained based on the multivariate loss function to obtain the target network model.
[0123] Optionally, feature extraction of the first remote sensing image sample set through the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category includes: extracting features of the first remote sensing image sample set through the feature extraction layer in the initial network model to obtain M third initial feature matrices corresponding to each remote sensing image category in the first remote sensing image sample set; and enhancing the semantic information corresponding to the remote sensing image category in the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter in the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category.
[0124] Optionally, before enhancing the semantic information of the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter in the initial network model to obtain the M third target feature matrices corresponding to each remote sensing image category, the method further includes: extracting semantic information from the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter to obtain semantic information corresponding to N remote sensing image categories; and training the semantic filter based on the semantic information corresponding to the N remote sensing image categories so that the weight layer of the semantic filter includes the semantic information corresponding to the N remote sensing image categories.
[0125] Optionally, the process of extracting features from the second remote sensing image sample set using the initial network model to obtain the target feature matrix set includes: extracting features from the second remote sensing image sample set using the feature extraction layer of the initial network model to obtain the initial feature matrix set corresponding to the second remote sensing image sample set; and enhancing the semantic information of the initial feature matrix set using a semantic filter based on the semantic information corresponding to N remote sensing image categories to obtain the target feature matrix set.
[0126] Optionally, the multivariate loss function is determined based on the M third target feature matrices and the target feature matrix set corresponding to each remote sensing image category, including: determining a first loss function based on the cosine distance between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category; determining a second loss function based on the cross-entropy between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category; determining a third loss function based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category; determining a fourth loss function based on the sixth target feature matrix and the fourth target feature matrix, wherein the sixth target feature matrix is a feature matrix among the M third target feature matrices corresponding to each remote sensing image category whose Euclidean distance to the fourth target feature matrix is less than a preset value; and determining the multivariate loss function based on the first, second, third, and fourth loss functions.
[0127] Optionally, the second remote sensing image sample set also includes the real remote sensing image categories corresponding to the second remote sensing sample images. Determining the first loss function based on the cosine distance values between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category includes: calculating the cosine distance values between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category to obtain the M cosine distance values corresponding to each remote sensing image category; determining S remote sensing image categories based on the M cosine distance values corresponding to each remote sensing image category, and defining the S remote sensing image categories as the first predicted remote sensing image categories corresponding to the second remote sensing sample images, where S is a positive integer greater than or equal to 2; and determining the first loss function based on the first predicted remote sensing image categories and the real remote sensing image categories.
[0128] Optionally, the second remote sensing image sample set also includes the real remote sensing image categories corresponding to the second remote sensing sample images. Determining the second loss function based on the cross-entropy between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category includes: calculating the cross-entropy between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category to obtain the M cross-entropy values corresponding to each remote sensing image category; determining P remote sensing image categories based on the M cross-entropy values corresponding to each remote sensing image category, and defining the P remote sensing image categories as the second predicted remote sensing image categories corresponding to the second remote sensing sample images, where P is a positive integer greater than or equal to 2; and determining the second loss function based on the second predicted remote sensing image categories and the real remote sensing image categories.
[0129] Optionally, the second remote sensing image sample set also includes the real remote sensing image category corresponding to the second remote sensing sample image. The third loss function is determined based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category. This includes: determining the third predicted remote sensing image category corresponding to each third remote sensing sample image based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category; and determining the third loss function based on the third predicted remote sensing image category and the real remote sensing image category.
[0130] Optionally, the second remote sensing image sample set also includes the real remote sensing image category corresponding to the second remote sensing sample image. Determining the fourth loss function based on the sixth target feature matrix and the fourth target feature matrix includes: calculating the Euclidean distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category using the Euclidean norm, obtaining multiple Euclidean distances; determining the sixth target feature matrix based on the multiple Euclidean distances, and determining the remote sensing image category corresponding to the sixth target feature matrix as the fourth predicted remote sensing image category corresponding to the second remote sensing sample image; and determining the fourth loss function based on the fourth predicted remote sensing image category corresponding to the second remote sensing sample image and the real remote sensing image category corresponding to the second remote sensing sample image.
[0131] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0132] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: acquiring a target remote sensing image to be classified; extracting features from the target remote sensing image through a feature extraction layer in a target network model to obtain a first target feature matrix; enhancing the semantic information of the first target feature matrix through a semantic filter in the target network model to obtain a second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image; and classifying the target remote sensing image according to the second target feature matrix to obtain a classification result of the target remote sensing image.
[0133] Optionally, before extracting features from the target remote sensing image through the feature extraction layer in the target network model to obtain the first target feature matrix, the method further includes: acquiring a first remote sensing image sample set and a second remote sensing image sample set, wherein the first remote sensing image sample set includes N remote sensing image categories, and each remote sensing image category includes M first remote sensing sample images; the second remote sensing image sample set includes at least a second remote sensing sample image and Z third remote sensing sample images obtained by rotating the second remote sensing sample images by Z angles, wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 2, and Z is a positive integer greater than or equal to 2. Integers; feature extraction is performed on the first remote sensing image sample set using the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category; feature extraction is performed on the second remote sensing image sample set using the initial network model to obtain a target feature matrix set, wherein the feature matrix set includes at least a fourth target feature matrix corresponding to the second remote sensing sample image and a fifth target feature matrix corresponding to each third remote sensing sample image; based on the M third target feature matrices and the target feature matrix set corresponding to each remote sensing image category, a multivariate loss function is determined, and the initial network model is trained based on the multivariate loss function to obtain the target network model.
[0134] Optionally, feature extraction of the first remote sensing image sample set through the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category includes: extracting features of the first remote sensing image sample set through the feature extraction layer in the initial network model to obtain M third initial feature matrices corresponding to each remote sensing image category in the first remote sensing image sample set; and enhancing the semantic information corresponding to the remote sensing image category in the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter in the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category.
[0135] Optionally, before enhancing the semantic information of the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter in the initial network model to obtain the M third target feature matrices corresponding to each remote sensing image category, the method further includes: extracting semantic information from the M third initial feature matrices corresponding to each remote sensing image category through the semantic filter to obtain semantic information corresponding to N remote sensing image categories; and training the semantic filter based on the semantic information corresponding to the N remote sensing image categories so that the weight layer of the semantic filter includes the semantic information corresponding to the N remote sensing image categories.
[0136] Optionally, the process of extracting features from the second remote sensing image sample set using the initial network model to obtain the target feature matrix set includes: extracting features from the second remote sensing image sample set using the feature extraction layer of the initial network model to obtain the initial feature matrix set corresponding to the second remote sensing image sample set; and enhancing the semantic information of the initial feature matrix set using a semantic filter based on the semantic information corresponding to N remote sensing image categories to obtain the target feature matrix set.
[0137] Optionally, the multivariate loss function is determined based on the M third target feature matrices and the target feature matrix set corresponding to each remote sensing image category, including: determining a first loss function based on the cosine distance between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category; determining a second loss function based on the cross-entropy between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category; determining a third loss function based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category; determining a fourth loss function based on the sixth target feature matrix and the fourth target feature matrix, wherein the sixth target feature matrix is a feature matrix among the M third target feature matrices corresponding to each remote sensing image category whose Euclidean distance to the fourth target feature matrix is less than a preset value; and determining the multivariate loss function based on the first, second, third, and fourth loss functions.
[0138] Optionally, the second remote sensing image sample set also includes the real remote sensing image categories corresponding to the second remote sensing sample images. Determining the first loss function based on the cosine distance values between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category includes: calculating the cosine distance values between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category to obtain the M cosine distance values corresponding to each remote sensing image category; determining S remote sensing image categories based on the M cosine distance values corresponding to each remote sensing image category, and defining the S remote sensing image categories as the first predicted remote sensing image categories corresponding to the second remote sensing sample images, where S is a positive integer greater than or equal to 2; and determining the first loss function based on the first predicted remote sensing image categories and the real remote sensing image categories.
[0139] Optionally, the second remote sensing image sample set also includes the real remote sensing image categories corresponding to the second remote sensing sample images. Determining the second loss function based on the cross-entropy between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category includes: calculating the cross-entropy between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category to obtain the M cross-entropy values corresponding to each remote sensing image category; determining P remote sensing image categories based on the M cross-entropy values corresponding to each remote sensing image category, and defining the P remote sensing image categories as the second predicted remote sensing image categories corresponding to the second remote sensing sample images, where P is a positive integer greater than or equal to 2; and determining the second loss function based on the second predicted remote sensing image categories and the real remote sensing image categories.
[0140] Optionally, the second remote sensing image sample set also includes the real remote sensing image category corresponding to the second remote sensing sample image. The third loss function is determined based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category. This includes: determining the third predicted remote sensing image category corresponding to each third remote sensing sample image based on the cross-entropy between the M third target feature matrices and the fifth target feature matrix corresponding to each remote sensing image category; and determining the third loss function based on the third predicted remote sensing image category and the real remote sensing image category.
[0141] Optionally, the second remote sensing image sample set also includes the real remote sensing image category corresponding to the second remote sensing sample image. Determining the fourth loss function based on the sixth target feature matrix and the fourth target feature matrix includes: calculating the Euclidean distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category using the Euclidean norm, obtaining multiple Euclidean distances; determining the sixth target feature matrix based on the multiple Euclidean distances, and determining the remote sensing image category corresponding to the sixth target feature matrix as the fourth predicted remote sensing image category corresponding to the second remote sensing sample image; and determining the fourth loss function based on the fourth predicted remote sensing image category corresponding to the second remote sensing sample image and the real remote sensing image category corresponding to the second remote sensing sample image.
[0142] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0143] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0144] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0145] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0146] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0147] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0148] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0149] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0150] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0151] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for classifying remote sensing images, characterized in that, include: Acquire remote sensing images of the target to be classified; The target remote sensing image is used to extract features through the feature extraction layer in the target network model to obtain the first target feature matrix; The semantic information of the first target feature matrix is enhanced by the semantic filter in the target network model to obtain the second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image. The target remote sensing image is classified based on the second target feature matrix to obtain the classification result of the target remote sensing image; Before extracting features from the target remote sensing image through the feature extraction layer in the target network model to obtain the first target feature matrix, the method further includes: Obtain the first remote sensing image sample set; The first remote sensing image sample set is used to extract features through the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category; The semantic filter in the initial network model is used to enhance the semantic information of the remote sensing image category in the M third initial feature matrices corresponding to each remote sensing image category, so as to obtain the M third target feature matrices corresponding to each remote sensing image category. Before enhancing the semantic information of the M third initial feature matrices corresponding to each remote sensing image category using the semantic filter in the initial network model to obtain the M third target feature matrices corresponding to each remote sensing image category, the method further includes: Semantic information is extracted from the M third initial feature matrices corresponding to each remote sensing image category using the semantic filter, resulting in semantic information corresponding to N remote sensing image categories. The semantic filter is trained based on the semantic information corresponding to the N remote sensing image categories, so that the weight layer of the semantic filter includes the semantic information corresponding to the N remote sensing image categories.
2. The method according to claim 1, characterized in that, Before extracting features from the target remote sensing image through the feature extraction layer in the target network model to obtain the first target feature matrix, the method further includes: Obtain a second remote sensing image sample set, wherein the first remote sensing image sample set includes N remote sensing image categories, each remote sensing image category includes M first remote sensing sample images, and the second remote sensing image sample set includes at least a second remote sensing sample image and Z third remote sensing sample images obtained by rotating the second remote sensing sample images by Z angles, wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 2, and Z is a positive integer greater than or equal to 2; The initial network model is used to extract features from the second remote sensing image sample set to obtain a target feature matrix set, wherein the target feature matrix set includes at least a fourth target feature matrix corresponding to the second remote sensing sample image and a fifth target feature matrix corresponding to each third remote sensing sample image; Based on the M third target feature matrices corresponding to each remote sensing image category and the target feature matrix set, a multivariate loss function is determined, and the initial network model is trained based on the multivariate loss function to obtain the target network model.
3. The method according to claim 2, characterized in that, Feature extraction is performed on the first remote sensing image sample set using the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category, including: The first remote sensing image sample set is subjected to feature extraction by the feature extraction layer in the initial network model, resulting in M third initial feature matrices corresponding to each remote sensing image category in the first remote sensing image sample set.
4. The method according to claim 2, characterized in that, The target feature matrix set obtained by extracting features from the second remote sensing image sample set using the initial network model includes: The feature extraction layer of the initial network model is used to extract features from the second remote sensing image sample set to obtain the initial feature matrix set corresponding to the second remote sensing image sample set; The semantic filter enhances the semantic information of the initial feature matrix set based on the semantic information corresponding to the N remote sensing image categories, thereby obtaining the target feature matrix set.
5. The method according to claim 2, characterized in that, Based on the M third target feature matrices corresponding to each remote sensing image category and the target feature matrix set, the multivariate loss function is determined as follows: The first loss function is determined based on the cosine distance between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category; The second loss function is determined based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fourth target feature matrix; The third loss function is determined based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fifth target feature matrix; Based on the sixth target feature matrix and the fourth target feature matrix, a fourth loss function is determined, wherein the sixth target feature matrix is a feature matrix among the M third target feature matrices corresponding to each remote sensing image category whose Euclidean distance to the fourth target feature matrix is less than a preset value; The multivariate loss function is determined based on the first loss function, the second loss function, the third loss function, and the fourth loss function.
6. The method according to claim 5, characterized in that, The second remote sensing image sample set also includes the real remote sensing image categories corresponding to the second remote sensing sample images. Based on the cosine distance values between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category, the first loss function is determined as follows: Calculate the cosine distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category to obtain the M cosine distance values corresponding to each remote sensing image category; Based on the M cosine distance values corresponding to each remote sensing image category, S remote sensing image categories are determined, and the S remote sensing image categories are determined as the first predicted remote sensing image category corresponding to the second remote sensing sample image, where S is a positive integer greater than or equal to 2; The first loss function is determined based on the first predicted remote sensing image category and the actual remote sensing image category.
7. The method according to claim 5, characterized in that, The second remote sensing image sample set also includes the real remote sensing image categories corresponding to the second remote sensing sample images. Based on the cross-entropy between the M third target feature matrices and the fourth target feature matrix corresponding to each remote sensing image category, the second loss function is determined as follows: Calculate the cross-entropy between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category to obtain the M cross-entropy values corresponding to each remote sensing image category; Based on the M cross-entropy values corresponding to each remote sensing image category, P remote sensing image categories are determined, and the P remote sensing image categories are determined as the second predicted remote sensing image categories corresponding to the second remote sensing sample image, where P is a positive integer greater than or equal to 2; The second loss function is determined based on the second predicted remote sensing image category and the actual remote sensing image category.
8. The method according to claim 5, characterized in that, The second remote sensing image sample set also includes the real remote sensing image categories corresponding to the second remote sensing sample images. Based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fifth target feature matrix, the third loss function is determined as follows: Based on the cross-entropy between the M third target feature matrices corresponding to each remote sensing image category and the fifth target feature matrix, the third predicted remote sensing image category corresponding to each third remote sensing sample image is determined; The third loss function is determined based on the third predicted remote sensing image category and the actual remote sensing image category.
9. The method according to claim 5, characterized in that, The second remote sensing image sample set also includes the real remote sensing image category corresponding to the second remote sensing sample image. Based on the sixth target feature matrix and the fourth target feature matrix, the fourth loss function is determined as follows: The Euclidean distance between the fourth target feature matrix and the M third target feature matrices corresponding to each remote sensing image category is calculated using the Euclidean norm, resulting in multiple Euclidean distances. Based on the multiple Euclidean distances, the sixth target feature matrix is determined, and the remote sensing image category corresponding to the sixth target feature matrix is determined as the fourth predicted remote sensing image category corresponding to the second remote sensing sample image; The fourth loss function is determined based on the fourth predicted remote sensing image category corresponding to the second remote sensing sample image and the real remote sensing image category corresponding to the second remote sensing sample image.
10. A remote sensing image classification device, characterized in that, include: The first acquisition unit is used to acquire remote sensing images of the target to be classified. The first extraction unit is used to extract features from the target remote sensing image through the feature extraction layer in the target network model to obtain a first target feature matrix; A filtering unit is used to enhance the semantic information of the first target feature matrix through a semantic filter in the target network model to obtain a second target feature matrix, wherein the semantic information of the first target feature matrix is used to characterize the remote sensing image category of the target remote sensing image. A classification unit is used to classify the target remote sensing image based on the second target feature matrix to obtain the classification result of the target remote sensing image; The apparatus further includes: a second acquisition unit for acquiring a first remote sensing image sample set and a second remote sensing image sample set; a second extraction unit for extracting features from the first remote sensing image sample set using an initial network model to obtain M third target feature matrices corresponding to each remote sensing image category; the second extraction unit includes: a first filtering module for enhancing the semantic information corresponding to the remote sensing image category in the M third initial feature matrices corresponding to each remote sensing image category using a semantic filter in the initial network model to obtain M third target feature matrices corresponding to each remote sensing image category; a fourth extraction unit for extracting semantic information from the M third initial feature matrices corresponding to each remote sensing image category using a semantic filter to obtain semantic information corresponding to N remote sensing image categories; and a second training unit for training the semantic filter based on the semantic information corresponding to the N remote sensing image categories so that the weight layer of the semantic filter includes the semantic information corresponding to the N remote sensing image categories.
11. A processor, characterized in that, The processor is used to run a program, wherein the program executes the remote sensing image classification method according to any one of claims 1 to 9.
12. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the remote sensing image classification method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Remote sensing image scene classification method based on bidirectional feature iterative fusion
CN112347888A
Scene recognition method and device based on artificial intelligence and electronic equipment
CN112990378A