WO2021082480A1 - Image classification method and related device - Google Patents

Image classification method and related device Download PDF

Info

Publication number
WO2021082480A1
WO2021082480A1 PCT/CN2020/097906 CN2020097906W WO2021082480A1 WO 2021082480 A1 WO2021082480 A1 WO 2021082480A1 CN 2020097906 W CN2020097906 W CN 2020097906W WO 2021082480 A1 WO2021082480 A1 WO 2021082480A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
image
spatial
spectral
trained
Prior art date
Application number
PCT/CN2020/097906
Other languages
French (fr)
Chinese (zh)
Inventor
张钧萍
吴斯凡
郭庆乐
汪鹏程
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021082480A1 publication Critical patent/WO2021082480A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • This application relates to the field of artificial intelligence (AI), and in particular to an image classification method and related devices.
  • AI artificial intelligence
  • AI technology is a technical discipline that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence. AI technology obtains the best results by perceiving the environment, acquiring knowledge, and using knowledge.
  • artificial intelligence technology is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a similar way to human intelligence.
  • the use of artificial intelligence for image processing is a common application of artificial intelligence.
  • a visible light image can be obtained through a monitoring device.
  • the visible light image usually contains multiple types of objects, such as people, houses, boxes, etc., in order to capture a certain type of target object to achieve monitoring .
  • the embodiments of the present application provide an image classification method and related devices, which can effectively improve the accuracy of image classification results and accurately identify objects in the image.
  • the first aspect of the embodiments of the present application provides an image classification method, which includes:
  • the target image to be classified can be acquired first, where the target image is an image generated based on a multispectral image;
  • the image classification model which is a deep network model, and then extract the spatial characteristics of the target image and the spectral characteristics of the target image through the image classification model;
  • the image classification model is used to construct the spatial features according to the spatial and spectral features
  • the classification result of the empty spectrum feature can be obtained through the image classification model, and the classification result includes the probability that the target image is located in each category;
  • the category to which the target image belongs can be finally determined.
  • the image classification model used in the image classification process can extract the spatial and spectral features of the target image, and the combination of the two forms the spatial spectral features that can be characterized in multiple dimensions
  • the attribute information of the image so the classification of the image based on the empty spectrum feature can effectively improve the accuracy of the classification result of the image, and accurately identify the object in the image.
  • the method before extracting the spatial features of the target image and the spectral features of the target image through the image classification model, the method further includes:
  • the spatial information of the target image and the spectral information of the target image where the spectral information of the target image is a one-dimensional vector formed by the target image, and the spatial information of the target image is a two-dimensional vector formed by the target image and the neighborhood image of the target image vector;
  • the spatial information and the spectral information are extracted respectively, and the spatial characteristics of the target image and the spectral characteristics of the target image are obtained.
  • the spatial information and spectral information of the target image can be extracted first, and used as the input of the image classification model to further extract the spatial characteristics of the target image and the spectral characteristics of the target image, which improves the flexibility and choice of the solution. Sex.
  • the image classification model includes a first branch network and a second branch network
  • the first branch network includes a first convolutional layer and a first pooling layer
  • the second branch network includes The second convolutional layer and the second pooling layer respectively perform feature extraction on the spatial information and spectral information through the image classification model, and obtain the spatial characteristics of the target image and the spectral characteristics of the target image, including:
  • the first spatial feature is maximally pooled by the second pooling layer to obtain the second spatial feature of the target image.
  • the image classification model includes two branch networks, and both the first branch network and the second branch network include a convolutional layer and a pooling layer, so it can pass through the first convolutional layer of the first branch network.
  • the second spectral feature can also be obtained.
  • the second convolutional layer of the branch network performs convolution processing on the spatial information of the target image to obtain the first spatial feature, and then performs the maximum pooling processing on the first spatial feature through the second pooling layer to obtain the second spatial feature, improving This improves the flexibility and selectivity of the program.
  • the image classification model further includes a fully connected layer, and the construction of the space spectrum feature based on the spatial feature and the spectral feature through the image classification model includes:
  • the second spectral feature and the second spatial feature are respectively stretched through the image classification model to obtain the third spectral feature and the third spatial feature, where the third spectral feature and the third spatial feature are one-dimensional vectors;
  • the third spectral feature and the third spatial feature are fused through the fully connected layer to obtain the spatial spectrum feature.
  • the image classification model also includes a fully connected layer. After the second spectral feature and the second spatial feature output by the first pooling layer and the second pooling layer are obtained, the two features can be combined. Stretching (ie element reorganization) to make it a one-dimensional vector, namely the third spectral feature and the third spatial feature, and then the third spectral feature and the third spatial feature are fused through the fully connected layer to obtain a single The scale of the empty spectrum feature improves the flexibility and selectivity of the scheme.
  • the image classification model includes a first branch network and a second branch network
  • the first branch network includes n first convolutional layers and n-1 first pooling layers
  • the second branch network includes n second convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2
  • the spatial information and spectral information are respectively feature extracted through the image classification model to obtain the target image
  • the spatial characteristics and spectral characteristics of the target image include:
  • the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
  • the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
  • the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
  • the image classification model includes two branch networks, and the first branch network includes n first convolutional layers and n-1 first pooling layers, so the spectral information of the target image can be used as the first
  • the input of the first convolutional layer, the first first spectral feature is obtained after convolution, and then the first first spectral feature is used as the input of the first first pooling layer, after the maximum pooling, the first 1 second spectral feature, and then use the first second spectral feature as the input of the second first convolutional layer.
  • the second first spectral feature is obtained, and then the second first spectral feature
  • the first first convolutional layer to the nth first convolutional layer can output the first first spectral feature to the nth first spectrum, respectively
  • the first first pooling layer to the n-1th first pooling layer can respectively output the first second spectral characteristic to the n-1th second spectral characteristic.
  • the first first spatial feature to the nth first spatial feature and the first second spatial feature to n-1 are also obtained.
  • the second spatial feature improves the flexibility and selectivity of the scheme.
  • the image classification model further includes n fully connected layers, and constructing the space spectrum feature according to the spatial feature and the spectral feature through the image classification model includes:
  • the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and the first The n first spatial features are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the third The spectral feature and the third spatial feature are one-dimensional vectors;
  • n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
  • the n sub-space spectrum features are spliced to obtain the spatial spectrum feature.
  • the image classification model further includes n fully connected layers.
  • the first second spectral feature to the n-1th second spectral feature, and the nth first spectral feature can be stretched, corresponding to the first third spectral feature to the nth third spectral feature.
  • the first second spatial feature to the n-1th second spatial feature, and the nth first spatial feature can be stretched to obtain the first third spatial feature to the nth A third spatial feature.
  • the first subspace spectral feature is obtained, and the second third spectral feature and the second The third spatial feature is used as the input of the second fully connected layer.
  • the second subspace spectrum feature is obtained, and so on, until n subspace spectrum features are obtained, and then n subspace spectrum features are spliced together to obtain a multiple
  • the scale of the empty spectrum feature improves the flexibility and selectivity of the scheme.
  • the image classification model further includes a classification layer, and obtaining the classification result of the empty spectrum feature through the image classification model includes:
  • the spatial spectrum features are classified by the classification layer to obtain the classification results.
  • the image classification model further includes a classification layer. After the empty spectrum feature is obtained, the empty spectrum feature can be split by the classification layer to obtain the classification result of the target image, which improves the flexibility and selectivity of the scheme.
  • the second aspect of the embodiments of the present application provides a method for model training, which includes:
  • an image to be trained and the image to be trained is an image generated based on a hyperspectral image
  • the target loss function is used to train the classification model to be trained to obtain the image classification model.
  • the image classification model obtained from the above-mentioned model training method can extract the spatial and spectral features of the target image.
  • the space spectrum feature formed by the combination of the two can represent the attribute information of the image in multiple dimensions, so it is based on the space spectrum feature
  • the classification of the image can effectively improve the accuracy of the classification result of the image and accurately identify the objects in the image.
  • the method before extracting the spatial features of the image to be trained and the spectral features of the image to be trained through the classification model to be trained, the method further includes:
  • the spatial information of the image to be trained and the spectral information of the image to be trained where the spectral information of the image to be trained is a one-dimensional vector formed by the image to be trained, and the spatial information of the image to be trained is the image to be trained and the neighbors of the image to be trained.
  • Extracting the spatial features of the image to be trained and the spectral features of the image to be trained through the classification model to be trained includes:
  • the spatial information and the spectral information are respectively feature extracted through the classification model to be trained to obtain the spatial features of the image to be trained and the spectral features of the image to be trained.
  • the classification model to be trained includes a first branch network and a second branch network, and the first branch network includes n first convolutional layers and n-1 first pooling layers , The second branch network includes n second convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2.
  • the spatial information and spectral information are respectively feature extracted through the classification model to be trained to obtain the
  • the spatial characteristics of the training image and the spectral characteristics of the image to be trained include:
  • the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
  • the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
  • the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
  • the classification model to be trained further includes n fully connected layers, and the construction of the spatial spectrum feature according to the spatial feature and the spectral feature through the classification model to be trained includes:
  • the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and The nth first spatial feature is stretched separately to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the The three-spectral feature and the third spatial feature are one-dimensional vectors;
  • n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
  • n subspace spectrum features are spliced by the classification model to be trained to obtain the spatial spectrum features.
  • the classification model to be trained further includes a classification layer, and obtaining the classification result of the empty spectrum feature through the classification model to be trained includes:
  • the spatial spectrum features are classified by the classification layer to obtain the classification results.
  • a third aspect of the embodiments of the present application provides an image classification device, including:
  • the first acquisition module is configured to acquire a target image, and the target image is an image generated based on a hyperspectral image;
  • the extraction module is used to extract the spatial characteristics of the target image and the spectral characteristics of the target image through the image classification model;
  • the construction module is used to construct the empty spectrum feature according to the spatial feature and the spectral feature through the image classification model;
  • the second acquisition module is used to acquire the classification result of the empty spectrum feature through the image classification model
  • the determining module is used to determine the category to which the target image belongs according to the classification result.
  • the device further includes:
  • the third acquisition module is used to acquire the spatial information of the target image and the spectral information of the target image, where the spectral information of the target image is a one-dimensional vector formed by the target image, and the spatial information of the target image is the neighbor of the target image and the target image.
  • the spectral information of the target image is a one-dimensional vector formed by the target image
  • the spatial information of the target image is the neighbor of the target image and the target image.
  • the extraction module is also used to perform feature extraction on the spatial information and the spectral information through the image classification model to obtain the spatial features of the target image and the spectral features of the target image.
  • the image classification model includes a first branch network and a second branch network
  • the first branch network includes a first convolutional layer and a first pooling layer
  • the second branch network includes The second convolutional layer and the second pooling layer
  • the extraction module is also used to:
  • the first spatial feature is maximally pooled by the second pooling layer to obtain the second spatial feature of the target image.
  • the image classification model further includes a fully connected layer, and the building module is also used to:
  • the second spectral feature and the second spatial feature are respectively stretched through the image classification model to obtain the third spectral feature and the third spatial feature, where the third spectral feature and the third spatial feature are one-dimensional vectors;
  • the third spectral feature and the third spatial feature are fused through the fully connected layer to obtain the spatial spectrum feature.
  • the image classification model includes a first branch network and a second branch network
  • the first branch network includes n first convolutional layers and n-1 first pooling layers
  • the second branch network includes n second convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2
  • the extraction module is also used for:
  • the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
  • the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
  • the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
  • the image classification model further includes n fully connected layers, and the building module is further used for:
  • the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and the first The n first spatial features are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the third The spectral feature and the third spatial feature are one-dimensional vectors;
  • n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
  • the n sub-space spectrum features are spliced to obtain the spatial spectrum feature.
  • the image classification model further includes a classification layer
  • the second acquisition module is further configured to classify the empty spectrum features through the classification layer to obtain a classification result.
  • a fourth aspect of the embodiments of the present application provides a model training device, which includes:
  • the first acquisition module is used to acquire an image to be trained, and the image to be trained is an image generated based on a hyperspectral image;
  • the extraction module is used to extract the spatial characteristics of the image to be trained and the spectral characteristics of the image to be trained through the classification model to be trained;
  • the construction module is used to construct the empty spectrum feature according to the spatial feature and the spectral feature through the classification model to be trained;
  • the second acquisition module is used to acquire the classification result of the empty spectrum feature through the classification model to be trained
  • the training module is used to train the classification model to be trained through the target loss function according to the classification result and the real result to obtain the image classification model.
  • the device further includes:
  • the third acquisition module is used to acquire the spatial information of the image to be trained and the spectral information of the image to be trained, where the spectral information of the image to be trained is a one-dimensional vector formed by the image to be trained, and the spatial information of the image to be trained is the image to be trained A two-dimensional vector formed by the image and the neighborhood image of the image to be trained;
  • the extraction module is also used to perform feature extraction on the spatial information and the spectral information respectively through the classification model to be trained to obtain the spatial features of the image to be trained and the spectral features of the image to be trained.
  • the classification model to be trained includes a first branch network and a second branch network, and the first branch network includes n first convolutional layers and n-1 first pooling layers , The second branch network includes n second convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2, and the extraction module is also used for:
  • the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
  • the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
  • the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
  • the classification model to be trained further includes n fully connected layers, and the building module is further used for:
  • the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and The nth first spatial feature is stretched separately to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the The three-spectral feature and the third spatial feature are one-dimensional vectors;
  • n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
  • n subspace spectrum features are spliced by the classification model to be trained to obtain the spatial spectrum features.
  • the classification model to be trained further includes a classification layer
  • the second acquisition module is further configured to classify the empty spectrum features through the classification layer to obtain a classification result.
  • a fifth aspect of the embodiments of the present application provides an image classification device, including:
  • One or more central processing units memory, input and output interfaces, wired or wireless network interfaces, power supply;
  • the memory is a short-term storage memory or a persistent storage memory
  • the central processing unit is configured to communicate with the memory, and execute the instruction operations in the memory on the image classification device to execute any possible implementation of the first aspect and the first aspect, and any possible implementation of the second and second aspects The method in the way.
  • the sixth aspect of the embodiments of the present application provides a computer-readable storage medium, including instructions, which when the instructions run on a computer, cause the computer to execute any possible implementation manner as in the first aspect and the first aspect, and the second aspect and The method in any possible implementation of the second aspect.
  • the seventh aspect of the embodiments of the present application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any one of the possible implementation manners of the first aspect and the first aspect, the second aspect and the second aspect In any one of the possible implementation manners.
  • the embodiment of the present application provides a method and related device for image classification, wherein the method first obtains a target image to be classified, the target image is an image generated based on a hyperspectral image, and then the target image is extracted through an image classification model The spatial characteristics of the target image and the spectral characteristics of the target image are used to construct the empty spectrum feature according to the spatial and spectral characteristics through the image classification model, and the classification result of the empty spectrum feature is obtained through the image classification model. Finally, the category of the target image is determined according to the classification result .
  • the image classification model used in the above process can extract the spatial and spectral features of the target image.
  • the space spectrum feature formed by the combination of the two can represent the attribute information of the image in multiple dimensions. Therefore, the image is processed based on the space spectrum feature. Classification can effectively improve the accuracy of image classification results and accurately identify objects in the image.
  • FIG. 1 is a schematic diagram of an image classification model provided by an embodiment of the application.
  • FIG. 2 is a schematic flowchart of an image classification method provided by an embodiment of the application.
  • FIG. 3 is another schematic diagram of an image classification model provided by an embodiment of the application.
  • FIG. 4 is another schematic flowchart of the image classification method provided by an embodiment of this application.
  • FIG. 5 is a schematic diagram of feature extraction provided by an embodiment of this application.
  • FIG. 6 is a schematic flowchart of a model training method provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of another process of the model training method provided by an embodiment of the application.
  • FIG. 8 is a schematic structural diagram of an image classification apparatus provided by an embodiment of the application.
  • FIG. 9 is a schematic structural diagram of a model training device provided by an embodiment of the application.
  • FIG. 10 is a schematic structural diagram of an image classification device provided by an embodiment of the application.
  • the embodiment of the application provides a method and related device for image classification. If a certain multispectral image needs to be classified, the image classification model that has been trained can be obtained first.
  • the image classification model is composed of two branch networks, fully connected Layer and classification layer composition.
  • the spectral features of the image can be extracted through the first branch network to characterize the spectral reflectance distribution of the object surface in the image
  • the spatial features of the image can be extracted through the second branch network for Characterize the features such as the contour, surface texture and shadow of the object in the image, and then use the fully connected layer to fuse the spectral features and the spatial features to obtain the spatial spectrum features of the image, and then classify the spatial spectrum features of the image through the classification layer to obtain
  • the classification result of the image finally determines the category to which the image belongs.
  • the spatial spectrum feature In the process of image classification, because the object analyzed by the image classification model is the spatial spectrum feature of the image, the spatial spectrum feature not only involves the spatial feature of the image, but also considers the spectral feature of the image, so the spatial spectrum feature can be more comprehensively characterized
  • the attribute information of the image for example, comprehensively reflects the spectral reflectance distribution of the surface of the object in the image, as well as the contour, surface texture, and shadow of the object. Therefore, compared with the traditional method only considering the spatial characteristics, the blank in this application
  • the spectral feature can analyze the effective attribute information of the image from multiple aspects, so that the image classification model has a high accuracy rate for the classification result of the image, and can accurately identify the object in the image.
  • This application uses AI technology to classify images.
  • a monitoring scene is taken as an example for illustration.
  • images can be collected by monitoring equipment.
  • the images usually contain multiple types of objects, such as people, vehicles, and houses, in order to achieve real-time monitoring of certain types of objects.
  • objects such as people, vehicles, and houses, in order to achieve real-time monitoring of certain types of objects.
  • the present application provides an image classification method, which is implemented by an image classification device, wherein the image classification device includes monitoring equipment for acquiring multiple frames of images to be classified.
  • the images collected by the monitoring device in this application are usually multispectral images.
  • Multispectral images refer to images with more than 3 spectral channels, for example, hyperspectral images with 128 spectral channels and so on.
  • the image classification model used to classify multi-spectral images in this application is a deep network model, which can perform feature extraction and classification on multi-spectral images, and then identify the object categories in the images.
  • Figure 1 is a schematic diagram of an image classification model provided by an embodiment of the application. As shown in Figure 1, the image classification model includes a fully connected layer, a classification layer, and two branch networks. The first branch network includes a first branch network. A convolutional layer and a first pooling layer, and the second branch network also includes a second convolutional layer and a second pooling layer.
  • the first branch network can be used to extract the spectral features of the multi-spectral image
  • the second branch network can be used to extract the spatial features of the multi-spectral image, fully connected layer
  • the empty spectrum feature can be constructed based on the spectral feature and the spatial feature, and the classification layer can be classified based on the empty spectrum feature to obtain the classification result of the image.
  • Fig. 2 is a schematic flow chart of a method for image classification provided by an embodiment of the application. Please refer to Fig. 2.
  • the method for image classification based on the image classification model shown in Fig. 1 includes:
  • the image classification device After the image classification device obtains the multi-spectral image through the monitoring device, it can generate the target image to be classified based on the multi-spectral image.
  • the image classification model can classify the entire multispectral image or part of the multispectral image, because the multispectral image can be regarded as composed of multiple pixels. Therefore, the process of classifying multispectral images by the image classification model can be regarded as the process of classifying multiple parallel input pixels. For each pixel, the operation performed by the image classification model is the same Yes, any pixel in the multispectral image can be used as the input of the image classification model, that is, the target image to be classified.
  • the spatial information and spectral information of the target image can be further acquired, where the spectral information of the target image is a one-dimensional vector formed by the target image, and the spatial information of the target image is the target image and the neighborhood image of the target image The two-dimensional vector formed.
  • the target image is a certain pixel in the multispectral image
  • the spectral curve of the pixel can be generated based on the pixel first, and the spectral curve is used as the spectral information of the pixel as the input of the first branch network .
  • a certain frame of multi-spectral image is the multi-spectral image N that needs to be classified currently
  • each pixel in the multi-spectral image N is
  • take pixel point n such as the nth pixel point in the multispectral image N
  • Multiple frames of continuous multispectral images form a three-dimensional image block.
  • the image block has three dimensions, namely the wide dimension, the high dimension and the spectral dimension.
  • the spectral dimension of the image block can be determined from In each frame of multispectral image, obtain the pixel point corresponding to pixel point n (such as the nth pixel point in each frame of multispectral image), that is, pixel point n and multiple pixels corresponding to pixel point n are obtained, This part of the pixel points can constitute the spectral curve of the pixel point n, and the spectral curve is presented in the form of a one-dimensional vector, that is, the spectral information of the pixel point n.
  • the spatial information of the target image can also be acquired. Since the target image is a certain pixel in the multispectral image, the pixel can be generated based on the pixel and the neighborhood information of the pixel.
  • the spatial information of the pixel is used as the input of the second branch network. The above example is still used for explanation.
  • the above image block can be reduced by principal component analysis technology, and the first principal component obtained (can be understood as a frame of image obtained by compressing the image block) Determine the pixel point n, and select the neighborhood image of the pixel point n, such as r ⁇ r pixels centered on the pixel point n, the value of r can be set according to actual needs.
  • the pixel point n and the neighborhood image of the pixel point n constitute the spatial information of the pixel point n, and the spatial information is presented in the form of a two-dimensional vector.
  • the two pieces of information can be correspondingly input into the two branch networks of the image classification model to realize feature extraction and image classification.
  • the spectral information of the target image After the spectral information of the target image is obtained, it can be input into the first convolutional layer of the first branch network of the image classification model. After the first convolutional layer performs convolution processing on the spectral information, the first spectral feature of the target image can be obtained .
  • the spectral information is a one-dimensional vector.
  • a first spectral feature composed of m one-dimensional vectors can be obtained (for example, a plane image composed of m one-dimensional vectors side by side) ), where m is greater than or equal to 2.
  • the first spectral feature can be used as the input of the first pooling layer.
  • the second spectral feature can be obtained. Specifically, the first pooling layer can halve the length of each one-dimensional vector in the first spectral feature, so as to obtain the compressed spectral feature, that is, the second spectral feature.
  • the spatial information of the target image After the spatial information of the target image is obtained, it can be input into the second convolutional layer of the second branch network of the image classification model. After the second convolutional layer convolves the spatial information, the first spatial feature of the target image can be obtained . Specifically, the spectral information is a two-dimensional vector. After the second convolutional layer is processed, the first spatial feature composed of k two-dimensional vectors can be obtained (for example, one composed of k two-dimensional vectors side by side has a certain Thickness of the image block), where k is greater than or equal to 2.
  • step 205 and step 203 is in no particular order, and can be performed simultaneously or asynchronously, and there is no specific limitation here.
  • the first spatial feature can be used as the input of the second pooling layer.
  • the second spatial feature can be obtained. Specifically, the second pooling layer can halve the length and width of each two-dimensional vector in the first spatial feature, and the number of two-dimensional vectors of the first spatial feature (that is, the thickness of the image block) remains unchanged, thereby obtaining
  • the compressed spatial feature is the second spatial feature.
  • the second spectral feature and the second spatial feature After obtaining the second spectral feature and the second spatial feature, since the second spectral feature is a two-dimensional vector composed of m one-dimensional vectors, and the second spatial feature is a three-dimensional vector composed of k two-dimensional vectors, it can be passed through the image
  • the classification model stretches the second spectral feature and the second spatial feature, so that the elements of the second spectral feature and the second spatial feature are rearranged to form a one-dimensional third spectral feature and third spatial feature, that is, the third
  • the spectral feature and the third spatial feature are one-dimensional vectors.
  • the third spectral feature and the third spatial feature can be used as the input of the fully connected layer, so that the fully connected layer can merge the third spectral feature and the third spatial feature , Get the empty spectrum feature, so far, get the empty spectrum feature of the target image.
  • the empty spectrum features of the target image can be classified through the classification layer of the image classification model to obtain the classification result.
  • the classification result includes the probability that the target image is located in each category.
  • the classification result includes: pixel n
  • the probability of belonging to category A is 67%
  • the probability of pixel n belonging to category B is 20%
  • the probability of pixel n belonging to category C is 13%.
  • the category to which the target image belongs can be finally determined.
  • the classification result indicates that the probability of pixel n belonging to category A is the highest, it can be determined that the category to which pixel n belongs is category A.
  • the image classification model used in this embodiment can extract the spatial and spectral features of the target image, and the space spectrum feature formed by the combination of the two can represent the attribute information of the image in multiple dimensions, so this embodiment can effectively acquire the image Highly reliable attribute information. Furthermore, the image is classified based on the spatial spectrum feature, and the classification result is more effective in spatial correlation and spectral correlation, which can effectively improve the accuracy of the classification result of the image and accurately identify the objects in the image.
  • the spatial spectrum features generated in the above embodiments are single-scale features.
  • the scene reflected by the image usually contains objects of various scales, such as larger-scale buildings and smaller-scale objects.
  • the single-scale spatial spectrum feature generally cannot describe the scene of the multispectral image well, and it is easy to cause the information of small objects to be lost, which affects the accuracy of the image classification results.
  • FIG. 3 is another schematic diagram of the image classification model provided by an embodiment of the application.
  • the image classification The model is a multiscale spectral-spatial unified network (MSSN), which includes two branch networks, n fully connected layers, and a classification layer.
  • the first branch network includes n first convolutions. Layer and n-1 first pooling layers, n first convolutional layers and n-1 first pooling layers are alternately connected, and the second branch network includes n second convolutional layers and n-1 first pooling layers. Two pooling layers, n second convolutional layers and n-1 second pooling layers are alternately connected.
  • MSSN multiscale spectral-spatial unified network
  • the input of the first fully connected layer is the output of the first first pooling layer and the output of the first second pooling layer
  • the input of the second fully connected layer is the second first.
  • the output of the pooling layer and the output of the second second pooling layer, and so on, the input of the n-1th fully connected layer is the output of the n-1th first pooling layer and the n-1th
  • the output of the second pooling layer, and the input of the nth fully connected layer is the output of the nth first convolutional layer and the output of the nth second convolutional layer.
  • the output of all fully connected layers is spliced, it is used as the input of the classification layer for final image classification.
  • Fig. 4 is a schematic diagram of another flow chart of an image classification method provided by an embodiment of this application. Please refer to Fig. 4. This method performs image classification based on the image classification model shown in Fig. 3, including:
  • step 401 to step 402 please refer to the relevant description of step 201 to step 202 in the above-mentioned embodiment, which will not be repeated here.
  • the spectral information of the target image is input into the first first convolutional layer, and the first first convolutional layer convolves the spectral information.
  • the first first spectral feature is obtained, and then the first first spectral feature is input into the first first pooling layer for maximum pooling processing to obtain a second spectral feature, and then the first The second spectral feature is input to the second first convolutional layer for convolution processing to obtain the second first spectral feature, and then the second first spectral feature is input to the second first pooling layer for maximum pooling processing , Get the second second spectral feature, and so on, until the n-1th second spectral feature is input to the nth first convolutional layer for convolution processing to get the nth first spectral feature, so far, Then the spectral feature extraction of the target image is completed.
  • FIG. 5 is a schematic diagram of feature extraction provided by an embodiment of this application. As shown in Figure 5, suppose that the first branch network includes three first convolutional layers and two first pooling layers.
  • the first spectral feature a composed of m one-dimensional vectors can be obtained, where m is greater than or equal to 2. Then, the first spectral feature a is input into the first first pooling layer, so that the length of each one-dimensional vector of the first spectral feature a is halved, and the second spectral feature x is obtained. Then the second spectral feature x is input into the second first convolutional layer, and the first spectral feature b composed of p one-dimensional vectors can be obtained, where p is greater than m.
  • the first spectral feature b is input into the second first pooling layer, so that the length of each one-dimensional vector of the first spectral feature b is halved to obtain the second spectral feature y.
  • the second spectral feature y is input into the third first convolutional layer, and the first spectral feature c composed of t one-dimensional vectors can be obtained, where t is greater than p.
  • each branch network is illustrated schematically with only 3 convolutional layers and 2 pooling layers, and the number of convolutional layers and pooling layers of each branch network in the embodiment of the present application are not described.
  • the quantity constitutes a limit.
  • FIG. 5 only uses three fully connected layers for schematic illustration, and does not limit the number of fully connected layers in the embodiment of the present application.
  • the spatial information of the target image is obtained, it can be used as the input of the second branch network of the image classification model.
  • the spatial information of the target image is input into the first second convolutional layer, and the first second convolutional layer convolves the spatial information
  • the first first spatial feature is obtained, and then the first first spatial feature is input to the first second pooling layer for maximum pooling processing to obtain a second spatial feature, and then the first
  • the second spatial feature is input to the second second convolutional layer for convolution processing to obtain the second first spatial feature
  • the second first spatial feature is input to the second second pooling layer for maximum pooling processing , Get the second second spatial feature, and so on, until the n-1th second spatial feature is input to the nth second convolutional layer for convolution processing to obtain the nth first spatial feature, so far, Then the spatial feature extraction of the target image is completed. Since n second convolutional
  • n second convolutional layers and n-1 second pooling layers in the second branch network are alternately connected, 2n-1 spatial features can be generated (including n first spatial features and n-1th Two spatial features), and each spatial feature has a difference in size.
  • the second branch network includes 3 second convolutional layers and 2 second pooling.
  • Layer when the spatial information (a two-dimensional vector) is input to the first second convolutional layer, the first spatial feature d composed of k two-dimensional vectors can be obtained (one composed of k two-dimensional vectors side by side has Image block with a certain thickness), where k is greater than or equal to 2.
  • the first spatial feature d is input to the first second pooling layer, so that the length and width of each two-dimensional vector of the first spatial feature d are halved, and the second spatial feature z is obtained.
  • the second spatial feature z is input to the second second convolutional layer, and the first spatial feature e composed of q two-dimensional vectors can be obtained, where q is greater than k.
  • the first spatial feature e is input into the second second pooling layer, so that the length and width of each two-dimensional vector of the first spatial feature e are halved to obtain the second spatial feature u.
  • the second spatial feature u is input into the third second convolutional layer, and the first spatial feature f composed of s two-dimensional vectors can be obtained, where s is greater than q.
  • n-1 second spectral features After obtaining n first spectral features, n-1 second spectral features, n first spatial features, and n-1 second spatial features, you can use the image classification model to compare 1 second spectral feature to nth -1 second spectral feature and n-th first spectral feature are respectively stretched, so that the elements of this part of the feature are reorganized, corresponding to the first third spectral feature to the n-th third spectral feature, and Each third spectral feature is a one-dimensional vector.
  • the first second spatial feature to the n-1th second spatial feature and the nth first spatial feature can also be stretched through the image classification model to obtain the first third spatial feature correspondingly To the nth third spatial feature, and each third spatial feature is a one-dimensional vector.
  • the first third spectral feature and the first third spatial feature can be combined into a feature group, and the second third spectral feature and the second third spectral feature can be combined into a feature group.
  • the third spatial feature forms a feature group, and so on, until the nth third spectral feature and the nth third spatial feature are formed into a feature group, and finally n feature groups are obtained. Then input the first feature group into the first fully connected layer, so that the first fully connected layer will fuse the two features in the feature group to obtain the first sub-empty spectrum feature, and at the same time input the second feature group into the first fully connected layer.
  • y i is the sub-space spectrum feature output by the i-th fully connected layer
  • f() is the activation function
  • W i is the preset weight
  • b i is the preset bias, when i is 1 to n-
  • spe i is the i-th second spectral feature
  • spa i is the i-th second spatial feature
  • spe i is the i-th first spectral feature
  • spa i Is the i-th first spatial feature.
  • the n sub-space spectrum features can be spliced through the image classification model to obtain the empty spectrum feature.
  • the formula used by the image classification model for splicing processing is as follows:
  • output is the space spectrum feature obtained by splicing multiple sub-space spectrum features. Since each sub-space spectrum feature represents a different scale, the multiple sub-space spectrum features of different scales can be spliced to obtain multi-scale space spectrum features.
  • step 412 to step 413 please refer to the relevant descriptions of step 209 to step 210 in the foregoing embodiment, which will not be repeated here.
  • the image classification model used in this embodiment can effectively extract multi-scale spatial spectrum features of multi-spectral images, and perform image classification based on the spatial spectrum features.
  • the resulting classification results can effectively distinguish objects of different scales. In order to accurately interpret the complex scene in the image, and accurately identify the object category in the scene.
  • the image classification device obtains a hyperspectral image for classification through a hyperspectral imager.
  • the scene of the hyperspectral image contains objects of different scales, such as large-scale walls, cars, people, and smaller-scale glasses and For objects such as skin, 17 types of image samples are marked from the hyperspectral image.
  • the first type of image sample is a wall
  • the second type of image sample is a car
  • so on obtain the MSSN that has completed the training, and input the aforementioned hyperspectral image into the MSSN for image classification, and obtain the corresponding classification results.
  • Table 1 shows the scene interpretation accuracy of MSSN on hyperspectral images.
  • this application example also uses support vector machine (SVM).
  • SVM support vector machine
  • the performance of image classification is used as a comparison. It should be noted that the samples used in the training process of SVM and MSSN are the same, and the hyperspectral images used in image classification of SVM and MSSN are also the same.
  • the hyperspectral image scene interpretation based on the MSSN network can obtain higher classification accuracy.
  • the classification accuracy of the first type of sample under MSSN is 100
  • the classification accuracy under SVM is 98.96
  • the accuracy of the correct identification can reach 100%
  • the accuracy rate of being correctly identified is 98.96%. Therefore, the classification accuracy of MSSN for each category is higher than that of SVM, especially the three types of samples of 7, 8, and 9. MSSN greatly improves the classification accuracy and effectively shows the performance of MSSN.
  • OA the number of samples correctly classified/the number of samples to be classified, for example, the number of samples of the first type is 100 (for example, 100 pixels belonging to the wall in the hyperspectral image), after After classification, the number of samples correctly classified into the first category out of 100 samples is the number of samples correctly classified.
  • FIG. 6 is a schematic flow chart of the model training method provided by the embodiment of the application. Please refer to FIG. 6. The method includes:
  • step 601 to step 609 For specific descriptions of step 601 to step 609, reference may be made to related descriptions of step 201 to step 209 in the above-mentioned embodiment, which will not be repeated here.
  • the to-be-trained classification model is trained through the target loss function to obtain the image classification model.
  • the classification result includes the probability that the image to be trained belongs to each category, but the classification result is not necessarily correct. Since the correct category of the image to be trained in the multispectral image is marked in advance when the image to be trained is obtained, that is, the real result, the difference between the classification result of the image to be trained and the real result can be calculated through the objective loss function. If the difference between the two is beyond the qualified range, adjust the parameters of the classification model to be trained, and re-train with additional samples to be trained until the gap between the classification result of the image to be trained and the real result meets the requirements, then the image can be obtained. 2 The image classification model in the corresponding embodiment.
  • the image classification model obtained in this embodiment can extract the spatial and spectral features of the target image.
  • the space spectrum feature formed by the combination of the two can represent the attribute information of the image in multiple dimensions. Therefore, the image is performed based on the space spectrum feature. Classification can effectively improve the accuracy of image classification results and accurately identify objects in the image.
  • FIG. 7 is a schematic diagram of another flow chart of the model training method provided by an embodiment of the application. Please refer to FIG. 7.
  • the method includes:
  • the to-be-trained classification model uses the to-be-trained classification model to convert the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, and the nth first spectrum.
  • the feature and the nth first spatial feature are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature;
  • step 701 to step 712 please refer to the relevant descriptions of step 401 to step 412 in the foregoing embodiment, which will not be repeated here.
  • the to-be-trained classification model is trained through the target loss function to obtain the image classification model.
  • the classification result includes the probability that the image to be trained belongs to each category, but the classification result is not necessarily correct. Since the correct category of the image to be trained in the multispectral image is marked in advance when the image to be trained is obtained, that is, the real result, the difference between the classification result of the image to be trained and the real result can be calculated through the objective loss function. If the difference between the two is beyond the qualified range, adjust the parameters of the classification model to be trained, and re-train with additional samples to be trained until the gap between the classification result of the image to be trained and the real result meets the requirements, then the image can be obtained. 4 corresponds to the image classification model in the embodiment.
  • the image classification model obtained in this embodiment can extract the spatial and spectral features of the target image.
  • the space spectrum feature formed by the combination of the two can represent the attribute information of the image in multiple dimensions. Therefore, the image is performed based on the space spectrum feature. Classification can effectively improve the accuracy of image classification results and accurately identify objects in the image.
  • FIG. 8 is a schematic structural diagram of an image classification device provided by an embodiment of the application. As shown in FIG. 8, the device includes:
  • the first acquisition module 801 is configured to acquire a target image, and the target image is an image generated based on a hyperspectral image;
  • the extraction module 802 is used to extract the spatial characteristics of the target image and the spectral characteristics of the target image through the image classification model;
  • the construction module 803 is used to construct the empty spectrum feature according to the spatial feature and the spectral feature through the image classification model;
  • the second acquisition module 804 is configured to acquire the classification result of the empty spectrum feature through the image classification model
  • the determining module 805 is used to determine the category to which the target image belongs according to the classification result.
  • the device further includes:
  • the third acquisition module is used to acquire the spatial information of the target image and the spectral information of the target image, where the spectral information of the target image is a one-dimensional vector formed by the target image, and the spatial information of the target image is the neighbor of the target image and the target image.
  • the spectral information of the target image is a one-dimensional vector formed by the target image
  • the spatial information of the target image is the neighbor of the target image and the target image.
  • the extraction module 802 is also used to perform feature extraction on the spatial information and the spectral information respectively through the image classification model to obtain the spatial features of the target image and the spectral features of the target image.
  • the image classification model includes a first branch network and a second branch network
  • the first branch network includes a first convolutional layer and a first pooling layer
  • the second branch network includes a second convolutional layer and a second pooling layer.
  • the layer, the extraction module 802 is also used to:
  • the first spatial feature is maximally pooled by the second pooling layer to obtain the second spatial feature of the target image.
  • the image classification model further includes a fully connected layer
  • the building module 803 is also used to:
  • the second spectral feature and the second spatial feature are respectively stretched through the image classification model to obtain the third spectral feature and the third spatial feature, where the third spectral feature and the third spatial feature are one-dimensional vectors;
  • the third spectral feature and the third spatial feature are fused through the fully connected layer to obtain the spatial spectrum feature.
  • the image classification model includes a first branch network and a second branch network
  • the first branch network includes n first convolutional layers and n-1 first pooling layers
  • the second branch network includes n second The convolutional layer and n-1 second pooling layers, where n is greater than or equal to 2
  • the extraction module 802 is also used for:
  • the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
  • the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
  • the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
  • the image classification model further includes n fully connected layers, and the building module 803 is also used to:
  • the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and the first The n first spatial features are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the third The spectral feature and the third spatial feature are one-dimensional vectors;
  • n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
  • the n sub-space spectrum features are spliced to obtain the spatial spectrum feature.
  • the image classification model further includes a classification layer
  • the second acquisition module 804 is further configured to classify the empty spectrum features through the classification layer to obtain a classification result.
  • Fig. 9 is a schematic structural diagram of a model training device provided by an embodiment of the application. As shown in Fig. 9, the device includes:
  • the first acquisition module 901 is configured to acquire an image to be trained, and the image to be trained is an image generated based on a hyperspectral image;
  • the extraction module 902 is configured to extract the spatial features of the image to be trained and the spectral features of the image to be trained through the classification model to be trained;
  • the construction module 903 is used to construct an empty spectrum feature according to the spatial feature and the spectral feature through the classification model to be trained;
  • the second obtaining module 904 is configured to obtain the classification result of the empty spectrum feature through the classification model to be trained;
  • the training module 905 is used to train the to-be-trained classification model through the target loss function according to the classification result and the real result to obtain the image classification model.
  • the device further includes:
  • the third acquisition module is used to acquire the spatial information of the image to be trained and the spectral information of the image to be trained, where the spectral information of the image to be trained is a one-dimensional vector formed by the image to be trained, and the spatial information of the image to be trained is the image to be trained A two-dimensional vector formed by the image and the neighborhood image of the image to be trained;
  • the extraction module 902 is further configured to perform feature extraction on the spatial information and the spectral information respectively through the classification model to be trained to obtain the spatial features of the image to be trained and the spectral features of the image to be trained.
  • the classification model to be trained includes a first branch network and a second branch network.
  • the first branch network includes n first convolutional layers and n-1 first pooling layers
  • the second branch network includes n first convolutional layers.
  • Two convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2 and the extraction module 902 is also used for:
  • the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
  • the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
  • the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
  • the classification model to be trained further includes n fully connected layers, and the building module 903 is also used to:
  • the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and The nth first spatial feature is stretched separately to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the The three-spectral feature and the third spatial feature are one-dimensional vectors;
  • n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
  • n subspace spectrum features are spliced by the classification model to be trained to obtain the spatial spectrum features.
  • the classification model to be trained further includes a classification layer
  • the second acquisition module 904 is further configured to classify the empty spectrum features through the classification layer to obtain a classification result.
  • Fig. 10 is a schematic structural diagram of an image classification device provided by an embodiment of the application. Please refer to Fig. 10.
  • the device includes: one or more central processing units 1001, a memory 1002, an input/output interface 1003, and a wired or wireless network interface 1004, Power supply 1005;
  • the memory 1002 is a short-term storage memory or a persistent storage memory
  • the central processing unit 1001 is configured to communicate with the memory 1002, and execute the instruction operations in the memory 1002 on the image classification device to perform operations performed by the image classification device in FIG. 2 or FIG. 4, and details are not described herein again.
  • the embodiment of the present application also relates to a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute the method corresponding to FIG. 2 or FIG. 4.
  • the embodiment of the present application also relates to providing a computer program product containing instructions, which when running on a computer, causes the computer to execute the method corresponding to FIG. 2 or FIG. 4.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .

Abstract

An image classification method and a related device. An image classification model used in the method can extract a spatial feature and a spectral feature from a target image, and spatial-spectral features formed by combining the two features can represent attribute information of the image in a multi-dimensional manner. Therefore, classifying the image on the basis of the spatial-spectral features can effectively improve the accuracy of an image classification result, such that an object in the image can be accurately recognized. The method comprises: first acquiring the target image needing to be classified, wherein the target image is an image generated on the basis of a hyperspectral image, then extracting the spatial feature of the target image and the spectral feature of the target image by means of the image classification model, then constructing, by means of the image classification model, the spatial-spectral features according to the spatial feature and the spectral feature, acquiring a classification result of the spatial-spectral features by means of the image classification model, and finally determining, according to the classification result, the category to which the target image belongs.

Description

一种图像分类的方法及相关装置An image classification method and related device 技术领域Technical field
本申请涉及人工智能(artificial intelligence,AI)领域,尤其涉及一种图像分类的方法及相关装置。This application relates to the field of artificial intelligence (AI), and in particular to an image classification method and related devices.
背景技术Background technique
人工智能(artificial intelligence,AI)技术是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能的技术学科,AI技术通过感知环境、获取知识并使用知识获得最佳结果。换句话说,人工智能技术是计算机科学的一个分支,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式做出反应的智能机器。利用人工智能进行图像处理是人工智能常见的一个应用方式。Artificial intelligence (AI) technology is a technical discipline that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence. AI technology obtains the best results by perceiving the environment, acquiring knowledge, and using knowledge. In other words, artificial intelligence technology is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a similar way to human intelligence. The use of artificial intelligence for image processing is a common application of artificial intelligence.
以监控场景为例进行说明,在该场景中,可通过监控设备获取可见光图像,该可见光图像通常包含有多类物体,例如人,房屋和箱子等等,为了捕捉某一类目标物体以实现监控,可从该可见光图像中选择包含某个物体(或某些物体)的部分图像作为待分类的目标图像,然后通过神经网络提取该目标图像的空间特征(用于表征物体的几何形状、纹理等等),并通过神经网络对该目标图像的空间特征进行分类,进而确定目标图像所属的类别。Take a monitoring scene as an example. In this scene, a visible light image can be obtained through a monitoring device. The visible light image usually contains multiple types of objects, such as people, houses, boxes, etc., in order to capture a certain type of target object to achieve monitoring , You can select a part of the image containing an object (or certain objects) from the visible light image as the target image to be classified, and then extract the spatial characteristics of the target image (used to characterize the geometric shape, texture, etc. of the object) through the neural network Etc.), and classify the spatial characteristics of the target image through a neural network, and then determine the category to which the target image belongs.
上述图像分类过程中,由于仅考虑图像的空间特征,不足以全面地表征图像的所有属性信息,导致对图像的分类结果准确率不高,无法正确辨识图像中的物体。In the above-mentioned image classification process, since only the spatial characteristics of the image are considered, it is not sufficient to fully characterize all the attribute information of the image, resulting in a low accuracy rate of the image classification result, and the object in the image cannot be correctly identified.
发明内容Summary of the invention
本申请实施例提供了一种图像分类的方法及相关装置,可以有效提高图像的分类结果准确率,精准辨识图像中的物体。The embodiments of the present application provide an image classification method and related devices, which can effectively improve the accuracy of image classification results and accurately identify objects in the image.
本申请实施例第一方面提供一种图像分类的方法,该方法包括:The first aspect of the embodiments of the present application provides an image classification method, which includes:
若需要进行图像分类,可先获取待进行分类的目标图像,其中,该目标图像为基于多光谱图像所生成的图像;If image classification is required, the target image to be classified can be acquired first, where the target image is an image generated based on a multispectral image;
得到目标图像后,可以先获取图像分类模型,该模型为一种深度网络模型,然后通过图像分类模型提取目标图像的空间特征和目标图像的光谱特征;After obtaining the target image, you can first obtain the image classification model, which is a deep network model, and then extract the spatial characteristics of the target image and the spectral characteristics of the target image through the image classification model;
得到目标图像的空间特征和光谱特征后,再通过图像分类模型根据空间特征和光谱特征构建空谱特征;After obtaining the spatial features and spectral features of the target image, the image classification model is used to construct the spatial features according to the spatial and spectral features;
得到空谱特征后,可以通过图像分类模型获取空谱特征的分类结果,该分类结果包括目标图像位于各个类别的概率;After obtaining the empty spectrum feature, the classification result of the empty spectrum feature can be obtained through the image classification model, and the classification result includes the probability that the target image is located in each category;
从分类结果中确定目标图像在哪一类别中的概率最高,即可最终确定目标图像所属的类别。From the classification results to determine which category the target image has the highest probability, the category to which the target image belongs can be finally determined.
从上述图像分类的方法中,可以看出:该图像分类过程中所使用的图像分类模型,可以提取目标图像的空间特征和光谱特征,二者的结合所构成的空谱特征能够多维度地表征图像的属性信息,故基于该空谱特征对图像进行分类,可以有效提高图像的分类结果准确率,精准辨识图像中的物体。From the above image classification method, it can be seen that the image classification model used in the image classification process can extract the spatial and spectral features of the target image, and the combination of the two forms the spatial spectral features that can be characterized in multiple dimensions The attribute information of the image, so the classification of the image based on the empty spectrum feature can effectively improve the accuracy of the classification result of the image, and accurately identify the object in the image.
在第一方面的一种可能的实施方式中,通过图像分类模型提取目标图像的空间特征和目标图像的光谱特征之前,该方法还包括:In a possible implementation of the first aspect, before extracting the spatial features of the target image and the spectral features of the target image through the image classification model, the method further includes:
获取目标图像的空间信息和目标图像的光谱信息,其中,目标图像的光谱信息为目标图像所构成的一维向量,目标图像的空间信息为目标图像和目标图像的邻域图像所构成的 二维向量;Obtain the spatial information of the target image and the spectral information of the target image, where the spectral information of the target image is a one-dimensional vector formed by the target image, and the spatial information of the target image is a two-dimensional vector formed by the target image and the neighborhood image of the target image vector;
通过图像分类模型提取目标图像的空间特征和目标图像的光谱特征包括:Extracting the spatial characteristics of the target image and the spectral characteristics of the target image through the image classification model includes:
通过图像分类模型对空间信息和光谱信息分别进行特征提取,得到目标图像的空间特征和目标图像的光谱特征。Through the image classification model, the spatial information and the spectral information are extracted respectively, and the spatial characteristics of the target image and the spectral characteristics of the target image are obtained.
在上述实施方式中,可以先提取目标图像的空间信息和光谱信息,并作为图像分类模型的输入,以进一步提取目标图像的空间特征和目标图像的光谱特征,提高了方案的灵活度和可选择性。In the above embodiment, the spatial information and spectral information of the target image can be extracted first, and used as the input of the image classification model to further extract the spatial characteristics of the target image and the spectral characteristics of the target image, which improves the flexibility and choice of the solution. Sex.
在第一方面的一种可能的实施方式中,图像分类模型包括第一分支网络和第二分支网络,第一分支网络包括第一卷积层和第一池化层,第二分支网路包括第二卷积层和第二池化层,通过图像分类模型对空间信息和光谱信息分别进行特征提取,得到目标图像的空间特征和目标图像的光谱特征包括:In a possible implementation manner of the first aspect, the image classification model includes a first branch network and a second branch network, the first branch network includes a first convolutional layer and a first pooling layer, and the second branch network includes The second convolutional layer and the second pooling layer respectively perform feature extraction on the spatial information and spectral information through the image classification model, and obtain the spatial characteristics of the target image and the spectral characteristics of the target image, including:
通过第一卷积层对光谱信息进行卷积处理,得到目标图像的第一光谱特征;Perform convolution processing on the spectral information through the first convolution layer to obtain the first spectral feature of the target image;
通过第一池化层对第一光谱特征进行最大池化处理,得到目标图像的第二光谱特征;Perform maximum pooling processing on the first spectral feature through the first pooling layer to obtain the second spectral feature of the target image;
通过第二卷积层对空间信息进行卷积处理,得到目标图像的第一空间特征;Perform convolution processing on the spatial information through the second convolution layer to obtain the first spatial feature of the target image;
通过第二池化层对第一空间特征进行最大池化处理,得到目标图像的第二空间特征。The first spatial feature is maximally pooled by the second pooling layer to obtain the second spatial feature of the target image.
在上述实施方式中,图像分类模型包含两个分支网络,且第一分支网络和第二分支网络均包括一个卷积层和一个池化层,故可通过第一分支网络的第一卷积层对目标图像的光谱信息进行卷积处理,得到第一光谱特征,然后再通过第一池化层对第一光谱特征进行最大池化处理,得到第二光谱特征,同理,还可通过第二分支网络的第二卷积层对目标图像的空间信息进行卷积处理,得到第一空间特征,然后通过第二池化层对第一空间特征进行最大池化处理,得到第二空间特征,提高了方案的灵活度和可选择性。In the above embodiment, the image classification model includes two branch networks, and both the first branch network and the second branch network include a convolutional layer and a pooling layer, so it can pass through the first convolutional layer of the first branch network. Perform convolution processing on the spectral information of the target image to obtain the first spectral feature, and then perform maximum pooling processing on the first spectral feature through the first pooling layer to obtain the second spectral feature. In the same way, the second spectral feature can also be obtained. The second convolutional layer of the branch network performs convolution processing on the spatial information of the target image to obtain the first spatial feature, and then performs the maximum pooling processing on the first spatial feature through the second pooling layer to obtain the second spatial feature, improving This improves the flexibility and selectivity of the program.
在第一方面的一种可能的实施方式中,图像分类模型还包括全连接层,通过图像分类模型根据空间特征和光谱特征构建空谱特征包括:In a possible implementation of the first aspect, the image classification model further includes a fully connected layer, and the construction of the space spectrum feature based on the spatial feature and the spectral feature through the image classification model includes:
通过图像分类模型将第二光谱特征和第二空间特征分别进行拉伸处理,得到第三光谱特征和第三空间特征,其中,第三光谱特征和第三空间特征为一维向量;The second spectral feature and the second spatial feature are respectively stretched through the image classification model to obtain the third spectral feature and the third spatial feature, where the third spectral feature and the third spatial feature are one-dimensional vectors;
通过全连接层对第三光谱特征和第三空间特征进行融合处理,得到空谱特征。The third spectral feature and the third spatial feature are fused through the fully connected layer to obtain the spatial spectrum feature.
在上述实施方式中,图像分类模型还包含一个全连接层,当得到第一池化层和第二池化层分别输出的第二光谱特征和第二空间特征后,可以将这两个特征进行拉伸(即元素重组),使其成为一维向量,即第三光谱特征和第三空间特征,然后通过全连接层对第三光谱特征和第三空间特征进行融合处理,即可得到一个单尺度的空谱特征,提高了方案的灵活度和可选择性。In the above embodiment, the image classification model also includes a fully connected layer. After the second spectral feature and the second spatial feature output by the first pooling layer and the second pooling layer are obtained, the two features can be combined. Stretching (ie element reorganization) to make it a one-dimensional vector, namely the third spectral feature and the third spatial feature, and then the third spectral feature and the third spatial feature are fused through the fully connected layer to obtain a single The scale of the empty spectrum feature improves the flexibility and selectivity of the scheme.
在第一方面的一种可能的实施方式中,图像分类模型包括第一分支网络和第二分支网络,第一分支网络包括n个第一卷积层和n-1个第一池化层,第二分支网络包括n个第二卷积层和n-1个第二池化层,其中,n大于或等于2,通过图像分类模型对空间信息和光谱信息分别进行特征提取,得到目标图像的空间特征和目标图像的光谱特征包括:In a possible implementation of the first aspect, the image classification model includes a first branch network and a second branch network, and the first branch network includes n first convolutional layers and n-1 first pooling layers, The second branch network includes n second convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2, and the spatial information and spectral information are respectively feature extracted through the image classification model to obtain the target image The spatial characteristics and spectral characteristics of the target image include:
通过第1个第一卷积层对光谱信息进行卷积处理,得到第1个第一光谱特征;Perform convolution processing on the spectral information through the first first convolution layer to obtain the first first spectral feature;
通过第1个第一池化层至第n-1个第一池化层对第1个第一光谱特征至第n-1个第一光谱特征分别进行最大池化处理,得到第1个第二光谱特征至第n-1个第二光谱特征;Through the first first pooling layer to the n-1th first pooling layer, the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
通过第2个第一卷积层至第n个第一卷积层对第1个第二光谱特征至第n-1个第二光 谱特征分别进行卷积处理,得到第2个第一光谱特征至第n个第一光谱特征;Through the second first convolutional layer to the nth first convolutional layer, the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
通过第1个第二卷积层对空间信息进行卷积处理,得到第1个第一空间特征;Perform convolution processing on the spatial information through the first second convolution layer to obtain the first first spatial feature;
通过第1个第二池化层至第n-1个第二池化层对第1个第一空间特征至第n-1个第一空间特征分别进行最大池化处理,得到第1个第二空间特征至第n-1个第二空间特征;Through the first second pooling layer to the n-1th second pooling layer, the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
通过第2个第二卷积层至第n个第二卷积层对第1个第二空间特征至第n-1个第二空间特征分别进行卷积处理,得到第2个第一空间特征至第n个第一空间特征。Perform convolution processing on the first second spatial feature to the n-1th second spatial feature through the second second convolutional layer to the nth second convolutional layer to obtain the second first spatial feature To the nth first spatial feature.
在上述实施方式中,图像分类模型包含两个分支网络,且第一分支网络包括n个第一卷积层和n-1个第一池化层,故可将目标图像的光谱信息作为第1个第一卷积层的输入,经过卷积后得到第1个第一光谱特征,再将第1个第一光谱特征作为第1个第一池化层的输入,经过最大池化后得到第1个第二光谱特征,然后将第1个第二光谱特征作为第2个第一卷积层的输入,经过卷积后得到第2个第一光谱特征,然后将第2个第一光谱特征作为第2个第一池化层的输入,以此类推,第1个第一卷积层至第n个第一卷积层可以分别输出第1个第一光谱特征至第n个第一光谱特征,第1个第一池化层至第n-1个第一池化层可以分别输出第1个第二光谱特征至第n-1个第二光谱特征。In the above embodiment, the image classification model includes two branch networks, and the first branch network includes n first convolutional layers and n-1 first pooling layers, so the spectral information of the target image can be used as the first The input of the first convolutional layer, the first first spectral feature is obtained after convolution, and then the first first spectral feature is used as the input of the first first pooling layer, after the maximum pooling, the first 1 second spectral feature, and then use the first second spectral feature as the input of the second first convolutional layer. After convolution, the second first spectral feature is obtained, and then the second first spectral feature As the input of the second first pooling layer, and so on, the first first convolutional layer to the nth first convolutional layer can output the first first spectral feature to the nth first spectrum, respectively Features, the first first pooling layer to the n-1th first pooling layer can respectively output the first second spectral characteristic to the n-1th second spectral characteristic.
同理,通过第二分支网络对目标图像的空间信息进行特征提取,也可以得到第1个第一空间特征至第n个第一空间特征,以及第1个第二空间特征至第n-1个第二空间特征,提高了方案的灵活度和可选择性。In the same way, by performing feature extraction on the spatial information of the target image through the second branch network, the first first spatial feature to the nth first spatial feature and the first second spatial feature to n-1 are also obtained. The second spatial feature improves the flexibility and selectivity of the scheme.
在第一方面的一种可能的实施方式中,图像分类模型还包括n个全连接层,通过图像分类模型根据空间特征和光谱特征构建空谱特征包括:In a possible implementation of the first aspect, the image classification model further includes n fully connected layers, and constructing the space spectrum feature according to the spatial feature and the spectral feature through the image classification model includes:
通过图像分类模型将第1个第二光谱特征至第n-1个第二光谱特征、第1个第二空间特征至第n-1个第二空间特征、第n个第一光谱特征和第n个第一空间特征分别进行拉伸处理,得到第1个第三光谱特征至第n个第三光谱特征,以及第1个第三空间特征至第n个第三空间特征,其中,第三光谱特征和第三空间特征为一维向量;Through the image classification model, the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and the first The n first spatial features are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the third The spectral feature and the third spatial feature are one-dimensional vectors;
通过n个全连接层对n对特征组分别进行融合处理,得到n个子空谱特征,其中,排序相同的一个第三光谱特征和一个第三空间特征构成一个特征组;The n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
通过图像分类模型将n个子空谱特征进行拼接处理,得到空谱特征。Through the image classification model, the n sub-space spectrum features are spliced to obtain the spatial spectrum feature.
在上述实施方式中,图像分类模型还包括n个全连接层。可以对第1个第二光谱特征至第n-1个第二光谱特征,以及第n个第一光谱特征进行拉伸处理,对应得到第1个第三光谱特征至第n个第三光谱特征,同理,还可以对第1个第二空间特征至第n-1个第二空间特征,以及第n个第一空间特征进行拉伸处理,对应得到第1个第三空间特征至第n个第三空间特征。然后将第1个第三光谱特征和第1个第三空间特征作为第1个全连接层的输入,经过融合后得到第1个子空谱特征,将第2个第三光谱特征和第2个第三空间特征作为第2个全连接层的输入,经过融合后得到第2个子空谱特征,以此类推,直至得到n个子空谱特征,再将n个子空谱特征进行拼接,得到一个多尺度的空谱特征,提高了方案的灵活度和可选择性。In the foregoing embodiment, the image classification model further includes n fully connected layers. The first second spectral feature to the n-1th second spectral feature, and the nth first spectral feature can be stretched, corresponding to the first third spectral feature to the nth third spectral feature In the same way, the first second spatial feature to the n-1th second spatial feature, and the nth first spatial feature can be stretched to obtain the first third spatial feature to the nth A third spatial feature. Then use the first third spectral feature and the first third spatial feature as the input of the first fully connected layer. After fusion, the first subspace spectral feature is obtained, and the second third spectral feature and the second The third spatial feature is used as the input of the second fully connected layer. After fusion, the second subspace spectrum feature is obtained, and so on, until n subspace spectrum features are obtained, and then n subspace spectrum features are spliced together to obtain a multiple The scale of the empty spectrum feature improves the flexibility and selectivity of the scheme.
在第一方面的一种可能的实施方式中,图像分类模型还包括分类层,通过图像分类模型获取空谱特征的分类结果包括:In a possible implementation of the first aspect, the image classification model further includes a classification layer, and obtaining the classification result of the empty spectrum feature through the image classification model includes:
通过分类层对空谱特征进行分类处理,得到分类结果。The spatial spectrum features are classified by the classification layer to obtain the classification results.
在上述实施方式中,图像分类模型还包括分类层,得到空谱特征后,可通过分类层对 空谱特征进行分裂,进而得到目标图像的分类结果,提高了方案的灵活度和可选择性。In the foregoing embodiment, the image classification model further includes a classification layer. After the empty spectrum feature is obtained, the empty spectrum feature can be split by the classification layer to obtain the classification result of the target image, which improves the flexibility and selectivity of the scheme.
本申请实施例第二方面提供一种模型训练的方法,该方法包括:The second aspect of the embodiments of the present application provides a method for model training, which includes:
获取待训练图像,待训练图像为基于高光谱图像所生成的图像;Obtain an image to be trained, and the image to be trained is an image generated based on a hyperspectral image;
通过待训练分类模型提取待训练图像的空间特征和待训练图像的光谱特征;Extract the spatial characteristics of the image to be trained and the spectral characteristics of the image to be trained through the classification model to be trained;
通过待训练分类模型根据空间特征和光谱特征构建空谱特征;Construct empty spectrum features according to spatial and spectral features through the classification model to be trained;
通过待训练分类模型获取空谱特征的分类结果;Obtain the classification result of the empty spectrum feature through the classification model to be trained;
根据分类结果和真实结果,通过目标损失函数对待训练分类模型进行训练,得到图像分类模型。According to the classification results and the real results, the target loss function is used to train the classification model to be trained to obtain the image classification model.
从上述模型训练的方法所得到的图像分类模型,可以提取目标图像的空间特征和光谱特征,二者的结合所构成的空谱特征能够多维度地表征图像的属性信息,故基于该空谱特征对图像进行分类,可以有效提高图像的分类结果准确率,精准辨识图像中的物体。The image classification model obtained from the above-mentioned model training method can extract the spatial and spectral features of the target image. The space spectrum feature formed by the combination of the two can represent the attribute information of the image in multiple dimensions, so it is based on the space spectrum feature The classification of the image can effectively improve the accuracy of the classification result of the image and accurately identify the objects in the image.
在第二方面的一种可能的实施方式中,通过待训练分类模型提取待训练图像的空间特征和待训练图像的光谱特征之前,该方法还包括:In a possible implementation of the second aspect, before extracting the spatial features of the image to be trained and the spectral features of the image to be trained through the classification model to be trained, the method further includes:
获取待训练图像的空间信息和待训练图像的光谱信息,其中,待训练图像的光谱信息为待训练图像所构成的一维向量,待训练图像的空间信息为待训练图像和待训练图像的邻域图像所构成的二维向量;Obtain the spatial information of the image to be trained and the spectral information of the image to be trained, where the spectral information of the image to be trained is a one-dimensional vector formed by the image to be trained, and the spatial information of the image to be trained is the image to be trained and the neighbors of the image to be trained. A two-dimensional vector formed by the domain image;
通过待训练分类模型提取待训练图像的空间特征和待训练图像的光谱特征包括:Extracting the spatial features of the image to be trained and the spectral features of the image to be trained through the classification model to be trained includes:
通过待训练分类模型对空间信息和光谱信息分别进行特征提取,得到待训练图像的空间特征和待训练图像的光谱特征。The spatial information and the spectral information are respectively feature extracted through the classification model to be trained to obtain the spatial features of the image to be trained and the spectral features of the image to be trained.
在第二方面的一种可能的实施方式中,待训练分类模型包括第一分支网络和第二分支网络,第一分支网络包括n个第一卷积层和n-1个第一池化层,第二分支网络包括n个第二卷积层和n-1个第二池化层,其中,n大于或等于2,通过待训练分类模型对空间信息和光谱信息分别进行特征提取,得到待训练图像的空间特征和待训练图像的光谱特征包括:In a possible implementation of the second aspect, the classification model to be trained includes a first branch network and a second branch network, and the first branch network includes n first convolutional layers and n-1 first pooling layers , The second branch network includes n second convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2. The spatial information and spectral information are respectively feature extracted through the classification model to be trained to obtain the The spatial characteristics of the training image and the spectral characteristics of the image to be trained include:
通过第1个第一卷积层对光谱信息进行卷积处理,得到第1个第一光谱特征;Perform convolution processing on the spectral information through the first first convolution layer to obtain the first first spectral feature;
通过第1个第一池化层至第n-1个第一池化层对第1个第一光谱特征至第n-1个第一光谱特征分别进行最大池化处理,得到第1个第二光谱特征至第n-1个第二光谱特征;Through the first first pooling layer to the n-1th first pooling layer, the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
通过第2个第一卷积层至第n个第一卷积层对第1个第二光谱特征至第n-1个第二光谱特征分别进行卷积处理,得到第2个第一光谱特征至第n个第一光谱特征;Through the second first convolutional layer to the nth first convolutional layer, the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
通过第1个第二卷积层对空间信息进行卷积处理,得到第1个第一空间特征;Perform convolution processing on the spatial information through the first second convolution layer to obtain the first first spatial feature;
通过第1个第二池化层至第n-1个第二池化层对第1个第一空间特征至第n-1个第一空间特征分别进行最大池化处理,得到第1个第二空间特征至第n-1个第二空间特征;Through the first second pooling layer to the n-1th second pooling layer, the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
通过第2个第二卷积层至第n个第二卷积层对第1个第二空间特征至第n-1个第二空间特征分别进行卷积处理,得到第2个第一空间特征至第n个第一空间特征。Perform convolution processing on the first second spatial feature to the n-1th second spatial feature through the second second convolutional layer to the nth second convolutional layer to obtain the second first spatial feature To the nth first spatial feature.
在第二方面的一种可能的实施方式中,待训练分类模型还包括n个全连接层,通过待训练分类模型根据空间特征和光谱特征构建空谱特征包括:In a possible implementation manner of the second aspect, the classification model to be trained further includes n fully connected layers, and the construction of the spatial spectrum feature according to the spatial feature and the spectral feature through the classification model to be trained includes:
通过待训练分类模型将第1个第二光谱特征至第n-1个第二光谱特征、第1个第二空间特征至第n-1个第二空间特征、第n个第一光谱特征和第n个第一空间特征分别进行拉伸处理,得到第1个第三光谱特征至第n个第三光谱特征,以及第1个第三空间特征至第n个第三空间特征,其中,第三光谱特征和第三空间特征为一维向量;Through the classification model to be trained, the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and The nth first spatial feature is stretched separately to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the The three-spectral feature and the third spatial feature are one-dimensional vectors;
通过n个全连接层对n对特征组分别进行融合处理,得到n个子空谱特征,其中,排序相同的一个第三光谱特征和一个第三空间特征构成一个特征组;The n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
通过待训练分类模型将n个子空谱特征进行拼接处理,得到空谱特征。The n subspace spectrum features are spliced by the classification model to be trained to obtain the spatial spectrum features.
在第二方面的一种可能的实施方式中,待训练分类模型还包括分类层,通过待训练分类模型获取空谱特征的分类结果包括:In a possible implementation manner of the second aspect, the classification model to be trained further includes a classification layer, and obtaining the classification result of the empty spectrum feature through the classification model to be trained includes:
通过分类层对空谱特征进行分类处理,得到分类结果。The spatial spectrum features are classified by the classification layer to obtain the classification results.
本申请实施例第三方面提供一种图像分类的装置,包括:A third aspect of the embodiments of the present application provides an image classification device, including:
第一获取模块,用于获取目标图像,目标图像为基于高光谱图像所生成的图像;The first acquisition module is configured to acquire a target image, and the target image is an image generated based on a hyperspectral image;
提取模块,用于通过图像分类模型提取目标图像的空间特征和目标图像的光谱特征;The extraction module is used to extract the spatial characteristics of the target image and the spectral characteristics of the target image through the image classification model;
构建模块,用于通过图像分类模型根据空间特征和光谱特征构建空谱特征;The construction module is used to construct the empty spectrum feature according to the spatial feature and the spectral feature through the image classification model;
第二获取模块,用于通过图像分类模型获取空谱特征的分类结果;The second acquisition module is used to acquire the classification result of the empty spectrum feature through the image classification model;
确定模块,用于根据分类结果,确定目标图像所属的类别。The determining module is used to determine the category to which the target image belongs according to the classification result.
在第三方面的一种可能的实施方式中,该装置还包括:In a possible implementation manner of the third aspect, the device further includes:
第三获取模块,用于获取目标图像的空间信息和目标图像的光谱信息,其中,目标图像的光谱信息为目标图像所构成的一维向量,目标图像的空间信息为目标图像和目标图像的邻域图像所构成的二维向量;The third acquisition module is used to acquire the spatial information of the target image and the spectral information of the target image, where the spectral information of the target image is a one-dimensional vector formed by the target image, and the spatial information of the target image is the neighbor of the target image and the target image. A two-dimensional vector formed by the domain image;
提取模块还用于通过图像分类模型对空间信息和光谱信息分别进行特征提取,得到目标图像的空间特征和目标图像的光谱特征。The extraction module is also used to perform feature extraction on the spatial information and the spectral information through the image classification model to obtain the spatial features of the target image and the spectral features of the target image.
在第三方面的一种可能的实施方式中,图像分类模型包括第一分支网络和第二分支网络,第一分支网络包括第一卷积层和第一池化层,第二分支网路包括第二卷积层和第二池化层,提取模块还用于:In a possible implementation manner of the third aspect, the image classification model includes a first branch network and a second branch network, the first branch network includes a first convolutional layer and a first pooling layer, and the second branch network includes The second convolutional layer and the second pooling layer, the extraction module is also used to:
通过第一卷积层对光谱信息进行卷积处理,得到目标图像的第一光谱特征;Perform convolution processing on the spectral information through the first convolution layer to obtain the first spectral feature of the target image;
通过第一池化层对第一光谱特征进行最大池化处理,得到目标图像的第二光谱特征;Perform maximum pooling processing on the first spectral feature through the first pooling layer to obtain the second spectral feature of the target image;
通过第二卷积层对空间信息进行卷积处理,得到目标图像的第一空间特征;Perform convolution processing on the spatial information through the second convolution layer to obtain the first spatial feature of the target image;
通过第二池化层对第一空间特征进行最大池化处理,得到目标图像的第二空间特征。The first spatial feature is maximally pooled by the second pooling layer to obtain the second spatial feature of the target image.
在第三方面的一种可能的实施方式中,图像分类模型还包括全连接层,构建模块还用于:In a possible implementation of the third aspect, the image classification model further includes a fully connected layer, and the building module is also used to:
通过图像分类模型将第二光谱特征和第二空间特征分别进行拉伸处理,得到第三光谱特征和第三空间特征,其中,第三光谱特征和第三空间特征为一维向量;The second spectral feature and the second spatial feature are respectively stretched through the image classification model to obtain the third spectral feature and the third spatial feature, where the third spectral feature and the third spatial feature are one-dimensional vectors;
通过全连接层对第三光谱特征和第三空间特征进行融合处理,得到空谱特征。The third spectral feature and the third spatial feature are fused through the fully connected layer to obtain the spatial spectrum feature.
在第三方面的一种可能的实施方式中,图像分类模型包括第一分支网络和第二分支网络,第一分支网络包括n个第一卷积层和n-1个第一池化层,第二分支网络包括n个第二卷积层和n-1个第二池化层,其中,n大于或等于2,提取模块还用于:In a possible implementation manner of the third aspect, the image classification model includes a first branch network and a second branch network, and the first branch network includes n first convolutional layers and n-1 first pooling layers, The second branch network includes n second convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2, and the extraction module is also used for:
通过第1个第一卷积层对光谱信息进行卷积处理,得到第1个第一光谱特征;Perform convolution processing on the spectral information through the first first convolution layer to obtain the first first spectral feature;
通过第1个第一池化层至第n-1个第一池化层对第1个第一光谱特征至第n-1个第一光谱特征分别进行最大池化处理,得到第1个第二光谱特征至第n-1个第二光谱特征;Through the first first pooling layer to the n-1th first pooling layer, the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
通过第2个第一卷积层至第n个第一卷积层对第1个第二光谱特征至第n-1个第二光谱特征分别进行卷积处理,得到第2个第一光谱特征至第n个第一光谱特征;Through the second first convolutional layer to the nth first convolutional layer, the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
通过第1个第二卷积层对空间信息进行卷积处理,得到第1个第一空间特征;Perform convolution processing on the spatial information through the first second convolution layer to obtain the first first spatial feature;
通过第1个第二池化层至第n-1个第二池化层对第1个第一空间特征至第n-1个第一空间特征分别进行最大池化处理,得到第1个第二空间特征至第n-1个第二空间特征;Through the first second pooling layer to the n-1th second pooling layer, the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
通过第2个第二卷积层至第n个第二卷积层对第1个第二空间特征至第n-1个第二空间特征分别进行卷积处理,得到第2个第一空间特征至第n个第一空间特征。Perform convolution processing on the first second spatial feature to the n-1th second spatial feature through the second second convolutional layer to the nth second convolutional layer to obtain the second first spatial feature To the nth first spatial feature.
在第三方面的一种可能的实施方式中,图像分类模型还包括n个全连接层,构建模块还用于:In a possible implementation manner of the third aspect, the image classification model further includes n fully connected layers, and the building module is further used for:
通过图像分类模型将第1个第二光谱特征至第n-1个第二光谱特征、第1个第二空间特征至第n-1个第二空间特征、第n个第一光谱特征和第n个第一空间特征分别进行拉伸处理,得到第1个第三光谱特征至第n个第三光谱特征,以及第1个第三空间特征至第n个第三空间特征,其中,第三光谱特征和第三空间特征为一维向量;Through the image classification model, the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and the first The n first spatial features are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the third The spectral feature and the third spatial feature are one-dimensional vectors;
通过n个全连接层对n对特征组分别进行融合处理,得到n个子空谱特征,其中,排序相同的一个第三光谱特征和一个第三空间特征构成一个特征组;The n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
通过图像分类模型将n个子空谱特征进行拼接处理,得到空谱特征。Through the image classification model, the n sub-space spectrum features are spliced to obtain the spatial spectrum feature.
在第三方面的一种可能的实施方式中,图像分类模型还包括分类层,第二获取模块还用于通过分类层对空谱特征进行分类处理,得到分类结果。In a possible implementation manner of the third aspect, the image classification model further includes a classification layer, and the second acquisition module is further configured to classify the empty spectrum features through the classification layer to obtain a classification result.
本申请实施例第四方面提供一种模型训练的装置,该装置包括:A fourth aspect of the embodiments of the present application provides a model training device, which includes:
第一获取模块,用于获取待训练图像,待训练图像为基于高光谱图像所生成的图像;The first acquisition module is used to acquire an image to be trained, and the image to be trained is an image generated based on a hyperspectral image;
提取模块,用于通过待训练分类模型提取待训练图像的空间特征和待训练图像的光谱特征;The extraction module is used to extract the spatial characteristics of the image to be trained and the spectral characteristics of the image to be trained through the classification model to be trained;
构建模块,用于通过待训练分类模型根据空间特征和光谱特征构建空谱特征;The construction module is used to construct the empty spectrum feature according to the spatial feature and the spectral feature through the classification model to be trained;
第二获取模块,用于通过待训练分类模型获取空谱特征的分类结果;The second acquisition module is used to acquire the classification result of the empty spectrum feature through the classification model to be trained;
训练模块,用于根据分类结果和真实结果,通过目标损失函数对待训练分类模型进行训练,得到图像分类模型。The training module is used to train the classification model to be trained through the target loss function according to the classification result and the real result to obtain the image classification model.
在第四方面的一种可能的实施方式中,该装置还包括:In a possible implementation manner of the fourth aspect, the device further includes:
第三获取模块,用于获取待训练图像的空间信息和待训练图像的光谱信息,其中,待训练图像的光谱信息为待训练图像所构成的一维向量,待训练图像的空间信息为待训练图像和待训练图像的邻域图像所构成的二维向量;The third acquisition module is used to acquire the spatial information of the image to be trained and the spectral information of the image to be trained, where the spectral information of the image to be trained is a one-dimensional vector formed by the image to be trained, and the spatial information of the image to be trained is the image to be trained A two-dimensional vector formed by the image and the neighborhood image of the image to be trained;
提取模块还用于通过待训练分类模型对空间信息和光谱信息分别进行特征提取,得到待训练图像的空间特征和待训练图像的光谱特征。The extraction module is also used to perform feature extraction on the spatial information and the spectral information respectively through the classification model to be trained to obtain the spatial features of the image to be trained and the spectral features of the image to be trained.
在第四方面的一种可能的实施方式中,待训练分类模型包括第一分支网络和第二分支网络,第一分支网络包括n个第一卷积层和n-1个第一池化层,第二分支网络包括n个第二卷积层和n-1个第二池化层,其中,n大于或等于2,提取模块还用于:In a possible implementation manner of the fourth aspect, the classification model to be trained includes a first branch network and a second branch network, and the first branch network includes n first convolutional layers and n-1 first pooling layers , The second branch network includes n second convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2, and the extraction module is also used for:
通过第1个第一卷积层对光谱信息进行卷积处理,得到第1个第一光谱特征;Perform convolution processing on the spectral information through the first first convolution layer to obtain the first first spectral feature;
通过第1个第一池化层至第n-1个第一池化层对第1个第一光谱特征至第n-1个第一光谱特征分别进行最大池化处理,得到第1个第二光谱特征至第n-1个第二光谱特征;Through the first first pooling layer to the n-1th first pooling layer, the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
通过第2个第一卷积层至第n个第一卷积层对第1个第二光谱特征至第n-1个第二光谱特征分别进行卷积处理,得到第2个第一光谱特征至第n个第一光谱特征;Through the second first convolutional layer to the nth first convolutional layer, the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
通过第1个第二卷积层对空间信息进行卷积处理,得到第1个第一空间特征;Perform convolution processing on the spatial information through the first second convolution layer to obtain the first first spatial feature;
通过第1个第二池化层至第n-1个第二池化层对第1个第一空间特征至第n-1个第一 空间特征分别进行最大池化处理,得到第1个第二空间特征至第n-1个第二空间特征;Through the first second pooling layer to the n-1th second pooling layer, the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
通过第2个第二卷积层至第n个第二卷积层对第1个第二空间特征至第n-1个第二空间特征分别进行卷积处理,得到第2个第一空间特征至第n个第一空间特征。Perform convolution processing on the first second spatial feature to the n-1th second spatial feature through the second second convolutional layer to the nth second convolutional layer to obtain the second first spatial feature To the nth first spatial feature.
在第四方面的一种可能的实施方式中,待训练分类模型还包括n个全连接层,构建模块还用于:In a possible implementation manner of the fourth aspect, the classification model to be trained further includes n fully connected layers, and the building module is further used for:
通过待训练分类模型将第1个第二光谱特征至第n-1个第二光谱特征、第1个第二空间特征至第n-1个第二空间特征、第n个第一光谱特征和第n个第一空间特征分别进行拉伸处理,得到第1个第三光谱特征至第n个第三光谱特征,以及第1个第三空间特征至第n个第三空间特征,其中,第三光谱特征和第三空间特征为一维向量;Through the classification model to be trained, the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and The nth first spatial feature is stretched separately to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the The three-spectral feature and the third spatial feature are one-dimensional vectors;
通过n个全连接层对n对特征组分别进行融合处理,得到n个子空谱特征,其中,排序相同的一个第三光谱特征和一个第三空间特征构成一个特征组;The n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
通过待训练分类模型将n个子空谱特征进行拼接处理,得到空谱特征。The n subspace spectrum features are spliced by the classification model to be trained to obtain the spatial spectrum features.
在第四方面的一种可能的实施方式中,待训练分类模型还包括分类层,第二获取模块还用于通过分类层对空谱特征进行分类处理,得到分类结果。In a possible implementation manner of the fourth aspect, the classification model to be trained further includes a classification layer, and the second acquisition module is further configured to classify the empty spectrum features through the classification layer to obtain a classification result.
本申请实施例第五方面提供一种图像分类设备,包括:A fifth aspect of the embodiments of the present application provides an image classification device, including:
一个或一个以上中央处理器,存储器,输入输出接口,有线或无线网络接口,电源;One or more central processing units, memory, input and output interfaces, wired or wireless network interfaces, power supply;
存储器为短暂存储存储器或持久存储存储器;The memory is a short-term storage memory or a persistent storage memory;
中央处理器配置为与存储器通信,在图像分类设备上执行存储器中的指令操作以执行第一方面及第一方面任意一种可能的实施方式,第二方面及第二方面任意一种可能的实施方式中的方法。The central processing unit is configured to communicate with the memory, and execute the instruction operations in the memory on the image classification device to execute any possible implementation of the first aspect and the first aspect, and any possible implementation of the second and second aspects The method in the way.
本申请实施例第六方面提供一种计算机可读存储介质,包括指令,当指令在计算机上运行时,使得计算机执行如第一方面及第一方面任意一种可能的实施方式,第二方面及第二方面任意一种可能的实施方式中的方法。The sixth aspect of the embodiments of the present application provides a computer-readable storage medium, including instructions, which when the instructions run on a computer, cause the computer to execute any possible implementation manner as in the first aspect and the first aspect, and the second aspect and The method in any possible implementation of the second aspect.
本申请实施例第七方面提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如第一方面及第一方面任意一种可能的实施方式,第二方面及第二方面任意一种可能的实施方式中的方法。The seventh aspect of the embodiments of the present application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any one of the possible implementation manners of the first aspect and the first aspect, the second aspect and the second aspect In any one of the possible implementation manners.
从以上技术方案可以看出,本申请实施例具有以下优点:It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
本申请实施例提供了一种图像分类的方法及相关装置,其中,该方法先获取需进行分类的目标图像,该目标图像为基于高光谱图像所生成的图像,然后通过图像分类模型提取目标图像的空间特征和目标图像的光谱特征,再通过图像分类模型根据空间特征和光谱特征构建空谱特征,并通过图像分类模型获取空谱特征的分类结果,最后根据分类结果,确定目标图像所属的类别。上述过程中所使用的图像分类模型,可以提取目标图像的空间特征和光谱特征,二者的结合所构成的空谱特征能够多维度地表征图像的属性信息,故基于该空谱特征对图像进行分类,可以有效提高图像的分类结果准确率,精准辨识图像中的物体。The embodiment of the present application provides a method and related device for image classification, wherein the method first obtains a target image to be classified, the target image is an image generated based on a hyperspectral image, and then the target image is extracted through an image classification model The spatial characteristics of the target image and the spectral characteristics of the target image are used to construct the empty spectrum feature according to the spatial and spectral characteristics through the image classification model, and the classification result of the empty spectrum feature is obtained through the image classification model. Finally, the category of the target image is determined according to the classification result . The image classification model used in the above process can extract the spatial and spectral features of the target image. The space spectrum feature formed by the combination of the two can represent the attribute information of the image in multiple dimensions. Therefore, the image is processed based on the space spectrum feature. Classification can effectively improve the accuracy of image classification results and accurately identify objects in the image.
附图说明Description of the drawings
图1为本申请实施例提供的图像分类模型的一个示意图;FIG. 1 is a schematic diagram of an image classification model provided by an embodiment of the application;
图2为本申请实施例提供的图像分类的方法的一个流程示意图;FIG. 2 is a schematic flowchart of an image classification method provided by an embodiment of the application;
图3为本申请实施例提供的图像分类模型的另一个示意图;FIG. 3 is another schematic diagram of an image classification model provided by an embodiment of the application;
图4为本申请实施例提供的图像分类的方法的另一个流程示意图;FIG. 4 is another schematic flowchart of the image classification method provided by an embodiment of this application;
图5为本申请实施例提供的特征提取的一个示意图;FIG. 5 is a schematic diagram of feature extraction provided by an embodiment of this application;
图6为本申请实施例提供的模型训练的方法的一个流程示意图;FIG. 6 is a schematic flowchart of a model training method provided by an embodiment of the application;
图7为本申请实施例提供的模型训练的方法的另一个流程示意图;FIG. 7 is a schematic diagram of another process of the model training method provided by an embodiment of the application;
图8为本申请实施例提供的图像分类的装置的一个结构示意图;FIG. 8 is a schematic structural diagram of an image classification apparatus provided by an embodiment of the application;
图9为本申请实施例提供的模型训练的装置的一个结构示意图;FIG. 9 is a schematic structural diagram of a model training device provided by an embodiment of the application;
图10为本申请实施例提供的图像分类设备的一个结构示意图。FIG. 10 is a schematic structural diagram of an image classification device provided by an embodiment of the application.
具体实施方式Detailed ways
本申请实施例提供了一种图像分类的方法及相关装置,若需要对某个多光谱图像进行分类,可先获取已完成训练的图像分类模型,该图像分类模型由两个分支网络、全连接层和分类层构成。进行图像分类时,可先通过第一分支网络提取该图像的光谱特征,用于表征该图像中物体表面的光谱反射率分布情况,并通过第二分支网络可提取该图像的空间特征,用于表征该图像中物体的轮廓、表面纹理和阴影等特征,然后通过全连接层融合光谱特征和空间特征,得到该图像的空谱特征,接着通过分类层对该图像的空谱特征进行分类,得到该图像的分类结果,最终确定该图像所属的类别。在图像分类的过程中,由于图像分类模型所分析的对象为图像的空谱特征,该空谱特征不仅涉及图像的空间特征,还考虑了图像的光谱特征,因此空谱特征能够较为全面地表征图像的属性信息,例如综合反映图像中物体表面的光谱反射率分布情况,以及物体的轮廓、表面纹理和阴影等特征,故相较于传统方式中仅单一地考虑空间特征,本申请中的空谱特征能够从多个方面分析图像的有效属性信息,进而使得图像分类模型对图像的分类结果具有较高的准确率,能够精准辨识图像中的物体。The embodiment of the application provides a method and related device for image classification. If a certain multispectral image needs to be classified, the image classification model that has been trained can be obtained first. The image classification model is composed of two branch networks, fully connected Layer and classification layer composition. When performing image classification, the spectral features of the image can be extracted through the first branch network to characterize the spectral reflectance distribution of the object surface in the image, and the spatial features of the image can be extracted through the second branch network for Characterize the features such as the contour, surface texture and shadow of the object in the image, and then use the fully connected layer to fuse the spectral features and the spatial features to obtain the spatial spectrum features of the image, and then classify the spatial spectrum features of the image through the classification layer to obtain The classification result of the image finally determines the category to which the image belongs. In the process of image classification, because the object analyzed by the image classification model is the spatial spectrum feature of the image, the spatial spectrum feature not only involves the spatial feature of the image, but also considers the spectral feature of the image, so the spatial spectrum feature can be more comprehensively characterized The attribute information of the image, for example, comprehensively reflects the spectral reflectance distribution of the surface of the object in the image, as well as the contour, surface texture, and shadow of the object. Therefore, compared with the traditional method only considering the spatial characteristics, the blank in this application The spectral feature can analyze the effective attribute information of the image from multiple aspects, so that the image classification model has a high accuracy rate for the classification result of the image, and can accurately identify the object in the image.
下面结合附图,对本申请的实施例进行描述。本领域普通技术人员可知,随着技术的发展和新场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。The embodiments of the present application will be described below in conjunction with the drawings. A person of ordinary skill in the art knows that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。The terms "first" and "second" in the specification and claims of the application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, and this is merely a way of distinguishing objects with the same attribute used in describing the embodiments of the present application. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusion, so that a process, method, system, product, or device that includes a series of units is not necessarily limited to those units, but may include Listed or inherent to these processes, methods, products, or equipment.
本申请通过AI技术进行图像分类。具体的,以监控场景作为示例进行说明,在此场景中,可以通过监控设备采集图像,该图像中通常包含多类物体,例如人、车辆和房屋等等,为了实现对某类物体的实时监控,一般需要对图像中所包含的物体进行分类,以正确辨识物体所属的类别。This application uses AI technology to classify images. Specifically, a monitoring scene is taken as an example for illustration. In this scene, images can be collected by monitoring equipment. The images usually contain multiple types of objects, such as people, vehicles, and houses, in order to achieve real-time monitoring of certain types of objects. Generally, it is necessary to classify the objects contained in the image to correctly identify the category to which the object belongs.
为了提高图像分类结果的准确率,本申请提供了一种图像分类的方法,该方法通过图像分类装置实现,其中,该图像分类装置包括监控设备,用于获取待分类的多帧图像。值得注意的是,本申请中监控设备所采集的图像通常为多光谱图像,多光谱图像指光谱通道数量大于3的图像,例如,光谱通道数量为128的高光谱图像等等。In order to improve the accuracy of image classification results, the present application provides an image classification method, which is implemented by an image classification device, wherein the image classification device includes monitoring equipment for acquiring multiple frames of images to be classified. It is worth noting that the images collected by the monitoring device in this application are usually multispectral images. Multispectral images refer to images with more than 3 spectral channels, for example, hyperspectral images with 128 spectral channels and so on.
此外,本申请中用于对多光谱图像进行分类的图像分类模型,为一种深度网络模型,该模型可以对多光谱图像进行特征提取和分类,进而辨识图像中的物体类别。图1为本申 请实施例提供的图像分类模型的一个示意图,如图1所示,该图像分类模型包含一个全连接层、一个分类层和两个分支网络,其中,第一分支网络包括一个第一卷积层和一个第一池化层,第二分支网络也包括一个第二卷积层和一个第二池化层。当使用上述多光谱图像作为图像分裂模型的两个分支网络的输入时,第一分支网络可用于提取多光谱图像的光谱特征,第二分支网络可用于提取多光谱图像的空间特征,全连接层可基于光谱特征和空间特征构建空谱特征,分类层可基于空谱特征进行分类,得到图像的分类结果。In addition, the image classification model used to classify multi-spectral images in this application is a deep network model, which can perform feature extraction and classification on multi-spectral images, and then identify the object categories in the images. Figure 1 is a schematic diagram of an image classification model provided by an embodiment of the application. As shown in Figure 1, the image classification model includes a fully connected layer, a classification layer, and two branch networks. The first branch network includes a first branch network. A convolutional layer and a first pooling layer, and the second branch network also includes a second convolutional layer and a second pooling layer. When using the above-mentioned multi-spectral image as the input of the two branch networks of the image splitting model, the first branch network can be used to extract the spectral features of the multi-spectral image, and the second branch network can be used to extract the spatial features of the multi-spectral image, fully connected layer The empty spectrum feature can be constructed based on the spectral feature and the spatial feature, and the classification layer can be classified based on the empty spectrum feature to obtain the classification result of the image.
图2为本申请实施例提供的图像分类的方法的一个流程示意图,请参阅图2,该方法基于图1所示的图像分类模型进行图像分类,包括:Fig. 2 is a schematic flow chart of a method for image classification provided by an embodiment of the application. Please refer to Fig. 2. The method for image classification based on the image classification model shown in Fig. 1 includes:
201、获取目标图像;201. Obtain a target image;
图像分类装置通过监控设备获取多光谱图像后,可以基于多光谱图像生成待分类的目标图像。需要说明的是,在对某一帧多光谱图像进行分类的过程中,图像分类模型可以对整个多光谱图像或部分多光谱图像进行分类,由于多光谱图像可以视为由多个像素点所构成的图像,因此,图像分类模型对多光谱图像进行分类的过程可以视为对多个并行输入的像素点进行分类的过程,相对于每一个像素点而言,图像分类模型所执行的操作是相同的,故多光谱图像中的任一像素点均可作为图像分类模型的输入,即待分类的目标图像。After the image classification device obtains the multi-spectral image through the monitoring device, it can generate the target image to be classified based on the multi-spectral image. It should be noted that in the process of classifying a certain frame of multispectral image, the image classification model can classify the entire multispectral image or part of the multispectral image, because the multispectral image can be regarded as composed of multiple pixels. Therefore, the process of classifying multispectral images by the image classification model can be regarded as the process of classifying multiple parallel input pixels. For each pixel, the operation performed by the image classification model is the same Yes, any pixel in the multispectral image can be used as the input of the image classification model, that is, the target image to be classified.
202、获取目标图像的空间信息和目标图像的光谱信息;202. Acquire spatial information of the target image and spectral information of the target image;
在获取目标图像后,可以进一步获取目标图像的空间信息和光谱信息,其中,目标图像的光谱信息为目标图像所构成的一维向量,目标图像的空间信息为目标图像和目标图像的邻域图像所构成的二维向量。After acquiring the target image, the spatial information and spectral information of the target image can be further acquired, where the spectral information of the target image is a one-dimensional vector formed by the target image, and the spatial information of the target image is the target image and the neighborhood image of the target image The two-dimensional vector formed.
具体的,目标图像为多光谱图像中的某一像素点,可以先基于该像素点生成该像素点的光谱曲线,并以该光谱曲线作为该像素点的光谱信息,作为第一分支网络的输入。例如,通过监控设备获取某一段时间内连续的多帧多光谱图像(其中某一帧多光谱图像为当前所需进行分类的多光谱图像N),多光谱图像N中的每个像素点均为目标图像,取像素点n(如多光谱图像N中的第n个像素点)作为示例进行说明。多帧连续的多光谱图像组成一个立体的图像块,该图像块具有三个维度,分别为宽维度、高维度和光谱维度,当确定像素点n后,可沿着图像块的光谱维度,从每帧多光谱图像中,获取与像素点n相对应的像素点(如每帧多光谱图像中的第n个像素点),即得到像素点n以及像素点n所对应的多个像素点,这一部分像素点可以构成像素点n的光谱曲线,且该光谱曲线以一维向量的形式呈现,即像素点n的光谱信息。Specifically, the target image is a certain pixel in the multispectral image, and the spectral curve of the pixel can be generated based on the pixel first, and the spectral curve is used as the spectral information of the pixel as the input of the first branch network . For example, through the monitoring equipment to obtain continuous multi-frame multi-spectral images within a certain period of time (a certain frame of multi-spectral image is the multi-spectral image N that needs to be classified currently), and each pixel in the multi-spectral image N is For the target image, take pixel point n (such as the nth pixel point in the multispectral image N) as an example for description. Multiple frames of continuous multispectral images form a three-dimensional image block. The image block has three dimensions, namely the wide dimension, the high dimension and the spectral dimension. When the pixel point n is determined, the spectral dimension of the image block can be determined from In each frame of multispectral image, obtain the pixel point corresponding to pixel point n (such as the nth pixel point in each frame of multispectral image), that is, pixel point n and multiple pixels corresponding to pixel point n are obtained, This part of the pixel points can constitute the spectral curve of the pixel point n, and the spectral curve is presented in the form of a one-dimensional vector, that is, the spectral information of the pixel point n.
此外,在获取目标图像的光谱信息的同时,也可以获取目标图像的空间信息,由于目标图像为多光谱图像中的某一像素点,可以基于该像素点以及该像素点的邻域信息生成该像素点的空间信息,作为第二分支网络的输入。依旧以上述例子进行说明。由于多光谱图像的波段数过多,可先通过主成分分析技术对上述图像块进行降维处理,从得到的第一主成分中(可理解为将图像块进行压缩所得到的一帧图像)确定像素点n,并选取像素点n的邻域图像,如以像素点n为中心的r×r个像素点,r的数值可以根据实际需求进行设置。此时,像素点n以及像素点n的邻域图像则构成了像素点n的空间信息,且该空间信息以二维向量的形式呈现。In addition, while acquiring the spectral information of the target image, the spatial information of the target image can also be acquired. Since the target image is a certain pixel in the multispectral image, the pixel can be generated based on the pixel and the neighborhood information of the pixel. The spatial information of the pixel is used as the input of the second branch network. The above example is still used for explanation. Since the number of bands of the multispectral image is too large, the above image block can be reduced by principal component analysis technology, and the first principal component obtained (can be understood as a frame of image obtained by compressing the image block) Determine the pixel point n, and select the neighborhood image of the pixel point n, such as r×r pixels centered on the pixel point n, the value of r can be set according to actual needs. At this time, the pixel point n and the neighborhood image of the pixel point n constitute the spatial information of the pixel point n, and the spatial information is presented in the form of a two-dimensional vector.
得到目标图像的光谱信息和空间信息后,则可将两个信息对应输入图像分类模型的两个分支网络中,进而实现特征提取和图像分类。After the spectral information and spatial information of the target image are obtained, the two pieces of information can be correspondingly input into the two branch networks of the image classification model to realize feature extraction and image classification.
203、通过第一卷积层对光谱信息进行卷积处理,得到目标图像的第一光谱特征;203. Perform convolution processing on the spectral information through the first convolution layer to obtain the first spectral feature of the target image.
得到目标图像的光谱信息后,可以将其输入图像分类模型的第一分支网络的第一卷积层,第一卷积层对光谱信息进行卷积处理后,可得到目标图像的第一光谱特征。具体的,光谱信息为1个一维向量,经过第一卷积层的处理后,可以得到由m个一维向量构成的第一光谱特征(例如由m个一维向量并排组成的一个平面图像),其中,m大于或等于2。After the spectral information of the target image is obtained, it can be input into the first convolutional layer of the first branch network of the image classification model. After the first convolutional layer performs convolution processing on the spectral information, the first spectral feature of the target image can be obtained . Specifically, the spectral information is a one-dimensional vector. After processing by the first convolution layer, a first spectral feature composed of m one-dimensional vectors can be obtained (for example, a plane image composed of m one-dimensional vectors side by side) ), where m is greater than or equal to 2.
204、通过第一池化层对第一光谱特征进行最大池化处理,得到目标图像的第二光谱特征;204. Perform maximum pooling processing on the first spectral feature through the first pooling layer to obtain the second spectral feature of the target image;
得到第一光谱特征后,可以将第一光谱特征作为第一池化层的输入。第一池化层对第一光谱特征进行最大池化后,可得到第二光谱特征。具体的,第一池化层可将第一光谱特征中每个一维向量的长度减半,进而得到压缩后的光谱特征,即第二光谱特征。After the first spectral feature is obtained, the first spectral feature can be used as the input of the first pooling layer. After the first pooling layer performs maximum pooling on the first spectral feature, the second spectral feature can be obtained. Specifically, the first pooling layer can halve the length of each one-dimensional vector in the first spectral feature, so as to obtain the compressed spectral feature, that is, the second spectral feature.
205、通过第二卷积层对空间信息进行卷积处理,得到目标图像的第一空间特征;205. Perform convolution processing on the spatial information through the second convolution layer to obtain the first spatial feature of the target image.
得到目标图像的空间信息后,可将其输入图像分类模型的第二分支网络的第二卷积层,第二卷积层对空间信息进行卷积处理后,可得到目标图像的第一空间特征。具体的,光谱信息为1个二维向量,经过第二卷积层的处理后,可以得到由k个二维向量构成的第一空间特征(例如由k个二维向量并排组成的一个具备一定厚度的图像块),其中,k大于或等于2。After the spatial information of the target image is obtained, it can be input into the second convolutional layer of the second branch network of the image classification model. After the second convolutional layer convolves the spatial information, the first spatial feature of the target image can be obtained . Specifically, the spectral information is a two-dimensional vector. After the second convolutional layer is processed, the first spatial feature composed of k two-dimensional vectors can be obtained (for example, one composed of k two-dimensional vectors side by side has a certain Thickness of the image block), where k is greater than or equal to 2.
应理解,步骤205与步骤203的执行顺序不分先后,可同时进行也可异步进行,此处不做具体限制。It should be understood that the execution order of step 205 and step 203 is in no particular order, and can be performed simultaneously or asynchronously, and there is no specific limitation here.
206、通过第二池化层对第一空间特征进行最大池化处理,得到目标图像的第二空间特征;206. Perform maximum pooling processing on the first spatial feature through the second pooling layer to obtain the second spatial feature of the target image.
得到第一空间特征后,可以将第一空间特征作为第二池化层的输入。第二池化层对第一空间特征进行最大池化后,可得到第二空间特征。具体的,第二池化层可将第一空间特征中每个二维向量的长度和宽度减半,且第一空间特征的二维向量数量(即图像块的厚度)保持不变,进而得到压缩后的空间特征,即第二空间特征。After the first spatial feature is obtained, the first spatial feature can be used as the input of the second pooling layer. After the second pooling layer performs maximum pooling on the first spatial feature, the second spatial feature can be obtained. Specifically, the second pooling layer can halve the length and width of each two-dimensional vector in the first spatial feature, and the number of two-dimensional vectors of the first spatial feature (that is, the thickness of the image block) remains unchanged, thereby obtaining The compressed spatial feature is the second spatial feature.
207、通过图像分类模型将第二光谱特征和第二空间特征分别进行拉伸处理,得到第三光谱特征和第三空间特征;207. Perform stretching processing on the second spectral feature and the second spatial feature through the image classification model, respectively, to obtain the third spectral feature and the third spatial feature;
得到第二光谱特征后第二空间特征后,由于第二光谱特征为由m个一维向量组成的二维向量,第二空间特征为由k个二维向量组成的三维向量,故可通过图像分类模型对第二光谱特征和第二空间特征进行拉伸处理,使得第二光谱特征和第二空间特征的元素进行重新排列,构成一维的第三光谱特征和第三空间特征,即第三光谱特征和第三空间特征为一维向量。After obtaining the second spectral feature and the second spatial feature, since the second spectral feature is a two-dimensional vector composed of m one-dimensional vectors, and the second spatial feature is a three-dimensional vector composed of k two-dimensional vectors, it can be passed through the image The classification model stretches the second spectral feature and the second spatial feature, so that the elements of the second spectral feature and the second spatial feature are rearranged to form a one-dimensional third spectral feature and third spatial feature, that is, the third The spectral feature and the third spatial feature are one-dimensional vectors.
208、通过全连接层对第三光谱特征和第三空间特征进行融合处理,得到空谱特征;208. Perform fusion processing on the third spectral feature and the third spatial feature through the fully connected layer to obtain the spatial spectrum feature;
得到一维的第三光谱特征和第三空间特征后,可将第三光谱特征和第三空间特征作为全连接层的输入,使得全连接层对第三光谱特征和第三空间特征进行融合处理,得到空谱特征,至此,则得到了目标图像的空谱特征。After obtaining the one-dimensional third spectral feature and the third spatial feature, the third spectral feature and the third spatial feature can be used as the input of the fully connected layer, so that the fully connected layer can merge the third spectral feature and the third spatial feature , Get the empty spectrum feature, so far, get the empty spectrum feature of the target image.
209、通过分类层对空谱特征进行分类处理,得到分类结果;209. Perform classification processing on the space spectrum feature through the classification layer to obtain a classification result;
得到目标图像的空谱特征后,可以通过图像分类模型的分类层对空谱特征进行分类处理,得到分类结果,该分类结果包括目标图像位于各个类别的概率,例如,分类结果包括:像素点n属于类别A的概率为67%,像素点n属于类别B的概率为20%,像素点n属于类别 C的概率为13%。After the empty spectrum features of the target image are obtained, the empty spectrum features can be classified through the classification layer of the image classification model to obtain the classification result. The classification result includes the probability that the target image is located in each category. For example, the classification result includes: pixel n The probability of belonging to category A is 67%, the probability of pixel n belonging to category B is 20%, and the probability of pixel n belonging to category C is 13%.
210、根据分类结果,确定目标图像所属的类别。210. Determine the category to which the target image belongs according to the classification result.
从分类结果中确定目标图像在哪一类别中的概率最高,即可最终确定目标图像所属的类别。依旧如上述例子,当分类结果表明像素点n属于类别A的概率最高时,则可确定像素点n所属的类别为类别A。From the classification results to determine which category the target image has the highest probability, the category to which the target image belongs can be finally determined. As in the above example, when the classification result indicates that the probability of pixel n belonging to category A is the highest, it can be determined that the category to which pixel n belongs is category A.
本实施例中所使用的图像分类模型,可以提取目标图像的空间特征和光谱特征,二者的结合所构成的空谱特征能够多维度地表征图像的属性信息,故本实施例可以有效获取图像的高可靠性属性信息。更进一步的,基于该空谱特征对图像进行分类,其分类结果在空间相关性和光谱相关性上更具良好的效果,可以有效提高图像的分类结果准确率,精准辨识图像中的物体。The image classification model used in this embodiment can extract the spatial and spectral features of the target image, and the space spectrum feature formed by the combination of the two can represent the attribute information of the image in multiple dimensions, so this embodiment can effectively acquire the image Highly reliable attribute information. Furthermore, the image is classified based on the spatial spectrum feature, and the classification result is more effective in spatial correlation and spectral correlation, which can effectively improve the accuracy of the classification result of the image and accurately identify the objects in the image.
上述实施例所生成的空谱特征为单尺度的特征,在对多光谱图像进行分类的过程中,图像所反应的场景中通常包含各种尺度的物体,例如尺度较大的建筑和尺度较小的行李箱,然而,单尺度的空谱特征一般不能较好地对多光谱图像的场景进行全方位的描述,容易造成小物体的信息丢失,从而影响图像分类结果的准确率。The spatial spectrum features generated in the above embodiments are single-scale features. In the process of classifying multi-spectral images, the scene reflected by the image usually contains objects of various scales, such as larger-scale buildings and smaller-scale objects. However, the single-scale spatial spectrum feature generally cannot describe the scene of the multispectral image well, and it is easy to cause the information of small objects to be lost, which affects the accuracy of the image classification results.
因此,为了进一步提高图像分类结果的准确率,本申请还提供了另一种图像分类模型,图3为本申请实施例提供的图像分类模型的另一个示意图,如图3所示,该图像分类模型为多尺度空谱联合双分支网络(multiscale spectral-spatial unified network,MSSN),包含两个分支网络、n个全连接层和一个分类层,其中,第一分支网络包括n个第一卷积层和n-1个第一池化层,n个第一卷积层和n-1个第一池化层交替连接,第二分支网络包括n个第二卷积层和n-1个第二池化层,n个第二卷积层和n-1个第二池化层交替连接。值得注意的是,第1个全连接层的输入为第1个第一池化层的输出和第1个第二池化层的输出,第2个全连接层的输入为第2个第一池化层的输出和第2个第二池化层的输出,以此类推,第n-1个全连接层的输入为第n-1个第一池化层的输出和第n-1个第二池化层的输出,且第n个全连接层的输入为第n个第一卷积层的输出和第n个第二卷积层的输出。此外,所有全连接层的输出拼接后,作为分类层的输入,以进行最终的图像分类。Therefore, in order to further improve the accuracy of the image classification results, this application also provides another image classification model. FIG. 3 is another schematic diagram of the image classification model provided by an embodiment of the application. As shown in FIG. 3, the image classification The model is a multiscale spectral-spatial unified network (MSSN), which includes two branch networks, n fully connected layers, and a classification layer. The first branch network includes n first convolutions. Layer and n-1 first pooling layers, n first convolutional layers and n-1 first pooling layers are alternately connected, and the second branch network includes n second convolutional layers and n-1 first pooling layers. Two pooling layers, n second convolutional layers and n-1 second pooling layers are alternately connected. It is worth noting that the input of the first fully connected layer is the output of the first first pooling layer and the output of the first second pooling layer, and the input of the second fully connected layer is the second first. The output of the pooling layer and the output of the second second pooling layer, and so on, the input of the n-1th fully connected layer is the output of the n-1th first pooling layer and the n-1th The output of the second pooling layer, and the input of the nth fully connected layer is the output of the nth first convolutional layer and the output of the nth second convolutional layer. In addition, after the output of all fully connected layers is spliced, it is used as the input of the classification layer for final image classification.
图4为本申请实施例提供的图像分类的方法的另一个流程示意图,请参阅图4,该方法基于图3所示的图像分类模型进行图像分类,包括:Fig. 4 is a schematic diagram of another flow chart of an image classification method provided by an embodiment of this application. Please refer to Fig. 4. This method performs image classification based on the image classification model shown in Fig. 3, including:
401、获取目标图像;401. Obtain a target image;
402、获取目标图像的空间信息和目标图像的光谱信息;402. Acquire spatial information of the target image and spectral information of the target image.
步骤401至步骤402的具体说明可参考上述实施例中步骤201至步骤202的相关说明内容,此处不再赘述。For the specific description of step 401 to step 402, please refer to the relevant description of step 201 to step 202 in the above-mentioned embodiment, which will not be repeated here.
403、通过第1个第一卷积层对光谱信息进行卷积处理,得到第1个第一光谱特征;403. Perform convolution processing on the spectral information through the first first convolution layer to obtain the first first spectral feature;
404、通过第1个第一池化层至第n-1个第一池化层对第1个第一光谱特征至第n-1个第一光谱特征分别进行最大池化处理,得到第1个第二光谱特征至第n-1个第二光谱特征;404. Perform maximum pooling processing on the first first spectral feature to the n-1th first spectral feature through the first first pooling layer to the n-1th first pooling layer, respectively, to obtain the first Second spectral feature to the n-1th second spectral feature;
405、通过第2个第一卷积层至第n个第一卷积层对第1个第二光谱特征至第n-1个第二光谱特征分别进行卷积处理,得到第2个第一光谱特征至第n个第一光谱特征;405. Perform convolution processing on the first second spectral feature to the n-1th second spectral feature through the second first convolutional layer to the nth first convolutional layer to obtain the second first convolutional layer. From the spectral feature to the n-th first spectral feature;
得到目标图像的光谱信息后,可将其作为图像分类模型的第一分支网络的输入。为了便于理解,以下结合图3对第一分支网络提取光谱特征的过程进行介绍:将目标图像的光谱信息输入第1个第一卷积层,第1个第一卷积层对光谱信息进行卷积处理后,得到第1 个第一光谱特征,然后将第1个第一光谱特征输入第1个第一池化层进行最大池化处理,得到1个第二光谱特征,再将第1个第二光谱特征输入第2个第一卷积层进行卷积处理,得到第2个第一光谱特征,再将第2个第一光谱特征输入第2个第一池化层进行最大池化处理,得到第2个第二光谱特征,以此类推,直至将第n-1个第二光谱特征输入第n个第一卷积层进行卷积处理,得到第n个第一光谱特征,至此,则完成对目标图像的光谱特征提取。After obtaining the spectral information of the target image, it can be used as the input of the first branch network of the image classification model. In order to facilitate understanding, the following describes the process of extracting the spectral features of the first branch network with reference to Figure 3. The spectral information of the target image is input into the first first convolutional layer, and the first first convolutional layer convolves the spectral information. After the product processing, the first first spectral feature is obtained, and then the first first spectral feature is input into the first first pooling layer for maximum pooling processing to obtain a second spectral feature, and then the first The second spectral feature is input to the second first convolutional layer for convolution processing to obtain the second first spectral feature, and then the second first spectral feature is input to the second first pooling layer for maximum pooling processing , Get the second second spectral feature, and so on, until the n-1th second spectral feature is input to the nth first convolutional layer for convolution processing to get the nth first spectral feature, so far, Then the spectral feature extraction of the target image is completed.
由于第一分支网络中的n个第一卷积层和n-1个第一池化层交替连接,因此可生成2n-1个光谱特征(包括n个第一光谱特征和n-1个第二光谱特征),且每一个光谱特征均存在尺寸上的差异。为了便于理解,以下结合图5对相邻两个光谱特征之间的尺寸变化进行介绍,为了便于说明,n取值为3。图5为本申请实施例提供的特征提取的一个示意图,如图5所示,设第一分支网络包含3个第一卷积层和2个第一池化层,当光谱信息(为一个一维向量)输入第1个第一卷积层后,可以得到由m个一维向量构成的第一光谱特征a,其中,m大于或等于2。再将第一光谱特征a输入第1个第一池化层,使得第一光谱特征a的每个一维向量的长度减半,得到第二光谱特征x。然后将第二光谱特征x输入第2个第一卷积层,可以得到由p个一维向量构成的第一光谱特征b,其中,p大于m。接着将第一光谱特征b输入第2个第一池化层,使得第一光谱特征b的每个一维向量的长度减半,得到第二光谱特征y。最后将第二光谱特征y输入第3个第一卷积层,可以得到由t个一维向量构成的第一光谱特征c,其中,t大于p。Since n first convolutional layers and n-1 first pooling layers in the first branch network are alternately connected, 2n-1 spectral features can be generated (including n first spectral features and n-1th Two spectral features), and each spectral feature has a size difference. For ease of understanding, the size change between two adjacent spectral features will be introduced below in conjunction with FIG. 5. For ease of description, the value of n is 3. Figure 5 is a schematic diagram of feature extraction provided by an embodiment of this application. As shown in Figure 5, suppose that the first branch network includes three first convolutional layers and two first pooling layers. Dimensional vector) After inputting the first first convolutional layer, the first spectral feature a composed of m one-dimensional vectors can be obtained, where m is greater than or equal to 2. Then, the first spectral feature a is input into the first first pooling layer, so that the length of each one-dimensional vector of the first spectral feature a is halved, and the second spectral feature x is obtained. Then the second spectral feature x is input into the second first convolutional layer, and the first spectral feature b composed of p one-dimensional vectors can be obtained, where p is greater than m. Then, the first spectral feature b is input into the second first pooling layer, so that the length of each one-dimensional vector of the first spectral feature b is halved to obtain the second spectral feature y. Finally, the second spectral feature y is input into the third first convolutional layer, and the first spectral feature c composed of t one-dimensional vectors can be obtained, where t is greater than p.
应理解,在图5中,每个分支网络仅以3个卷积层和2个池化层进行示意性说明,并不对本申请实施例中每个分支网络的卷积层数量和池化层数量构成限制。同理,图5也仅以3个全连接层进行示意性说明,并不对本申请实施例中的全连接层数量构成限制。It should be understood that, in FIG. 5, each branch network is illustrated schematically with only 3 convolutional layers and 2 pooling layers, and the number of convolutional layers and pooling layers of each branch network in the embodiment of the present application are not described. The quantity constitutes a limit. In the same way, FIG. 5 only uses three fully connected layers for schematic illustration, and does not limit the number of fully connected layers in the embodiment of the present application.
406、通过第1个第二卷积层对空间信息进行卷积处理,得到第1个第一空间特征;406. Perform convolution processing on the spatial information through the first second convolution layer to obtain the first first spatial feature.
407、通过第1个第二池化层至第n-1个第二池化层对第1个第一空间特征至第n-1个第一空间特征分别进行最大池化处理,得到第1个第二空间特征至第n-1个第二空间特征;407. Perform maximum pooling processing on the first first spatial feature to the n-1th first spatial feature through the first second pooling layer to the n-1th second pooling layer, respectively, to obtain the first Second spatial feature to the n-1th second spatial feature;
408、通过第2个第二卷积层至第n个第二卷积层对第1个第二空间特征至第n-1个第二空间特征分别进行卷积处理,得到第2个第一空间特征至第n个第一空间特征;408. Perform convolution processing on the first second spatial feature to the n-1th second spatial feature through the second second convolutional layer to the nth second convolutional layer, respectively, to obtain the second first Spatial feature to the nth first spatial feature;
同理,得到目标图像的空间信息后,可将其作为图像分类模型的第二分支网络的输入。为了便于理解,以下结合图3对第一分支网络提取空间特征的过程进行介绍:将目标图像的空间信息输入第1个第二卷积层,第1个第二卷积层对空间信息进行卷积处理后,得到第1个第一空间特征,然后将第1个第一空间特征输入第1个第二池化层进行最大池化处理,得到1个第二空间特征,再将第1个第二空间特征输入第2个第二卷积层进行卷积处理,得到第2个第一空间特征,再将第2个第一空间特征输入第2个第二池化层进行最大池化处理,得到第2个第二空间特征,以此类推,直至将第n-1个第二空间特征输入第n个第二卷积层进行卷积处理,得到第n个第一空间特征,至此,则完成对目标图像的空间特征提取。由于第一分支网络中的n个第二卷积层和n-1个第二池化层交替连接,因此可生成n个第一空间特征和n-1个第二空间特征。In the same way, after the spatial information of the target image is obtained, it can be used as the input of the second branch network of the image classification model. For ease of understanding, the following describes the process of extracting spatial features by the first branch network with reference to Figure 3: The spatial information of the target image is input into the first second convolutional layer, and the first second convolutional layer convolves the spatial information After the product processing, the first first spatial feature is obtained, and then the first first spatial feature is input to the first second pooling layer for maximum pooling processing to obtain a second spatial feature, and then the first The second spatial feature is input to the second second convolutional layer for convolution processing to obtain the second first spatial feature, and then the second first spatial feature is input to the second second pooling layer for maximum pooling processing , Get the second second spatial feature, and so on, until the n-1th second spatial feature is input to the nth second convolutional layer for convolution processing to obtain the nth first spatial feature, so far, Then the spatial feature extraction of the target image is completed. Since n second convolutional layers and n-1 second pooling layers in the first branch network are alternately connected, n first spatial features and n-1 second spatial features can be generated.
由于第二分支网络中的n个第二卷积层和n-1个第二池化层交替连接,因此可生成2n-1个空间特征(包括n个第一空间特征和n-1个第二空间特征),且每一个空间特征均存在尺寸上的差异。为了便于理解,以下依旧结合图5对相邻两个空间特征之间的尺寸变化进行 介绍,如图5所示,设第二分支网络包含3个第二卷积层和2个第二池化层,当空间信息(为一个二维向量)输入第1个第二卷积层后,可以得到由k个二维向量构成的第一空间特征d(由k个二维向量并排组成的一个具备一定厚度的图像块),其中,k大于或等于2。再将第一空间特征d输入第1个第二池化层,使得第一空间特征d的每个二维向量的长度和宽度减半,得到第二空间特征z。然后将第二空间特征z输入第2个第二卷积层,可以得到由q个二维向量构成的第一空间特征e,其中,q大于k。接着将第一空间特征e输入第2个第二池化层,使得第一空间特征e的每个二维向量的长度和宽度减半,得到第二空间特征u。最后将第二空间特征u输入第3个第二卷积层,可以得到由s个二维向量构成的第一空间特征f,其中,s大于q。Since n second convolutional layers and n-1 second pooling layers in the second branch network are alternately connected, 2n-1 spatial features can be generated (including n first spatial features and n-1th Two spatial features), and each spatial feature has a difference in size. For ease of understanding, the following will still introduce the size change between two adjacent spatial features in conjunction with Figure 5. As shown in Figure 5, suppose that the second branch network includes 3 second convolutional layers and 2 second pooling. Layer, when the spatial information (a two-dimensional vector) is input to the first second convolutional layer, the first spatial feature d composed of k two-dimensional vectors can be obtained (one composed of k two-dimensional vectors side by side has Image block with a certain thickness), where k is greater than or equal to 2. Then the first spatial feature d is input to the first second pooling layer, so that the length and width of each two-dimensional vector of the first spatial feature d are halved, and the second spatial feature z is obtained. Then the second spatial feature z is input to the second second convolutional layer, and the first spatial feature e composed of q two-dimensional vectors can be obtained, where q is greater than k. Then, the first spatial feature e is input into the second second pooling layer, so that the length and width of each two-dimensional vector of the first spatial feature e are halved to obtain the second spatial feature u. Finally, the second spatial feature u is input into the third second convolutional layer, and the first spatial feature f composed of s two-dimensional vectors can be obtained, where s is greater than q.
409、通过图像分类模型将第1个第二光谱特征至第n-1个第二光谱特征、第1个第二空间特征至第n-1个第二空间特征、第n个第一光谱特征和第n个第一空间特征分别进行拉伸处理,得到第1个第三光谱特征至第n个第三光谱特征,以及第1个第三空间特征至第n个第三空间特征;409. Use the image classification model to convert the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, and the nth first spectral feature And the nth first spatial feature are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature;
得到n个第一光谱特征、n-1个第二光谱特征、n个第一空间特征和n-1个第二空间特征后,则可以通过图像分类模型对1个第二光谱特征至第n-1个第二光谱特征,以及第n个第一光谱特征分别进行拉伸处理,使得这一部分特征的元素进行重组,对应得到第1个第三光谱特征至第n个第三光谱特征,且每一个第三光谱特征均为一维向量。同理,还可以通过图像分类模型对第1个第二空间特征至第n-1个第二空间特征,以及第n个第一空间特征进行拉伸处理,对应得到第1个第三空间特征至第n个第三空间特征,且每一个第三空间特征均为一维向量。After obtaining n first spectral features, n-1 second spectral features, n first spatial features, and n-1 second spatial features, you can use the image classification model to compare 1 second spectral feature to nth -1 second spectral feature and n-th first spectral feature are respectively stretched, so that the elements of this part of the feature are reorganized, corresponding to the first third spectral feature to the n-th third spectral feature, and Each third spectral feature is a one-dimensional vector. In the same way, the first second spatial feature to the n-1th second spatial feature and the nth first spatial feature can also be stretched through the image classification model to obtain the first third spatial feature correspondingly To the nth third spatial feature, and each third spatial feature is a one-dimensional vector.
410、通过n个全连接层对n对特征组分别进行融合处理,得到n个子空谱特征,其中,排序相同的一个第三光谱特征和一个第三空间特征构成一个特征组;410. Perform fusion processing on n pairs of feature groups through n fully connected layers, respectively, to obtain n subspace spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
得到n个第三光谱特征和n个第三空间特征后,可以将第1个第三光谱特征和第1个第三空间特征组成一个特征组,将第2个第三光谱特征和第2个第三空间特征组成一个特征组,以此类推,直至将第n个第三光谱特征和第n个第三空间特征组成一个特征组,最终得到n个特征组。然后将第1个特征组输入第1个全连接层,使得第1个全连接层将特征组中的两个特征进行融合,得到第1个子空谱特征,同时将第2个特征组输入第2个全连接层,使得第2个全连接层将特征组中的两个特征进行融合,得到第2个子空谱特征,以此类推,直至将第n个特征组输入第n个全连接层,使得第n个全连接层将特征组中的两个特征进行融合,得到第n个子空谱特征。After n third spectral features and n third spatial features are obtained, the first third spectral feature and the first third spatial feature can be combined into a feature group, and the second third spectral feature and the second third spectral feature can be combined into a feature group. The third spatial feature forms a feature group, and so on, until the nth third spectral feature and the nth third spatial feature are formed into a feature group, and finally n feature groups are obtained. Then input the first feature group into the first fully connected layer, so that the first fully connected layer will fuse the two features in the feature group to obtain the first sub-empty spectrum feature, and at the same time input the second feature group into the first fully connected layer. 2 fully connected layers, so that the second fully connected layer merges the two features in the feature group to obtain the second sub-empty spectrum feature, and so on, until the nth feature group is input to the nth fully connected layer , So that the nth fully connected layer fuses the two features in the feature group to obtain the nth subspace spectrum feature.
具体的,全连接层进行融合处理所应用的公式如下:Specifically, the formula used for the fusion processing of the fully connected layer is as follows:
y i=f[W i(spe i+spa i)+b i] y i = f[W i (spe i +spa i )+b i ]
式中,y i为第i个全连接层输出的子空谱特征,f()为激活函数,W i为预设的权重,b i为预设的偏置,当i为1至n-1中的任一取值时,spe i为第i个第二光谱特征,spa i为第i个第二空间特征,当i为n时,spe i为第i个第一光谱特征,spa i为第i个第一空间特征。 In the formula, y i is the sub-space spectrum feature output by the i-th fully connected layer, f() is the activation function, W i is the preset weight, and b i is the preset bias, when i is 1 to n- When any value in 1, spe i is the i-th second spectral feature, spa i is the i-th second spatial feature, when i is n, spe i is the i-th first spectral feature, spa i Is the i-th first spatial feature.
411、通过图像分类模型将n个子空谱特征进行拼接处理,得到空谱特征;411. Perform splicing processing on the n sub-space spectrum features through the image classification model to obtain the spatial spectrum feature;
得到n个子空谱特征后,可以通过图像分类模型将n个子空谱特征进行拼接处理,得到空谱特征。具体的,图像分类模型进行拼接处理所应用的公式如下:After the n sub-space spectrum features are obtained, the n sub-space spectrum features can be spliced through the image classification model to obtain the empty spectrum feature. Specifically, the formula used by the image classification model for splicing processing is as follows:
output=concat(y 1,y 2,y 3,...) output=concat(y 1 ,y 2 ,y 3 ,...)
式中,output为多个子空谱特征拼接得到的空谱特征,由于每个子空谱特征代表不同的尺度,故该多个不同尺度的子空谱特征可拼接得到多尺度的空谱特征。In the formula, output is the space spectrum feature obtained by splicing multiple sub-space spectrum features. Since each sub-space spectrum feature represents a different scale, the multiple sub-space spectrum features of different scales can be spliced to obtain multi-scale space spectrum features.
412、通过分类层对空谱特征进行分类处理,得到分类结果;412. Perform classification processing on the space spectrum feature through the classification layer to obtain a classification result;
413、根据分类结果,确定目标图像所属的类别。413. Determine the category to which the target image belongs according to the classification result.
步骤412至步骤413的具体说明可参考上述实施例中步骤209至步骤210的相关说明内容,此处不再赘述。For specific descriptions of step 412 to step 413, please refer to the relevant descriptions of step 209 to step 210 in the foregoing embodiment, which will not be repeated here.
本实施例所使用的图像分类模型,能够有效提取多光谱图像的多尺度的空谱特征,以此空谱特征为基础进行图像分类,所得到的分类结果能够有效区分尺度大小不一的物体,以准确解译图像内的复杂场景,并精准辨识场景内的物体类别。The image classification model used in this embodiment can effectively extract multi-scale spatial spectrum features of multi-spectral images, and perform image classification based on the spatial spectrum features. The resulting classification results can effectively distinguish objects of different scales. In order to accurately interpret the complex scene in the image, and accurately identify the object category in the scene.
为了进一步说明本申请实施例提供的图像分类的方法,以下将提供一个应用例进行具体介绍,该应用例包括:In order to further explain the method of image classification provided by the embodiments of the present application, an application example will be provided below for specific introduction, and the application example includes:
图像分类装置通过高光谱成像仪获取用于分类的高光谱图像,该高光谱图像的场景包含多种尺度不一的物体,例如尺度较大的墙壁、汽车、人,以及尺度较小的眼镜和皮肤等等物体,从高光谱图像中标记出17类图像样本,例如,第1类图像样本为墙壁,第2类图像样本为汽车等等。然后获取已经完成训练的MSSN,并将前述高光谱图像输入MSSN进行图像分类,得到相应的分类结果。The image classification device obtains a hyperspectral image for classification through a hyperspectral imager. The scene of the hyperspectral image contains objects of different scales, such as large-scale walls, cars, people, and smaller-scale glasses and For objects such as skin, 17 types of image samples are marked from the hyperspectral image. For example, the first type of image sample is a wall, the second type of image sample is a car, and so on. Then obtain the MSSN that has completed the training, and input the aforementioned hyperspectral image into the MSSN for image classification, and obtain the corresponding classification results.
通过对分类结果进行定量化分析,其分析结果如表1所示,表1示出了MSSN对高光谱图像的场景解译精度,其中,本应用例还通过支持向量机(support vector machine,SVM)进行图像分类的表现作为对比,需要说明的是,SVM与MSSN的训练过程所用的样本相同,且SVM与MSSN进行图像分类时所用的高光谱图像也相同。Through quantitative analysis of the classification results, the analysis results are shown in Table 1. Table 1 shows the scene interpretation accuracy of MSSN on hyperspectral images. Among them, this application example also uses support vector machine (SVM). ) The performance of image classification is used as a comparison. It should be noted that the samples used in the training process of SVM and MSSN are the same, and the hyperspectral images used in image classification of SVM and MSSN are also the same.
表1分析结果Table 1 Analysis results
Figure PCTCN2020097906-appb-000001
Figure PCTCN2020097906-appb-000001
通过表1可知,与SVM相对比,基于MSSN网络的高光谱图像场景解译能够获得更高的分类精度,例如,第1类样本在MSSN下的分类精度为100,在SVM下的分类精度为98.96,即表明,将高光谱图像中所标记出的第1类样本(即墙壁图像样本)输入MSSN后,能够被正确辨识的准确率达100%,而将第1类样本输入SVN后,能够被正确辨识的准确率则达98.96%。因此,MSSN对每一个类别的分类精度均要高于SVM,尤其是第7、8、9这三类样本,MSSN大幅度地提高了分类精度,有效地表明了MSSN的性能。It can be seen from Table 1 that compared with SVM, the hyperspectral image scene interpretation based on the MSSN network can obtain higher classification accuracy. For example, the classification accuracy of the first type of sample under MSSN is 100, and the classification accuracy under SVM is 98.96, which means that after entering the first type of sample (ie wall image sample) marked in the hyperspectral image into the MSSN, the accuracy of the correct identification can reach 100%, and after entering the first type of sample into the SVN, it can The accuracy rate of being correctly identified is 98.96%. Therefore, the classification accuracy of MSSN for each category is higher than that of SVM, especially the three types of samples of 7, 8, and 9. MSSN greatly improves the classification accuracy and effectively shows the performance of MSSN.
值得注意的是,本应用例中主要通过以下三个指标来衡量MSSN和SVM的性能,分别为:It is worth noting that in this application example, the following three indicators are used to measure the performance of MSSN and SVM, which are:
(1)总体精度OA,OA=正确分类的样本数/所有待分类的样本数,例如,第1类样本的数量为100个(如高光谱图像中取100个属于墙壁的像素点),经过分类后,100个样本中被正确分类至第1类的样本数量即为正确分类的样本数。(1) Overall accuracy OA, OA = the number of samples correctly classified/the number of samples to be classified, for example, the number of samples of the first type is 100 (for example, 100 pixels belonging to the wall in the hyperspectral image), after After classification, the number of samples correctly classified into the first category out of 100 samples is the number of samples correctly classified.
(2)平均精度AA,AA=每类分类的正确率之和/类别数。(2) Average accuracy AA, AA = the sum of the correct rates of each category/the number of categories.
(3)Kappa系数,Kappa=(OA-OO)/(1-AO),其中,AO为理论精度,为预先设置的精度值。(3) Kappa coefficient, Kappa=(OA-OO)/(1-AO), where AO is the theoretical accuracy, which is the preset accuracy value.
以上是对本申请实施例提供的图像分类的方法进行的具体介绍,以下将对本申请实施例提供的模型训练的方法进行说明。图6为本申请实施例提供的模型训练的方法的一个流程示意图,请参阅图6,该方法包括:The above is a specific introduction to the image classification method provided in the embodiment of the present application, and the model training method provided in the embodiment of the present application will be described below. FIG. 6 is a schematic flow chart of the model training method provided by the embodiment of the application. Please refer to FIG. 6. The method includes:
601、获取待训练图像;601. Obtain an image to be trained;
602、获取待训练图像的空间信息和待训练图像的光谱信息;602. Obtain spatial information of the image to be trained and spectral information of the image to be trained.
603、通过第一卷积层对光谱信息进行卷积处理,得到待训练图像的第一光谱特征;603. Perform convolution processing on the spectral information through the first convolution layer to obtain the first spectral feature of the image to be trained.
604、通过第一池化层对第一光谱特征进行最大池化处理,得到待训练图像的第二光谱特征;604. Perform maximum pooling processing on the first spectral feature through the first pooling layer to obtain the second spectral feature of the image to be trained.
605、通过第二卷积层对空间信息进行卷积处理,得到待训练图像的第一空间特征;605. Perform convolution processing on the spatial information through the second convolution layer to obtain the first spatial feature of the image to be trained.
606、通过第二池化层对第一空间特征进行最大池化处理,得到待训练图像的第二空间特征;606. Perform maximum pooling processing on the first spatial feature through the second pooling layer to obtain the second spatial feature of the image to be trained.
607、通过待训练分类模型将第二光谱特征和第二空间特征分别进行拉伸处理,得到第三光谱特征和第三空间特征;607. Perform stretching processing on the second spectral feature and the second spatial feature by the classification model to be trained to obtain the third spectral feature and the third spatial feature.
608、通过全连接层对第三光谱特征和第三空间特征进行融合处理,得到空谱特征;608. Perform fusion processing on the third spectral feature and the third spatial feature through the fully connected layer to obtain the spatial spectrum feature;
609、通过分类层对空谱特征进行分类处理,得到分类结果;609. Perform classification processing on the space spectrum feature through the classification layer to obtain a classification result;
步骤601至步骤609的具体说明可参考上述实施例中步骤201至步骤209的相关说明内容,此处不再赘述。For specific descriptions of step 601 to step 609, reference may be made to related descriptions of step 201 to step 209 in the above-mentioned embodiment, which will not be repeated here.
610、根据分类结果和真实结果,通过目标损失函数对待训练分类模型进行训练,得到图像分类模型。610. According to the classification result and the real result, the to-be-trained classification model is trained through the target loss function to obtain the image classification model.
由于待训练图像为多光谱图像中的某个像素点,其分类结果包含该待训练图像属于各类别的概率,然而该分类结果不一定正确。由于在获取待训练图像时,已提前标记待训练图像在多光谱图像中所属的正确类别,即真实结果,因此,可以通过目标损失函数计算待训练图像的分类结果和真实结果之间的差距,若二者的差距超出合格范围,则调整待训练分类模型的参数,并重新用额外的待训练样本进行训练,直至待训练图像的分类结果和真实结果之间的差距满足要求,则可得到图2所对应实施例中的图像分类模型。Since the image to be trained is a certain pixel in the multispectral image, the classification result includes the probability that the image to be trained belongs to each category, but the classification result is not necessarily correct. Since the correct category of the image to be trained in the multispectral image is marked in advance when the image to be trained is obtained, that is, the real result, the difference between the classification result of the image to be trained and the real result can be calculated through the objective loss function. If the difference between the two is beyond the qualified range, adjust the parameters of the classification model to be trained, and re-train with additional samples to be trained until the gap between the classification result of the image to be trained and the real result meets the requirements, then the image can be obtained. 2 The image classification model in the corresponding embodiment.
本实施例所得到的图像分类模型,可以提取目标图像的空间特征和光谱特征,二者的结合所构成的空谱特征能够多维度地表征图像的属性信息,故基于该空谱特征对图像进行分类,可以有效提高图像的分类结果准确率,精准辨识图像中的物体。The image classification model obtained in this embodiment can extract the spatial and spectral features of the target image. The space spectrum feature formed by the combination of the two can represent the attribute information of the image in multiple dimensions. Therefore, the image is performed based on the space spectrum feature. Classification can effectively improve the accuracy of image classification results and accurately identify objects in the image.
图7为本申请实施例提供的模型训练的方法的另一个流程示意图,请参阅图7,该方法包括:FIG. 7 is a schematic diagram of another flow chart of the model training method provided by an embodiment of the application. Please refer to FIG. 7. The method includes:
701、获取待训练图像;701. Obtain an image to be trained;
702、获取待训练图像的空间信息和待训练图像的光谱信息;702. Obtain spatial information of the image to be trained and spectral information of the image to be trained.
703、通过第1个第一卷积层对光谱信息进行卷积处理,得到第1个第一光谱特征;703. Perform convolution processing on the spectral information through the first first convolution layer to obtain the first first spectral feature;
704、通过第1个第一池化层至第n-1个第一池化层对第1个第一光谱特征至第n-1个第一光谱特征分别进行最大池化处理,得到第1个第二光谱特征至第n-1个第二光谱特征;704. Perform maximum pooling processing on the first first spectral feature to the n-1th first spectral feature through the first first pooling layer to the n-1th first pooling layer, respectively, to obtain the first Second spectral feature to the n-1th second spectral feature;
705、通过第2个第一卷积层至第n个第一卷积层对第1个第二光谱特征至第n-1个第二光谱特征分别进行卷积处理,得到第2个第一光谱特征至第n个第一光谱特征;705. Perform convolution processing on the first second spectral feature to the n-1th second spectral feature through the second first convolutional layer to the nth first convolutional layer, respectively, to obtain the second first convolutional layer. From the spectral feature to the n-th first spectral feature;
706、通过第1个第二卷积层对空间信息进行卷积处理,得到第1个第一空间特征;706. Perform convolution processing on the spatial information through the first second convolution layer to obtain the first first spatial feature.
707、通过第1个第二池化层至第n-1个第二池化层对第1个第一空间特征至第n-1个第一空间特征分别进行最大池化处理,得到第1个第二空间特征至第n-1个第二空间特征;707. Perform maximum pooling processing on the first first spatial feature to the n-1th first spatial feature through the first second pooling layer to the n-1th second pooling layer, respectively, to obtain the first Second spatial feature to the n-1th second spatial feature;
708、通过第2个第二卷积层至第n个第二卷积层对第1个第二空间特征至第n-1个第二空间特征分别进行卷积处理,得到第2个第一空间特征至第n个第一空间特征;708. Perform convolution processing on the first second spatial feature to the n-1th second spatial feature through the second second convolutional layer to the nth second convolutional layer, respectively, to obtain the second first Spatial feature to the nth first spatial feature;
709、通过待训练分类模型将第1个第二光谱特征至第n-1个第二光谱特征、第1个第二空间特征至第n-1个第二空间特征、第n个第一光谱特征和第n个第一空间特征分别进行拉伸处理,得到第1个第三光谱特征至第n个第三光谱特征,以及第1个第三空间特征至第n个第三空间特征;709. Use the to-be-trained classification model to convert the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, and the nth first spectrum. The feature and the nth first spatial feature are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature;
710、通过n个全连接层对n对特征组分别进行融合处理,得到n个子空谱特征,其中,排序相同的一个第三光谱特征和一个第三空间特征构成一个特征组;710. Perform fusion processing on n pairs of feature groups respectively through n fully connected layers to obtain n subspace spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
711、通过待训练分类模型将n个子空谱特征进行拼接处理,得到空谱特征;711: Perform splicing processing on the n sub-space spectrum features through the classification model to be trained to obtain the empty spectrum feature;
712、通过分类层对空谱特征进行分类处理,得到分类结果;712. Perform classification processing on the space spectrum feature through the classification layer to obtain a classification result.
步骤701至步骤712的具体说明可参考上述实施例中步骤401至步骤412的相关说明内容,此处不再赘述。For specific descriptions of step 701 to step 712, please refer to the relevant descriptions of step 401 to step 412 in the foregoing embodiment, which will not be repeated here.
713、根据分类结果和真实结果,通过目标损失函数对待训练分类模型进行训练,得到图像分类模型。713. According to the classification result and the real result, the to-be-trained classification model is trained through the target loss function to obtain the image classification model.
由于待训练图像为多光谱图像中的某个像素点,其分类结果包含该待训练图像属于各类别的概率,然而该分类结果不一定正确。由于在获取待训练图像时,已提前标记待训练图像在多光谱图像中所属的正确类别,即真实结果,因此,可以通过目标损失函数计算待训练图像的分类结果和真实结果之间的差距,若二者的差距超出合格范围,则调整待训练分类模型的参数,并重新用额外的待训练样本进行训练,直至待训练图像的分类结果和真实结果之间的差距满足要求,则可得到图4所对应实施例中的图像分类模型。Since the image to be trained is a certain pixel in the multispectral image, the classification result includes the probability that the image to be trained belongs to each category, but the classification result is not necessarily correct. Since the correct category of the image to be trained in the multispectral image is marked in advance when the image to be trained is obtained, that is, the real result, the difference between the classification result of the image to be trained and the real result can be calculated through the objective loss function. If the difference between the two is beyond the qualified range, adjust the parameters of the classification model to be trained, and re-train with additional samples to be trained until the gap between the classification result of the image to be trained and the real result meets the requirements, then the image can be obtained. 4 corresponds to the image classification model in the embodiment.
本实施例所得到的图像分类模型,可以提取目标图像的空间特征和光谱特征,二者的结合所构成的空谱特征能够多维度地表征图像的属性信息,故基于该空谱特征对图像进行分类,可以有效提高图像的分类结果准确率,精准辨识图像中的物体。The image classification model obtained in this embodiment can extract the spatial and spectral features of the target image. The space spectrum feature formed by the combination of the two can represent the attribute information of the image in multiple dimensions. Therefore, the image is performed based on the space spectrum feature. Classification can effectively improve the accuracy of image classification results and accurately identify objects in the image.
以上是对本申请实施例提供的模型训练的方法进行的具体介绍,以下将对本申请实施 例提供的图像分类的装置和模型训练的装置分别进行说明。图8为本申请实施例提供的图像分类的装置的一个结构示意图,如图8所示,该装置包括:The above is a specific introduction to the model training method provided by the embodiment of the present application. The image classification device and the model training device provided in the embodiment of the present application will be separately described below. FIG. 8 is a schematic structural diagram of an image classification device provided by an embodiment of the application. As shown in FIG. 8, the device includes:
第一获取模块801,用于获取目标图像,目标图像为基于高光谱图像所生成的图像;The first acquisition module 801 is configured to acquire a target image, and the target image is an image generated based on a hyperspectral image;
提取模块802,用于通过图像分类模型提取目标图像的空间特征和目标图像的光谱特征;The extraction module 802 is used to extract the spatial characteristics of the target image and the spectral characteristics of the target image through the image classification model;
构建模块803,用于通过图像分类模型根据空间特征和光谱特征构建空谱特征;The construction module 803 is used to construct the empty spectrum feature according to the spatial feature and the spectral feature through the image classification model;
第二获取模块804,用于通过图像分类模型获取空谱特征的分类结果;The second acquisition module 804 is configured to acquire the classification result of the empty spectrum feature through the image classification model;
确定模块805,用于根据分类结果,确定目标图像所属的类别。The determining module 805 is used to determine the category to which the target image belongs according to the classification result.
可选的,该装置还包括:Optionally, the device further includes:
第三获取模块,用于获取目标图像的空间信息和目标图像的光谱信息,其中,目标图像的光谱信息为目标图像所构成的一维向量,目标图像的空间信息为目标图像和目标图像的邻域图像所构成的二维向量;The third acquisition module is used to acquire the spatial information of the target image and the spectral information of the target image, where the spectral information of the target image is a one-dimensional vector formed by the target image, and the spatial information of the target image is the neighbor of the target image and the target image. A two-dimensional vector formed by the domain image;
提取模块802还用于通过图像分类模型对空间信息和光谱信息分别进行特征提取,得到目标图像的空间特征和目标图像的光谱特征。The extraction module 802 is also used to perform feature extraction on the spatial information and the spectral information respectively through the image classification model to obtain the spatial features of the target image and the spectral features of the target image.
可选的,图像分类模型包括第一分支网络和第二分支网络,第一分支网络包括第一卷积层和第一池化层,第二分支网路包括第二卷积层和第二池化层,提取模块802还用于:Optionally, the image classification model includes a first branch network and a second branch network, the first branch network includes a first convolutional layer and a first pooling layer, and the second branch network includes a second convolutional layer and a second pooling layer. The layer, the extraction module 802 is also used to:
通过第一卷积层对光谱信息进行卷积处理,得到目标图像的第一光谱特征;Perform convolution processing on the spectral information through the first convolution layer to obtain the first spectral feature of the target image;
通过第一池化层对第一光谱特征进行最大池化处理,得到目标图像的第二光谱特征;Perform maximum pooling processing on the first spectral feature through the first pooling layer to obtain the second spectral feature of the target image;
通过第二卷积层对空间信息进行卷积处理,得到目标图像的第一空间特征;Perform convolution processing on the spatial information through the second convolution layer to obtain the first spatial feature of the target image;
通过第二池化层对第一空间特征进行最大池化处理,得到目标图像的第二空间特征。The first spatial feature is maximally pooled by the second pooling layer to obtain the second spatial feature of the target image.
可选的,图像分类模型还包括全连接层,构建模块803还用于:Optionally, the image classification model further includes a fully connected layer, and the building module 803 is also used to:
通过图像分类模型将第二光谱特征和第二空间特征分别进行拉伸处理,得到第三光谱特征和第三空间特征,其中,第三光谱特征和第三空间特征为一维向量;The second spectral feature and the second spatial feature are respectively stretched through the image classification model to obtain the third spectral feature and the third spatial feature, where the third spectral feature and the third spatial feature are one-dimensional vectors;
通过全连接层对第三光谱特征和第三空间特征进行融合处理,得到空谱特征。The third spectral feature and the third spatial feature are fused through the fully connected layer to obtain the spatial spectrum feature.
可选的,图像分类模型包括第一分支网络和第二分支网络,第一分支网络包括n个第一卷积层和n-1个第一池化层,第二分支网络包括n个第二卷积层和n-1个第二池化层,其中,n大于或等于2,提取模块802还用于:Optionally, the image classification model includes a first branch network and a second branch network, the first branch network includes n first convolutional layers and n-1 first pooling layers, and the second branch network includes n second The convolutional layer and n-1 second pooling layers, where n is greater than or equal to 2, the extraction module 802 is also used for:
通过第1个第一卷积层对光谱信息进行卷积处理,得到第1个第一光谱特征;Perform convolution processing on the spectral information through the first first convolution layer to obtain the first first spectral feature;
通过第1个第一池化层至第n-1个第一池化层对第1个第一光谱特征至第n-1个第一光谱特征分别进行最大池化处理,得到第1个第二光谱特征至第n-1个第二光谱特征;Through the first first pooling layer to the n-1th first pooling layer, the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
通过第2个第一卷积层至第n个第一卷积层对第1个第二光谱特征至第n-1个第二光谱特征分别进行卷积处理,得到第2个第一光谱特征至第n个第一光谱特征;Through the second first convolutional layer to the nth first convolutional layer, the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
通过第1个第二卷积层对空间信息进行卷积处理,得到第1个第一空间特征;Perform convolution processing on the spatial information through the first second convolution layer to obtain the first first spatial feature;
通过第1个第二池化层至第n-1个第二池化层对第1个第一空间特征至第n-1个第一空间特征分别进行最大池化处理,得到第1个第二空间特征至第n-1个第二空间特征;Through the first second pooling layer to the n-1th second pooling layer, the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
通过第2个第二卷积层至第n个第二卷积层对第1个第二空间特征至第n-1个第二空间特征分别进行卷积处理,得到第2个第一空间特征至第n个第一空间特征。Perform convolution processing on the first second spatial feature to the n-1th second spatial feature through the second second convolutional layer to the nth second convolutional layer to obtain the second first spatial feature To the nth first spatial feature.
可选的,图像分类模型还包括n个全连接层,构建模块803还用于:Optionally, the image classification model further includes n fully connected layers, and the building module 803 is also used to:
通过图像分类模型将第1个第二光谱特征至第n-1个第二光谱特征、第1个第二空间 特征至第n-1个第二空间特征、第n个第一光谱特征和第n个第一空间特征分别进行拉伸处理,得到第1个第三光谱特征至第n个第三光谱特征,以及第1个第三空间特征至第n个第三空间特征,其中,第三光谱特征和第三空间特征为一维向量;Through the image classification model, the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and the first The n first spatial features are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the third The spectral feature and the third spatial feature are one-dimensional vectors;
通过n个全连接层对n对特征组分别进行融合处理,得到n个子空谱特征,其中,排序相同的一个第三光谱特征和一个第三空间特征构成一个特征组;The n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
通过图像分类模型将n个子空谱特征进行拼接处理,得到空谱特征。Through the image classification model, the n sub-space spectrum features are spliced to obtain the spatial spectrum feature.
可选的,图像分类模型还包括分类层,第二获取模块804还用于通过分类层对空谱特征进行分类处理,得到分类结果。Optionally, the image classification model further includes a classification layer, and the second acquisition module 804 is further configured to classify the empty spectrum features through the classification layer to obtain a classification result.
图9为本申请实施例提供的模型训练的装置的一个结构示意图,如图9所示,该装置包括:Fig. 9 is a schematic structural diagram of a model training device provided by an embodiment of the application. As shown in Fig. 9, the device includes:
第一获取模块901,用于获取待训练图像,待训练图像为基于高光谱图像所生成的图像;The first acquisition module 901 is configured to acquire an image to be trained, and the image to be trained is an image generated based on a hyperspectral image;
提取模块902,用于通过待训练分类模型提取待训练图像的空间特征和待训练图像的光谱特征;The extraction module 902 is configured to extract the spatial features of the image to be trained and the spectral features of the image to be trained through the classification model to be trained;
构建模块903,用于通过待训练分类模型根据空间特征和光谱特征构建空谱特征;The construction module 903 is used to construct an empty spectrum feature according to the spatial feature and the spectral feature through the classification model to be trained;
第二获取模块904,用于通过待训练分类模型获取空谱特征的分类结果;The second obtaining module 904 is configured to obtain the classification result of the empty spectrum feature through the classification model to be trained;
训练模块905,用于根据分类结果和真实结果,通过目标损失函数对待训练分类模型进行训练,得到图像分类模型。The training module 905 is used to train the to-be-trained classification model through the target loss function according to the classification result and the real result to obtain the image classification model.
可选的,该装置还包括:Optionally, the device further includes:
第三获取模块,用于获取待训练图像的空间信息和待训练图像的光谱信息,其中,待训练图像的光谱信息为待训练图像所构成的一维向量,待训练图像的空间信息为待训练图像和待训练图像的邻域图像所构成的二维向量;The third acquisition module is used to acquire the spatial information of the image to be trained and the spectral information of the image to be trained, where the spectral information of the image to be trained is a one-dimensional vector formed by the image to be trained, and the spatial information of the image to be trained is the image to be trained A two-dimensional vector formed by the image and the neighborhood image of the image to be trained;
提取模块902还用于通过待训练分类模型对空间信息和光谱信息分别进行特征提取,得到待训练图像的空间特征和待训练图像的光谱特征。The extraction module 902 is further configured to perform feature extraction on the spatial information and the spectral information respectively through the classification model to be trained to obtain the spatial features of the image to be trained and the spectral features of the image to be trained.
可选的,待训练分类模型包括第一分支网络和第二分支网络,第一分支网络包括n个第一卷积层和n-1个第一池化层,第二分支网络包括n个第二卷积层和n-1个第二池化层,其中,n大于或等于2,提取模块902还用于:Optionally, the classification model to be trained includes a first branch network and a second branch network. The first branch network includes n first convolutional layers and n-1 first pooling layers, and the second branch network includes n first convolutional layers. Two convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2, and the extraction module 902 is also used for:
通过第1个第一卷积层对光谱信息进行卷积处理,得到第1个第一光谱特征;Perform convolution processing on the spectral information through the first first convolution layer to obtain the first first spectral feature;
通过第1个第一池化层至第n-1个第一池化层对第1个第一光谱特征至第n-1个第一光谱特征分别进行最大池化处理,得到第1个第二光谱特征至第n-1个第二光谱特征;Through the first first pooling layer to the n-1th first pooling layer, the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain the first From the second spectral feature to the n-1th second spectral feature;
通过第2个第一卷积层至第n个第一卷积层对第1个第二光谱特征至第n-1个第二光谱特征分别进行卷积处理,得到第2个第一光谱特征至第n个第一光谱特征;Through the second first convolutional layer to the nth first convolutional layer, the first second spectral feature to the n-1th second spectral feature are respectively convolved to obtain the second first spectral feature To the nth first spectral feature;
通过第1个第二卷积层对空间信息进行卷积处理,得到第1个第一空间特征;Perform convolution processing on the spatial information through the first second convolution layer to obtain the first first spatial feature;
通过第1个第二池化层至第n-1个第二池化层对第1个第一空间特征至第n-1个第一空间特征分别进行最大池化处理,得到第1个第二空间特征至第n-1个第二空间特征;Through the first second pooling layer to the n-1th second pooling layer, the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain the first From the second spatial feature to the n-1th second spatial feature;
通过第2个第二卷积层至第n个第二卷积层对第1个第二空间特征至第n-1个第二空间特征分别进行卷积处理,得到第2个第一空间特征至第n个第一空间特征。Perform convolution processing on the first second spatial feature to the n-1th second spatial feature through the second second convolutional layer to the nth second convolutional layer to obtain the second first spatial feature To the nth first spatial feature.
可选的,待训练分类模型还包括n个全连接层,构建模块903还用于:Optionally, the classification model to be trained further includes n fully connected layers, and the building module 903 is also used to:
通过待训练分类模型将第1个第二光谱特征至第n-1个第二光谱特征、第1个第二空间特征至第n-1个第二空间特征、第n个第一光谱特征和第n个第一空间特征分别进行拉 伸处理,得到第1个第三光谱特征至第n个第三光谱特征,以及第1个第三空间特征至第n个第三空间特征,其中,第三光谱特征和第三空间特征为一维向量;Through the classification model to be trained, the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the nth first spectral feature and The nth first spatial feature is stretched separately to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth third spatial feature, where the The three-spectral feature and the third spatial feature are one-dimensional vectors;
通过n个全连接层对n对特征组分别进行融合处理,得到n个子空谱特征,其中,排序相同的一个第三光谱特征和一个第三空间特征构成一个特征组;The n pairs of feature groups are respectively fused through n fully connected layers to obtain n sub-space spectral features, where a third spectral feature and a third spatial feature with the same order form a feature group;
通过待训练分类模型将n个子空谱特征进行拼接处理,得到空谱特征。The n subspace spectrum features are spliced by the classification model to be trained to obtain the spatial spectrum features.
可选的,待训练分类模型还包括分类层,第二获取模块904还用于通过分类层对空谱特征进行分类处理,得到分类结果。Optionally, the classification model to be trained further includes a classification layer, and the second acquisition module 904 is further configured to classify the empty spectrum features through the classification layer to obtain a classification result.
需要说明的是,上述装置各模块/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其带来的技术效果与本申请方法实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that the information interaction and execution process among the various modules/units of the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effects brought by it are the same as those of the method embodiment of the present application, and the specific content may be Please refer to the description in the method embodiment shown in the foregoing application, which will not be repeated here.
图10为本申请实施例提供的图像分类设备的一个结构示意图,请参阅图10,该设备包括:一个或一个以上中央处理器1001,存储器1002,输入输出接口1003,有线或无线网络接口1004,电源1005;Fig. 10 is a schematic structural diagram of an image classification device provided by an embodiment of the application. Please refer to Fig. 10. The device includes: one or more central processing units 1001, a memory 1002, an input/output interface 1003, and a wired or wireless network interface 1004, Power supply 1005;
存储器1002为短暂存储存储器或持久存储存储器;The memory 1002 is a short-term storage memory or a persistent storage memory;
中央处理器1001配置为与存储器1002通信,在图像分类设备上执行存储器1002中的指令操作以执行图2或图4中图像分类设备所执行的操作,具体此处不再赘述。The central processing unit 1001 is configured to communicate with the memory 1002, and execute the instruction operations in the memory 1002 on the image classification device to perform operations performed by the image classification device in FIG. 2 or FIG. 4, and details are not described herein again.
本申请实施例还涉及一种计算机可读存储介质,包括指令,当指令在计算机上运行时,使得计算机执行图2或图4所对应的方法。The embodiment of the present application also relates to a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute the method corresponding to FIG. 2 or FIG. 4.
本申请实施例还涉及提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行图2或图4所对应的方法。The embodiment of the present application also relates to providing a computer program product containing instructions, which when running on a computer, causes the computer to execute the method corresponding to FIG. 2 or FIG. 4.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of the description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部 分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .

Claims (17)

  1. 一种图像分类的方法,其特征在于,所述方法包括:An image classification method, characterized in that the method includes:
    获取目标图像,所述目标图像为基于多光谱图像所生成的图像;Acquiring a target image, the target image being an image generated based on a multispectral image;
    通过图像分类模型提取所述目标图像的空间特征和所述目标图像的光谱特征;Extracting the spatial feature of the target image and the spectral feature of the target image through an image classification model;
    通过所述图像分类模型根据所述空间特征和所述光谱特征构建空谱特征;Constructing a spatial spectrum feature according to the spatial feature and the spectral feature through the image classification model;
    通过所述图像分类模型获取所述空谱特征的分类结果;Acquiring the classification result of the empty spectrum feature through the image classification model;
    根据所述分类结果,确定所述目标图像所属的类别。According to the classification result, the category to which the target image belongs is determined.
  2. 根据权利要求1所述的方法,其特征在于,通过图像分类模型提取所述目标图像的空间特征和所述目标图像的光谱特征之前,所述方法还包括:The method according to claim 1, wherein before extracting the spatial feature of the target image and the spectral feature of the target image through an image classification model, the method further comprises:
    获取所述目标图像的空间信息和所述目标图像的光谱信息,其中,所述目标图像的光谱信息为所述目标图像所构成的一维向量,所述目标图像的空间信息为所述目标图像和所述目标图像的邻域图像所构成的二维向量;Acquire the spatial information of the target image and the spectral information of the target image, wherein the spectral information of the target image is a one-dimensional vector formed by the target image, and the spatial information of the target image is the target image And a two-dimensional vector formed by the neighborhood image of the target image;
    所述通过图像分类模型提取所述目标图像的空间特征和所述目标图像的光谱特征包括:The extracting the spatial feature of the target image and the spectral feature of the target image through an image classification model includes:
    通过所述图像分类模型对所述空间信息和所述光谱信息分别进行特征提取,得到所述目标图像的空间特征和所述目标图像的光谱特征。The spatial information and the spectral information are respectively feature extracted through the image classification model to obtain the spatial features of the target image and the spectral features of the target image.
  3. 根据权利要求2所述的方法,其特征在于,所述图像分类模型包括第一分支网络和第二分支网络,所述第一分支网络包括第一卷积层和第一池化层,所述第二分支网路包括第二卷积层和第二池化层,通过所述图像分类模型对所述空间信息和所述光谱信息分别进行特征提取,得到所述目标图像的空间特征和所述目标图像的光谱特征包括:The method according to claim 2, wherein the image classification model includes a first branch network and a second branch network, the first branch network includes a first convolutional layer and a first pooling layer, the The second branch network includes a second convolutional layer and a second pooling layer. The spatial information and the spectral information are respectively feature extracted through the image classification model to obtain the spatial features of the target image and the The spectral characteristics of the target image include:
    通过所述第一卷积层对所述光谱信息进行卷积处理,得到所述目标图像的第一光谱特征;Performing convolution processing on the spectral information through the first convolution layer to obtain the first spectral feature of the target image;
    通过所述第一池化层对所述第一光谱特征进行最大池化处理,得到所述目标图像的第二光谱特征;Performing maximum pooling processing on the first spectral feature through the first pooling layer to obtain the second spectral feature of the target image;
    通过所述第二卷积层对所述空间信息进行卷积处理,得到所述目标图像的第一空间特征;Performing convolution processing on the spatial information through the second convolution layer to obtain the first spatial feature of the target image;
    通过所述第二池化层对所述第一空间特征进行最大池化处理,得到所述目标图像的第二空间特征。Perform maximum pooling processing on the first spatial feature through the second pooling layer to obtain the second spatial feature of the target image.
  4. 根据权利要求3所述的方法,其特征在于,所述图像分类模型还包括全连接层,通过所述图像分类模型根据所述空间特征和所述光谱特征构建空谱特征包括:The method according to claim 3, wherein the image classification model further comprises a fully connected layer, and constructing a space spectrum feature according to the spatial feature and the spectral feature through the image classification model comprises:
    通过所述图像分类模型将所述第二光谱特征和第二空间特征分别进行拉伸处理,得到第三光谱特征和第三空间特征,其中,所述第三光谱特征和所述第三空间特征为一维向量;The second spectral feature and the second spatial feature are respectively stretched through the image classification model to obtain a third spectral feature and a third spatial feature, wherein the third spectral feature and the third spatial feature Is a one-dimensional vector;
    通过所述全连接层对所述第三光谱特征和所述第三空间特征进行融合处理,得到空谱特征。The third spectral feature and the third spatial feature are fused through the fully connected layer to obtain a spatial spectrum feature.
  5. 根据权利要求2所述的方法,其特征在于,所述图像分类模型包括第一分支网络和第二分支网络,所述第一分支网络包括n个第一卷积层和n-1个第一池化层,所述第二分支网络包括n个第二卷积层和n-1个第二池化层,其中,n大于或等于2,通过所述图像分类模型对所述空间信息和所述光谱信息分别进行特征提取,得到所述目标图 像的空间特征和所述目标图像的光谱特征包括:The method according to claim 2, wherein the image classification model includes a first branch network and a second branch network, and the first branch network includes n first convolutional layers and n-1 first convolutional layers. Pooling layer, the second branch network includes n second convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2, and the spatial information and all the spatial information are compared through the image classification model. Performing feature extraction on the spectral information respectively to obtain the spatial feature of the target image and the spectral feature of the target image includes:
    通过第1个所述第一卷积层对所述光谱信息进行卷积处理,得到第1个第一光谱特征;Performing convolution processing on the spectral information by using the first first convolution layer to obtain the first first spectral feature;
    通过第1个所述第一池化层至第n-1个所述第一池化层对第1个第一光谱特征至第n-1个第一光谱特征分别进行最大池化处理,得到第1个第二光谱特征至第n-1个第二光谱特征;Through the first pooling layer to the n-1th first pooling layer, the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain The first second spectral feature to the n-1th second spectral feature;
    通过第2个所述第一卷积层至第n个所述第一卷积层对所述第1个第二光谱特征至第n-1个第二光谱特征分别进行卷积处理,得到第2个第一光谱特征至第n个第一光谱特征;Convolution processing is performed on the first second spectral feature to the n-1th second spectral feature through the second first convolutional layer to the nth first convolutional layer to obtain the first 2 first spectral features to the nth first spectral feature;
    通过第1个所述第二卷积层对所述空间信息进行卷积处理,得到第1个第一空间特征;Performing convolution processing on the spatial information by using the first second convolution layer to obtain the first first spatial feature;
    通过第1个所述第二池化层至第n-1个所述第二池化层对第1个第一空间特征至第n-1个第一空间特征分别进行最大池化处理,得到第1个第二空间特征至第n-1个第二空间特征;Through the first second pooling layer to the n-1th second pooling layer, the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain The first second spatial feature to the n-1th second spatial feature;
    通过第2个所述第二卷积层至第n个所述第二卷积层对所述第1个第二空间特征至第n-1个第二空间特征分别进行卷积处理,得到第2个第一空间特征至第n个第一空间特征。The first second spatial feature to the n-1th second spatial feature are respectively subjected to convolution processing through the second second convolutional layer to the nth second convolutional layer to obtain the first 2 first spatial features to nth first spatial feature.
  6. 根据权利要求5所述的方法,其特征在于,所述图像分类模型还包括n个全连接层,通过所述图像分类模型根据所述空间特征和所述光谱特征构建空谱特征包括:The method according to claim 5, wherein the image classification model further comprises n fully connected layers, and constructing a space spectrum feature according to the spatial feature and the spectral feature through the image classification model comprises:
    通过所述图像分类模型将所述第1个第二光谱特征至第n-1个第二光谱特征、所述第1个第二空间特征至第n-1个第二空间特征、所述第n个第一光谱特征和所述第n个第一空间特征分别进行拉伸处理,得到第1个第三光谱特征至第n个第三光谱特征,以及第1个第三空间特征至第n个第三空间特征,其中,所述第三光谱特征和所述第三空间特征为一维向量;According to the image classification model, the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the first The n first spectral features and the nth first spatial feature are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the nth A third spatial feature, wherein the third spectral feature and the third spatial feature are one-dimensional vectors;
    通过所述n个全连接层对n对特征组分别进行融合处理,得到n个子空谱特征,其中,排序相同的一个所述第三光谱特征和一个所述第三空间特征构成一个所述特征组;The n pairs of feature groups are respectively fused through the n fully connected layers to obtain n sub-space spectral features, wherein one of the third spectral features and one of the third spatial features with the same order constitutes one of the features group;
    通过所述图像分类模型将所述n个子空谱特征进行拼接处理,得到空谱特征。The n subspace spectrum features are spliced by the image classification model to obtain the spatial spectrum feature.
  7. 根据权利要求1至6任意一项所述的方法,其特征在于,所述图像分类模型还包括分类层,通过所述图像分类模型获取所述空谱特征的分类结果包括:The method according to any one of claims 1 to 6, wherein the image classification model further comprises a classification layer, and obtaining the classification result of the empty spectrum feature through the image classification model comprises:
    通过所述分类层对所述空谱特征进行分类处理,得到分类结果。Perform classification processing on the empty spectrum feature through the classification layer to obtain a classification result.
  8. 一种模型训练的方法,其特征在于,包括:A method for model training is characterized in that it includes:
    获取待训练图像,所述待训练图像为基于高光谱图像所生成的图像;Acquiring an image to be trained, where the image to be trained is an image generated based on a hyperspectral image;
    通过待训练分类模型提取所述待训练图像的空间特征和所述待训练图像的光谱特征;Extracting the spatial feature of the image to be trained and the spectral feature of the image to be trained through the classification model to be trained;
    通过所述待训练分类模型根据所述空间特征和所述光谱特征构建空谱特征;Constructing an empty spectrum feature according to the spatial feature and the spectral feature through the classification model to be trained;
    通过所述待训练分类模型获取所述空谱特征的分类结果;Acquiring the classification result of the empty spectrum feature through the classification model to be trained;
    根据所述分类结果和真实结果,通过目标损失函数对所述待训练分类模型进行训练,得到图像分类模型。According to the classification result and the real result, the classification model to be trained is trained through the target loss function to obtain an image classification model.
  9. 根据权利要求8所述的方法,其特征在于,通过待训练分类模型提取所述待训 练图像的空间特征和所述待训练图像的光谱特征之前,所述方法还包括:The method according to claim 8, characterized in that, before extracting the spatial characteristics of the image to be trained and the spectral characteristics of the image to be trained through the classification model to be trained, the method further comprises:
    获取所述待训练图像的空间信息和所述待训练图像的光谱信息,其中,所述待训练图像的光谱信息为所述待训练图像所构成的一维向量,所述待训练图像的空间信息为所述待训练图像和所述待训练图像的邻域图像所构成的二维向量;Obtain the spatial information of the image to be trained and the spectral information of the image to be trained, wherein the spectral information of the image to be trained is a one-dimensional vector formed by the image to be trained, and the spatial information of the image to be trained Is a two-dimensional vector formed by the image to be trained and the neighborhood image of the image to be trained;
    所述通过待训练分类模型提取所述待训练图像的空间特征和所述待训练图像的光谱特征包括:The extracting the spatial feature of the image to be trained and the spectral feature of the image to be trained through the classification model to be trained includes:
    通过所述待训练分类模型对所述空间信息和所述光谱信息分别进行特征提取,得到所述待训练图像的空间特征和所述待训练图像的光谱特征。The spatial information and the spectral information are respectively feature extracted through the to-be-trained classification model to obtain the spatial features of the to-be-trained image and the spectral features of the to-be-trained image.
  10. 根据权利要求9所述的方法,其特征在于,所述待训练分类模型包括第一分支网络和第二分支网络,所述第一分支网络包括n个第一卷积层和n-1个第一池化层,所述第二分支网络包括n个第二卷积层和n-1个第二池化层,其中,n大于或等于2,通过所述待训练分类模型对所述空间信息和所述光谱信息分别进行特征提取,得到所述待训练图像的空间特征和所述待训练图像的光谱特征包括:The method according to claim 9, wherein the classification model to be trained includes a first branch network and a second branch network, and the first branch network includes n first convolutional layers and n-1 A pooling layer, the second branch network includes n second convolutional layers and n-1 second pooling layers, where n is greater than or equal to 2, and the spatial information is analyzed by the classification model to be trained Performing feature extraction separately from the spectral information to obtain the spatial feature of the image to be trained and the spectral feature of the image to be trained includes:
    通过第1个所述第一卷积层对所述光谱信息进行卷积处理,得到第1个第一光谱特征;Performing convolution processing on the spectral information by using the first first convolution layer to obtain the first first spectral feature;
    通过第1个所述第一池化层至第n-1个所述第一池化层对第1个第一光谱特征至第n-1个第一光谱特征分别进行最大池化处理,得到第1个第二光谱特征至第n-1个第二光谱特征;Through the first pooling layer to the n-1th first pooling layer, the first first spectral feature to the n-1th first spectral feature are respectively subjected to maximum pooling processing to obtain The first second spectral feature to the n-1th second spectral feature;
    通过第2个所述第一卷积层至第n个所述第一卷积层对所述第1个第二光谱特征至第n-1个第二光谱特征分别进行卷积处理,得到第2个第一光谱特征至第n个第一光谱特征;Convolution processing is performed on the first second spectral feature to the n-1th second spectral feature through the second first convolutional layer to the nth first convolutional layer to obtain the first 2 first spectral features to the nth first spectral feature;
    通过第1个所述第二卷积层对所述空间信息进行卷积处理,得到第1个第一空间特征;Performing convolution processing on the spatial information by using the first second convolution layer to obtain the first first spatial feature;
    通过第1个所述第二池化层至第n-1个所述第二池化层对第1个第一空间特征至第n-1个第一空间特征分别进行最大池化处理,得到第1个第二空间特征至第n-1个第二空间特征;Through the first second pooling layer to the n-1th second pooling layer, the first first spatial feature to the n-1th first spatial feature are respectively subjected to maximum pooling processing to obtain The first second spatial feature to the n-1th second spatial feature;
    通过第2个所述第二卷积层至第n个所述第二卷积层对所述第1个第二空间特征至第n-1个第二空间特征分别进行卷积处理,得到第2个第一空间特征至第n个第一空间特征。The first second spatial feature to the n-1th second spatial feature are respectively subjected to convolution processing through the second second convolutional layer to the nth second convolutional layer to obtain the first 2 first spatial features to nth first spatial feature.
  11. 根据权利要求10所述的方法,其特征在于,所述待训练分类模型还包括n个全连接层,通过所述待训练分类模型根据所述空间特征和所述光谱特征构建空谱特征包括:The method according to claim 10, wherein the classification model to be trained further comprises n fully connected layers, and constructing a spatial spectrum feature according to the spatial feature and the spectral feature through the classification model to be trained comprises:
    通过所述待训练分类模型将所述第1个第二光谱特征至第n-1个第二光谱特征、所述第1个第二空间特征至第n-1个第二空间特征、所述第n个第一光谱特征和所述第n个第一空间特征分别进行拉伸处理,得到第1个第三光谱特征至第n个第三光谱特征,以及第1个第三空间特征至第n个第三空间特征,其中,所述第三光谱特征和所述第三空间特征为一维向量;According to the classification model to be trained, the first second spectral feature to the n-1th second spectral feature, the first second spatial feature to the n-1th second spatial feature, the The nth first spectral feature and the nth first spatial feature are respectively stretched to obtain the first third spectral feature to the nth third spectral feature, and the first third spatial feature to the first n third spatial features, wherein the third spectral feature and the third spatial feature are one-dimensional vectors;
    通过所述n个全连接层对n对特征组分别进行融合处理,得到n个子空谱特征,其中,排序相同的一个所述第三光谱特征和一个所述第三空间特征构成一个所述特征组;The n pairs of feature groups are respectively fused through the n fully connected layers to obtain n sub-space spectral features, wherein one of the third spectral features and one of the third spatial features with the same order constitutes one of the features group;
    通过所述待训练分类模型将所述n个子空谱特征进行拼接处理,得到空谱特征。The n sub-space-spectrum features are spliced by the classification model to be trained to obtain the null-spectrum features.
  12. 根据权利要求8至11任意一项所述的方法,其特征在于,所述待训练分类模型还包括分类层,通过所述待训练分类模型获取所述空谱特征的分类结果包括:The method according to any one of claims 8 to 11, wherein the classification model to be trained further comprises a classification layer, and obtaining the classification result of the empty spectrum feature through the classification model to be trained comprises:
    通过所述分类层对所述空谱特征进行分类处理,得到分类结果。Perform classification processing on the empty spectrum feature through the classification layer to obtain a classification result.
  13. 一种图像分类的装置,其特征在于,包括:An image classification device, characterized in that it comprises:
    第一获取模块,用于获取目标图像,所述目标图像为基于高光谱图像所生成的图像;The first acquisition module is configured to acquire a target image, the target image being an image generated based on a hyperspectral image;
    提取模块,用于通过图像分类模型提取所述目标图像的空间特征和所述目标图像的光谱特征;An extraction module for extracting the spatial characteristics of the target image and the spectral characteristics of the target image through an image classification model;
    构建模块,用于通过所述图像分类模型根据所述空间特征和所述光谱特征构建空谱特征;A construction module, configured to construct an empty spectrum feature according to the spatial feature and the spectral feature through the image classification model;
    第二获取模块,用于通过所述图像分类模型获取所述空谱特征的分类结果;The second acquisition module is configured to acquire the classification result of the empty spectrum feature through the image classification model;
    确定模块,用于根据所述分类结果,确定所述目标图像所属的类别。The determining module is configured to determine the category to which the target image belongs according to the classification result.
  14. 一种模型训练的装置,其特征在于,包括:A model training device is characterized in that it comprises:
    第一获取模块,用于获取待训练图像,所述待训练图像为基于高光谱图像所生成的图像;The first acquisition module is configured to acquire an image to be trained, and the image to be trained is an image generated based on a hyperspectral image;
    提取模块,用于通过待训练分类模型提取所述待训练图像的空间特征和所述待训练图像的光谱特征;An extraction module, configured to extract the spatial characteristics of the image to be trained and the spectral characteristics of the image to be trained through the classification model to be trained;
    构建模块,用于通过所述待训练分类模型根据所述空间特征和所述光谱特征构建空谱特征;A construction module, configured to construct an empty spectrum feature according to the spatial feature and the spectral feature through the classification model to be trained;
    第二获取模块,用于通过所述待训练分类模型获取所述空谱特征的分类结果;The second acquisition module is configured to acquire the classification result of the empty spectrum feature through the classification model to be trained;
    训练模块,用于根据所述分类结果和真实结果,通过目标损失函数对所述待训练分类模型进行训练,得到图像分类模型。The training module is used to train the classification model to be trained through the target loss function according to the classification result and the real result to obtain an image classification model.
  15. 一种图像分类设备,其特征在于,包括:An image classification device, characterized in that it comprises:
    一个或一个以上中央处理器,存储器,输入输出接口,有线或无线网络接口,电源;One or more central processing units, memory, input and output interfaces, wired or wireless network interfaces, power supply;
    所述存储器为短暂存储存储器或持久存储存储器;The memory is a short-term storage memory or a persistent storage memory;
    所述中央处理器配置为与所述存储器通信,在所述图像分类设备上执行所述存储器中的指令操作以执行权利要求1至12中任意一项所述的方法。The central processing unit is configured to communicate with the memory, and execute the instruction operations in the memory on the image classification device to execute the method according to any one of claims 1-12.
  16. 一种计算机可读存储介质,包括指令,当所述指令在计算机上运行时,使得计算机执行如权利要求1至12中任意一项所述的方法。A computer-readable storage medium, comprising instructions, when the instructions run on a computer, cause the computer to execute the method according to any one of claims 1-12.
  17. 一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如权利要求1至12中任意一项所述的方法。A computer program product containing instructions that, when run on a computer, causes the computer to execute the method according to any one of claims 1 to 12.
PCT/CN2020/097906 2019-10-29 2020-06-24 Image classification method and related device WO2021082480A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911041029.3 2019-10-29
CN201911041029.3A CN110991236A (en) 2019-10-29 2019-10-29 Image classification method and related device

Publications (1)

Publication Number Publication Date
WO2021082480A1 true WO2021082480A1 (en) 2021-05-06

Family

ID=70082504

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/097906 WO2021082480A1 (en) 2019-10-29 2020-06-24 Image classification method and related device

Country Status (2)

Country Link
CN (1) CN110991236A (en)
WO (1) WO2021082480A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113705630A (en) * 2021-08-10 2021-11-26 南京邮电大学 Skin lesion image classification method
CN113822208A (en) * 2021-09-27 2021-12-21 海南长光卫星信息技术有限公司 Hyperspectral anomaly detection method and device, electronic equipment and readable storage medium
CN113920323A (en) * 2021-11-18 2022-01-11 西安电子科技大学 Different-chaos hyperspectral image classification method based on semantic graph attention network
CN115979973A (en) * 2023-03-20 2023-04-18 湖南大学 Hyperspectral traditional Chinese medicinal material identification method based on dual-channel compression attention network
CN117372789A (en) * 2023-12-07 2024-01-09 北京观微科技有限公司 Image classification method and image classification device

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110991236A (en) * 2019-10-29 2020-04-10 成都华为技术有限公司 Image classification method and related device
CN111797941A (en) * 2020-07-20 2020-10-20 中国科学院长春光学精密机械与物理研究所 Image classification method and system carrying spectral information and spatial information
CN113191261B (en) * 2021-04-29 2022-12-06 北京百度网讯科技有限公司 Image category identification method and device and electronic equipment
CN113344040A (en) * 2021-05-20 2021-09-03 深圳索信达数据技术有限公司 Image classification method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100266185A1 (en) * 2009-04-21 2010-10-21 Sloan Kettering Institute of Cancer Malignant tissue recognition model for the prostate
CN107798348A (en) * 2017-10-27 2018-03-13 广东省智能制造研究所 Hyperspectral image classification method based on neighborhood information deep learning
CN107909015A (en) * 2017-10-27 2018-04-13 广东省智能制造研究所 Hyperspectral image classification method based on convolutional neural networks and empty spectrum information fusion
CN110084159A (en) * 2019-04-15 2019-08-02 西安电子科技大学 Hyperspectral image classification method based on the multistage empty spectrum information CNN of joint
CN110991236A (en) * 2019-10-29 2020-04-10 成都华为技术有限公司 Image classification method and related device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321963B (en) * 2019-07-09 2022-03-04 西安电子科技大学 Hyperspectral image classification method based on fusion of multi-scale and multi-dimensional space spectrum features

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100266185A1 (en) * 2009-04-21 2010-10-21 Sloan Kettering Institute of Cancer Malignant tissue recognition model for the prostate
CN107798348A (en) * 2017-10-27 2018-03-13 广东省智能制造研究所 Hyperspectral image classification method based on neighborhood information deep learning
CN107909015A (en) * 2017-10-27 2018-04-13 广东省智能制造研究所 Hyperspectral image classification method based on convolutional neural networks and empty spectrum information fusion
CN110084159A (en) * 2019-04-15 2019-08-02 西安电子科技大学 Hyperspectral image classification method based on the multistage empty spectrum information CNN of joint
CN110991236A (en) * 2019-10-29 2020-04-10 成都华为技术有限公司 Image classification method and related device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113705630A (en) * 2021-08-10 2021-11-26 南京邮电大学 Skin lesion image classification method
CN113705630B (en) * 2021-08-10 2023-10-13 南京邮电大学 Skin lesion image classification method
CN113822208A (en) * 2021-09-27 2021-12-21 海南长光卫星信息技术有限公司 Hyperspectral anomaly detection method and device, electronic equipment and readable storage medium
CN113822208B (en) * 2021-09-27 2023-08-08 海南长光卫星信息技术有限公司 Hyperspectral anomaly detection method, hyperspectral anomaly detection device, electronic equipment and readable storage medium
CN113920323A (en) * 2021-11-18 2022-01-11 西安电子科技大学 Different-chaos hyperspectral image classification method based on semantic graph attention network
CN113920323B (en) * 2021-11-18 2023-04-07 西安电子科技大学 Different-chaos hyperspectral image classification method based on semantic graph attention network
CN115979973A (en) * 2023-03-20 2023-04-18 湖南大学 Hyperspectral traditional Chinese medicinal material identification method based on dual-channel compression attention network
CN117372789A (en) * 2023-12-07 2024-01-09 北京观微科技有限公司 Image classification method and image classification device
CN117372789B (en) * 2023-12-07 2024-03-08 北京观微科技有限公司 Image classification method and image classification device

Also Published As

Publication number Publication date
CN110991236A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
WO2021082480A1 (en) Image classification method and related device
CN108615010B (en) Facial expression recognition method based on parallel convolution neural network feature map fusion
Yuan et al. Factorization-based texture segmentation
CN106529447B (en) Method for identifying face of thumbnail
CA3066029A1 (en) Image feature acquisition
US10289927B2 (en) Image integration search based on human visual pathway model
WO2017024963A1 (en) Image recognition method, measure learning method and image source recognition method and device
CN113095370B (en) Image recognition method, device, electronic equipment and storage medium
CN104866831B (en) The face recognition algorithms of characteristic weighing
TWI753588B (en) Face attribute recognition method, electronic device and computer-readable storage medium
WO2022179587A1 (en) Feature extraction method and apparatus
CN111652273B (en) Deep learning-based RGB-D image classification method
CN105354555A (en) Probabilistic graphical model-based three-dimensional face recognition method
Liang et al. An improved DualGAN for near-infrared image colorization
CN111954250A (en) Lightweight Wi-Fi behavior sensing method and system
CN111597933A (en) Face recognition method and device
CN111401339A (en) Method and device for identifying age of person in face image and electronic equipment
CN111160225A (en) Human body analysis method and device based on deep learning
Jenifa et al. Classification of cotton leaf disease using multi-support vector machine
CN111860601B (en) Method and device for predicting type of large fungi
CN110633630B (en) Behavior identification method and device and terminal equipment
CN115311186B (en) Cross-scale attention confrontation fusion method and terminal for infrared and visible light images
JP7225731B2 (en) Imaging multivariable data sequences
CN116563649A (en) Tensor mapping network-based hyperspectral image lightweight classification method and device
CN110738194A (en) three-dimensional object identification method based on point cloud ordered coding

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20883131

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20883131

Country of ref document: EP

Kind code of ref document: A1